com.tensegrity.gui.swt.control.labels
Class PaintItemLabel

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended bycom.tensegrity.gui.swt.control.widgets.BorderedWidget
                          extended bycom.tensegrity.gui.swt.control.labels.PaintItemLabel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class PaintItemLabel
extends BorderedWidget

A gui component which visualizes a PaintItem object.

Version:
$Id: PaintItemLabel.java,v 1.13 2006/03/02 11:41:40 BurkhardWick Exp $
Author:
Arnd Houben

Field Summary
 
Fields inherited from class com.tensegrity.gui.swt.control.widgets.BorderedWidget
indent
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
PaintItemLabel(org.eclipse.swt.widgets.Composite parent, int style, PaintItem pItem)
          Constructor which requires an initial PaintItem
PaintItemLabel(org.eclipse.swt.widgets.Composite parent, int style, PaintItem pItem, boolean doHighlighting)
          Constructor which lets the user define if the label should be highlighted on mouse over events
 
Method Summary
protected  void draw(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle cArea)
          Draw the content.
 org.eclipse.swt.graphics.RGB getBackColor()
          Returns the currently set background color
 org.eclipse.swt.graphics.Color getBackground()
          Returns the current PaintItem background color
 org.eclipse.swt.graphics.RGB getForeColor()
          Returns the currently set foreground color
 org.eclipse.swt.graphics.Color getForeground()
           
 int getGradientBackground()
          Returns the gradient background color
 int getGradientForeground()
          Returns the current PaintItem foreground color of
 int getGradientType()
          Returns the gradient type of the paint item
 PaintItem getPaintItem()
          Returns the paint item
 int getPatternType()
          Returns the pattern type of the paint item
 void setBackground(int color)
          Sets the PaintItem background color
 void setBackground(org.eclipse.swt.graphics.RGB backColor)
          Sets the PaintItem background color to the specified one
 void setForeground(int color)
          Sets the PaintItem foreground color
 void setForeground(org.eclipse.swt.graphics.RGB foreColor)
          Sets the PaintItem foreground color to the specified on
 void setGradientType(int type)
          Sets the gradient type of the paint item
 void setPatternType(int type)
          Sets the pattern type of the paint item
 void setTexture(java.lang.String textureKey)
          Sets the texture key of the paint item
protected  void widgetDisposed(org.eclipse.swt.events.DisposeEvent de)
          Called on dispose events.
 
Methods inherited from class com.tensegrity.gui.swt.control.widgets.BorderedWidget
computeSize, hasBorder, setBorderColor
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBorderWidth, getBounds, getEnabled, getFont, 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, setBounds, setBounds, setCapture, setCursor, setEnabled, 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
 

Constructor Detail

PaintItemLabel

public PaintItemLabel(org.eclipse.swt.widgets.Composite parent,
                      int style,
                      PaintItem pItem)
Constructor which requires an initial PaintItem

Parameters:
parent - parent component of this view
style - swt style bits
pItem - the initial paint item instance

PaintItemLabel

public PaintItemLabel(org.eclipse.swt.widgets.Composite parent,
                      int style,
                      PaintItem pItem,
                      boolean doHighlighting)
Constructor which lets the user define if the label should be highlighted on mouse over events

Parameters:
parent - parent component of this view
style - swt style bits
pItem - the initial paint item instance
doHighlighting - set to true to indicate that the label should be highlighted, false otherwise
Method Detail

getPaintItem

public final PaintItem getPaintItem()
Returns the paint item

Returns:
the paint item

getGradientType

public final int getGradientType()
Returns the gradient type of the paint item

Returns:
paint item's gradient type

getPatternType

public final int getPatternType()
Returns the pattern type of the paint item

Returns:
paint item's pattern type

getGradientBackground

public final int getGradientBackground()
Returns the gradient background color

Returns:
background color encoded as Tensegrity Color Format

getGradientForeground

public final int getGradientForeground()
Returns the current PaintItem foreground color of

Returns:
foreground color encoded as Tensegrity Color Format

getBackground

public final org.eclipse.swt.graphics.Color getBackground()
Returns the current PaintItem background color

Returns:
the bacground color of the PaintItem

getForeground

public final org.eclipse.swt.graphics.Color getForeground()

setForeground

public final void setForeground(org.eclipse.swt.graphics.RGB foreColor)
Sets the PaintItem foreground color to the specified on

Parameters:
foreColor - an RGB instance defining the new foreground color

getForeColor

public final org.eclipse.swt.graphics.RGB getForeColor()
Returns the currently set foreground color

Returns:
an RGB instance representing the currently set foreground color

setBackground

public final void setBackground(org.eclipse.swt.graphics.RGB backColor)
Sets the PaintItem background color to the specified one

Parameters:
backColor - an RGB instance representing the new background color

getBackColor

public final org.eclipse.swt.graphics.RGB getBackColor()
Returns the currently set background color

Returns:
an RGB instance representing the currently used background color

setForeground

public final void setForeground(int color)
Sets the PaintItem foreground color

Parameters:
color - encoded as Tensegrity Color Format

setBackground

public final void setBackground(int color)
Sets the PaintItem background color

Parameters:
color - encoded as Tensegrity Color Format

setGradientType

public final void setGradientType(int type)
Sets the gradient type of the paint item

Parameters:
type - the new gradient type

setPatternType

public final void setPatternType(int type)
Sets the pattern type of the paint item

Parameters:
type - the new pattern type

setTexture

public final void setTexture(java.lang.String textureKey)
Sets the texture key of the paint item

Parameters:
textureKey - the new texture key

draw

protected void draw(org.eclipse.swt.graphics.GC gc,
                    org.eclipse.swt.graphics.Rectangle cArea)
Description copied from class: BorderedWidget
Draw the content.

Specified by:
draw in class BorderedWidget
Parameters:
gc - the graphicd context to use for drawing
cArea - the area an implementing class can use for drawing

widgetDisposed

protected void widgetDisposed(org.eclipse.swt.events.DisposeEvent de)
Description copied from class: BorderedWidget
Called on dispose events. Implementing classes should release all their requested resources

Specified by:
widgetDisposed in class BorderedWidget
Parameters:
de - a DisposeEvent instance with additional information


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.