de.cau.cs.kieler.synccharts.custom
Class OpenRectangleFigure

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by org.eclipse.draw2d.Shape
          extended by de.cau.cs.kieler.synccharts.custom.OpenRectangleFigure
All Implemented Interfaces:
IFigure
Direct Known Subclasses:
NeighborAwareOpenRectangleFigure

public class OpenRectangleFigure
extends Shape

A rectangle figure that can be configured to draw only specific outline sides, e.g. omit drawing one or multiple lines.

Rating proposed yellow
(2010-01-27) msp

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch
 
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
 
Fields inherited from class org.eclipse.draw2d.Shape
lineStyle, lineWidth
 
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
OpenRectangleFigure()
           
 
Method Summary
protected  void fillShape(Graphics graphics)
          
protected  Rectangle getPreBounds()
          Returns the preBounds.
protected  Rectangle getPreParentBounds()
          Returns the preParentBounds.
protected  boolean isEast()
          Returns the east.
protected  boolean isNorth()
          Returns the north.
protected  boolean isSouth()
          Returns the south.
protected  boolean isWest()
          Returns the west.
protected  void outlineShape(Graphics graphics)
          Draws the outline of the shape, i.e.
 void realRepaint()
          Really repaint the Figure, i.e.
 void setDrawSides(boolean thenorth, boolean theeast, boolean thesouth, boolean thewest)
          Set which sides of the rectangle shall be drawn.
protected  void setEast(boolean theeast)
          Sets the east.
protected  void setNorth(boolean thenorth)
          Sets the north.
protected  void setPreBounds(Rectangle thepreBounds)
          Sets the preBounds.
protected  void setPreParentBounds(Rectangle thepreParentBounds)
          Sets the preParentBounds.
protected  void setSouth(boolean thesouth)
          Sets the south.
protected  void setWest(boolean thewest)
          Sets the west.
 boolean shouldRepaint()
          Test whether the realRepaint should be called or not.
 
Methods inherited from class org.eclipse.draw2d.Shape
getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidth, setLineWidthFloat, setOutline, setOutlineXOR, setXOR
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, 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, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, 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
 

Constructor Detail

OpenRectangleFigure

public OpenRectangleFigure()
Method Detail

setDrawSides

public void setDrawSides(boolean thenorth,
                         boolean theeast,
                         boolean thesouth,
                         boolean thewest)
Set which sides of the rectangle shall be drawn. If a value is true, the side gets drawn. It is not drawn otherwise.

Parameters:
thenorth - north side
theeast - east side
thesouth - south side
thewest - west side

fillShape

protected void fillShape(Graphics graphics)

Specified by:
fillShape in class Shape

realRepaint

public void realRepaint()
Really repaint the Figure, i.e. the coordinates or dimensions have been changed. This method may be overridden by subclasses to do some action only when the figure has changed. The base implementation does nothing.


shouldRepaint

public boolean shouldRepaint()
Test whether the realRepaint should be called or not. May be overridden by subclasses. Default always to true.

Returns:
true

outlineShape

protected void outlineShape(Graphics graphics)
Draws the outline of the shape, i.e. a rectangle where not all border get drawn but only those specified by the setDrawSide() method.

Specified by:
outlineShape in class Shape
Parameters:
graphics - the graphics object

setNorth

protected void setNorth(boolean thenorth)
Sets the north.

Parameters:
thenorth - the north to set

isNorth

protected boolean isNorth()
Returns the north.

Returns:
the north

setSouth

protected void setSouth(boolean thesouth)
Sets the south.

Parameters:
thesouth - the south to set

isSouth

protected boolean isSouth()
Returns the south.

Returns:
the south

setWest

protected void setWest(boolean thewest)
Sets the west.

Parameters:
thewest - the west to set

isWest

protected boolean isWest()
Returns the west.

Returns:
the west

setEast

protected void setEast(boolean theeast)
Sets the east.

Parameters:
theeast - the east to set

isEast

protected boolean isEast()
Returns the east.

Returns:
the east

setPreBounds

protected void setPreBounds(Rectangle thepreBounds)
Sets the preBounds.

Parameters:
thepreBounds - the preBounds to set

getPreBounds

protected Rectangle getPreBounds()
Returns the preBounds.

Returns:
the preBounds

setPreParentBounds

protected void setPreParentBounds(Rectangle thepreParentBounds)
Sets the preParentBounds.

Parameters:
thepreParentBounds - the preParentBounds to set

getPreParentBounds

protected Rectangle getPreParentBounds()
Returns the preParentBounds.

Returns:
the preParentBounds