public class SymbolIconCellRenderer extends javax.swing.DefaultListCellRenderer implements SymbolConstants
javax.swing.DefaultListCellRenderer.UIResourcejavax.swing.JLabel.AccessibleJLabeljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_SPACER_STRING
define spacer string to leave blank space where symbol will go
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCIRCLE_SYMBOL_OBJECT, RECTANGLE_SYMBOL_OBJECT, TRIANGLE_SYMBOL_OBJECT| Constructor and Description |
|---|
SymbolIconCellRenderer()
Creates a renderer with a symbol icon.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearSymbolChar()
Clears any character symbol in use, making a circle symbol be used instead.
|
int |
getIconHeight()
Returns the icon's height.
|
int |
getIconWidth()
Returns the icon's width.
|
java.lang.String |
getLabelText()
Get the label text.
|
protected java.lang.String |
getLabelText(java.lang.Object value)
Get the label text for the value.
|
java.awt.Component |
getListCellRendererComponent(javax.swing.JList list,
java.lang.Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
Return a component that has been configured to display the specified value.
|
java.lang.String |
getSpacerString()
Gets the spacer string used to create space for the symbol.
|
protected java.lang.String |
getText(java.lang.String labelText)
Get the text for the specified label text.
|
boolean |
isCharSymbol()
Gets a flag indicating whether or not a character symbol is in use.
|
void |
setBoldFlag(boolean flgVal)
Sets whether or not the the character symbol is displayed using a bold
font.
|
java.awt.Color |
setColorObj(java.awt.Color colorObj)
Sets the color for the symbol.
|
java.awt.Color |
setColorObj(int colorRGB)
Sets the color for the symbol.
|
void |
setFillFlag(boolean flgVal)
Sets whether or not the the object symbol is filled.
|
void |
setIcon(javax.swing.Icon icon)
Set the icon.
|
void |
setIcon(SymbolIcon icon)
Set the icon.
|
void |
setLabelText(java.lang.String labelText)
Set the label text.
|
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.
|
java.lang.String |
toString()
Return the label text.
|
protected void |
updateLabelText(java.lang.String labelText)
Update the label text.
|
protected void |
updateText()
Update the text.
|
firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, invalidate, isOpaque, repaint, repaint, repaint, revalidate, validatecheckHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, 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, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, 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, updateadd, 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, 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, validateTreeaction, 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, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleprotected static final java.lang.String DEFAULT_SPACER_STRING
public SymbolIconCellRenderer()
public void clearSymbolChar()
public int getIconHeight()
public int getIconWidth()
public java.lang.String getLabelText()
protected java.lang.String getLabelText(java.lang.Object value)
value - the value.public java.awt.Component getListCellRendererComponent(javax.swing.JList list,
java.lang.Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
getListCellRendererComponent in interface javax.swing.ListCellRenderer<java.lang.Object>getListCellRendererComponent in class javax.swing.DefaultListCellRendererlist - The JList we're painting.value - The value returned by list.getModel().getElementAt(index).index - The cells index.isSelected - True if the specified cell was selected.cellHasFocus - True if the specified cell has the focus.public java.lang.String getSpacerString()
protected java.lang.String getText(java.lang.String labelText)
labelText - the label text.public boolean isCharSymbol()
public void setBoldFlag(boolean flgVal)
flgVal - true for bold, false for normal font.public java.awt.Color setColorObj(java.awt.Color colorObj)
colorObj - the color to use.public java.awt.Color setColorObj(int colorRGB)
colorRGB - the color RGB to use.public void setFillFlag(boolean flgVal)
flgVal - true if the object is to be filled; false if not.public void setIcon(javax.swing.Icon icon)
setIcon in class javax.swing.JLabelicon - the icon (ignored if not SymbolIcon.)public void setIcon(SymbolIcon icon)
icon - the icon (ignored if null.)public void setLabelText(java.lang.String labelText)
labelText - the label text.public void setOutlineColorObj(java.awt.Color colorObj)
colorObj - the color for the symbol outline, or null for no outline.public void setSpacerString(java.lang.String str)
str - a string blanks for spacing.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.public java.lang.String toString()
toString in class java.awt.Componentprotected void updateLabelText(java.lang.String labelText)
labelText - the label text.protected void updateText()