|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JLabel com.isti.util.gui.SymbolJLabel
Class SymbolJLabel is a JLabel with a symbol to the left of its text. The symbol may be a filled circle, an empty circle, or a character; all with a given color.
Nested Class Summary |
Nested classes inherited from class javax.swing.JLabel |
javax.swing.JLabel.AccessibleJLabel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected boolean |
boldFlag
|
static int |
CIRCLE_SYMBOL_OBJECT
Circle symbol select value. |
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
|
static int |
RECTANGLE_SYMBOL_OBJECT
Rectangle symbol select value. |
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
|
static int |
TRIANGLE_SYMBOL_OBJECT
Triangle symbol select value. |
Fields inherited from class javax.swing.JLabel |
labelFor |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
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. |
Method Summary | |
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()'. |
Methods inherited from class javax.swing.JLabel |
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 |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CIRCLE_SYMBOL_OBJECT
public static final int RECTANGLE_SYMBOL_OBJECT
public static final int TRIANGLE_SYMBOL_OBJECT
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
Constructor Detail |
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.Method Detail |
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)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |