Package com.deltaApps.components
Class JDeltaBadge
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JPanel
- 
- com.deltaApps.components.JDeltaBadge
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible
 
 public class JDeltaBadge extends javax.swing.JPanelFile history 2020-12-11 - Initially created - Darshana Ariyarathna 2021-03-20 - Change structure of the project, copy and paste file from the old structure- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class javax.swing.JPaneljavax.swing.JPanel.AccessibleJPanel
 - 
Nested classes/interfaces inherited from class javax.swing.JComponentjavax.swing.JComponent.AccessibleJComponent
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static intDARK_BUTTON(package private) java.awt.GridBagConstraintsgbstatic intINFO_BUTTONstatic intLIGHT_BUTTONstatic intPRIMARY_BUTTONprivate javax.swing.JLabelprimaryLabelprivate javax.swing.JPanelprimaryPanelprivate java.lang.StringprimaryTextstatic intSECONDARY_BUTTONprivate javax.swing.JLabelsecondaryLabelprivate javax.swing.JPanelsecondaryPanelprivate java.lang.StringsecondaryTextstatic intSUCCESS_BUTTONstatic intWARNING_BUTTON- 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
- 
 - 
Constructor SummaryConstructors Constructor Description JDeltaBadge()No argument constructorJDeltaBadge(java.lang.String primaryText, int amount)This will create a basic components with light primary background and dark primary fonts with a dark secondary fonts and light secondary backgroundJDeltaBadge(java.lang.String primaryText, int amount, JDeltaColors secondaryForegroundColor, JDeltaColors secondaryBackgroundColor)This will create a custom colored secondary badgeJDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText)This will create a basic components with light primary background and dark primary fonts with a dark secondary fonts and light secondary backgroundJDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, int buttonType)This constructor will create standard colored badge with the button typeJDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, JDeltaColors secondaryForegroundColor, JDeltaColors secondaryBackgroundColor)This will create a custom colored secondary badgeJDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, JDeltaColors primaryForegroundColor, JDeltaColors primaryBackgroundColor, JDeltaColors secondaryForegroundColor, JDeltaColors secondaryBackgroundColor)You can create a more colorful badgeJDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, JDeltaColors primaryBackgroundColor, JDeltaColors primaryForegroundColor, JDeltaFonts primaryFont, JDeltaColors secondaryBackgroundColor, JDeltaColors secondaryForegroundColor, JDeltaFonts secondaryFont, boolean rounded)This will create a full flexible JDeltaButton for the user
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description JDeltaColorsgetBackgroundColor()Get background color of the JDeltaBadgeJDeltaFontsgetPrimaryFont()get primary's fontJDeltaColorsgetPrimaryForegroundColor()get primary's foreground colorjava.lang.StringgetPrimaryText()get primary text from the jDeltaBadgeJDeltaColorsgetSecondaryBackgroundColor()get Secondary's background colorJDeltaFontsgetSecondaryFont()this will get secondary's font objectJDeltaColorsgetSecondaryForegroundColor()get secondary's foreground colorjava.lang.StringgetSecondaryText()get secondary text from the jDeltaBadgevoidsetBackgroundColor(JDeltaColors backgroundColor)Set background color of the JDeltaBadgevoidsetPrimaryFont(JDeltaFonts primaryFont)update primary's fontvoidsetPrimaryForegroundColor(JDeltaColors primaryForegroundColor)this will update your primary foreground colorvoidsetPrimaryText(java.lang.String primaryText)Can update your jDeltaButton's primary textvoidsetSecondaryBackgroundColor(JDeltaColors primaryBackgroundColor)update Secondary's background colorvoidsetSecondaryFont(JDeltaFonts font)this will set secondary's font objectvoidsetSecondaryForegroundColor(JDeltaColors primaryForegroundColor)this will update your secondary foreground colorvoidsetSecondaryText(int amount)Can update your jDeltaButton's secondary textvoidsetSecondaryText(java.lang.String secondaryText)Can update your jDeltaButton's secondary text- 
Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 - 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 - 
Methods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
Methods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Field Detail- 
primaryTextprivate java.lang.String primaryText 
 - 
