Runtime

org.eclipse.gmf.runtime.diagram.ui.figures
Class ResizableCompartmentFigure

java.lang.Object
  extended byorg.eclipse.draw2d.Figure
      extended byorg.eclipse.gmf.runtime.gef.ui.figures.NodeFigure
          extended byorg.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure
All Implemented Interfaces:
HandleBounds, IAnchorableFigure, IFigure
Direct Known Subclasses:
ShapeCompartmentFigure

public class ResizableCompartmentFigure
extends NodeFigure


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
static int MIN_CLIENT_DP
          Specifies the default minimum client size of this figure in device coordinates.
protected  ScrollPane scrollPane
          The compartment scroll pane
 
Fields inherited from class org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure
szAnchor
 
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
ResizableCompartmentFigure(java.lang.String compartmentTitle, org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode mm)
          A constructor for a top level resizable compartment figure
 
Method Summary
 void collapse()
          Collapses the compartment figure
protected  org.eclipse.gmf.runtime.draw2d.ui.internal.figures.AnimatableScrollPane createScrollpane()
          Deprecated. use ResizableCompartmentFigure.createScrollPane(IMapMode) instead
protected  org.eclipse.gmf.runtime.draw2d.ui.internal.figures.AnimatableScrollPane createScrollpane(org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode mm)
          Deprecated. use ResizableCompartmentFigure.createScrollPane(IMapMode) instead
protected  ScrollPane createScrollPane(org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode mm)
          Creates the animatable scroll pane
 void expand()
          Expands the compartment figure
 IFigure getAdjacentSibling(boolean before)
          Gets the adjacent visible sibling before (or after) the figure
 java.lang.String getCompartmentTitle()
          Return this figure's compartment title.
 IFigure getContentPane()
           
 Dimension getMaximumSize()
           
 Dimension getMinClientDimension()
          For this compartment we need it to be a min size so to fit the collapse handles and to give the user an area they can drag and drop into the list compartment even if there is nothing in the compartment
protected  int getMinClientSize()
           
 Dimension getMinimumSize(int w, int h)
           
 Dimension getPreferredSize(int wHint, int hHint)
           
 ScrollPane getScrollPane()
          scrollpane accessor
 Figure getTextPane()
           
 void invalidate()
           
 boolean isExpanded()
          Accessor for the expanded property
 boolean isHorizontal()
          getter for the horizontal flag
protected  void paintFigure(Graphics graphics)
           
 void setCollapsed()
          Collapses the compartment figure
 void setExpanded()
          Expands the compartment figure
 void setFont(Font f)
           
 void setFontColor(Color c)
          Sets the font color of the compartment title label
 void setHorizontal(boolean horizontal)
          setter for the horizontal flag
 void setSelected(boolean b)
          Sets the selection state of this label
 void setTitle(java.lang.String title)
          Set the compartment title to the supplied text.
 void setTitleVisibility(boolean visibility)
          Sets the compartment title visibility
 void setToolTip(java.lang.String tooltip)
          Set the tooltip to the supplied text.
 void validate()
           
 
Methods inherited from class org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure
createAnchor, createConnectionAnchor, createDefaultAnchor, getConnectionAnchor, getConnectionAnchors, getConnectionAnchorTerminal, getDefaultAnchorID, getHandleBounds, getSlidableAnchorArea, getSourceConnectionAnchorAt, getTargetConnectionAnchorAt, isDefaultAnchorArea
 
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, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, 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, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.draw2d.IFigure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setEnabled, setFocusTraversable, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative
 

Field Detail

scrollPane

protected ScrollPane scrollPane
The compartment scroll pane


MIN_CLIENT_DP

public static final int MIN_CLIENT_DP
Specifies the default minimum client size of this figure in device coordinates. Clients should use their editors IMapMode to convert this to logical coordinates.

See Also:
Constant Field Values
Constructor Detail

ResizableCompartmentFigure

public ResizableCompartmentFigure(java.lang.String compartmentTitle,
                                  org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode mm)
A constructor for a top level resizable compartment figure

Parameters:
compartmentTitle - String that is the title that is displayed at the top of the compartment figure (optional).
mm - the IMapMode that is used to initialize the default values of of the scrollpane contained inside the figure. This is necessary since the figure is not attached at construction time and consequently can't get access to the owned IMapMode in the parent containment hierarchy.
Method Detail

