|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
bibliothek.gui.dock.util.BackgroundPanel
bibliothek.gui.dock.util.ConfiguredBackgroundPanel
bibliothek.gui.dock.util.swing.OrientedLabel
public class OrientedLabel
A label which draws some text, and can change the layout of the text between horizontal and vertical.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
OrientedLabel()
Creates a new label with no text |
|
| Method Summary | |
|---|---|
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 |
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 |
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()
|
| Methods inherited from class bibliothek.gui.dock.util.ConfiguredBackgroundPanel |
|---|
configure, setupRenderingHints |
| Methods inherited from class bibliothek.gui.dock.util.BackgroundPanel |
|---|
getBackgroundAlgorithm, getComponent, getTransparency, paintBackground, paintBorder, paintChildren, paintComponent, paintOverlay, setBackground, setTransparency |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OrientedLabel()
| Method Detail |
|---|
public void setIcon(Icon icon)
icon - the icon, can be nullpublic Icon getIcon()
nullpublic 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 iconpublic void updateUI()
updateUI in class JPanelprotected void updateFonts()
updateUI() if the fonts need to be
updated, the default implementation does nothing
public 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)
PaintableComponent
paintForeground 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 JComponent
public void setBounds(int x,
int y,
int w,
int h)
setBounds in class Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||