Eclipse Draw2d
2.1

org.eclipse.draw2d
Class LayeredPane

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

public class LayeredPane
extends Layer

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.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
 
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.
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.
 void removeLayer(IFigure layer)
          Deprecated. call remove(IFigure)
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.Layer
containsPoint, findFigureAt
 
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, 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, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, 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, 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.

Specified by:
add in interface IFigure
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
See Also:
IFigure.add(IFigure, Object, int)

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.
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

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)
Deprecated. call remove(IFigure)

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)

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.