|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JLayeredPane
Unsafe:
Field Summary | |
private Hashtable |
componentToLayer
|
static Integer |
DEFAULT_LAYER
Suppressed: Convenience object defining the Default layer. |
static Integer |
DRAG_LAYER
Suppressed: Convenience object defining the Drag layer. |
static Integer |
FRAME_CONTENT_LAYER
Suppressed: Convenience object defining the Frame Content layer. |
static String |
LAYER_PROPERTY
Suppressed: Bound property |
static Integer |
MODAL_LAYER
Suppressed: Convenience object defining the Modal layer. |
private boolean |
optimizedDrawingPossible
|
static Integer |
PALETTE_LAYER
Suppressed: Convenience object defining the Palette layer. |
static Integer |
POPUP_LAYER
Suppressed: Convenience object defining the Popup layer. |
Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
JLayeredPane()
Suppressed: Create a new JLayeredPane |
Method Summary | |
protected void |
addImpl(Component comp,
Object constraints,
int index)
Adds the specified component to this container at the specified index. |
AccessibleContext |
getAccessibleContext()
Suppressed: Gets the AccessibleContext associated with this JLayeredPane. |
int |
getComponentCountInLayer(int layer)
Suppressed: Returns the number of children currently in the specified layer. |
Component[] |
getComponentsInLayer(int layer)
Suppressed: Returns an array of the components in the specified layer. |
protected Hashtable |
getComponentToLayer()
Returns the hashtable that maps components to layers. |
int |
getIndexOf(Component c)
Suppressed: Returns the index of the specified Component. |
int |
getLayer(Component c)
Suppressed: Returns the layer attribute for the specified Component. |
static int |
getLayer(JComponent c)
Suppressed: Gets the layer property for a JComponent, it does not cause any side effects like setLayer(). |
static JLayeredPane |
getLayeredPaneAbove(Component c)
Suppressed: Convenience method that returns the first JLayeredPane which contains the specified component. |
protected Integer |
getObjectForLayer(int layer)
Returns the Integer object associated with a specified layer. |
int |
getPosition(Component c)
Suppressed: Get the relative position of the component within its layer. |
int |
highestLayer()
Suppressed: Returns the highest layer value from all current children. |
protected int |
insertIndexForLayer(int layer,
int position)
Primitive method that determines the proper location to insert a new child based on layer and position requests. |
boolean |
isOptimizedDrawingEnabled()
Suppressed: Returns false if components in the pane can overlap, which makes optimized drawing impossible. |
int |
lowestLayer()
Suppressed: Returns the lowest layer value from all current children. |
void |
moveToBack(Component c)
Suppressed: Moves the component to the bottom of the components in its current layer (position -1). |
void |
moveToFront(Component c)
Suppressed: Moves the component to the top of the components in its current layer (position 0). |
void |
paint(Graphics g)
Suppressed: Paints this JLayeredPane within the specified graphics context. |
protected String |
paramString()
Returns a string representation of this JLayeredPane. |
static void |
putLayer(JComponent c,
int layer)
Suppressed: Sets the layer property on a JComponent. |
void |
remove(int index)
Suppressed: Remove the indexed component from this pane. |
void |
setLayer(Component c,
int layer)
Suppressed: Sets the layer attribute on the specified component, making it the bottommost component in that layer. |
void |
setLayer(Component c,
int layer,
int position)
Suppressed: Sets the layer attribute for the specified component and also sets its position within that layer. |
void |
setPosition(Component c,
int position)
Suppressed: Moves the component to position within its current layer,
where 0 is the topmost position within the layer and -1 is the bottommost
position. |
private void |
validateOptimizedDrawing()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Integer DEFAULT_LAYER
public static final Integer PALETTE_LAYER
public static final Integer MODAL_LAYER
public static final Integer POPUP_LAYER
public static final Integer DRAG_LAYER
public static final Integer FRAME_CONTENT_LAYER
JFrame
public static final String LAYER_PROPERTY
private Hashtable componentToLayer
private boolean optimizedDrawingPossible
Constructor Detail |
public JLayeredPane()
Method Detail |
private void validateOptimizedDrawing()
protected void addImpl(Component comp, Object constraints, int index)
Container
addLayoutComponent
method. The constraints are
defined by the particular layout manager being used. For
example, the BorderLayout
class defines five
constraints: BorderLayout.NORTH
,
BorderLayout.SOUTH
, BorderLayout.EAST
,
BorderLayout.WEST
, and BorderLayout.CENTER
.
Note that if the component already exists in this container or a child of this container, it is removed from that container before being added to this container.
This is the method to override if a program needs to track every add request to a container as all other add methods defer to this one. An overriding method should usually include a call to the superclass's version of the method:
super.addImpl(comp, constraints, index)
addImpl
in class Container
comp
- the component to be addedconstraints
- an object expressing layout constraints
for this componentindex
- the position in the container's list at which to
insert the component, where -1
means append to the endContainer.add(Component)
,
Container.add(Component, int)
,
Container.add(Component, java.lang.Object)
,
LayoutManager
,
LayoutManager2
public void remove(int index)
remove
in class Container
index
- an int specifying the component to removegetIndexOf(java.awt.Component)
public boolean isOptimizedDrawingEnabled()
isOptimizedDrawingEnabled
in class JComponent
JComponent.isOptimizedDrawingEnabled()
public static void putLayer(JComponent c, int layer)
c
- the JComponent to movelayer
- an int specifying the layer to move it tosetLayer(java.awt.Component, int)
public static int getLayer(JComponent c)
c
- the JComponent to check
public static JLayeredPane getLayeredPaneAbove(Component c)
c
- the Component to check
JFrame
,
JRootPane
public void setLayer(Component c, int layer)
c
- the Component to set the layer forlayer
- an int specifying the layer to set, where
lower numbers are closer to the bottompublic void setLayer(Component c, int layer, int position)
c
- the Component to set the layer forlayer
- an int specifying the layer to set, where
lower numbers are closer to the bottomposition
- an int specifying the position within the
layer, where 0 is the topmost position and -1
is the bottommost positionpublic int getLayer(Component c)
c
- the Component to check
public int getIndexOf(Component c)
c
- the Component to check
public void moveToFront(Component c)
c
- the Component to movesetPosition(Component, int)
public void moveToBack(Component c)
c
- the Component to movesetPosition(Component, int)
public void setPosition(Component c, int position)
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 moveposition
- an int in the range -1..N-1, where N is the number of
components in the component's current layerpublic int getPosition(Component c)
c
- the Component to check
getComponentCountInLayer(int)
public int highestLayer()
public int lowestLayer()
public int getComponentCountInLayer(int layer)
layer
- an int specifying the layer to check
public Component[] getComponentsInLayer(int layer)
layer
- an int specifying the layer to check
public void paint(Graphics g)
paint
in class JComponent
g
- the Graphics context within which to paintJComponent.paintComponent(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
,
JComponent.getComponentGraphics(java.awt.Graphics)
,
JComponent.repaint(long, int, int, int, int)
protected Hashtable getComponentToLayer()
protected Integer getObjectForLayer(int layer)
layer
- an int specifying the layer
protected int insertIndexForLayer(int layer, int position)
layer
- an int specifying the layerposition
- an int specifying the position within the layer
getIndexOf(java.awt.Component)
protected String paramString()
null
.
paramString
in class JComponent
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
getAccessibleContext
in class JComponent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |