JavaTM Platform
Standard Ed. 6

javax.swing
クラス JLayeredPane

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 javax.swing.JComponent
              上位を拡張 javax.swing.JLayeredPane
すべての実装されたインタフェース:
ImageObserver, MenuContainer, Serializable, Accessible
直系の既知のサブクラス:
JDesktopPane

public class JLayeredPane
extends JComponent
implements Accessible

JLayeredPane は、JFC/Swing コンテナに深さを追加し、必要であればコンポーネントどうしが互いにオーバーラップできるようにします。Integer オブジェクトはコンテナ内での各コンポーネントの深さを表し、番号が大きいほどほかのコンポーネントの上に表示されます。階層化区画に関するタスク指向のドキュメントおよび使用例は、「The Java Tutorial」の「How to Use a Layered Pane」を参照してください。  

次の文は、この図について説明しています。

操作を容易にするため、JLayeredPane は深さの範囲をいくつかのレイヤーに分割しています。コンポーネントをこれらのレイヤーのどれかに配置することで、深さを指定する番号を指定することなしに、コンポーネントを適切にオーバーラップさせることができます。
DEFAULT_LAYER
ほとんどのコンポーネントが配置される標準レイヤーです。最下層のレイヤーとなります。
PALETTE_LAYER
パレットレイヤーは、デフォルトレイヤーの上に表示されます。ドラッグ可能なツールバーやパレットは、ほかのコンポーネントの上に表示されるように、このレイヤーに配置すると便利です。
MODAL_LAYER
モーダルダイアログ用のレイヤーです。モーダルダイアログは、コンテナ内のツールバー、パレット、および標準コンポーネントの上に表示されます。
POPUP_LAYER
ポップアップレイヤーは、ダイアログの上に表示されます。このレイヤーにより、コンボボックス、ツールヒント、およびその他のヘルプテキストに関連したポップアップウィンドウは、そのポップアップウィンドウを生成したコンポーネント、パレット、またはダイアログの上に表示されます。
DRAG_LAYER
コンポーネントをドラッグする際には、そのコンポーネントをドラッグレイヤーに割り当てることによって、コンテナ内のほかのすべてのコンポーネントより上に表示させることができます。ドラッグが完了したら、そのコンポーネントを元のレイヤーに割り当て直すことができます。
JLayeredPane のメソッドである moveToFront(Component)moveToBack(Component)、および setPosition を使用することで、レイヤー内でコンポーネントを再配置することができます。setLayer メソッドを使用すると、コンポーネントの現在のレイヤーを変更することができます。

詳細

JLayeredPane は、Container と同じように子のリストを管理しますが、内部で複数のレイヤーを定義することができます。同じレイヤーに属する子は、通常の Container オブジェクトとまったく同じように管理されますが、子コンポーネントどうしがオーバーラップした場合には、上位のレイヤーのコンポーネントのほうが下位レイヤーのコンポーネントより上に表示されます。  

各レイヤーには個別の整数値が割り当てられます。各レイヤーには個別の整数値が割り当てられます。Component のレイヤー属性を設定するには、add 呼び出しで Integer オブジェクトを渡します。
次に例を示します。

layeredPane.add(child, JLayeredPane.DEFAULT_LAYER);
または
layeredPane.add(child, new Integer(10));
 
Component のレイヤー属性を設定するには、コンポーネントの親である JlayeredPane 上で
layeredPaneParent.setLayer(child, 10)
を呼び出すこともできます。レイヤーは、子を親に追加する前に設定する必要があります。  

番号が大きいレイヤーほど上に表示されます。したがって、次のように各コンポーネントに個別のレイヤー番号と文字を割り当てることにより、

5a, 5b, 5c, 2a, 2b, 2c, 1a 
左のコンポーネントほど上に表示されます。  

コンポーネントをレイヤー内で一番上または一番下に移動させるには、moveToFront または moveToBack を呼び出します。  

レイヤー内でのコンポーネントの位置を位置番号で指定することもできます。指定できる位置番号は、0 〜「レイヤー内のコンポーネント数 - 1」です。-1 を指定すると、コンポーネントは一番下に表示されます。0 を指定すると、コンポーネントは一番上に表示されます。レイヤー番号とは異なり、値が大きいほど下に表示されます。

