com.tensegrity.gui.swt.repository
Class VisualGraphObjectSwtRepositoryItem

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
                      extended bycom.tensegrity.gui.swt.repository.VisualGraphObjectSwtRepositoryItem
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

public class VisualGraphObjectSwtRepositoryItem
extends AbstractSwtRepositoryItem

The VisualGraphObjectSwtRepositoryItem is used to display a VisualGraphObject in an SWT context.

Additionally to display the VisualGraphObject this VisualGraphObjectSwtRepositoryItem enables the drag and drop mechanism such that the VisualGraphObject can be dragged out of the repository item and dropped onto any appropriate control.

Version:
$Id: VisualGraphObjectSwtRepositoryItem.java,v 1.25 2005/10/19 10:26:28 ArndHouben Exp $
Author:
S�bastien Guyon

Field Summary
 
Fields inherited from class com.tensegrity.gui.swt.repository.AbstractSwtRepositoryItem
DEFAULT_WIDTH_AND_HEIGHT, mouseIn, mousePressed
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
VisualGraphObjectSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0, DragContext vgoDragSource, VisualGraphObject vgo, java.lang.String tooltip, int iconWidth, int iconHeight)
           Initializes a repository item with a 1.0 scale factor and no special drag representation but one of vgo.
VisualGraphObjectSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0, DragContext vgoDragSource, VisualGraphObject vgo, java.lang.String tooltip, java.lang.String iconpath, java.lang.Class resourceclass, int iconWidth, int iconHeight)
           Initializes a repository item with a 1.0 scale factor and no special drag representation but one of vgo.
VisualGraphObjectSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0, int arg1, DragContext vgoDragSource, VisualGraphObject vgo, VisualGraphObject dragRepresentation, double scaleFactor, java.lang.String tooltip, int iconWidth, int iconHeight)
           Initializes a repository item with a scaleFactor scale factor and a special drag representation (dragRepresentation).
 
Method Summary
 void dispose()
           
 VisualGraphObject[] getAdditionalVGOS()
           
 java.util.List getComposites()
          Returns all basecomposites that are referenced by the repository item - The drag representation (which was given as constructor argument) - The base composite used to render the icon - Additional objects that have been added to this item
protected  AbstractSwtDragSourceListener getDragListener()
           Returns the AbstractSwtDragSourceListener associated to this repository item.
protected  java.lang.Object getTooltip()
           Returns the tooltip for this repository item.
 VisualGraphObject getVisualGraphObject()
           Returns the VisualGraphObject associated with this repository item.
 void revalidateIcon()
          Revalidates the icon representation for this repository item after changes to the visual graph object.
 void setAdditionalVGOS(VisualGraphObject[] additional_vgos)
           
 void setIcon(VisualGraphObjectSwtIcon icon)
           
 
Methods inherited from class com.tensegrity.gui.swt.repository.AbstractSwtRepositoryItem
getIconHeight, getIconlabel, getIconWidth, initToolTipGenerator, installDragging, mouseDoubleClick, mouseDown, mouseEnter, mouseExit, mouseHover, mouseUp, setImage, setText
 
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
 

Constructor Detail

VisualGraphObjectSwtRepositoryItem

public VisualGraphObjectSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0,
                                          DragContext vgoDragSource,
                                          VisualGraphObject vgo,
                                          java.lang.String tooltip,
                                          int iconWidth,
                                          int iconHeight)

Initializes a repository item with a 1.0 scale factor and no special drag representation but one of vgo.

Parameters:
arg0 - The parent of this swt Composite
vgoDragSource - The DragContext associated with this repository item
vgo - The VisualGraphObject associated with this repository item
tooltip - The tooltip used for this repository item
iconWidth - the icon width
iconHeight - the icon height

VisualGraphObjectSwtRepositoryItem

public VisualGraphObjectSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0,
                                          DragContext vgoDragSource,
                                          VisualGraphObject vgo,
                                          java.lang.String tooltip,
                                          java.lang.String iconpath,
                                          java.lang.Class resourceclass,
                                          int iconWidth,
                                          int iconHeight)

Initializes a repository item with a 1.0 scale factor and no special drag representation but one of vgo.

Parameters:
arg0 - The parent of this swt Composite
vgoDragSource - The DragContext associated with this repository item
vgo - The VisualGraphObject associated with this repository item
tooltip - The tooltip used for this repository item
iconpath - the path for the icon (from the location of resourceclass)
resourceclass - The resource class for the icon
iconWidth - the icon width
iconHeight - the icon height

VisualGraphObjectSwtRepositoryItem

public VisualGraphObjectSwtRepositoryItem(org.eclipse.swt.widgets.Composite arg0,
                                          int arg1,
                                          DragContext vgoDragSource,
                                          VisualGraphObject vgo,
                                          VisualGraphObject dragRepresentation,
                                          double scaleFactor,
                                          java.lang.String tooltip,
                                          int iconWidth,
                                          int iconHeight)

Initializes a repository item with a scaleFactor scale factor and a special drag representation (dragRepresentation).

Parameters:
arg0 - The parent of this swt Composite
arg1 - the style of this swt Composite to construct
vgoDragSource - The DragContext associated with this repository item
vgo - The VisualGraphObject associated with this repository item
dragRepresentation - The VisualGraphObject representing vgo during the drag
scaleFactor - The scale factor for the dragged object
tooltip - The tooltip used for this repository item
iconWidth - the icon width
iconHeight - the icon height
Method Detail

getVisualGraphObject

public final VisualGraphObject getVisualGraphObject()

Returns the VisualGraphObject associated with this repository item.

Returns:
the VisualGraphObject associated with this repository item.

getComposites

public java.util.List getComposites()
Returns all basecomposites that are referenced by the repository item - The drag representation (which was given as constructor argument) - The base composite used to render the icon - Additional objects that have been added to this item

Returns:
A list of all base composites referenced by this item

setAdditionalVGOS

public void setAdditionalVGOS(VisualGraphObject[] additional_vgos)

getAdditionalVGOS

public VisualGraphObject[] getAdditionalVGOS()

getDragListener

protected AbstractSwtDragSourceListener getDragListener()
Description copied from class: AbstractSwtRepositoryItem

Returns the AbstractSwtDragSourceListener associated to this repository item.

Specified by:
getDragListener in class AbstractSwtRepositoryItem
Returns:
the AbstractSwtDragSourceListener associated to this repository item.

getTooltip

protected java.lang.Object getTooltip()
Description copied from class: AbstractSwtRepositoryItem

Returns the tooltip for this repository item.

Specified by:
getTooltip in class AbstractSwtRepositoryItem
Returns:
the tooltip for this repository item.

dispose

public void dispose()
Overrides:
dispose in class AbstractSwtRepositoryItem

revalidateIcon

public void revalidateIcon()
Revalidates the icon representation for this repository item after changes to the visual graph object.


setIcon

public void setIcon(VisualGraphObjectSwtIcon icon)


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