secondaryTextprivate java.lang.String secondaryText 
 - 
primaryLabelprivate javax.swing.JLabel primaryLabel 
 - 
secondaryLabelprivate javax.swing.JLabel secondaryLabel 
 - 
primaryPanelprivate javax.swing.JPanel primaryPanel 
 - 
secondaryPanelprivate javax.swing.JPanel secondaryPanel 
 - 
gbjava.awt.GridBagConstraints gb 
 - 
PRIMARY_BUTTONpublic static final int PRIMARY_BUTTON - See Also:
- Constant Field Values
 
 - 
SECONDARY_BUTTONpublic static final int SECONDARY_BUTTON - See Also:
- Constant Field Values
 
 - 
SUCCESS_BUTTONpublic static final int SUCCESS_BUTTON - See Also:
- Constant Field Values
 
 - 
WARNING_BUTTONpublic static final int WARNING_BUTTON - See Also:
- Constant Field Values
 
 - 
INFO_BUTTONpublic static final int INFO_BUTTON - See Also:
- Constant Field Values
 
 - 
LIGHT_BUTTONpublic static final int LIGHT_BUTTON - See Also:
- Constant Field Values
 
 - 
DARK_BUTTONpublic static final int DARK_BUTTON - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
JDeltaBadgepublic JDeltaBadge() No argument constructor- Since:
- v1.0.0
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText)This will create a basic components with light primary background and dark primary fonts with a dark secondary fonts and light secondary background- Parameters:
- primaryText- Text to write as primary text
- secondaryText- Text to write as secondary text
- Since:
- v1.0.0
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, int amount)This will create a basic components with light primary background and dark primary fonts with a dark secondary fonts and light secondary background- Parameters:
- primaryText- Text to write as primary text
- amount- A integer number to write as secondary text
- Since:
- v1.0.0
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, JDeltaColors secondaryForegroundColor, JDeltaColors secondaryBackgroundColor)This will create a custom colored secondary badge- Parameters:
- primaryText- Text to write as primary text
- secondaryText- Text to write as primary text
- secondaryForegroundColor- Secondary font color
- secondaryBackgroundColor- Secondary background color
- Since:
- v1.0.0
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, int amount, JDeltaColors secondaryForegroundColor, JDeltaColors secondaryBackgroundColor)This will create a custom colored secondary badge- Parameters:
- primaryText- Text to write as primary text
- amount- A integer number to write as secondary text
- secondaryForegroundColor- Secondary font color
- secondaryBackgroundColor- Secondary background color
- Since:
- v1.0.0
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, JDeltaColors primaryForegroundColor, JDeltaColors primaryBackgroundColor, JDeltaColors secondaryForegroundColor, JDeltaColors secondaryBackgroundColor)You can create a more colorful badge- Parameters:
- primaryText- Text to write as primary text
- secondaryText- Text to write as secondary text
- primaryForegroundColor- Primary font color
- primaryBackgroundColor- Primary background color
- secondaryForegroundColor- Secondary font color
- secondaryBackgroundColor- Secondary background color
- Since:
- v1.0.0
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, int buttonType)This constructor will create standard colored badge with the button type- Parameters:
- primaryText- Text to write as primary text
- secondaryText- Text to write as secondary text
- buttonType- button type
- Since:
- v1.0.1
 
 - 
JDeltaBadgepublic JDeltaBadge(java.lang.String primaryText, java.lang.String secondaryText, JDeltaColors primaryBackgroundColor, JDeltaColors primaryForegroundColor, JDeltaFonts primaryFont, JDeltaColors secondaryBackgroundColor, JDeltaColors secondaryForegroundColor, JDeltaFonts secondaryFont, boolean rounded)This will create a full flexible JDeltaButton for the user- Parameters:
- primaryText- Text to write as primary text
- secondaryText- Text to write as secondary text
- primaryBackgroundColor- Primary font color
- primaryForegroundColor- Primary font color
- primaryFont- Primary font specifications
- secondaryBackgroundColor- Secondary background color
- secondaryForegroundColor- Secondary font color
- secondaryFont- Secondary font specifications
- rounded- is the JDeltaButton round in shape or not
- Since:
- v1.0.0
 
 
- 
 - 