注: この順序 (java.awt.Container で定義されている) は、レイヤー番号の順序の反対になっています。通常は、moveToFrontmoveToBack、および setLayer を使用します。
add(Component, layer, position) メソッドの使用例を示します。add(5x, 5, -1) 呼び出しの結果は次のとおりです。
5a, 5b, 5c, 5x, 2a, 2b, 2c, 1a 
add(5z, 5, 2) 呼び出しの結果は次のとおりです。
5a, 5b, 5z, 5c, 5x, 2a, 2b, 2c, 1a 
add(3a, 3, 7) 呼び出しの結果は次のとおりです。
5a, 5b, 5z, 5c, 5x, 3a, 2a, 2b, 2c, 1a 
通常のペイント/イベント方式では、1a が一番下、5a が一番上に表示されます。  

注: これらのレイヤーは単に論理的な構造であり、LayoutManager は、レイヤー設定には関係なく、このコンテナのすべての子コンポーネントに影響します。  

警告: Swing はスレッドに対して安全ではありません。詳細は、「Swing's Threading Policy」を参照してください。  

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。JDK Version 1.4 以降、すべての JavaBeans の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。


入れ子のクラスの概要
protected  class JLayeredPane.AccessibleJLayeredPane
          このクラスは JLayeredPane クラス用のアクセシビリティーサポートを実装しています。
 
クラス javax.swing.JComponent から継承された入れ子のクラス/インタフェース
JComponent.AccessibleJComponent
 
クラス java.awt.Container から継承された入れ子のクラス/インタフェース
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承された入れ子のクラス/インタフェース
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
static Integer DEFAULT_LAYER
          デフォルトレイヤーを定義する簡易オブジェクトです。
static Integer DRAG_LAYER
          ドラッグレイヤーを定義する簡易オブジェクトです。
static Integer FRAME_CONTENT_LAYER
          フレーム内容レイヤーを定義する簡易オブジェクトです。
static String LAYER_PROPERTY
          バウンドプロパティーです。
static Integer MODAL_LAYER
          モーダルレイヤーを定義する簡易オブジェクトです。
static Integer PALETTE_LAYER
          パレットレイヤーを定義する簡易オブジェクトです。
static Integer POPUP_LAYER
          ポップアップレイヤーを定義する簡易オブジェクトです。
 
クラス javax.swing.JComponent から継承されたフィールド
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
クラス java.awt.Component から継承されたフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース java.awt.image.ImageObserver から継承されたフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
JLayeredPane()
          新しい JLayeredPane を作成します。
 
メソッドの概要
protected  void addImpl(Component comp, Object constraints, int index)
          指定されたコンポーネントを、指定されたインデックスで、コンテナへ追加します。
 AccessibleContext getAccessibleContext()
          この JLayeredPane に関連した AccessibleContext を返します。
 int getComponentCountInLayer(int layer)
          指定されたレイヤーの現在の子の数を返します。
 Component[] getComponentsInLayer(int layer)
          指定されたレイヤーのコンポーネントの配列を返します。
protected  Hashtable<Component,Integer> getComponentToLayer()
          コンポーネントをレイヤーにマッピングするハッシュテーブルを返します。
 int getIndexOf(Component c)
          指定された Component のインデックスを返します。
 int getLayer(Component c)
          指定された Component のレイヤー属性を返します。
static int getLayer(JComponent c)
          JComponent のレイヤープロパティーを返します。
static JLayeredPane getLayeredPaneAbove(Component c)
          指定されたコンポーネントを含む最初の JLayeredPane を返す簡易メソッドです。
protected  Integer getObjectForLayer(int layer)
          指定されたレイヤーに関連した Integer オブジェクトを返します。
 int getPosition(Component c)
          レイヤー内でのコンポーネントの相対位置を返します。
 int highestLayer()
          現在のすべての子から最大レイヤー値を返します。
protected  int insertIndexForLayer(int layer, int position)
          レイヤーおよび位置の要求に従って新しい子を挿入する適切な位置を決定するためのプリミティブメソッドです。
 boolean isOptimizedDrawingEnabled()
          区画内のコンポーネントがオーバーラップ可能である場合には false を返します。
 int lowestLayer()
          現在のすべての子から最小レイヤー値を返します。
 void moveToBack(Component c)
          コンポーネントを現在のレイヤーで一番下 (位置 -1) に移動します。
 void moveToFront(Component c)
          コンポーネントを現在のレイヤーで一番上 (位置 0) に移動します。
 void paint(Graphics g)
          指定されたグラフィックスコンテキストで、この JLayeredPane を描画します。
protected  String paramString()
          この JLayeredPane の文字列表現を返します。
static void putLayer(JComponent c, int layer)
          JComponent のレイヤープロパティーを設定します。
 void remove(int index)
          この区画からインデックス付きのコンポーネントを削除します。
 void removeAll()
          コンテナからすべてのコンポーネントを削除します。
 void setLayer(Component c, int layer)
          指定されたコンポーネントのレイヤー属性を設定し、レイヤー内で一番下のコンポーネントとします。
 void setLayer(Component c, int layer, int position)
          指定されたコンポーネントのレイヤー属性と、レイヤー内でのコンポーネントの位置を指定します。
 void setPosition(Component c, int position)
          コンポーネントを現在のレイヤーの position に移動します。
 
クラス javax.swing.JComponent から継承されたメソッド
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
クラス java.awt.Container から継承されたメソッド
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
クラス java.awt.Component から継承されたメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

DEFAULT_LAYER

public static final Integer DEFAULT_LAYER
デフォルトレイヤーを定義する簡易オブジェクトです。new Integer(0) と同等です。


PALETTE_LAYER

public static final Integer PALETTE_LAYER
パレットレイヤーを定義する簡易オブジェクトです。new Integer(100) と同等です。


MODAL_LAYER

public static final Integer MODAL_LAYER
モーダルレイヤーを定義する簡易オブジェクトです。new Integer(200) と同等です。


POPUP_LAYER

public static final Integer POPUP_LAYER
ポップアップレイヤーを定義する簡易オブジェクトです。new Integer(300) と同等です。


DRAG_LAYER

public static final Integer DRAG_LAYER
ドラッグレイヤーを定義する簡易オブジェクトです。new Integer(400) と同等です。


FRAME_CONTENT_LAYER

public static final Integer FRAME_CONTENT_LAYER
フレーム内容レイヤーを定義する簡易オブジェクトです。このレイヤーは通常、JFrame の contentPane および menuBar コンポーネントを配置するためにだけ使用します。new Integer(-30000) と同等です。

関連項目:
JFrame

LAYER_PROPERTY

public static final String LAYER_PROPERTY
バウンドプロパティーです。

関連項目:
定数フィールド値
コンストラクタの詳細

JLayeredPane

public JLayeredPane()
新しい JLayeredPane を作成します。

メソッドの詳細

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
クラス Container の記述:
指定されたコンポーネントを、指定されたインデックスで、コンテナへ追加します。また、このメソッドは、addLayoutComponent メソッドを使用して、指定された制約オブジェクトを使ってこのコンテナのレイアウトにコンポーネントを追加することをレイアウトマネージャーに通知します。  

制約は使用されているレイアウトマネージャーを使用して定義されます。たとえば BorderLayout クラスは、BorderLayout.NORTHBorderLayout.SOUTHBorderLayout.EASTBorderLayout.WEST、および BorderLayout.CENTER の 5 つの制約を定義します。  

GridBagLayout クラスには GridBagConstraints オブジェクトが必要です。正しい型の制約オブジェクトを渡さないと、IllegalArgumentException が発生します。  

現在のレイアウトマネージャーが LayoutManager2 を実装する場合は、このオブジェクトに対して LayoutManager2.addLayoutComponent(Component,Object) が呼び出されます。現在のレイアウトマネージャーが LayoutManager2 を実装せず、制約が String である場合は、このオブジェクトに対して LayoutManager.addLayoutComponent(String,Component) が呼び出されます。  

コンポーネントがこのコンテナの上位にはなく、null でない親がある場合は、このコンテナに追加される前に現在の親から削除されます。  

これは、プログラムがコンテナへのすべての追加要求を追跡する必要がある場合にオーバーライドするメソッドです。 ほかのすべての追加メソッドでは追跡を行いません。オーバーライドするメソッドは、通常、メソッドのスーパークラスのバージョンの呼び出しを含む必要があります。  

