com.yospace.yae.yogi
Class YogiLayeredPane

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiLayeredPane

public class YogiLayeredPane
extends YogiComponent

A layered panel-style container. Z-ordering associated with 'standard' components still exists, but the abstract concept of 'layers' is introduced, each with their own internal z-ordering. These layers consist of a YogiPaneletDisplay and zero or more associated YogiPopups with higher z-ordering. On top of this, a layer of zero or more system-level YogiPopups exists. The root content pane is a layered pane, and this allows for both Panelet-level and system-level popups to be displayed.


Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
YogiLayeredPane()
          Simply sets up the system (popup) layer to be empty.
 
Method Summary
 void add(YogiComponent comp)
          Can be used to add a YogiPaneletDisplay or a YogiPopup to this YogiLayeredPane.
 void bringForwards(YogiComponent c)
          If we have a YogiPaneletDisplay, bring the whole YogiPaneletDisplay's layer in front of the layer currently above that YogiPaneletDisplay's layer (if it is not at the top already).
 void bringInFrontOf(YogiComponent firstComp, YogiComponent secondComp)
          If both parameters are YogiPaneletDisplays, bring that whole of the first YogiPaneletDisplay's layer in front of the second YogiPaneletDisplay's layer.
 void bringToFront(YogiComponent c)
          If we have a YogiPaneletDisplay, bring that whole YogiPaneletDisplay's layer to the front of the layers, but behind the system popups layer if one exists.
protected  void ensureVisible(YogiComponent child, int fx, int fy, int fw, int fh)
          Ensures that the specified area of this component is visible, where possible; if there is a choice (perhaps because this component supports layers), then the supplied child component is the one that should be shown.
 YogiComponent getTopInLayer(YogiComponent c)
          Returns the component highest in the z-ordering which is in the same layer as the given component.
 void remove(YogiComponent c)
          Can be used to remove a YogiPaneletDisplay or a YogiPopup from this YogiLayeredPane.
 void sendBackwards(YogiComponent c)
          If we have a YogiPaneletDisplay, send that whole YogiPaneletDisplay's layer behind the layer currently below that YogiPaneletDisplay's layer (if it is not at the bottom already).
 void sendBehind(YogiComponent firstComp, YogiComponent secondComp)
          If both parameters are YogiPaneletDisplays, send that whole of the first YogiPaneletDisplay's layer behind the second YogiPaneletDisplay's layer.
 void sendToBack(YogiComponent c)
          If we have a YogiPaneletDisplay, send that whole YogiPaneletDisplay's layer to the bottom of the layers.
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, addPropertyChangeListener, contains, containsComponent, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YogiLayeredPane

public YogiLayeredPane()
Simply sets up the system (popup) layer to be empty.
Method Detail

add

public void add(YogiComponent comp)
Can be used to add a YogiPaneletDisplay or a YogiPopup to this YogiLayeredPane. A window is added as a new layer (on top, apart from any system level popups), and a popup is added as the highest popup in the layer to which it is affiliated This is found through a call to YogiPopup's getPopupModalRoot(). If the modal root is a panelet display, the popup is added to the top of that panelet display's layer. If ?????
Overrides:
add in class YogiComponent
Parameters:
comp - the component to add.
Throws:
java.lang.IllegalArgumentException - if the component to add is not either a panelet display or a popup, or if the modal root is not already in the layered pane.

remove

public void remove(YogiComponent c)
Can be used to remove a YogiPaneletDisplay or a YogiPopup from this YogiLayeredPane. If we have a YogiPaneletDisplay, remove both the window and all the popups in its layer. With a YogiPopup, just remove that popup.
Overrides:
remove in class YogiComponent
Parameters:
c - the component to remove. Must be an instance of a YogiPaneletDisplay or a YogiPopup.
Throws:
java.lang.IllegalArgumentException - if the component to be removed is not in the layered pane.

sendToBack

public void sendToBack(YogiComponent c)
If we have a YogiPaneletDisplay, send that whole YogiPaneletDisplay's layer to the bottom of the layers. If we have a YogiPopup, send just that popup to the bottom of its associated layer, but above any YogiPaneletDisplay associated with that layer.
Overrides:
sendToBack in class YogiComponent
Parameters:
c - the component to send to the back.
Throws:
java.lang.IllegalArgumentException - if the component is not already in this layered pane.

bringToFront