createScrollpane

protected org.eclipse.gmf.runtime.draw2d.ui.internal.figures.AnimatableScrollPane createScrollpane()
Deprecated. use ResizableCompartmentFigure.createScrollPane(IMapMode) instead

Creates the animatable scroll pane

Returns:
AnimatableScrollPane

createScrollpane

protected org.eclipse.gmf.runtime.draw2d.ui.internal.figures.AnimatableScrollPane createScrollpane(org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode mm)
Deprecated. use ResizableCompartmentFigure.createScrollPane(IMapMode) instead

Creates the animatable scroll pane

Parameters:
mm - the IMapMode that is used to initialize the default values of of the scrollpane contained inside the figure. This is necessary since the figure is not attached at construction time and consequently can't get access to the owned IMapMode in the parent containment hierarchy.
Returns:
AnimatableScrollPane

createScrollPane

protected ScrollPane createScrollPane(org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode mm)
Creates the animatable scroll pane

Parameters:
mm - the IMapMode that is used to initialize the default values of of the scrollpane contained inside the figure. This is necessary since the figure is not attached at construction time and consequently can't get access to the owned IMapMode in the parent containment hierarchy.
Returns:
ScrollPane

getMinClientSize

protected final int getMinClientSize()
Returns:
that is the minimum size the client area can occupy in logical coordinates.

setTitleVisibility

public void setTitleVisibility(boolean visibility)
Sets the compartment title visibility

Parameters:
visibility -

expand

public void expand()
Expands the compartment figure


collapse

public void collapse()
Collapses the compartment figure


setExpanded

public void setExpanded()
Expands the compartment figure


setCollapsed

public void setCollapsed()
Collapses the compartment figure


getContentPane

public IFigure getContentPane()
Returns:
The contents pane of this compartment figure

setFont

public void setFont(Font f)

setFontColor

public void setFontColor(Color c)
Sets the font color of the compartment title label

Parameters:
c - The new color

setTitle

public void setTitle(java.lang.String title)
Set the compartment title to the supplied text.

Parameters:
title - this figure title

setToolTip

public void setToolTip(java.lang.String tooltip)
Set the tooltip to the supplied text.

Parameters:
tooltip - this figure tooltip

getScrollPane

public final ScrollPane getScrollPane()
scrollpane accessor

Returns:
the scrollpane figure.

isExpanded

public final boolean isExpanded()
Accessor for the expanded property

Returns:
boolean expanded

getCompartmentTitle

public final java.lang.String getCompartmentTitle()
Return this figure's compartment title.

Returns:
String

getAdjacentSibling

public final IFigure getAdjacentSibling(boolean before)
Gets the adjacent visible sibling before (or after) the figure

Parameters:
before - flag to identify the before or after, true means before, false means after
Returns:
IFigure

setSelected

public void setSelected(boolean b)
Sets the selection state of this label

Parameters:
b - true will cause the label to appear selected

paintFigure

protected void paintFigure(Graphics graphics)
Overrides:
paintFigure in class NodeFigure
See Also:
Figure.paintFigure(org.eclipse.draw2d.Graphics)

getPreferredSize

public Dimension getPreferredSize(int wHint,
                                  int hHint)
See Also:
IFigure.getPreferredSize(int, int)

getMinimumSize

public Dimension getMinimumSize(int w,
                                int h)
Returns:
makes sure that we can fit the collapse handles and the contents of the scroll pane.
See Also:
IFigure.getMinimumSize(int, int)

isHorizontal

public final boolean isHorizontal()
getter for the horizontal flag

Returns:
the horizontal flag

setHorizontal

public final void setHorizontal(boolean horizontal)
setter for the horizontal flag

Parameters:
horizontal - the new value of the horizontal flag

getMaximumSize

public Dimension getMaximumSize()
See Also:
IFigure.getMaximumSize()

invalidate

public void invalidate()
See Also:
IFigure.invalidate()

getTextPane

public Figure getTextPane()
Returns:
Returns the textPane.

getMinClientDimension

public Dimension getMinClientDimension()
For this compartment we need it to be a min size so to fit the collapse handles and to give the user an area they can drag and drop into the list compartment even if there is nothing in the compartment

Returns:
Dimension

validate

public void validate()

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.