public class OrientedLabel extends ConfiguredBackgroundPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
OrientedLabel()
Creates a new label with no text
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBackground() |
FontModifier |
getFontModifier()
Gets the font modifier of this label.
|
java.awt.Color |
getForeground() |
javax.swing.Icon |
getIcon()
Gets the icon of this label
|
int |
getIconOffset()
Gets the distance between icon and the tree adjacent borders.
|
int |
getIconTextDistance()
Gets the distance between icon and text.
|
DLabel |
getLabel()
Gets direct access to the label that is used by this
OrientedLabel to paint its content. |
java.awt.Dimension |
getMinimumSize() |
java.awt.Dimension |
getPreferredSize() |
java.lang.String |
getText()
Gets the text of this label
|
boolean |
isHorizontal()
Tells whether the content of this label is painted horizontally.
|
boolean |
isIconHidden()
Tells whether the icon is not painted.
|
boolean |
isPaintDisabledIcon()
Whether a special disabled version of
getIcon() is painted if this label is disabled. |
boolean |
isVertical()
Tells whether the content of this label is painted vertically.
|
void |
paint(java.awt.Graphics g) |
void |
paintForeground(java.awt.Graphics g)
Invokes the standard algorithm that paints the foreground
of the component.
|
void |
setBackground(java.awt.Color bg) |
void |
setBounds(int x,
int y,
int w,
int h) |
void |
setEnabled(boolean enabled) |
void |
setFont(java.awt.Font font) |
void |
setFontModifier(FontModifier modifier)
Sets the modifier for the current font.
|
void |
setForeground(java.awt.Color fg) |
void |
setHorizontal(boolean horizontal)
Sets the orientation.
|
void |
setIcon(javax.swing.Icon icon)
Sets the icon which will be painted on the left or on the top side.
|
void |
setIconHidden(boolean hideIcon)
Tells whether the
icon is hidden. |
void |
setIconOffset(int iconOffset)
Sets the distance between icon and the three adjacent borders.
|
void |
setIconTextDistance(int iconTextDistance)
Sets the distance between icon and text.
|
void |
setPaintDisabledIcon(boolean paintDisabledIcon)
Whether to build and paint a special disabled version of
getIcon() if this label is disabled. |
void |
setRotation(Rotation rotation)
Sets the orientation of this label.
|
void |
setText(java.lang.String text)
Sets the text of this label
|
void |
update(java.awt.Graphics g) |
protected void |
updateFonts()
Called by
updateUI() if the fonts need to be
updated, the default implementation does nothing |
void |
updateUI() |
configure, setupRenderingHints
getBackgroundAlgorithm, getComponent, getTransparency, paintBackground, paintBorder, paintChildren, paintComponent, paintOverlay, setBackground, setTransparency
getAccessibleContext, getUI, getUIClassID, paramString, setUI
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, getNextFocusableComponent, getPopupLocation, 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, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
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, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, 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, 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, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public void setIcon(javax.swing.Icon icon)
icon
- the icon, can be null
public javax.swing.Icon getIcon()
null
public void setPaintDisabledIcon(boolean paintDisabledIcon)
getIcon()
if this label is disabled.paintDisabledIcon
- whether to paint the special iconpublic boolean isPaintDisabledIcon()
getIcon()
is painted if this label is disabled.true
if an artificial icon is createdpublic void setIconOffset(int iconOffset)
iconOffset
- the distancepublic int getIconOffset()
public void setIconTextDistance(int iconTextDistance)
iconTextDistance
- the gappublic int getIconTextDistance()
public void setRotation(Rotation rotation)
rotation
- the orientation, not null
public void setHorizontal(boolean horizontal)
horizontal
, then the rotation is set
to 0 degrees, otherwise the rotation is set to 90 degrees.horizontal
- whether the label is painted horizontalpublic boolean isHorizontal()
public boolean isVertical()
public void setText(java.lang.String text)
text
- the text, null
is allowedpublic java.lang.String getText()
null
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public void setForeground(java.awt.Color fg)
setForeground
in class javax.swing.JComponent
public java.awt.Color getForeground()
getForeground
in class java.awt.Component
public void setBackground(java.awt.Color bg)
setBackground
in class javax.swing.JComponent
public java.awt.Color getBackground()
getBackground
in class java.awt.Component
public boolean isIconHidden()
setIconHidden(boolean)
public void setIconHidden(boolean hideIcon)
icon
is hidden. If the icon is hidden, it is not painted
and does not take any space. It is however treated normally when serving calls to getPreferredSize()
.hideIcon
- whether to hide the iconpublic void updateUI()
updateUI
in class javax.swing.JPanel
protected void updateFonts()
updateUI()
if the fonts need to be
updated, the default implementation does nothingpublic void setFont(java.awt.Font font)
setFont
in class javax.swing.JComponent
public void setFontModifier(FontModifier modifier)
modifier
- the modifierDLabel.setFontModifier(FontModifier)
public FontModifier getFontModifier()
public DLabel getLabel()
OrientedLabel
to paint its content. This method
should be treated with care, modifications to the underlying label may have unexpected side effects.public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void paint(java.awt.Graphics g)
paint
in class BackgroundPanel
public void paintForeground(java.awt.Graphics g)
PaintableComponent
paintForeground
in interface PaintableComponent
paintForeground
in class BackgroundPanel
g
- the graphics context to use, null
to just inform
this component that the foreground should not be painted automaticallypublic void update(java.awt.Graphics g)
update
in class javax.swing.JComponent
public void setBounds(int x, int y, int w, int h)
setBounds
in class java.awt.Component