Method Detail- 
getBackgroundColorpublic JDeltaColors getBackgroundColor() Get background color of the JDeltaBadge- Returns:
- background color
- Since:
- v1.0.0
 
 - 
setBackgroundColorpublic void setBackgroundColor(JDeltaColors backgroundColor) Set background color of the JDeltaBadge- Parameters:
- backgroundColor- New background color of the JDeltaBadge
- Since:
- v1.0.0
 
 - 
getSecondaryTextpublic java.lang.String getSecondaryText() get secondary text from the jDeltaBadge- Returns:
- secondary text of the jDeltaBadge
- Since:
- v1.0.0
 
 - 
setSecondaryTextpublic void setSecondaryText(java.lang.String secondaryText) Can update your jDeltaButton's secondary text- Parameters:
- secondaryText- New secondary text
- Since:
- v1.0.0
 
 - 
setSecondaryTextpublic void setSecondaryText(int amount) Can update your jDeltaButton's secondary text- Parameters:
- amount- New secondary amount
- Since:
- v1.0.0
 
 - 
getSecondaryForegroundColorpublic JDeltaColors getSecondaryForegroundColor() get secondary's foreground color- Returns:
- secondary's foreground color
- Since:
- v1.0.0
 
 - 
setSecondaryForegroundColorpublic void setSecondaryForegroundColor(JDeltaColors primaryForegroundColor) this will update your secondary foreground color- Parameters:
- primaryForegroundColor- new secondary foreground color
- Since:
- v1.0.0
 
 - 
getSecondaryFontpublic JDeltaFonts getSecondaryFont() this will get secondary's font object- Returns:
- secondary's font object
- Since:
- v1.0.0
 
 - 
setSecondaryFontpublic void setSecondaryFont(JDeltaFonts font) this will set secondary's font object- Parameters:
- font- new font for secondary
- Since:
- v1.0.0
 
 - 
getSecondaryBackgroundColorpublic JDeltaColors getSecondaryBackgroundColor() get Secondary's background color- Returns:
- Secondary's background color
- Since:
- v1.0.0
 
 - 
setSecondaryBackgroundColorpublic void setSecondaryBackgroundColor(JDeltaColors primaryBackgroundColor) update Secondary's background color- Parameters:
- primaryBackgroundColor- Secondary's background color
- Since:
- v1.0.0
 
 - 
getPrimaryTextpublic java.lang.String getPrimaryText() get primary text from the jDeltaBadge- Returns:
- primary text of the jDeltaBadge
- Since:
- v1.0.0
 
 - 
setPrimaryTextpublic void setPrimaryText(java.lang.String primaryText) Can update your jDeltaButton's primary text- Parameters:
- primaryText- New primary text
- Since:
- v1.0.0
 
 - 
getPrimaryForegroundColorpublic JDeltaColors getPrimaryForegroundColor() get primary's foreground color- Returns:
- primary's foreground color
- Since:
- v1.0.0
 
 - 
setPrimaryForegroundColorpublic void setPrimaryForegroundColor(JDeltaColors primaryForegroundColor) this will update your primary foreground color- Parameters:
- primaryForegroundColor- new primary foreground color
- Since:
- v1.0.0
 
 - 
getPrimaryFontpublic JDeltaFonts getPrimaryFont() get primary's font- Returns:
- primary's font
- Since:
- v1.0.0
 
 - 
setPrimaryFontpublic void setPrimaryFont(JDeltaFonts primaryFont) update primary's font- Parameters:
- primaryFont- primary's font
- Since:
- v1.0.0
 
 
- 
 
-