|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JSplitPane
JSplitPane は 2 つの Component を分割するのに使います (2 つだけに分割) 。2 つの Component は Look & Feel の実装を基準にしてグラフィカルに分割されます。そのあとでは、2 つの Component はユーザが対話的にサイズ変更できるようになります。
2 つの Component は、JSplitPane.HORIZONTAL_SPLIT
を使って左右に、JSplitPane.VERTICAL_SPLIT
を使って上下に整列できます。Component のサイズを変更するには、JSplitPane の方向に応じて location
が新しい x または y の位置である setDividerLocation
を呼び出すことをお勧めします。1 つのコンポーネントが変更されると、JSplitPane はほかのコンポーネントも再配置しようとします。
Component のサイズを目的のサイズに変更するには、resetToPreferredSizes
を呼び出します。
ユーザが Component のサイズを変更すると、Component の最小サイズを使用して、Component に設定可能な最大/最小の位置が決められます。したがって、2 つのコンポーネントの最小サイズが splitpane のサイズより大きい場合、ディバイダはコンポーネントのサイズ変更を許可しません。JComponent の最小サイズの変更については、JComponent.setMinimumSize(java.awt.Dimension)
を参照してください。
標準の Look & Feel (L&F) 表現でこのコンポーネントが使用するキーボードのキーについては、JSplitPane のキーの割り当てを参照してください。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
setDividerLocation(double)
,
resetToPreferredSizes()
, 直列化された形式内部クラスの概要 | |
protected class |
JSplitPane.AccessibleJSplitPane
オブジェクトのユーザ補助機能を取得するために使用するクラスです。 |
クラス javax.swing.JComponent から継承した内部クラス |
JComponent.AccessibleJComponent |
フィールドの概要 | |
static String |
BOTTOM
Component をもう一方の Component の下に追加するのに使います。 |
static String |
CONTINUOUS_LAYOUT_PROPERTY
continuousLayout のバウンドプロパティ名です。 |
protected boolean |
continuousLayout
サイズ変更の際、ビューが継続して再表示されるかどうかを示します。 |
static String |
DIVIDER
ディバイダを表す Component を追加するのに使います。 |
static String |
DIVIDER_SIZE_PROPERTY
ボーダのバウンドプロパティ名です。 |
protected int |
dividerSize
ディバイダのサイズです。 |
static int |
HORIZONTAL_SPLIT
水平分割は、Component が x 軸に沿って分割、つまり 2 つの Component が左右に並ぶように分割されることを示します。 |
static String |
LAST_DIVIDER_LOCATION_PROPERTY
lastLocation のバウンドプロパティです。 |
protected int |
lastDividerLocation
分割区画の以前の位置です。 |
static String |
LEFT
Component をもう一方の Component の左に追加するのに使います。 |
protected Component |
leftComponent
左または上のコンポーネントです。 |
static String |
ONE_TOUCH_EXPANDABLE_PROPERTY
oneTouchExpandable のバウンドプロパティです。 |
protected boolean |
oneTouchExpandable
分割区画をすばやく展開する/折りたたむために提供される小さなウィジットです。 |
protected int |
orientation
ビューを分割する方法です。 |
static String |
ORIENTATION_PROPERTY
方向 (水平または垂直) のバウンドプロパティ名です。 |
static String |
RIGHT
Component をもう一方の Component の右に追加するのに使います。 |
protected Component |
rightComponent
右または下のコンポーネントです。 |
static String |
TOP
Component をもう一方の Component の上に追加するのに使います。 |
static int |
VERTICAL_SPLIT
垂直分割は、Component が y 軸に沿って分割されること、つまり 2 つの Component が上下に並ぶように分割されることを示します。 |
クラス 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 |
コンストラクタの概要 | |
JSplitPane()
コンポーネントの 2 つのボタンを使って、連続したレイアウトではなく、水平方向に子コンポーネントが並ぶように設定された新しい JSplitPane を返します。 |
|
JSplitPane(int newOrientation)
指定された方向の、連続したレイアウトではない、新しい JSplitPane を返します。 |
|
JSplitPane(int newOrientation,
boolean newContinuousLayout)
方向と再描画のスタイルを指定して新しい JSplitPane を返します。 |
|
JSplitPane(int newOrientation,
boolean newContinuousLayout,
Component newLeftComponent,
Component newRightComponent)
方向と、描画スタイルとコンポーネントを指定して新しい JSplitPane を返します。 |
|
JSplitPane(int newOrientation,
Component newLeftComponent,
Component newRightComponent)
方向と、連続した描画を行わないコンポーネントを指定して新しい JSplitPane を返します。 |
メソッドの概要 | |
protected void |
addImpl(Component comp,
Object constraints,
int index)
constraints が左/上または右/下の子コンポーネントを識別し、その識別子を持つコンポーネントが以前に追加された場合は、それを削除してから、その位置に comp を追加します。 |
AccessibleContext |
getAccessibleContext()
この JComponent に関連付けられている AccessibleContext を取得します。 |
Component |
getBottomComponent()
ディバイダの下または右のコンポーネントを返します。 |
int |
getDividerLocation()
Look & Feel の実装からディバイダの位置を返します。 |
int |
getDividerSize()
ディバイダのサイズを返します。 |
int |
getLastDividerLocation()
ディバイダが置かれていた以前の位置を返します。 |
Component |
getLeftComponent()
ディバイダの左 (上) にあるコンポーネントを返します。 |
int |
getMaximumDividerLocation()
Look & Feel の実装からディバイダの最大の位置を返します。 |
int |
getMinimumDividerLocation()
Look & Feel の実装からディバイダの最小の位置を返します。 |
int |
getOrientation()
方向を返します。 |
Component |
getRightComponent()
ディバイダの右 (または下) のコンポーネントを返します。 |
Component |
getTopComponent()
ディバイダの上または左のコンポーネントを返します。 |
SplitPaneUI |
getUI()
現在の Look & Feel を提供している SplitPaneUI を返します。 |
String |
getUIClassID()
このコンポーネントを描画する L&F クラスの名前を返します。 |
boolean |
isContinuousLayout()
ユーザが操作したときに子コンポーネントが連続的に再描画されて配置される場合に true を返します。 |
boolean |
isOneTouchExpandable()
ディバイダを展開する/折りたたむ UI ウィジェットを区画が提供する場合に true を返します。 |
protected void |
paintChildren(Graphics g)
ボーダのペイントとともに、スーパークラスにメッセージが送られたあとで、finishedPaintingChildren を持つ UI にメッセージを送るためにサブクラス化されます。 |
protected String |
paramString()
この JSplitPane の文字列表現を返します。 |
void |
remove(Component component)
子コンポーネント component を区画からを削除します。 |
void |
remove(int index)
指定されたインデックスの Component を削除します。 |
void |
removeAll()
レシーバからすべての子コンポーネントを削除します。 |
void |
resetToPreferredSizes()
子コンポーネントの推奨サイズに基づいて JSplitPane を再配置するように通知します。 |
void |
setBottomComponent(Component comp)
コンポーネントをディバイダの下または右に設定します。 |
void |
setContinuousLayout(boolean newContinuousLayout)
ユーザが操作したときに子コンポーネントが連続的に再描画されて配置されるかどうかを設定します。 |
void |
setDividerLocation(double proportionalLocation)
JSplitPane のサイズのパーセンテージでディバイダの位置を設定します。 |
void |
setDividerLocation(int location)
ディバイダの位置を設定します。 |
void |
setDividerSize(int newSize)
ディバイダのサイズを設定します。 |
void |
setLastDividerLocation(int newLastLocation)
以前にディバイダが置かれていた位置を newLastLocation に設定します。 |
void |
setLeftComponent(Component comp)
コンポーネントをディバイダの左 (上) に設定します。 |
void |
setOneTouchExpandable(boolean newValue)
ディバイダをすばやく展開する/折りたたむために、JSplitPane がディバイダの UI ウィジェトを提供するかどうかを指定します。 |
void |
setOrientation(int orientation)
方向、またはスプリッタがどのように分割されるかを設定します。 |
void |
setRightComponent(Component comp)
ディバイダの右 (または下) のコンポーネントを設定します。 |
void |
setTopComponent(Component comp)
コンポーネントをディバイダの上または左に設定します。 |
void |
setUI(SplitPaneUI ui)
このコンポーネントを描画する L&F オブジェクトを設定します。 |
void |
updateUI()
L&F が変更されたことを示す UIManager からの通知です。 |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
フィールドの詳細 |
public static final int VERTICAL_SPLIT
public static final int HORIZONTAL_SPLIT
public static final String LEFT
public static final String RIGHT
public static final String TOP
public static final String BOTTOM
public static final String DIVIDER
public static final String ORIENTATION_PROPERTY
public static final String CONTINUOUS_LAYOUT_PROPERTY
public static final String DIVIDER_SIZE_PROPERTY
public static final String ONE_TOUCH_EXPANDABLE_PROPERTY
public static final String LAST_DIVIDER_LOCATION_PROPERTY
protected int orientation
protected boolean continuousLayout
protected Component leftComponent
protected Component rightComponent
protected int dividerSize
protected boolean oneTouchExpandable
protected int lastDividerLocation
コンストラクタの詳細 |
public JSplitPane()
public JSplitPane(int newOrientation)
newOrientation
- 水平方向または垂直方向を指定する int 値public JSplitPane(int newOrientation, boolean newContinuousLayout)
newOrientation
- 水平方向または垂直方向を指定する int 値newContinuousLayout
- boolean 値。ディバイダの位置が変更されるときに、コンポーネントが連続して再描画されるようにする場合は true。再描画のためにディバイダの位置の変更が中止されるまで待機する場合は falsepublic JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
newOrientation
- 垂直または水平の方向を指定する int 値newContinuousLayout
- boolean 値。ディバイダの位置が変更されるときに、コンポーネントが連続して再描画されるようにする場合は true。再描画のためにディバイダの位置の変更が中止されるまで待機する場合は falsenewLeftComponent
- 水平方向に分割された区画の左、または垂直方向に分割された区画の上に表示される Componentpublic JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent)
newOrientation
- 水平または垂直の方向を指定する int 値newContinuousLayout
- boolean 値。ディバイダの位置が変更されるときに、コンポーネントが連続して再描画されるようにする場合は true。再描画のためにディバイダの位置の変更が中止されるまで待機する場合は falsenewLeftComponent
- 水平方向に分割された区画の左、または垂直方向に分割された区画の上に表示される Componentメソッドの詳細 |
public void setUI(SplitPaneUI ui)
ui
- SplitPaneUI L&F オブジェクトUIDefaults.getUI(javax.swing.JComponent)
public SplitPaneUI getUI()
public void updateUI()
JComponent.updateUI()
public String getUIClassID()
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public void setDividerSize(int newSize)
newSize
- ディバイダのサイズをピクセル数で指定する int 値public int getDividerSize()
public void setLeftComponent(Component comp)
comp
- その位置に表示する Componentpublic Component getLeftComponent()
public void setTopComponent(Component comp)
comp
- その位置に表示する Componentpublic Component getTopComponent()
public void setRightComponent(Component comp)
comp
- その位置に表示する Componentpublic Component getRightComponent()
public void setBottomComponent(Component comp)
comp
- その位置に表示する Componentpublic Component getBottomComponent()
public void setOneTouchExpandable(boolean newValue)
newValue
- boolean 値。展開する/折りたたみウィジェトを提供する場合は truepublic boolean isOneTouchExpandable()
public void setLastDividerLocation(int newLastLocation)
newLastLocation
に設定します。newLastLocation
- 区画の左 (または上) 端からディバイダの左 (または上) 端までの、ディバイダの以前の位置をピクセル数で指定する int 値public int getLastDividerLocation()
public void setOrientation(int orientation)
orientation
- 方向を指定する int 値public int getOrientation()
setOrientation(int)
public void setContinuousLayout(boolean newContinuousLayout)
newContinuousLayout
- boolean 値。ディバイダの位置が変更されたときにコンポーネントが連続的に再描画される場合は truepublic boolean isContinuousLayout()
public void resetToPreferredSizes()
public void setDividerLocation(double proportionalLocation)
proportionalLocation
- 0 (上/左) から 1.0 (下/右) までのパーセンテージを指定する倍精度浮動小数点値public void setDividerLocation(int location)
location
- UI 固有の値 (通常はピクセル数) を指定する int 値public int getDividerLocation()
public int getMinimumDividerLocation()
public int getMaximumDividerLocation()
public void remove(Component component)
component
を区画からを削除します。必要に応じて、leftComponent または rightComponent インスタンス変数をリセットします。component
- 削除する Componentpublic void remove(int index)
index
- 削除するコンポーネントを指定する int 値。1 では左/上のコンポーネントが指定され、2 では下/右のコンポーネントが指定されるpublic void removeAll()
protected void addImpl(Component comp, Object constraints, int index)
constraints
が左/上または右/下の子コンポーネントを識別し、その識別子を持つコンポーネントが以前に追加された場合は、それを削除してから、その位置に comp
を追加します。constraints
が既知の識別子でない場合、レイアウトマネージャは IllegalArgumentException をスローします。
指定できる制約オブジェクト (String) は次のとおりです。
comp
- 追加するコンポーネントconstraints
- コンポーネントのレイアウト制約 (位置) を指定する Objectindex
- コンテナのリストでのインデックスを指定する int 値Container.addImpl(Component, Object, int)
protected void paintChildren(Graphics g)
g
- ペイント先となる Graphics コンテキストprotected String paramString()
null
にはなりません。
JFC コンポーネントの新しい側面についての情報を返すには、paramString() をオーバーライドします。
public AccessibleContext getAccessibleContext()
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |