org.dishevelled.identify
Class IdLabel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLabel
                  extended by org.dishevelled.identify.IdLabel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public final class IdLabel
extends JLabel

An extension of JLabel that displays the name property value and appropriate icon from an icon bundle for a given bean.

Version:
$Revision: 1059 $ $Date: 2012-01-03 14:03:02 -0600 (Tue, 03 Jan 2012) $
Author:
Michael Heuer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
 
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
static IconSize DEFAULT_ICON_SIZE
          Default icon size.
static IconState DEFAULT_ICON_STATE
          Default icon state.
 
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
IdLabel()
          Create a new label with a null value.
IdLabel(Object value)
          Create a new label for the specified value.
IdLabel(Object value, IconSize iconSize)
          Create a new label for the specified value with the specified icon size.
 
Method Summary
 void applyComponentOrientation(ComponentOrientation orientation)
          
 Rectangle getBounds()
          
 Rectangle getBounds(Rectangle rv)
          
 Icon getDisabledIcon()
          
 int getHeight()
          
 Icon getIcon()
          
 IconSize getIconSize()
          Return the icon size for this label.
 IconState getIconState()
          Return the icon state for this label.
(package private)  IconTextDirection getIconTextDirection()
          Return the icon text direction for this label.
 Dimension getMaximumSize()
          
 Dimension getMinimumSize()
          
 Dimension getPreferredSize()
          
 Dimension getSize()
          
 String getText()
          
 Object getValue()
          Return the value for this label.
 Rectangle getVisibleRect()
          
 int getWidth()
          
 void paintComponent(Graphics g)
          
 void setComponentOrientation(ComponentOrientation orientation)
          
 void setEnabled(boolean enabled)
          
 void setIconSize(IconSize iconSize)
          Set the icon size for this label to iconSize.
 void setIconState(IconState iconState)
          Set the icon state for this label to iconState.
 void setValue(Object value)
          Set the value for this label to value.
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIconTextGap, getLabelFor, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, 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, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, 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, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, setBounds, 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
 

Field Detail

DEFAULT_ICON_SIZE

public static final IconSize DEFAULT_ICON_SIZE
Default icon size.


DEFAULT_ICON_STATE

public static final IconState DEFAULT_ICON_STATE
Default icon state.

Constructor Detail

IdLabel

public IdLabel()
Create a new label with a null value.


IdLabel

public IdLabel(Object value)
Create a new label for the specified value.

Parameters:
value - value

IdLabel

public IdLabel(Object value,
               IconSize iconSize)
Create a new label for the specified value with the specified icon size.

Parameters:
value - value
iconSize - icon size, must not be null
Method Detail

getValue

public Object getValue()
Return the value for this label.

Returns:
the value for this label

setValue

public void setValue(Object value)
Set the value for this label to value.

This is a bound property.

Parameters:
value - value for this label

getIconSize

public IconSize getIconSize()
Return the icon size for this label.

Returns:
the icon size for this label

setIconSize

public void setIconSize(IconSize iconSize)
Set the icon size for this label to iconSize.

This is a bound property.

Parameters:
iconSize - icon size, must not be null

getIconState

public IconState getIconState()
Return the icon state for this label.

Returns:
the icon state for this label

setIconState

public void setIconState(IconState iconState)
Set the icon state for this label to iconState.

This is a bound property.

Parameters:
iconState - icon state, must not be null

getIconTextDirection

IconTextDirection getIconTextDirection()
Return the icon text direction for this label.

Returns:
the icon text direction for this label

setComponentOrientation

public void setComponentOrientation(ComponentOrientation orientation)

Overrides:
setComponentOrientation in class Component

applyComponentOrientation

public void applyComponentOrientation(ComponentOrientation orientation)

Overrides:
applyComponentOrientation in class Container

setEnabled

public void setEnabled(boolean enabled)

Overrides:
setEnabled in class JComponent

getText

public String getText()

Overrides:
getText in class JLabel

getIcon

public Icon getIcon()

Overrides:
getIcon in class JLabel

getDisabledIcon

public Icon getDisabledIcon()

Overrides:
getDisabledIcon in class JLabel

getBounds

public Rectangle getBounds()

Overrides:
getBounds in class Component

getBounds

public Rectangle getBounds(Rectangle rv)

Overrides:
getBounds in class JComponent

getMaximumSize

public Dimension getMaximumSize()

Overrides:
getMaximumSize in class JComponent

getMinimumSize

public Dimension getMinimumSize()

Overrides:
getMinimumSize in class JComponent

getPreferredSize

public Dimension getPreferredSize()

Overrides:
getPreferredSize in class JComponent

getSize

public Dimension getSize()

Overrides:
getSize in class Component

getVisibleRect

public Rectangle getVisibleRect()

Overrides:
getVisibleRect in class JComponent

getHeight

public int getHeight()

Overrides:
getHeight in class JComponent

getWidth

public int getWidth()

Overrides:
getWidth in class JComponent

paintComponent

public void paintComponent(Graphics g)

Overrides:
paintComponent in class JComponent


Copyright (c) 2003-2012 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).