com.tensegrity.gui.swt.repository
Class AbstractSwtRepositoryItem

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 bycom.tensegrity.gui.swt.repository.AbstractSwtRepositoryItem
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, java.util.EventListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseTrackListener, org.eclipse.swt.internal.SWTEventListener
Direct Known Subclasses:
ActionSwtRepositoryItem, VisualGraphObjectSwtRepositoryItem

public abstract class AbstractSwtRepositoryItem
extends org.eclipse.swt.widgets.Composite
implements org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseTrackListener

An AbstractSwtRepositoryItem is a Composite made of one ImageWidget for the icon and a Label for the text.

Version:
$Id: AbstractSwtRepositoryItem.java,v 1.16 2005/06/23 11:50:23 SebastienGuyon Exp $
Author:
S�bastien Guyon

Field Summary
static int DEFAULT_WIDTH_AND_HEIGHT
          Default icon width and height used by the constructor AbstractSwtRepositoryItem(Composite, int)
protected  boolean mouseIn
          Indicates wether the mouse cursor is within this Icon.
protected  boolean mousePressed
          Indicates wether the right mousebutton is pressed.
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
AbstractSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0, int arg1)
           This constructor internally sets up and lays out the local Button and Label used to represent this AbstractSwtRepositoryItem.
AbstractSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0, int arg1, int iconWidth, int iconHeight)
           This constructor internally sets up and lays out the local Button and Label used to represent a AbstractSwtRepositoryItem.
 
Method Summary
 void dispose()
           
protected abstract  AbstractSwtDragSourceListener getDragListener()
           Returns the AbstractSwtDragSourceListener associated to this repository item.
protected  int getIconHeight()
           TODO SGu (15.06.2005): Comment method
protected  ImageWidget getIconlabel()
           Gives subclasses access to the ImageWidget.
protected  int getIconWidth()
           TODO SGu (15.06.2005): Comment method
protected abstract  java.lang.Object getTooltip()
           Returns the tooltip for this repository item.
protected  void initToolTipGenerator()
           Initializes the tooltip generator.
protected  void installDragging()
           This routine installs the "dragging" feature on both this Composite and on the button holding the icon.
 void mouseDoubleClick(org.eclipse.swt.events.MouseEvent arg0)
           
 void mouseDown(org.eclipse.swt.events.MouseEvent arg0)
           
 void mouseEnter(org.eclipse.swt.events.MouseEvent arg0)
           
 void mouseExit(org.eclipse.swt.events.MouseEvent arg0)
           
 void mouseHover(org.eclipse.swt.events.MouseEvent arg0)
           
 void mouseUp(org.eclipse.swt.events.MouseEvent arg0)
           
 void setImage(SwtIcon swtIcon)
           Sets swtIcon as this repository item's image.
 void setText(java.lang.String text)
           Sets text as this repository item's text.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, 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, getBackground, 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, setBounds, setBounds, setCapture, setCursor, setEnabled, 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, 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
 

Field Detail

DEFAULT_WIDTH_AND_HEIGHT

public static final int DEFAULT_WIDTH_AND_HEIGHT
Default icon width and height used by the constructor AbstractSwtRepositoryItem(Composite, int)

See Also:
Constant Field Values

mouseIn

protected boolean mouseIn
Indicates wether the mouse cursor is within this Icon.


mousePressed

protected boolean mousePressed
Indicates wether the right mousebutton is pressed.

Constructor Detail

AbstractSwtRepositoryItem

public AbstractSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0,
                                 int arg1,
                                 int iconWidth,
                                 int iconHeight)

This constructor internally sets up and lays out the local Button and Label used to represent a AbstractSwtRepositoryItem.

Parameters:
arg0 - a widget which will be the parent of the new instance (cannot be null)
arg1 - the style of widget to construct
iconWidth - the icon width
iconHeight - the icon height

AbstractSwtRepositoryItem

public AbstractSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0,
                                 int arg1)

This constructor internally sets up and lays out the local Button and Label used to represent this AbstractSwtRepositoryItem. This constructor uses DEFAULT_WIDTH_AND_HEIGHT for the icon width and height.

Parameters:
arg0 - a widget which will be the parent of the new instance (cannot be null)
arg1 - the style of widget to construct
Method Detail

getIconHeight

protected int getIconHeight()

TODO SGu (15.06.2005): Comment method

Returns:

getIconWidth

protected int getIconWidth()

TODO SGu (15.06.2005): Comment method

Returns:

setText

public void setText(java.lang.String text)

Sets text as this repository item's text.

Parameters:
text - this repository item's text

mouseDown

public void mouseDown(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseDown in interface org.eclipse.swt.events.MouseListener

mouseEnter

public void mouseEnter(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseEnter in interface org.eclipse.swt.events.MouseTrackListener

mouseExit

public void mouseExit(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseExit in interface org.eclipse.swt.events.MouseTrackListener

mouseUp

public void mouseUp(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseUp in interface org.eclipse.swt.events.MouseListener

mouseDoubleClick

public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseDoubleClick in interface org.eclipse.swt.events.MouseListener

mouseHover

public void mouseHover(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseHover in interface org.eclipse.swt.events.MouseTrackListener

setImage

public void setImage(SwtIcon swtIcon)

Sets swtIcon as this repository item's image.

Parameters:
swtIcon - this repository item's image

installDragging

protected void installDragging()

This routine installs the "dragging" feature on both this Composite and on the button holding the icon.

See Also:
DragSource, getDragListener()

getDragListener

protected abstract AbstractSwtDragSourceListener getDragListener()

Returns the AbstractSwtDragSourceListener associated to this repository item.

Returns:
the AbstractSwtDragSourceListener associated to this repository item.

getTooltip

protected abstract java.lang.Object getTooltip()

Returns the tooltip for this repository item.

Returns:
the tooltip for this repository item.

initToolTipGenerator

protected void initToolTipGenerator()

Initializes the tooltip generator. By default it is set to the label and returns the tooltip text passed to the class constructor.


dispose

public void dispose()

getIconlabel

protected ImageWidget getIconlabel()

Gives subclasses access to the ImageWidget.

Returns:
the ImageWidget displaying the icon


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