public void bringToFront(YogiComponent c)
If we have a YogiPaneletDisplay, bring that whole YogiPaneletDisplay's layer to the front of the layers, but behind the system popups layer if one exists. If we have a YogiPopup, bring just that popup to the top of its associated layer.
Overrides:
bringToFront in class YogiComponent
Parameters:
c - the component to bring to the front.
Throws:
java.lang.IllegalArgumentException - if the component is not already in this layered pane.

sendBackwards

public void sendBackwards(YogiComponent c)
If we have a YogiPaneletDisplay, send that whole YogiPaneletDisplay's layer behind the layer currently below that YogiPaneletDisplay's layer (if it is not at the bottom already). If we have YogiPopup, send just that popup behind the popup just below it in its associated layer, if one exists.
Overrides:
sendBackwards in class YogiComponent
Parameters:
c - the component to send backwards.
Throws:
java.lang.IllegalArgumentException - if the component is not already in this layered pane.

bringForwards

public void bringForwards(YogiComponent c)
If we have a YogiPaneletDisplay, bring the whole YogiPaneletDisplay's layer in front of the layer currently above that YogiPaneletDisplay's layer (if it is not at the top already). If the next layer up is the system popup layer, do nothing. If we have YogiPopup, send just that popup in front of the popup just above it in its associated layer, if one exists.
Overrides:
bringForwards in class YogiComponent
Parameters:
c - the component to bring forwards.
Throws:
java.lang.IllegalArgumentException - if the component is not already in this layered pane.

sendBehind

public void sendBehind(YogiComponent firstComp,
                       YogiComponent secondComp)
If both parameters are YogiPaneletDisplays, send that whole of the first YogiPaneletDisplay's layer behind the second YogiPaneletDisplay's layer. If we have two YogiPopups, send just the first popup behind the second popup, but only if both popups exist in the same layer. Note that only if either both parameters are YogiPaneletDisplays or both parameters are YogiPopups does this method perform any ordering rearrangement
Overrides:
sendBehind in class YogiComponent
Parameters:
firstComp - the component to move.
secondComp - the component to send the firstComp behind.
Throws:
java.lang.IllegalArgumentException - if either parameter is not either a YogiPaneletDisplay or a YogiPopup.

bringInFrontOf

public void bringInFrontOf(YogiComponent firstComp,
                           YogiComponent secondComp)
If both parameters are YogiPaneletDisplays, bring that whole of the first YogiPaneletDisplay's layer in front of the second YogiPaneletDisplay's layer. If we have two YogiPopups, bring just the first popup in front of the second popup, but only if both popups exist in the same layer. Note that only if either both parameters are YogiPaneletDisplays or both parameters are YogiPopups does this method perform any ordering rearrangement
Overrides:
bringInFrontOf in class YogiComponent
Parameters:
firstComp - the component to move.
secondComp - the component to bring the firstComp in front of.
Throws:
java.lang.IllegalArgumentException - if either parameter is not either a YogiPaneletDisplay or a YogiPopup.

ensureVisible

protected void ensureVisible(YogiComponent child,
                             int fx,
                             int fy,
                             int fw,
                             int fh)
Description copied from class: YogiComponent
Ensures that the specified area of this component is visible, where possible; if there is a choice (perhaps because this component supports layers), then the supplied child component is the one that should be shown. This method's default implementation merely passes the request up the containment hierarchy. It should be overridden in classes which can move/scroll areas so that the the supplied rectangle is shifted into view. In classes that show multiple layers, the rectangle is not necessarily enough, for the region may overlap several layers: the "child" component should be used in this situation to decide which layer to show.
Overrides:
ensureVisible in class YogiComponent
Following copied from class: com.yospace.yae.yogi.YogiComponent
Parameters:
child - the component which, if there is a choice, should be made visible.
fx - the x-coordinate (in this component's coordinate space) of the rectangle that should be made visible.
fy - the y-coordinate (in this component's coordinate space) of the rectangle that should be made visible.
fw - the width of the rectangle that should be made visible.
fh - the height of the rectangle that should be made visible.

getTopInLayer

public YogiComponent getTopInLayer(YogiComponent c)
Returns the component highest in the z-ordering which is in the same layer as the given component.
Parameters:
c - the component that is in the same layer as the desired "top-in-layer" component.
Returns:
the component at the top of the layer.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.