public class SymbolJLabel extends javax.swing.JLabel implements SymbolConstants
javax.swing.JLabel.AccessibleJLabel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected boolean |
boldFlag |
protected java.awt.Color |
colorObj |
protected static java.lang.String |
DEFAULT_SPACER_STRING |
static int |
DEFAULT_SYMBOLSIZE
Default symbol size value.
|
protected boolean |
fillFlag |
protected java.lang.String |
labelText |
protected java.awt.Dimension |
originalDimension |
protected java.awt.Color |
outlineColorObj |
protected java.lang.String |
spacerString |
protected static int |
SYMBOL_XPOS |
protected static int |
symbolHeight |
protected int |
symbolObj |
protected int |
symbolSize |
protected java.lang.String |
symbolString |
protected static int |
symbolWidth |
protected int |
symbolXOffsetVal |
protected static java.awt.Font |
symFontBold |
protected static java.awt.Font |
symFontPlain |
protected static boolean |
symSetupFlag |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
CIRCLE_SYMBOL_OBJECT, RECTANGLE_SYMBOL_OBJECT, TRIANGLE_SYMBOL_OBJECT
Constructor and Description |
---|
SymbolJLabel(java.awt.Color colorObj,
boolean fillFlag)
Creates a label with a circle symbol and no text.
|
SymbolJLabel(java.awt.Color colorObj,
char symbolChar,
boolean boldFlag)
Creates a label with a character symbol and no text.
|
SymbolJLabel(java.lang.String labelText,
java.awt.Color colorObj,
boolean fillFlag)
Creates a label with a circle symbol.
|
SymbolJLabel(java.lang.String labelText,
java.awt.Color colorObj,
char symbolChar,
boolean boldFlag)
Creates a label with a character symbol.
|
Modifier and Type | Method and Description |
---|---|
void |
clearSymbolChar()
Clears any character symbol in use, making a circle symbol be used
instead.
|
protected static java.awt.Polygon |
createTriangle(int x,
int y,
int width)
Creates a triangle.
|
java.lang.String |
getLabelText()
Gets the text for the label (without the spacer string).
|
java.lang.String |
getSpacerString()
Gets the spacer string used to create space for the symbol.
|
boolean |
isCharSymbol()
Gets a flag indicating whether or not a character symbol is in use.
|
void |
paint(java.awt.Graphics g)
Calls the parent's paint method and then draws the symbol to the
left of the text.
|
protected void |
paintSymbol(java.awt.Graphics g,
boolean fillFlag)
Paints the symbol.
|
void |
setBoldFlag(boolean flgVal)
Sets whether or not the the character symbol is displayed using a
bold font.
|
void |
setColorObj(java.awt.Color colorObj)
Sets the color for the symbol.
|
void |
setFillFlag(boolean flgVal)
Sets whether or not the the object symbol is filled.
|
void |
setLabelText(java.lang.String str)
Sets the text for the label.
|
void |
setOutlineColorObj(java.awt.Color colorObj)
Sets the outline color to be used for filled symbols.
|
void |
setSpacerString(java.lang.String str)
Sets the spacer string used to create space for the symbol.
|
void |
setSymbolChar(char symbolChar)
Sets the character symbol to be used.
|
void |
setSymbolObject(int symbolObj)
Sets the object symbol to be used.
|
void |
setSymbolSize(int symbolSize)
Sets the size for the symbol.
|
void |
setSymbolXOffset(int offsetVal)
Enters an X-axis offset for the symbol.
|
protected java.lang.String |
symbolCharToString(char symbolChar)
Converts the given symbol character to a displayable, single-character
string.
|
protected void |
updateComponent()
Updates this component by calling 'revalidate()' and then 'repaint()'.
|
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
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, 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
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
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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static int DEFAULT_SYMBOLSIZE
protected static final java.lang.String DEFAULT_SPACER_STRING
protected static final int SYMBOL_XPOS
protected static final java.awt.Font symFontBold
protected static final java.awt.Font symFontPlain
protected java.lang.String spacerString
protected java.lang.String labelText
protected java.awt.Color colorObj
protected java.awt.Color outlineColorObj
protected boolean fillFlag
protected java.lang.String symbolString
protected int symbolObj
protected boolean boldFlag
protected static int symbolHeight
protected static int symbolWidth
protected static boolean symSetupFlag
protected final java.awt.Dimension originalDimension
protected int symbolSize
protected int symbolXOffsetVal
public SymbolJLabel(java.lang.String labelText, java.awt.Color colorObj, boolean fillFlag)
labelText
- the text for the label.colorObj
- the color for the symbol, or null for no symbol.fillFlag
- true if the circle is to be filled; false if not.public SymbolJLabel(java.awt.Color colorObj, boolean fillFlag)
colorObj
- the color for the symbol, or null for no symbol.fillFlag
- true if the circle is to be filled; false if not.public SymbolJLabel(java.lang.String labelText, java.awt.Color colorObj, char symbolChar, boolean boldFlag)
labelText
- the text for the label.colorObj
- the color for the symbol, or null for no symbol.symbolChar
- the character to be used.boldFlag
- true if the symbol character is to be displayed
using a bold font; false if not.public SymbolJLabel(java.awt.Color colorObj, char symbolChar, boolean boldFlag)
colorObj
- the color for the symbol, or null for no symbol.symbolChar
- the character to be used.boldFlag
- true if the symbol character is to be displayed
using a bold font; false if not.public void setLabelText(java.lang.String str)
str
- the text string to use.public java.lang.String getLabelText()
public void setSymbolSize(int symbolSize)
symbolSize
- size of the symbol or DEFAULT_SYMBOLSIZE for default.public void setSpacerString(java.lang.String str)
str
- a string blanks for spacing.public java.lang.String getSpacerString()
public void setColorObj(java.awt.Color colorObj)
colorObj
- the color to use.public void setOutlineColorObj(java.awt.Color colorObj)
colorObj
- the color for the symbol outline, or null for no outline.public void setFillFlag(boolean flgVal)
flgVal
- true if the object is to be filled; false if not.public void setSymbolChar(char symbolChar)
symbolChar
- the character symbol to use, or '(char)0' to have
no character symbol (and use circle symbol instead).public void setSymbolObject(int symbolObj)
symbolObj
- the object symbol to use.protected void updateComponent()
public void clearSymbolChar()
public void setBoldFlag(boolean flgVal)
flgVal
- true for bold, false for normal font.public void setSymbolXOffset(int offsetVal)
offsetVal
- the X-axis offset value to used, in pixels.public boolean isCharSymbol()
protected java.lang.String symbolCharToString(char symbolChar)
symbolChar
- the character to use.public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- graphics object to use.protected void paintSymbol(java.awt.Graphics g, boolean fillFlag)
g
- graphics object to use.fillFlag
- true if the circle is to be filled; false if not.protected static java.awt.Polygon createTriangle(int x, int y, int width)
x
- the x coordinate
of the triangle to be drawn.y
- the y coordinate
of the triangle to be drawn.width
- the width of the triangle to be drawn.