class org.aswing.JLayeredPane extends Container
Class Fields
static var DEFAULT_LAYER:Int
Convenience object defining the Default layer. Equivalent to new Integer(0).
static var DRAG_LAYER:Int
Convenience object defining the Drag layer. Equivalent to new Integer(400).
static var FRAME_CONTENT_LAYER:Int
Convenience object defining the Frame Content layer. This layer is normally only use to positon the contentPane and menuBar components of JFrame. Equivalent to new Integer(-30000). @see JFrame
static var MODAL_LAYER:Int
Convenience object defining the Modal layer. Equivalent to new Integer(200).
static var PALETTE_LAYER:Int
Convenience object defining the Palette layer. Equivalent to new Integer(100).
static var POPUP_LAYER:Int
Convenience object defining the Popup layer. Equivalent to new Integer(300).
static function getLayerProperty(c:Component): Int
Gets the layer property for a JComponent, it does not cause any side effects like setLayer(). (painting, add/remove, etc) Normally you should use the instance method getLayer().
c | the JComponent to check |
returns | an int specifying the component's layer |
static function getLayeredPaneAbove(c:Component): JLayeredPane
Convenience method that returns the first JLayeredPane which contains the specified component. Note that all JFrames have a JLayeredPane at their root, so any component in a JFrame will have a JLayeredPane parent.
@see JFrame @see JRootPane
c | the Component to check |
returns | the JLayeredPane that contains the component, or null if no JLayeredPane is found in the component hierarchy |
static function putLayerProperty(c:Component, layer:Int): Void
Sets the layer property on a JComponent. This method does not cause any side effects like setLayer() (painting, add/remove, etc). Normally you should use the instance method setLayer(), in order to get the desired side-effects (like repainting).
@see #setLayer
c | the JComponent to move |
layer | an int specifying the layer to move it to |
Instance Fields
function getComponentCountInLayer(layer:Int): Int
Returns the number of children currently in the specified layer.
layer | an int specifying the layer to check |
returns | an int specifying the number of components in that layer |
function getComponentsInLayer(layer:Int): Array<Component>
Returns an array of the components in the specified layer.
layer | an int specifying the layer to check |
returns | an array of Components contained in that layer |
function getIndexOf(c:Component): Int
Returns the index of the specified Component. This is the absolute index, ignoring layers. Index numbers, like position numbers, have the topmost component at index zero. Larger numbers are closer to the bottom.
c | the Component to check |
returns | an int specifying the component's index |
function getLayer(c:Component): Int
Returns the layer attribute for the specified Component.
c | the Component to check |
returns | an int specifying the component's current layer |
function getPosition(c:Component): Int
Get the relative position of the component within its layer.
@see #getComponentCountInLayer
c | the Component to check |
returns | an int giving the component's position, where 0 is the topmost position and the highest index value = the count count of components at that layer, minus 1 |
function highestLayer(): Int
Returns the highest layer value from all current children. Returns 0 if there are no children.
returns | an int indicating the layer of the topmost component in the pane, or zero if there are no children |
function isOptimizedDrawingEnabled(): Bool
Returns false if components in the pane can overlap, which makes optimized drawing impossible. Otherwise, returns true.
@see JComponent#isOptimizedDrawingEnabled
returns | false if components can overlap, else true |
function lowestLayer(): Int
Returns the lowest layer value from all current children. Returns 0 if there are no children.
returns | an int indicating the layer of the bottommost component in the pane, or zero if there are no children |
function moveToBack(c:Component): Void
Moves the component to the bottom of the components in its current layer (position -1).
@see #setPosition(Component, int)
c | the Component to move |
function moveToFront(c:Component): Void
Moves the component to the top of the components in its current layer (position 0).
@see #setPosition(Component, int)
c | the Component to move |
function removeAt(index:Int): Component
Remove the indexed component from this pane. This is the absolute index, ignoring layers.
@see #getIndexOf
index | an int specifying the component to remove |
function setLayer(c:Component, layer:Int, ?position:Int = -1): Void
Sets the layer attribute for the specified component and also sets its position within that layer.
c | the Component to set the layer for |
layer | an int specifying the layer to set, where lower numbers are closer to the bottom |
position | an int specifying the position within the layer, where 0 is the topmost position and -1 is the bottommost position |
function setPosition(c:Component, position:Int): Void
Moves the component to position
within its current layer,
where 0 is the topmost position within the layer and -1 is the bottommost
position.
Note: Position numbering is defined by java.awt.Container, and is the opposite of layer numbering. Lower position numbers are closer to the top (0 is topmost), and higher position numbers are closer to the bottom.
c | the Component to move |
position | an int in the range -1..N-1, where N is the number of components in the component's current layer |