edu.usc.cse.desi.figure
Class AbstractNodeSelectionFigure

java.lang.Object
  extended byorg.eclipse.draw2d.Figure
      extended byedu.usc.cse.desi.figure.AbstractNodeSelectionFigure
All Implemented Interfaces:
org.eclipse.draw2d.IFigure
Direct Known Subclasses:
ComponentSelectionFigure, HostSelectionFigure

public abstract class AbstractNodeSelectionFigure
extends org.eclipse.draw2d.Figure

There are two versions of a figure for the host and the component. This version is displayed when the selection page is in view. It gives not only the view of the host/component but also an external view that shows the connections leaving from the host/component. Here is how you will use this figure from the edit part. On each call to refresh visuals you should call addLinks one. Pass it an array of PolylineConnections with all the visual details such as width and color set. Any labels to displayed must already be added to the PolylinConnections adead of time.

Author:
Nels Started May 5, 2004

Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
protected  AbstractNodeFigure myNodeFigure
           
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
AbstractNodeSelectionFigure()
           
 
Method Summary
 void addLinks(java.util.ArrayList links)
          Call this method one time to initialize the figure with the links going to/from our node.
protected  org.eclipse.draw2d.geometry.Point getAnchorPoint(int x_point)
          This is a neat method from DESI 1.0.
 org.eclipse.draw2d.IFigure getContentPane()
          The contents pane of this figure is the Figure to which components or subcomponents are added.
 AbstractNodeFigure getMyNodeFigure()
          Returs the node contained on the interior of this selection figure.
 void setNodeFigureSize(float percent)
          Sets the size of the HostFigure or ComponentFigure contained within this figure.
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeKeyListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myNodeFigure

protected AbstractNodeFigure myNodeFigure
Constructor Detail

AbstractNodeSelectionFigure

public AbstractNodeSelectionFigure()
Method Detail

addLinks

public void addLinks(java.util.ArrayList links)
Call this method one time to initialize the figure with the links going to/from our node. You must pass it an array of PolyLineConnections that is filled with all of the connections that are to be added.

Parameters:
links -

getAnchorPoint

protected org.eclipse.draw2d.geometry.Point getAnchorPoint(int x_point)
This is a neat method from DESI 1.0. Given an amount of diplacement on the perimeter of a rectangle, it returns the the actual point on the rectangle. Here is the DESI 1.0 description: This method will return a point located on a Figure (either a Host or a Component) depending where in the entire perimeter of the figure that connection should lie. (This makes a lot more sense if you look at the methods that call this method.)

Parameters:
x_point - The displacement on the perimeter of the rect.
Returns:
Point that actual point.

getContentPane

public org.eclipse.draw2d.IFigure getContentPane()
The contents pane of this figure is the Figure to which components or subcomponents are added. In this case, we want them to be added to the node figure itself and not the selection figure.

Returns:
IFigure

getMyNodeFigure

public AbstractNodeFigure getMyNodeFigure()
Returs the node contained on the interior of this selection figure. This method exists so the edit part can change the properties (such as figure label) of the ComponentFigure or HostFigure contained within.

Returns:
AbstractNodeFigure

setNodeFigureSize

public void setNodeFigureSize(float percent)
Sets the size of the HostFigure or ComponentFigure contained within this figure. The size of the figure is set to be a percent of the screen area. The percent is of the shorter of the two dimentions, so most likely the percent of the vertical. If you call this method on the same figure that you have previously called addLinks() you may encounter some strange visual errors where the links do not properly connect to the figure.

Parameters:
percent - What percentage of the screen you want the figure to be. A float between 0.0 and 1.0.