|
|||||||||||
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.JLabel
net.jbeans.ui.label.OrientedLabel
OrientedLabel is a display area for a short text string or an image, or both. A label does not react to input events. As a result, it cannot get the keyboard focus. You can specify the orientation of OrientedLabel object.
JLabel
,
Serializable
,
Serialized FormNested 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 |
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.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 | |
OrientedLabel()
Creates an OrientedLabel instance with
no image and with an empty string for the title. |
|
OrientedLabel(javax.swing.Icon image)
Creates an OrientedLabel instance with the specified image. |
|
OrientedLabel(javax.swing.Icon image,
int horizontalAlignment)
Creates an OrientedLabel instance with the specified
image and horizontal alignment. |
|
OrientedLabel(java.lang.String text)
Creates an OrientedLabel instance with the specified text. |
|
OrientedLabel(java.lang.String text,
javax.swing.Icon image,
int horizontalAlignment)
|
|
OrientedLabel(java.lang.String text,
int horizontalAlignment)
Creates an OrientedLabel instance with the specified
text and horizontal alignment. |
Method Summary | |
double |
getAngle()
Gets a rotation angle. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this container. |
void |
paint(java.awt.Graphics g)
paints Label object. |
void |
setAngle(double angle)
Sets a rotation angle. |
void |
setDisabledIcon(javax.swing.Icon disabledIcon)
Set the icon to be displayed if this JLabel is "disabled" (JLabel.setEnabled(false)). |
void |
setDisplayedMnemonic(char aChar)
Specifies the displayedMnemonic as a char value. |
void |
setDisplayedMnemonic(int key)
Specify a keycode that indicates a mnemonic key. |
void |
setHorizontalAlignment(int alignment)
Sets the alignment of the label's contents along the X axis. |
void |
setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the label's text, relative to its image. |
void |
setIcon(javax.swing.Icon icon)
Defines the icon this component will display. |
void |
setIconTextGap(int iconTextGap)
If both the icon and text properties are set, this property defines the space between them. |
void |
setLabelFor(java.awt.Component c)
Set the component this is labelling. |
void |
setText(java.lang.String text)
Defines the single line of text this component will display. |
void |
setUI(javax.swing.plaf.LabelUI ui)
Sets the L&F object that renders this component. |
void |
setVerticalAlignment(int alignment)
Sets the alignment of the label's contents along the Y axis. |
void |
setVerticalTextPosition(int textPosition)
Sets the vertical position of the label's text, relative to its image. |
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, setDisplayedMnemonicIndex, 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, getNextFocusableComponent, 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 |
Constructor Detail |
public OrientedLabel()
OrientedLabel
instance with
no image and with an empty string for the title.
The label is centered vertically
in its display area.
The label's contents, once set, will be displayed on the leading edge
of the label's display area.
public OrientedLabel(javax.swing.Icon image)
OrientedLabel
instance with the specified image.
The label is centered vertically and horizontally
in its display area.
public OrientedLabel(javax.swing.Icon image, int horizontalAlignment)
OrientedLabel
instance with the specified
image and horizontal alignment.
The label is centered vertically in its display area.
horizontalAlignment
- One of the following constants
defined in SwingConstants
:
LEFT
,
CENTER
,
RIGHT
,
LEADING
or
TRAILING
.public OrientedLabel(java.lang.String text)
OrientedLabel
instance with the specified text.
The label is aligned against the leading edge of its display area,
and centered vertically.
text
- The text to be displayed by the label.public OrientedLabel(java.lang.String text, javax.swing.Icon image, int horizontalAlignment)
public OrientedLabel(java.lang.String text, int horizontalAlignment)
OrientedLabel
instance with the specified
text and horizontal alignment.
The label is centered vertically in its display area.
text
- The text to be displayed by the label.horizontalAlignment
- One of the following constants
defined in SwingConstants
:
LEFT
,
CENTER
,
RIGHT
,
LEADING
or
TRAILING
.Method Detail |
public void setAngle(double angle)
angle
- the rotation angle in radian.public double getAngle()
public void paint(java.awt.Graphics g)
public java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public void setUI(javax.swing.plaf.LabelUI ui)
ui
- the LabelUI L&F objectUIDefaults.getUI(javax.swing.JComponent)
public void setText(java.lang.String text)
The default value of this property is null.
This is a JavaBeans bound property.
setVerticalTextPosition(int)
,
setHorizontalTextPosition(int)
,
setIcon(javax.swing.Icon)
public void setIcon(javax.swing.Icon icon)
The default value of this property is null.
This is a JavaBeans bound property.
setVerticalTextPosition(int)
,
setHorizontalTextPosition(int)
,
JLabel.getIcon()
public void setDisabledIcon(javax.swing.Icon disabledIcon)
The default value of this property is null.
disabledIcon
- the Icon to display when the component is disabledJLabel.getDisabledIcon()
,
JComponent.setEnabled(boolean)
public void setDisplayedMnemonic(int key)
JLabel.getLabelFor()
,
setLabelFor(java.awt.Component)
public void setDisplayedMnemonic(char aChar)
aChar
- a char specifying the mnemonic to displaysetDisplayedMnemonic(int)
public void setIconTextGap(int iconTextGap)
The default value of this property is 4 pixels.
This is a JavaBeans bound property.
JLabel.getIconTextGap()
public void setVerticalAlignment(int alignment)
The default value of this property is CENTER.
alignment
- One of the following constants
defined in SwingConstants
:
TOP
,
CENTER
(the default), or
BOTTOM
.SwingConstants
,
JLabel.getVerticalAlignment()
public void setHorizontalAlignment(int alignment)
This is a JavaBeans bound property.
alignment
- One of the following constants
defined in SwingConstants
:
LEFT
,
CENTER
(the default for image-only labels),
RIGHT
,
LEADING
(the default for text-only labels) or
TRAILING
.SwingConstants
,
JLabel.getHorizontalAlignment()
public void setVerticalTextPosition(int textPosition)
The default value of this property is CENTER.
This is a JavaBeans bound property.
textPosition
- One of the following constants
defined in SwingConstants
:
TOP
,
CENTER
(the default), or
BOTTOM
.SwingConstants
,
JLabel.getVerticalTextPosition()
public void setHorizontalTextPosition(int textPosition)
java.lang.IllegalArgumentException
SwingConstants
public void setLabelFor(java.awt.Component c)
c
- the Component this label is for, or null if the label is
not the label for a componentJLabel.getDisplayedMnemonic()
,
setDisplayedMnemonic(int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |