- java.lang.Object
-
- javax.swing.DefaultDesktopManager
-
- すべての実装されたインタフェース:
Serializable
,DesktopManager
public class DefaultDesktopManager extends Object implements DesktopManager, Serializable
DesktopManager
の実装です。 現時点では、任意の親でJInternalFrame
を管理するための基本動作を実装します。JDesktop
の子でないJInternalFrame
は、このコンポーネントを使ってそのデスクトップ様式のアクションを処理します。このクラスはさまざまなJInternalFrameメソッドにポリシーを提供しますが、直接呼び出されるものではなく、さまざまなJInternalFrameメソッドがDesktopManagerに呼び込まれます。
- 導入されたバージョン:
- 1.2
- 関連項目:
JDesktopPane
,JInternalFrame
, 「直列化されたフォーム」
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 DefaultDesktopManager()
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 void
activateFrame(JInternalFrame f)
fをアクティブにして、フロントに移動します。void
closeFrame(JInternalFrame f)
フレームを削除し、必要に応じてその親からdesktopIcon
を削除します。void
deiconifyFrame(JInternalFrame f)
desktopIconをその親から削除して、そのフレームを親に追加します。void
dragFrame(JComponent f, int newX, int newY)
ドラッグされているフレームの可視位置を指定された位置に移動します。protected Rectangle
getBoundsForIconOf(JInternalFrame f)
iconifyFrame()
コードはこれを呼び出して、desktopIconの適切な境界を判断します。protected Rectangle
getPreviousBounds(JInternalFrame f)
コンポーネントの通常の境界をコンポーネント最大化の直前に返します。void
iconifyFrame(JInternalFrame f)
フレームをその親から削除して、そのdesktopIcon
を親に追加します。void
maximizeFrame(JInternalFrame f)
その親の境界を満たすように、フレームのサイズを変更します。void
minimizeFrame(JInternalFrame f)
maximizeFrame
の呼出し前のサイズと位置にフレームを復元します。void
openFrame(JInternalFrame f)
このメソッドは通常は呼び出されません。protected void
removeIconFor(JInternalFrame f)
fのdesktopIconを削除する簡易メソッドが必要です。void
resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
新しい値を指定してsetBoundsForFrame
を呼び出します。void
setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
JComponent
を移動して、影響を受けた領域を再描画します。protected void
setPreviousBounds(JInternalFrame f, Rectangle r)
コンポーネントの境界を、最大呼出しの直前に格納します。protected void
setWasIcon(JInternalFrame f, Boolean value)
コンポーネントがアイコン化されてdesktopIcon
の境界が有効であるように設定します。protected boolean
wasIcon(JInternalFrame f)
コンポーネントがアイコン化されてdesktopIcon
の境界が有効であればtrue
、そうでない場合はfalse
を返します。-
インタフェース javax.swing.DesktopManagerで宣言されたメソッド
beginDraggingFrame, beginResizingFrame, deactivateFrame, endDraggingFrame, endResizingFrame
-
-
-
-
メソッドの詳細
-
openFrame
public void openFrame(JInternalFrame f)
このメソッドは通常は呼び出されません。 そうであれば、フレームのdesktopIconから適切な親を決定しようとします。 フレームが正常に追加されると、desktopIconをその親から削除します。- 定義:
openFrame
、インタフェース:DesktopManager
- パラメータ:
f
- 表示されるJInternalFrame
-
closeFrame
public void closeFrame(JInternalFrame f)
フレームを削除し、必要に応じてその親からdesktopIcon
を削除します。- 定義:
closeFrame
、インタフェース:DesktopManager
- パラメータ:
f
- 削除するJInternalFrame
-
maximizeFrame
public void maximizeFrame(JInternalFrame f)
その親の境界を満たすように、フレームのサイズを変更します。- 定義:
maximizeFrame
、インタフェース:DesktopManager
- パラメータ:
f
- サイズを変更するフレーム
-
minimizeFrame
public void minimizeFrame(JInternalFrame f)
maximizeFrame
の呼出し前のサイズと位置にフレームを復元します。- 定義:
minimizeFrame
、インタフェース:DesktopManager
- パラメータ:
f
- 復元するJInternalFrame
-
iconifyFrame
public void iconifyFrame(JInternalFrame f)
フレームをその親から削除して、そのdesktopIcon
を親に追加します。- 定義:
iconifyFrame
、インタフェース:DesktopManager
- パラメータ:
f
- アイコン化するJInternalFrame
-
deiconifyFrame
public void deiconifyFrame(JInternalFrame f)
desktopIconをその親から削除して、そのフレームを親に追加します。- 定義:
deiconifyFrame
、インタフェース:DesktopManager
- パラメータ:
f
- アイコン化解除するJInternalFrame
-
activateFrame
public void activateFrame(JInternalFrame f)
fをアクティブにして、フロントに移動します。 現在アクティブなフレームがある場合は、そのフレームのIS_SELECTED_PROPERTY
がfalse
に設定されます。 アクティブなフレームは、レイヤー全体で1つだけです。- 定義:
activateFrame
、インタフェース:DesktopManager
- パラメータ:
f
- アクティブにするJInternalFrame
-
dragFrame
public void dragFrame(JComponent f, int newX, int newY)
ドラッグされているフレームの可視位置を指定された位置に移動します。 移動の方法は使用中のドラッグ・アルゴリズムによって変わる場合があります。 フレームの実際の論理位置は、endDraggingFrame
が呼び出されるまで変更されないことがあります。- 定義:
dragFrame
、インタフェース:DesktopManager
- パラメータ:
f
- ドラッグ中のJComponent
newX
- 新しいx座標newY
- 新しいy座標
-
resizeFrame
public void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
新しい値を指定してsetBoundsForFrame
を呼び出します。- 定義:
resizeFrame
、インタフェース:DesktopManager
- パラメータ:
f
- サイズ変更されるコンポーネントnewX
- 新しいx座標newY
- 新しいy座標newWidth
- 新しい幅newHeight
- 新しい高さ
-
setBoundsForFrame
public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
JComponent
を移動して、影響を受けた領域を再描画します。- 定義:
setBoundsForFrame
、インタフェース:DesktopManager
- パラメータ:
f
-JComponent
が移動またはサイズ変更されていますnewX
- 新しいx座標newY
- 新しいy座標newWidth
- 新しい幅newHeight
- 新しい高さ
-
removeIconFor
protected void removeIconFor(JInternalFrame f)
fのdesktopIconを削除する簡易メソッドが必要です。- パラメータ:
f
-desktopIcon
を削除するJInternalFrame
-
getBoundsForIconOf
protected Rectangle getBoundsForIconOf(JInternalFrame f)
iconifyFrame()
コードはこれを呼び出して、desktopIconの適切な境界を判断します。- パラメータ:
f
- 対象のJInternalFrame
- 戻り値:
desktopIcon
の境界を含むRectangle
-
setPreviousBounds
protected void setPreviousBounds(JInternalFrame f, Rectangle r)
コンポーネントの境界を、最大呼出しの直前に格納します。- パラメータ:
f
- サイズ変更されるコンポーネントr
- ほかの媒体に保存される通常の境界
-
getPreviousBounds
protected Rectangle getPreviousBounds(JInternalFrame f)
コンポーネントの通常の境界をコンポーネント最大化の直前に返します。- パラメータ:
f
- 対象のJInternalFrame
- 戻り値:
- コンポーネントの通常の境界
-
setWasIcon
protected void setWasIcon(JInternalFrame f, Boolean value)
コンポーネントがアイコン化されてdesktopIcon
の境界が有効であるように設定します。- パラメータ:
f
- 対象のJInternalFrame
value
- コンポーネントがアイコン化されているかどうかを示すBoolean
-
wasIcon
protected boolean wasIcon(JInternalFrame f)
コンポーネントがアイコン化されてdesktopIcon
の境界が有効であればtrue
、そうでない場合はfalse
を返します。- パラメータ:
f
- 対象のJInternalFrame
- 戻り値:
- コンポーネントがアイコン化されている場合は
true
、そうでない場合はfalse
-
-