swingwtx.swing
Class JLabel

java.lang.Object
  extended byswingwt.awt.Component
      extended byswingwt.awt.Container
          extended byswingwtx.swing.JComponent
              extended byswingwtx.swing.JLabel
All Implemented Interfaces:
ImageObserver, MenuContainer, SwingConstants
Direct Known Subclasses:
DefaultListCellRenderer, DefaultTableCellRenderer, DefaultTreeCellRenderer, Label

public class JLabel
extends JComponent
implements SwingConstants


Nested Class Summary
 
Nested classes inherited from class swingwtx.swing.JComponent
JComponent.InternalFrameSelectionListener
 
Field Summary
protected  Component labelFor
          If this is the label for a particular component, then show the one it's tied to
protected  int pHAlign
          The label's horizontal alignment
protected  int pHTextPosition
          The label's horizontal text position
protected  Icon pImage
          A cache of the label's icon
protected  org.eclipse.swt.widgets.Label ppeer
          The label's peer
protected  java.lang.String pText
          A cache of the label's text
protected  int pVAlign
          The label's vertical alignment
protected  int pVTextPosition
          The label's vertical text position
 
Fields inherited from class swingwtx.swing.JComponent
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, opaque, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap
 
Fields inherited from class swingwt.awt.Container
composite, comps, containerListeners, layout, queuedValidateRequest
 
Fields inherited from class swingwt.awt.Component
actionCommand, actionListeners, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListeners, componentName, consumeAvailableHeight, consumeAvailableWidth, focusable, focusListeners, graphicsConfig, inputMethodListeners, isUserSetFont, keyListeners, layoutModifier, LEFT_ALIGNMENT, LOCK, mouseListeners, mouseMotionListeners, mouseWheelListeners, parent, pBackground, pCursor, pDoubleBuffered, peer, pEnabled, pFont, pForeground, pLayoutData, pLocation, pMaxSize, pMinSize, pPrefSize, pSize, pToolTipText, pVisible, RIGHT_ALIGNMENT, swingWTDefaultActionEventAdapter, swingWTEventAdapter, TOP_ALIGNMENT
 
Fields inherited from interface swingwtx.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 swingwt.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JLabel()
          Creates a new JLabel with empty text and no icon
JLabel(Icon icon)
          Creates a new JLabel with the specified icon
JLabel(java.lang.String text)
          Creates a new JLabel with the specified text
JLabel(java.lang.String text, Icon icon, int align)
           
JLabel(java.lang.String text, int align)
          Creates a new JLabel with the specified text and alignment
 
Method Summary
protected  Dimension calculatePreferredSize()
          Overriden to calculate non-realised preferred size.
 Icon getDisabledIcon()
          NOT IMPLEMENTED
 int getHorizontalAlignment()
          Gets the horizontal alignment for the label
 int getHorizontalTextPosition()
          No meaning in native, calls across to getHorizontalAlignment()
 Icon getIcon()
          Gets the icon for this label
 Component getLabelFor()
          If this label is accompanying a component, the component
 java.lang.String getText()
           
 int getVerticalAlignment()
          Gets the vertical alignment for the label
 int getVerticalTextPosition()
          No meaning in native, calls across to getVerticalAlignment()
 void setDisabledIcon(Icon icon)
          NOT IMPLEMENTED
 void setDisplayedMnemonic(char c)
          NOT IMPLEMENTED
 void setDisplayedMnemonic(int c)
          NOT IMPLEMENTED
 void setHorizontalAlignment(int align)
          Sets the horizontal alignment for this label.
 void setHorizontalTextPosition(int textpos)
          No meaning in native, calls across to setHorizontalAlignment()
 void setIcon(Icon icon)
          Sets the icon for this label
 void setLabelFor(Component c)
          If this label is accompanying a component, the component
 void setSwingWTParent(Container parent)
          Once a parent component receives an "add" call for a child, this being the child, this should be called to tell us to instantiate the peer and load in any cached properties.
 void setText(java.lang.String text)
          Sets the label's text
 void setVerticalAlignment(int align)
          Sets the vertical alignment for this label.
 void setVerticalTextPosition(int textpos)
          No meaning in native, calls across to setVerticalAlignment()
 
Methods inherited from class swingwtx.swing.JComponent
add, add, add, add, add, addPropertyChangeListener, addPropertyChangeListener, checkInternalFrameChild, dispose, getAccessibleContext, getActionMap, getAutoscrolls, getBorder, getClientProperty, getInputMap, getInsets, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isValidateRoot, paint, paintBackground, paintChildren, paintComponent, paintImmediately, paintImmediately, putClientProperty, remove, remove, removePropertyChangeListener, removePropertyChangeListener, repaint, revalidate, scrollRectToVisible, setActionMap, setAutoscrolls, setBorder, setDoubleBuffered, setInputMap, setMargin, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled
 
Methods inherited from class swingwt.awt.Container
addComponentToLayout, addContainerListener, debug_showContainmentTree, doAdd, doLayout, getComponent, getComponentCount, getComponentOrientation, getComponents, getComposite, getLayout, getMaximumSize, getMinimumSize, getParent, getPreferredSize, invalidate, minimumSize, preferredSize, processContainerEvent, processEvent, queuedValidate, removeAll, removeComponentFromCache, removeContainerListener, setLayout, setLayoutImpl, validate
 
Methods inherited from class swingwt.awt.Component
add, addActionListener, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, componentOnlyDispose, computePreferredSize, contains, contains, createImage, createListenerArrayFromVector, createVolatileImage, dispatchEvent, getActionCommand, getAlignmentX, getAlignmentY, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getListeners, getLocation, getLocationOnScreen, getName, getPeer, getPeerSize, getSize, getSize, getSWTPeer, getToolkit, getToolTipText, getTreeLock, getWidth, getX, getY, grabFocus, hasFocus, hasSetFont, hide, imageUpdate, inside, isEnabled, isFocusable, isMinimumSizeSet, isShowing, isVisible, processActionEvent, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processTraverseEvent, registerActionEvents, registerComponentEvents, registerEvents, registerExtendedModifyEvents, registerFocusEvents, registerKeyEvents, registerModifyEvents, registerMouseEvents, registerPaintEvents, registerTraversalEvents, remove, removeActionListener, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, repaint, repaint, repaint, requestFocus, setActionCommand, setAlignmentX, setAlignmentY, setBackground, setBounds, setBounds, setCachedProperties, setComponentOrientation, setComponentRemoved, setCursor, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setHeight, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setSize, setSize, setToolTipText, setVisible, setWidth, show, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ppeer

protected org.eclipse.swt.widgets.Label ppeer
The label's peer


pText

protected java.lang.String pText
A cache of the label's text


pImage

protected Icon pImage
A cache of the label's icon


pHTextPosition

protected int pHTextPosition
The label's horizontal text position


pVTextPosition

protected int pVTextPosition
The label's vertical text position


pHAlign

protected int pHAlign
The label's horizontal alignment


pVAlign

protected int pVAlign
The label's vertical alignment


labelFor

protected Component labelFor
If this is the label for a particular component, then show the one it's tied to

Constructor Detail

JLabel

public JLabel()
Creates a new JLabel with empty text and no icon


JLabel

public JLabel(java.lang.String text)
Creates a new JLabel with the specified text

Parameters:
text - The text of the label

JLabel

public JLabel(java.lang.String text,
              int align)
Creates a new JLabel with the specified text and alignment

Parameters:
text - The text of the label
align - The label's horizontal alignment

JLabel

public JLabel(Icon icon)
Creates a new JLabel with the specified icon

Parameters:
icon - The label's icon

JLabel

public JLabel(java.lang.String text,
              Icon icon,
              int align)
Method Detail

getText

public java.lang.String getText()
Returns:
The text on the label

setText

public void setText(java.lang.String text)
Sets the label's text

Parameters:
text - The new text

setLabelFor

public void setLabelFor(Component c)
If this label is accompanying a component, the component

Parameters:
c - The component this label is accompanying

getLabelFor

public Component getLabelFor()
If this label is accompanying a component, the component

Returns:
The component

setDisplayedMnemonic

public void setDisplayedMnemonic(char c)
NOT IMPLEMENTED


setDisplayedMnemonic

public void setDisplayedMnemonic(int c)
NOT IMPLEMENTED


setIcon

public void setIcon(Icon icon)
Sets the icon for this label

Parameters:
icon - The icon to display in the label

getIcon

public Icon getIcon()
Gets the icon for this label

Returns:
The icon

getDisabledIcon

public Icon getDisabledIcon()
NOT IMPLEMENTED


setDisabledIcon

public void setDisabledIcon(Icon icon)
NOT IMPLEMENTED


setHorizontalAlignment

public void setHorizontalAlignment(int align)
Sets the horizontal alignment for this label. Use one of LEADING, LEFT, CENTER, RIGHT, TRAILING from SwingConstants

Parameters:
align - The alignment

setVerticalAlignment

public void setVerticalAlignment(int align)
Sets the vertical alignment for this label. Use one of LEADING, LEFT, CENTER, RIGHT, TRAILING from SwingConstants

Parameters:
align - The alignment

getHorizontalAlignment

public int getHorizontalAlignment()
Gets the horizontal alignment for the label

Returns:
The horizontal alignment

getVerticalAlignment

public int getVerticalAlignment()
Gets the vertical alignment for the label

Returns:
The vertical alignment

setHorizontalTextPosition

public void setHorizontalTextPosition(int textpos)
No meaning in native, calls across to setHorizontalAlignment()


setVerticalTextPosition

public void setVerticalTextPosition(int textpos)
No meaning in native, calls across to setVerticalAlignment()


getHorizontalTextPosition

public int getHorizontalTextPosition()
No meaning in native, calls across to getHorizontalAlignment()


getVerticalTextPosition

public int getVerticalTextPosition()
No meaning in native, calls across to getVerticalAlignment()


calculatePreferredSize

protected Dimension calculatePreferredSize()
Overriden to calculate non-realised preferred size.

Overrides:
calculatePreferredSize in class Component

setSwingWTParent

public void setSwingWTParent(Container parent)
                      throws java.lang.Exception
Once a parent component receives an "add" call for a child, this being the child, this should be called to tell us to instantiate the peer and load in any cached properties.

Overrides:
setSwingWTParent in class JComponent
Throws:
java.lang.Exception