Draw2D v2.0

org.eclipse.draw2d
Class LayeredPane

java.lang.Object
  |
  +--org.eclipse.draw2d.Figure
        |
        +--org.eclipse.draw2d.TransparentFigure
              |
              +--org.eclipse.draw2d.LayeredPane
All Implemented Interfaces:
IFigure
Direct Known Subclasses:
FreeformLayeredPane

public class LayeredPane
extends org.eclipse.draw2d.TransparentFigure

LayeredPane - Figure capable of holding any number of layers. Only layers can be added to this figure. Layers are added to this figure with thier respective keys, which are used to identify them.


Inner classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator
 
Inner classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
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
LayeredPane()
          Constructs a new layered pane with no layers in it.
 
Method Summary
 void add(IFigure figure, Object layerKey, int index)
          Adds the given layer figure, identifiable with the given key, at the specified index.
 void addLayerAfter(Layer layer, Object key, Object after)
          Adds the given layer, identifiable with the given key, under the after layer provided in the input.
 void addLayerBefore(Layer layer, Object key, Object before)
          Adds the given layer, identifiable with the given key, above the before layer provided in the input.
 boolean containsPoint(int x, int y)
          Overridden to implement transparent behavior.
 IFigure findFigureAtExcluding(int x, int y, Collection collection)
          Overridden to implement transparent behavior.
protected  Layer getLayer(int index)
          Returns the layer at the specified index in this pane.
 Layer getLayer(Object key)
          Returns the layer identified by the key given in the input.
 boolean isOpaque()
          Returns the opaque state of this pane containing layers.
protected  void paintChildren(Graphics g)
          Paints the children (layers) of this pane with the help of the input graphics handle.
 void removeLayer(IFigure layer)
          Removes the given layer from the layers in this figure.
protected  void removeLayer(int index)
          Removes the layer at the specified index from the list of layers in this layered pane.
 void removeLayer(Object key)
          Removes the layer identified by the given key from this layerepane.
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findMouseEventTargetAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocation, getMaximumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, isEnabled, isFocusTraversable, isMouseEventTarget, isRequestFocusEnabled, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, 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, setUpdateManager, 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

LayeredPane

public LayeredPane()
Constructs a new layered pane with no layers in it.
Method Detail

add

public void add(IFigure figure,
                Object layerKey,
                int index)
Adds the given layer figure, identifiable with the given key, at the specified index. While adding the layer, it informs the surrounding layers of the addition.
Overrides:
add in class Figure
Parameters:
figure - Figure of the layer to be added.
layerKey - Key for identifying the layer.
index - Index where the layer should be added.
Since:
2.0

addLayerAfter

public void addLayerAfter(Layer layer,
                          Object key,
                          Object after)
Adds the given layer, identifiable with the given key, under the after layer provided in the input.
Parameters:
layer - Layer to be added.
key - Key to identify the input layer.
after - Layer under which the input layer should be added.
Since:
2.0
See Also:
addLayerBefore(Layer, Object, Object)

addLayerBefore

public void addLayerBefore(Layer layer,
                           Object key,
                           Object before)
Adds the given layer, identifiable with the given key, above the before layer provided in the input.
Parameters:
layer - Layer to be added.
key - Key to identify the input layer.
after - Layer above which the input layer should be added.
Since:
2.0
See Also:
addLayerAfter(Layer, Object, Object)

getLayer

public Layer getLayer(Object key)
Returns the layer identified by the key given in the input.
Parameters:
key - Key to identify the desired layer.
Returns:
The desired layer.
Since:
2.0
See Also:
addLayerBefore(Layer, Object, Object), addLayerAfter(Layer, Object, Object), removeLayer(IFigure), removeLayer(Object)

getLayer

protected Layer getLayer(int index)
Returns the layer at the specified index in this pane.
Parameters:
index - Location of the desired layer.
Returns:
The layer desired.
Since:
2.0

isOpaque

public boolean isOpaque()
Returns the opaque state of this pane containing layers.
Overrides:
isOpaque in class Figure
Returns:
Returns true if any of the child layers is opaque, else returns false.
Since:
2.0

paintChildren

protected void paintChildren(Graphics g)
Paints the children (layers) of this pane with the help of the input graphics handle.
Overrides:
paintChildren in class Figure
Parameters:
g - Graphics handle for the painting.
Since:
2.0

removeLayer

public void removeLayer(Object key)
Removes the layer identified by the given key from this layerepane.
Parameters:
key - Key identifying the layer.
Since:
2.0

removeLayer

public void removeLayer(IFigure layer)
Removes the given layer from the layers in this figure.
Parameters:
layer - Layer to be removed.
Since:
2.0
See Also:
removeLayer(Object)

removeLayer

protected void removeLayer(int index)
Removes the layer at the specified index from the list of layers in this layered pane. It collapses the layers, occupying the space vacated by the removed layer.
Parameters:
index - Index of the layer to be removed.
Since:
2.0
See Also:
removeLayer(IFigure)

containsPoint

public boolean containsPoint(int x,
                             int y)
Overridden to implement transparent behavior.
Overrides:
containsPoint in class Figure
Parameters:
x - X coordiante of point to search children for.
y - Y coordinate of point to search children for.
Since:
2.0

findFigureAtExcluding

public IFigure findFigureAtExcluding(int x,
                                     int y,
                                     Collection collection)
Overridden to implement transparent behavior.
Overrides:
findFigureAtExcluding in class Figure
Since:
2.0

Draw2D v2.0