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.JPanel
File 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.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description static int
DARK_BUTTON
(package private) java.awt.GridBagConstraints
gb
static int
INFO_BUTTON
static int
LIGHT_BUTTON
static int
PRIMARY_BUTTON
private javax.swing.JLabel
primaryLabel
private javax.swing.JPanel
primaryPanel
private java.lang.String
primaryText
static int
SECONDARY_BUTTON
private javax.swing.JLabel
secondaryLabel
private javax.swing.JPanel
secondaryPanel
private java.lang.String
secondaryText
static int
SUCCESS_BUTTON
static int
WARNING_BUTTON
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JDeltaColors
getBackgroundColor()
Get background color of the JDeltaBadgeJDeltaFonts
getPrimaryFont()
get primary's fontJDeltaColors
getPrimaryForegroundColor()
get primary's foreground colorjava.lang.String
getPrimaryText()
get primary text from the jDeltaBadgeJDeltaColors
getSecondaryBackgroundColor()
get Secondary's background colorJDeltaFonts
getSecondaryFont()
this will get secondary's font objectJDeltaColors
getSecondaryForegroundColor()
get secondary's foreground colorjava.lang.String
getSecondaryText()
get secondary text from the jDeltaBadgevoid
setBackgroundColor(JDeltaColors backgroundColor)
Set background color of the JDeltaBadgevoid
setPrimaryFont(JDeltaFonts primaryFont)
update primary's fontvoid
setPrimaryForegroundColor(JDeltaColors primaryForegroundColor)
this will update your primary foreground colorvoid
setPrimaryText(java.lang.String primaryText)
Can update your jDeltaButton's primary textvoid
setSecondaryBackgroundColor(JDeltaColors primaryBackgroundColor)
update Secondary's background colorvoid
setSecondaryFont(JDeltaFonts font)
this will set secondary's font objectvoid
setSecondaryForegroundColor(JDeltaColors primaryForegroundColor)
this will update your secondary foreground colorvoid
setSecondaryText(int amount)
Can update your jDeltaButton's secondary textvoid
setSecondaryText(java.lang.String secondaryText)
Can update your jDeltaButton's secondary text-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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.Container
add, 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.Component
action, 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
-
primaryText
private java.lang.String primaryText
-
secondaryText
private java.lang.String secondaryText
-
primaryLabel
private javax.swing.JLabel primaryLabel
-
secondaryLabel
private javax.swing.JLabel secondaryLabel
-
primaryPanel
private javax.swing.JPanel primaryPanel
-
secondaryPanel
private javax.swing.JPanel secondaryPanel
-
gb
java.awt.GridBagConstraints gb
-
PRIMARY_BUTTON
public static final int PRIMARY_BUTTON
- See Also:
- Constant Field Values
-
SECONDARY_BUTTON
public static final int SECONDARY_BUTTON
- See Also:
- Constant Field Values
-
SUCCESS_BUTTON
public static final int SUCCESS_BUTTON
- See Also:
- Constant Field Values
-
WARNING_BUTTON
public static final int WARNING_BUTTON
- See Also:
- Constant Field Values
-
INFO_BUTTON
public static final int INFO_BUTTON
- See Also:
- Constant Field Values
-
LIGHT_BUTTON
public static final int LIGHT_BUTTON
- See Also:
- Constant Field Values
-
DARK_BUTTON
public static final int DARK_BUTTON
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JDeltaBadge
public JDeltaBadge()
No argument constructor- Since:
- v1.0.0
-
JDeltaBadge
public 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 textsecondaryText
- Text to write as secondary text- Since:
- v1.0.0
-
JDeltaBadge
public 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 textamount
- A integer number to write as secondary text- Since:
- v1.0.0
-
JDeltaBadge
public 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 textsecondaryText
- Text to write as primary textsecondaryForegroundColor
- Secondary font colorsecondaryBackgroundColor
- Secondary background color- Since:
- v1.0.0
-
JDeltaBadge
public 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 textamount
- A integer number to write as secondary textsecondaryForegroundColor
- Secondary font colorsecondaryBackgroundColor
- Secondary background color- Since:
- v1.0.0
-
JDeltaBadge
public 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 textsecondaryText
- Text to write as secondary textprimaryForegroundColor
- Primary font colorprimaryBackgroundColor
- Primary background colorsecondaryForegroundColor
- Secondary font colorsecondaryBackgroundColor
- Secondary background color- Since:
- v1.0.0
-
JDeltaBadge
public 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 textsecondaryText
- Text to write as secondary textbuttonType
- button type- Since:
- v1.0.1
-
JDeltaBadge
public 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 textsecondaryText
- Text to write as secondary textprimaryBackgroundColor
- Primary font colorprimaryForegroundColor
- Primary font colorprimaryFont
- Primary font specificationssecondaryBackgroundColor
- Secondary background colorsecondaryForegroundColor
- Secondary font colorsecondaryFont
- Secondary font specificationsrounded
- is the JDeltaButton round in shape or not- Since:
- v1.0.0
-
-
Method Detail
-
getBackgroundColor
public JDeltaColors getBackgroundColor()
Get background color of the JDeltaBadge- Returns:
- background color
- Since:
- v1.0.0
-
setBackgroundColor
public void setBackgroundColor(JDeltaColors backgroundColor)
Set background color of the JDeltaBadge- Parameters:
backgroundColor
- New background color of the JDeltaBadge- Since:
- v1.0.0
-
getSecondaryText
public java.lang.String getSecondaryText()
get secondary text from the jDeltaBadge- Returns:
- secondary text of the jDeltaBadge
- Since:
- v1.0.0
-
setSecondaryText
public void setSecondaryText(java.lang.String secondaryText)
Can update your jDeltaButton's secondary text- Parameters:
secondaryText
- New secondary text- Since:
- v1.0.0
-
setSecondaryText
public void setSecondaryText(int amount)
Can update your jDeltaButton's secondary text- Parameters:
amount
- New secondary amount- Since:
- v1.0.0
-
getSecondaryForegroundColor
public JDeltaColors getSecondaryForegroundColor()
get secondary's foreground color- Returns:
- secondary's foreground color
- Since:
- v1.0.0
-
setSecondaryForegroundColor
public void setSecondaryForegroundColor(JDeltaColors primaryForegroundColor)
this will update your secondary foreground color- Parameters:
primaryForegroundColor
- new secondary foreground color- Since:
- v1.0.0
-
getSecondaryFont
public JDeltaFonts getSecondaryFont()
this will get secondary's font object- Returns:
- secondary's font object
- Since:
- v1.0.0
-
setSecondaryFont
public void setSecondaryFont(JDeltaFonts font)
this will set secondary's font object- Parameters:
font
- new font for secondary- Since:
- v1.0.0
-
getSecondaryBackgroundColor
public JDeltaColors getSecondaryBackgroundColor()
get Secondary's background color- Returns:
- Secondary's background color
- Since:
- v1.0.0
-
setSecondaryBackgroundColor
public void setSecondaryBackgroundColor(JDeltaColors primaryBackgroundColor)
update Secondary's background color- Parameters:
primaryBackgroundColor
- Secondary's background color- Since:
- v1.0.0
-
getPrimaryText
public java.lang.String getPrimaryText()
get primary text from the jDeltaBadge- Returns:
- primary text of the jDeltaBadge
- Since:
- v1.0.0
-
setPrimaryText
public void setPrimaryText(java.lang.String primaryText)
Can update your jDeltaButton's primary text- Parameters:
primaryText
- New primary text- Since:
- v1.0.0
-
getPrimaryForegroundColor
public JDeltaColors getPrimaryForegroundColor()
get primary's foreground color- Returns:
- primary's foreground color
- Since:
- v1.0.0
-
setPrimaryForegroundColor
public void setPrimaryForegroundColor(JDeltaColors primaryForegroundColor)
this will update your primary foreground color- Parameters:
primaryForegroundColor
- new primary foreground color- Since:
- v1.0.0
-
getPrimaryFont
public JDeltaFonts getPrimaryFont()
get primary's font- Returns:
- primary's font
- Since:
- v1.0.0
-
setPrimaryFont
public void setPrimaryFont(JDeltaFonts primaryFont)
update primary's font- Parameters:
primaryFont
- primary's font- Since:
- v1.0.0
-
-