super.addImpl(comp, constraints, index)

オーバーライド:
クラス Container 内の addImpl
パラメータ:
comp - 追加されるコンポーネント
constraints - このコンポーネントの配置条件を 表現するオブジェクト
index - コンポーネントを挿入するコンテナのリスト内での位置。 -1 は 最後に追加することを意味する
関連項目:
Container.add(Component), Container.add(Component, int), Container.add(Component, java.lang.Object), LayoutManager, LayoutManager2

remove

public void remove(int index)
この区画からインデックス付きのコンポーネントを削除します。絶対インデックスであり、レイヤーは無視します。

オーバーライド:
クラス Container 内の remove
パラメータ:
index - 削除するコンポーネントを指定した int 値
関連項目:
getIndexOf(java.awt.Component)

removeAll

public void removeAll()
コンテナからすべてのコンポーネントを削除します。

オーバーライド:
クラス Container 内の removeAll
導入されたバージョン:
1.5
関連項目:
Container.add(java.awt.Component), Container.remove(int)

isOptimizedDrawingEnabled

public boolean isOptimizedDrawingEnabled()
区画内のコンポーネントがオーバーラップ可能である場合には false を返します。 この場合、最適な描画は不可能です。そうでない場合は true を返します。

オーバーライド:
クラス JComponent 内の isOptimizedDrawingEnabled
戻り値:
コンポーネントがオーバーラップ可能である場合は false、そうでない場合は true
関連項目:
JComponent.isOptimizedDrawingEnabled()

putLayer

public static void putLayer(JComponent c,
                            int layer)
JComponent のレイヤープロパティーを設定します。このメソッドは、setLayer() のような副作用 (ペイント、追加/削除など) はありません。通常は、必要な副作用 (再ペイントなど) を得るために、インスタンスメソッドの setLayer() を使用します。

パラメータ:
c - 移動する JComponent
layer - 移動先のレイヤーを指定する int 値
関連項目:
setLayer(java.awt.Component, int)

getLayer

public static int getLayer(JComponent c)
JComponent のレイヤープロパティーを返します。 このメソッドは、setLayer() のような副作用 (ペイント、追加/削除など) はありません。(ペイント、追加/削除など) はありません。通常は、インスタンスメソッドの getLayer() を使用するようにしてください。

パラメータ:
c - チェック対象の JComponent
戻り値:
コンポーネントのレイヤーを指定する int 値

getLayeredPaneAbove

public static JLayeredPane getLayeredPaneAbove(Component c)
指定されたコンポーネントを含む最初の JLayeredPane を返す簡易メソッドです。すべての JFrame は、ルートに JLayeredPane を持つため、JFrame のすべてのコンポーネントは JLayeredPane を親として持ちます。

パラメータ:
c - チェック対象の Component
戻り値:
コンポーネントを含む JLayeredPane。コンポーネント階層に JLayeredPane が含まれていない場合は null
関連項目:
JFrame, JRootPane

setLayer

public void setLayer(Component c,
                     int layer)
指定されたコンポーネントのレイヤー属性を設定し、レイヤー内で一番下のコンポーネントとします。親に追加する前に呼び出す必要があります。

パラメータ:
c - レイヤーを設定する Component
layer - 設定するレイヤーを指定する int 値。値が小さいほど下層

setLayer

public void setLayer(Component c,
                     int layer,
                     int position)
指定されたコンポーネントのレイヤー属性と、レイヤー内でのコンポーネントの位置を指定します。

パラメータ:
c - レイヤーを設定する Component
layer - 設定するレイヤーを指定する int 値。値が小さいほど下層
position - レイヤー内での位置を指定する int 値。0 が一番上、-1 が一番下

getLayer

public int getLayer(Component c)
指定された Component のレイヤー属性を返します。

パラメータ:
c - チェック対象の Component
戻り値:
コンポーネントの現在のレイヤーを指定する int 値

getIndexOf

public int getIndexOf(Component c)
指定された Component のインデックスを返します。絶対インデックスであり、レイヤーは無視します。インデックス番号は、位置番号と同じように、一番上のコンポーネントの番号が 0 となり、値が大きいほど下層に近くなります。

パラメータ:
c - チェック対象の Component
戻り値:
コンポーネントのインデックスを指定する int 値

