public class OrientedLabel extends ConfiguredBackgroundPanel
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, 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_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
OrientedLabel()
Creates a new label with no text
|
| Modifier and Type | Method and Description |
|---|---|
Color |
getBackground() |
FontModifier |
getFontModifier()
Gets the font modifier of this label.
|
Color |
getForeground() |
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. |
Dimension |
getMinimumSize() |
Dimension |
getPreferredSize() |
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(Graphics g) |
void |
paintForeground(Graphics g)
Invokes the standard algorithm that paints the foreground
of the component.
|
void |
setBackground(Color bg) |
void |
setBounds(int x,
int y,
int w,
int h) |
void |
setEnabled(boolean enabled) |
void |
setFont(Font font) |
void |
setFontModifier(FontModifier modifier)
Sets the modifier for the current font.
|
void |
setForeground(Color fg) |
void |
setHorizontal(boolean horizontal)
Sets the orientation.
|
void |
setIcon(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(String text)
Sets the text of this label
|
void |
update(Graphics g) |
protected void |
updateFonts()
Called by
updateUI() if the fonts need to be
updated, the default implementation does nothing |
void |
updateUI() |
configure, setupRenderingHintsgetBackgroundAlgorithm, getComponent, getTransparency, paintBackground, paintBorder, paintChildren, paintComponent, paintOverlay, setBackground, setTransparencygetAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, 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, unregisterKeyboardActionadd, 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, 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, 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, transferFocusUpCyclepublic void setIcon(Icon icon)
icon - the icon, can be nullpublic Icon getIcon()
nullpublic 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 nullpublic 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(String text)
text - the text, null is allowedpublic String getText()
nullpublic void setEnabled(boolean enabled)
setEnabled in class JComponentpublic void setForeground(Color fg)
setForeground in class JComponentpublic Color getForeground()
getForeground in class Componentpublic void setBackground(Color bg)
setBackground in class JComponentpublic Color getBackground()
getBackground in class Componentpublic 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 iconprotected void updateFonts()
updateUI() if the fonts need to be
updated, the default implementation does nothingpublic void setFont(Font font)
setFont in class JComponentpublic 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 Dimension getMinimumSize()
getMinimumSize in class JComponentpublic Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void paint(Graphics g)
paint in class BackgroundPanelpublic void paintForeground(Graphics g)
PaintableComponentpaintForeground in interface PaintableComponentpaintForeground in class BackgroundPanelg - the graphics context to use, null to just inform
this component that the foreground should not be painted automaticallypublic void update(Graphics g)
update in class JComponentCopyright © 2017 Docking Frames. All rights reserved.