net.xoetrope.swt
Class XLabel

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Label
              extended by net.xoetrope.swt.XLabel
All Implemented Interfaces:
XAttributedComponent, XTextHolder, org.eclipse.swt.graphics.Drawable

public class XLabel
extends org.eclipse.swt.widgets.Label
implements XTextHolder, XAttributedComponent

Draws text. The text may be wrapped over multiple lines. Double buffering is switched off by default.

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt


Field Summary
protected  int bufferHeight
           
protected  int bufferWidth
           
protected  boolean doubleBuffered
           
protected  java.lang.String name
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
XLabel(java.lang.Object parent)
          Create an XLabel
 
Method Summary
protected  void checkSubclass()
          Suppress the subclasing exception
 int getAlignment()
          Get the alignment style constant
 java.lang.Object getPreferredSize()
          Gets the preferred size of this component.
 int setAttribute(java.lang.String attribName, java.lang.Object attribValue)
          Set one or more attributes of the component.
 void setDoubleBuffered(boolean buffer)
          Toggle use of double buffering when painting this component
 void setText(java.lang.String text)
          Set the text
 void setTransparent(boolean b)
          Sets the transparency of the text.
 
Methods inherited from class org.eclipse.swt.widgets.Label
computeSize, getImage, getText, setAlignment, setImage
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFocus, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.xoetrope.xui.XTextHolder
getText
 

Field Detail

name

protected java.lang.String name

doubleBuffered

protected boolean doubleBuffered

bufferWidth

protected int bufferWidth

bufferHeight

protected int bufferHeight
Constructor Detail

XLabel

public XLabel(java.lang.Object parent)
Create an XLabel

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclasing exception

Overrides:
checkSubclass in class org.eclipse.swt.widgets.Widget

getAlignment

public int getAlignment()
Get the alignment style constant

Overrides:
getAlignment in class org.eclipse.swt.widgets.Label
Returns:
the alignment value

setTransparent

public void setTransparent(boolean b)
Sets the transparency of the text.

Parameters:
b - true to make text transparent

setAttribute

public int setAttribute(java.lang.String attribName,
                        java.lang.Object attribValue)
Set one or more attributes of the component.

Specified by:
setAttribute in interface XAttributedComponent
Parameters:
attribName - the name of the attribute
attribValue - the value of the attribute
Returns:
0 for success, non zero for failure or to require some further action

getPreferredSize

public java.lang.Object getPreferredSize()
Gets the preferred size of this component.

Returns:
a dimension object indicating this component's preferred size
See Also:
#getMinimumSize, LayoutManager

setDoubleBuffered

public void setDoubleBuffered(boolean buffer)
Toggle use of double buffering when painting this component

Parameters:
buffer - true to double buffer

setText

public void setText(java.lang.String text)
Set the text

Specified by:
setText in interface XTextHolder
Overrides:
setText in class org.eclipse.swt.widgets.Label
Parameters:
text - the new text