moveToFront

public void moveToFront(Component c)
コンポーネントを現在のレイヤーで一番上 (位置 0) に移動します。

パラメータ:
c - 移動する Component
関連項目:
setPosition(Component, int)

moveToBack

public void moveToBack(Component c)
コンポーネントを現在のレイヤーで一番下 (位置 -1) に移動します。

パラメータ:
c - 移動する Component
関連項目:
setPosition(Component, int)

setPosition

public void setPosition(Component c,
                        int position)
コンポーネントを現在のレイヤーの position に移動します。0 が一番上、-1 が一番下です。  

注: 位置番号は java.awt.Container によって定義されており、レイヤー番号の順序の反対になっています。位置番号が小さいほど上 (0 が一番上)、大きいほど下になります。

パラメータ:
c - 移動する Component
position - -1 〜 N-1 (N は現在のレイヤーのコンポーネント数) の範囲内の int 値

getPosition

public int getPosition(Component c)
レイヤー内でのコンポーネントの相対位置を返します。

パラメータ:
c - チェック対象の Component
戻り値:
コンポーネントの位置を表す int 値。0 が一番上で、最大インデックス値はレイヤー内のコンポーネント数 -1
関連項目:
getComponentCountInLayer(int)

highestLayer

public int highestLayer()
現在のすべての子から最大レイヤー値を返します。子が存在しない場合には 0 を返します。

戻り値:
区画内の一番上のコンポーネントのレイヤーを示す int 値。 子が存在しない場合は 0

lowestLayer

public int lowestLayer()
現在のすべての子から最小レイヤー値を返します。子が存在しない場合には 0 を返します。

戻り値:
区画内の一番下のコンポーネントのレイヤーを示す int 値。 子が存在しない場合は 0

getComponentCountInLayer

public int getComponentCountInLayer(int layer)
指定されたレイヤーの現在の子の数を返します。

パラメータ:
layer - チェックするレイヤーを指定する int 値
戻り値:
レイヤーのコンポーネント数を指定する int 値

getComponentsInLayer

public Component[] getComponentsInLayer(int layer)
指定されたレイヤーのコンポーネントの配列を返します。

パラメータ:
layer - チェックするレイヤーを指定する int 値
戻り値:
レイヤーに含まれている Component の配列

paint

public void paint(Graphics g)
指定されたグラフィックスコンテキストで、この JLayeredPane を描画します。

オーバーライド:
クラス JComponent 内の paint
パラメータ:
g - ペイント先となる Graphics コンテキスト
関連項目:
JComponent.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)

getComponentToLayer

protected Hashtable<Component,Integer> getComponentToLayer()
コンポーネントをレイヤーにマッピングするハッシュテーブルを返します。

戻り値:
コンポーネントをレイヤーにマッピングするためのハッシュテーブル

getObjectForLayer

protected Integer getObjectForLayer(int layer)
指定されたレイヤーに関連した Integer オブジェクトを返します。

パラメータ:
layer - レイヤーを指定する int 値
戻り値:
レイヤーの Integer オブジェクト

insertIndexForLayer

protected int insertIndexForLayer(int layer,
                                  int position)
レイヤーおよび位置の要求に従って新しい子を挿入する適切な位置を決定するためのプリミティブメソッドです。

パラメータ:
layer - レイヤーを指定する int 値
position - レイヤー内の位置を指定する int 値
戻り値:
(絶対) 挿入インデックスを指定する int 値
関連項目:
getIndexOf(java.awt.Component)

paramString

protected String paramString()
この JLayeredPane の文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、null にはなりません。

オーバーライド:
クラス JComponent 内の paramString
戻り値:
この JLayeredPane の文字列表現

getAccessibleContext

public AccessibleContext getAccessibleContext()
この JLayeredPane に関連した AccessibleContext を返します。階層化区画の場合、AccessibleContext は AccessibleJLayeredPane の形式を取ります。必要に応じて新規の AccessibleJLayeredPane インスタンスが作成されます。

定義:
インタフェース Accessible 内の getAccessibleContext
オーバーライド:
クラス JComponent 内の getAccessibleContext
戻り値:
この JLayeredPane の AccessibleContext として 機能する AccessibleJLayeredPane

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。