de.cau.cs.kieler.karma.util.expandcollapsebutton
Class SwitchableCollapseFigure

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by org.eclipse.draw2d.Shape
          extended by de.cau.cs.kieler.karma.SwitchableFigure
              extended by de.cau.cs.kieler.karma.util.expandcollapsebutton.SwitchableCollapseFigure
All Implemented Interfaces:
IFigure

public class SwitchableCollapseFigure
extends SwitchableFigure

A SwitchableFigure that switches the displayed figure according to collapse status change.

Rating red

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 de.cau.cs.kieler.karma.SwitchableFigure
currentFigure
 
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
SwitchableCollapseFigure(IFigure parent)
          the constructor.
 
Method Summary
protected  void fillShape(Graphics graphics)
           
 boolean isCollapsed()
          isCollapsed Utility method to determine if the IFigure is collapse or not.
protected  void outlineShape(Graphics graphics)
           
 void paint(Graphics graphics)
           
 void setCollapsed(boolean b)
          setCollapsed Setter method to change collapsed state of the figure.
 void setCollapseFigure(IFigure figure)
          set a custom collapse figure.
 void setCurrentFigure(IFigure figure)
          Setter for the currently displayed figure.
 void setExpandFigure(IFigure figure)
          set a custom expand figure.
 
Methods inherited from class de.cau.cs.kieler.karma.SwitchableFigure
getCurrentFigure, getLineDash, getLineStyle, getLineWidth, getLineWidthFloat, getResizeable, setBackgroundColor, setBounds, setBoundsDirect, setFill, setForegroundColor, setLineDash, setLineStyle, setLineWidth, setLineWidthFloat, setMaximumSize, setMinimumSize, setPreferredSize, setResizeable, setSize
 
Methods inherited from class org.eclipse.draw2d.Shape
getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDashOffset, getLineJoin, getLineMiterLimit, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFillXOR, setLineAttributes, setLineCap, setLineDashOffset, setLineJoin, setLineMiterLimit, 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, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBorder, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setLayoutManager, setLocation, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, 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

SwitchableCollapseFigure

public SwitchableCollapseFigure(IFigure parent)
the constructor.

Parameters:
parent - the parent of this figure. Should probably be a collapse handle.
Method Detail

setCollapseFigure

public void setCollapseFigure(IFigure figure)
set a custom collapse figure.

Parameters:
figure - the new collapse figure

setExpandFigure

public void setExpandFigure(IFigure figure)
set a custom expand figure.

Parameters:
figure - the new expand figure

paint

public void paint(Graphics graphics)
Specified by:
paint in interface IFigure
Overrides:
paint in class SwitchableFigure

isCollapsed

public boolean isCollapsed()
isCollapsed Utility method to determine if the IFigure is collapse or not.

Returns:
true if collapse, false otherwise.

setCollapsed

public void setCollapsed(boolean b)
setCollapsed Setter method to change collapsed state of the figure. Will force update to repaint the figure to reflect the changes.

Parameters:
b - boolean true to set collapsed, false to uncollapse.

setCurrentFigure

public void setCurrentFigure(IFigure figure)
Description copied from class: SwitchableFigure
Setter for the currently displayed figure.

Overrides:
setCurrentFigure in class SwitchableFigure
Parameters:
figure - new figure to be displayed

outlineShape

protected void outlineShape(Graphics graphics)
Overrides:
outlineShape in class SwitchableFigure

fillShape

protected void fillShape(Graphics graphics)
Overrides:
fillShape in class SwitchableFigure