Kagetaka

net.hizlab.kagetaka.awt
クラス DialogBox

java.lang.Object
  拡張java.awt.Component
      拡張java.awt.Container
          拡張java.awt.Window
              拡張java.awt.Dialog
                  拡張net.hizlab.kagetaka.awt.DialogBox
すべての実装インタフェース:
Accessible, ImageObserver, MenuContainer, Serializable
直系の既知のサブクラス:
AuthorizationDialog, BookmarkAs, Detail, InputBox, MessageBox, OpenDialog, OptionDialog

public abstract class DialogBox
extends Dialog

標準的なダイアログボックスです。

バージョン:
$Revision: 1.3 $
関連項目:
直列化された形式

入れ子クラスの概要
 
クラス java.awt.Dialog から継承した入れ子クラス
Dialog.AccessibleAWTDialog
 
クラス java.awt.Window から継承した入れ子クラス
Window.AccessibleAWTWindow
 
クラス java.awt.Container から継承した入れ子クラス
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承した入れ子クラス
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
protected static int ALIGN_CENTER
          ボタンを中央に配置
protected static int ALIGN_LEFT
          ボタンを左に配置
protected static int ALIGN_RIGHT
          ボタンを右に配置
protected static int BUTTON_CANCEL
          キャンセルボタン
protected static int BUTTON_OK
          OK ボタン
protected static int BUTTON_OKCANCEL
          OK とキャンセルボタン
protected static int BUTTON_OKCANCELAPPLY
          OK とキャンセルと適用ボタン
protected static int BUTTON_YESNO
          YES と NO ボタン
protected static int BUTTON_YESNOCANCEL
          YES と NO とキャンセルボタン
static String COMMAND_APPLY
          適用 ボタンのコマンド
static String COMMAND_CANCEL
          キャンセル ボタンのコマンド
static String COMMAND_HELP
          ヘルプ ボタンのコマンド
static String COMMAND_NO
          NO ボタンのコマンド
static String COMMAND_OK
          OK ボタンのコマンド
static String COMMAND_YES
          YES ボタンのコマンド
protected static int DEFAULT_BUTTON1
          第一ボタンをデフォルトに
protected static int DEFAULT_BUTTON2
          第二ボタンをデフォルトに
protected static int DEFAULT_BUTTON3
          第三ボタンをデフォルトに
protected static int DEFAULT_BUTTON4
          第四ボタンをデフォルトに
protected  Panel mainPanel
          ダイアログのメインの部分のパネルです。
protected static int MASK_ALIGN
          位置揃えマスク
protected static int MASK_BUTTON
          利用ボタン用マスク
protected static int MASK_DEFAULT
          デフォルトボタン用マスク
protected static int OPTION_HELPBUTTON
          ヘルプボタンを追加
static int RESULT_CANCEL
          キャンセルボタンを押された
static int RESULT_NO
          NO ボタンが押された
static int RESULT_NONE
          ボタンは押されていない
static int RESULT_OK
          OK ボタンを押された
static int RESULT_YES
          YES ボタンが押された
 
クラス 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
 
コンストラクタの概要
protected DialogBox(Frame owner, int mode)
          指定した表示モードに従い、ダイアログボックスを作成します。
 
メソッドの概要
 void addButtonActionListener(ActionListener l)
          ボタンに対するアクションリスナを登録します。
 void addButtonComponentListener(ComponentListener l)
          ボタンに対するコンポーネントリスナを登録します。
 void addButtonFocusListener(FocusListener l)
          ボタンに対するフォーカスリスナを登録します。
 void addButtonKeyListener(KeyListener l)
          ボタンに対するキーリスナを登録します。
 void addButtonMouseListener(MouseListener l)
          ボタンに対するマウスリスナを登録します。
 void addButtonMouseMotionListener(MouseMotionListener l)
          ボタンに対するマウスモーションリスナを登録します。
 void addComponentListener(ComponentListener l)
          ダイアログのメインパネルに対するコンポーネントリスナを登録します。
 void addContainerListener(ContainerListener l)
          ダイアログに対するコンテナリスナを登録します。
 void addFocusListener(FocusListener l)
          ダイアログに対するフォーカスリスナを登録します。
 void addKeyListener(KeyListener l)
          ダイアログに対するキーリスナを登録します。
 void addMouseListener(MouseListener l)
          ダイアログに対するマウスリスナを登録します。
 void addMouseMotionListener(MouseMotionListener l)
          ダイアログに対するマウスモーションリスナを登録します。
 void addToPanel(Component comp, GridBagLayout gbl, int x, int y, int width, int height, double weightx, double weighty, int fill, int anchor, Insets insets)
          ダイアログにコンポーネントを指定した引数で追加します。
 void clearResult()
          押されたボタンの情報をクリアします。
protected  boolean dialogClosing(int result)
          ダイアログが閉じられるときに呼び出されます。
protected  int getMode()
          設定されているモードを返します。
 int getResult()
          どのボタンが押されたかを返します。
 void removeButtonActionListener(ActionListener l)
          ボタンに対するアクションリスナを解除します。
 void removeButtonComponentListener(ComponentListener l)
          ボタンに対するコンポーネントリスナを解除します。
 void removeButtonFocusListener(FocusListener l)
          ボタンに対するフォーカスリスナを解除します。
 void removeButtonKeyListener(KeyListener l)
          ボタンに対するキーリスナを解除します。
 void removeButtonMouseListener(MouseListener l)
          ボタンに対するマウスリスナを解除します。
 void removeButtonMouseMotionListener(MouseMotionListener l)
          ボタンに対するマウスモーションリスナを解除します。
 void removeComponentListener(ComponentListener l)
          ダイアログに対するコンポーネントリスナを解除します。
 void removeContainerListener(ContainerListener l)
          ダイアログに対するコンテナリスナを解除します。
 void removeFocusListener(FocusListener l)
          ダイアログに対するフォーカスリスナを解除します。
 void removeKeyListener(KeyListener l)
          ダイアログに対するキーリスナを解除します。
 void removeMouseListener(MouseListener l)
          ダイアログに対するマウスリスナを解除します。
 void removeMouseMotionListener(MouseMotionListener l)
          ダイアログに対するマウスモーションリスナを解除します。
 void setButtonLabel(int index, String label)
          ボタンのラベルを変更します。
protected  void setLocationToCenter()
          このダイアログを、親ウィンドウの中央に移動します。
protected  void setMode(int value)
          モードを設定します。
 void setSize(int width, int height)
          内容部分が指定された大きさになるように変更します。
 
クラス java.awt.Dialog から継承したメソッド
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated, show
 
クラス java.awt.Window から継承したメソッド
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
クラス java.awt.Container から継承したメソッド
add, add, add, add, add, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
クラス java.lang.Object から継承したメソッド
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

ALIGN_CENTER

protected static final int ALIGN_CENTER
ボタンを中央に配置

関連項目:
定数フィールド値

ALIGN_LEFT

protected static final int ALIGN_LEFT
ボタンを左に配置

関連項目:
定数フィールド値

ALIGN_RIGHT

protected static final int ALIGN_RIGHT
ボタンを右に配置

関連項目:
定数フィールド値

BUTTON_CANCEL

protected static final int BUTTON_CANCEL
キャンセルボタン

関連項目:
定数フィールド値

BUTTON_OK

protected static final int BUTTON_OK
OK ボタン

関連項目:
定数フィールド値

BUTTON_OKCANCEL

protected static final int BUTTON_OKCANCEL
OK とキャンセルボタン

関連項目:
定数フィールド値

BUTTON_OKCANCELAPPLY

protected static final int BUTTON_OKCANCELAPPLY
OK とキャンセルと適用ボタン

関連項目:
定数フィールド値

BUTTON_YESNO

protected static final int BUTTON_YESNO
YES と NO ボタン

関連項目:
定数フィールド値

BUTTON_YESNOCANCEL

protected static final int BUTTON_YESNOCANCEL
YES と NO とキャンセルボタン

関連項目:
定数フィールド値

COMMAND_APPLY

public static final String COMMAND_APPLY
適用 ボタンのコマンド

関連項目:
定数フィールド値

COMMAND_CANCEL

public static final String COMMAND_CANCEL
キャンセル ボタンのコマンド

関連項目:
定数フィールド値

COMMAND_HELP

public static final String COMMAND_HELP
ヘルプ ボタンのコマンド

関連項目:
定数フィールド値

COMMAND_NO

public static final String COMMAND_NO
NO ボタンのコマンド

関連項目:
定数フィールド値

COMMAND_OK

public static final String COMMAND_OK
OK ボタンのコマンド

関連項目:
定数フィールド値

COMMAND_YES

public static final String COMMAND_YES
YES ボタンのコマンド

関連項目:
定数フィールド値

DEFAULT_BUTTON1

protected static final int DEFAULT_BUTTON1
第一ボタンをデフォルトに

関連項目:
定数フィールド値

DEFAULT_BUTTON2

protected static final int DEFAULT_BUTTON2
第二ボタンをデフォルトに

関連項目:
定数フィールド値

DEFAULT_BUTTON3

protected static final int DEFAULT_BUTTON3
第三ボタンをデフォルトに

関連項目:
定数フィールド値

DEFAULT_BUTTON4

protected static final int DEFAULT_BUTTON4
第四ボタンをデフォルトに

関連項目:
定数フィールド値

mainPanel

protected Panel mainPanel
ダイアログのメインの部分のパネルです。 ダイアログにコンポーネントを追加する場合は、 このパネルに追加する必要があります。


MASK_ALIGN

protected static final int MASK_ALIGN
位置揃えマスク

関連項目:
定数フィールド値

MASK_BUTTON

protected static final int MASK_BUTTON
利用ボタン用マスク

関連項目:
定数フィールド値

MASK_DEFAULT

protected static final int MASK_DEFAULT
デフォルトボタン用マスク

関連項目:
定数フィールド値

OPTION_HELPBUTTON

protected static final int OPTION_HELPBUTTON
ヘルプボタンを追加

関連項目:
定数フィールド値

RESULT_CANCEL

public static final int RESULT_CANCEL
キャンセルボタンを押された

関連項目:
定数フィールド値

RESULT_NO

public static final int RESULT_NO
NO ボタンが押された

関連項目:
定数フィールド値

RESULT_NONE

public static final int RESULT_NONE
ボタンは押されていない

関連項目:
定数フィールド値

RESULT_OK

public static final int RESULT_OK
OK ボタンを押された

関連項目:
定数フィールド値

RESULT_YES

public static final int RESULT_YES
YES ボタンが押された

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

DialogBox

protected DialogBox(Frame owner,
                    int mode)
指定した表示モードに従い、ダイアログボックスを作成します。

パラメータ:
owner - オーナー
mode - 表示モード
メソッドの詳細

addButtonActionListener

public void addButtonActionListener(ActionListener l)
ボタンに対するアクションリスナを登録します。

パラメータ:
l - 登録するアクションリスナ

addButtonComponentListener

public void addButtonComponentListener(ComponentListener l)
ボタンに対するコンポーネントリスナを登録します。

パラメータ:
l - 登録するコンポーネントリスナ

addButtonFocusListener

public void addButtonFocusListener(FocusListener l)
ボタンに対するフォーカスリスナを登録します。

パラメータ:
l - 登録するフォーカスリスナ

addButtonKeyListener

public void addButtonKeyListener(KeyListener l)
ボタンに対するキーリスナを登録します。

パラメータ:
l - 登録するキーリスナ

addButtonMouseListener

public void addButtonMouseListener(MouseListener l)
ボタンに対するマウスリスナを登録します。

パラメータ:
l - 登録するマウスリスナ

addButtonMouseMotionListener

public void addButtonMouseMotionListener(MouseMotionListener l)
ボタンに対するマウスモーションリスナを登録します。

パラメータ:
l - 登録するマウスモーションリスナ

addComponentListener

public void addComponentListener(ComponentListener l)
ダイアログのメインパネルに対するコンポーネントリスナを登録します。

パラメータ:
l - 登録するコンポーネントリスナ

addContainerListener

public void addContainerListener(ContainerListener l)
ダイアログに対するコンテナリスナを登録します。

パラメータ:
l - 登録するコンテナリスナ

addFocusListener

public void addFocusListener(FocusListener l)
ダイアログに対するフォーカスリスナを登録します。

パラメータ:
l - 登録するフォーカスリスナ

addKeyListener

public void addKeyListener(KeyListener l)
ダイアログに対するキーリスナを登録します。

パラメータ:
l - 登録するキーリスナ

addMouseListener

public void addMouseListener(MouseListener l)
ダイアログに対するマウスリスナを登録します。

パラメータ:
l - 登録するマウスリスナ

addMouseMotionListener

public void addMouseMotionListener(MouseMotionListener l)
ダイアログに対するマウスモーションリスナを登録します。

パラメータ:
l - 登録するマウスモーションリスナ

addToPanel

public void addToPanel(Component comp,
                       GridBagLayout gbl,
                       int x,
                       int y,
                       int width,
                       int height,
                       double weightx,
                       double weighty,
                       int fill,
                       int anchor,
                       Insets insets)
ダイアログにコンポーネントを指定した引数で追加します。 このメソッドは、GridBagLayout を利用する際の簡易メソッドです。 従って、引数は GridBagLayout のもので、 事前にレイアウトマネージャを GridBagLayout に設定しておく 必要があります。

パラメータ:
comp - 追加するコンポーネント
x - GridBagConstraints.gridx
y - GridBagConstraints.gridy
width - GridBagConstraints.gridwidth
height - GridBagConstraints.gridheight
weightx - GridBagConstraints.weightx
weighty - GridBagConstraints.weighty
fill - GridBagConstraints.fill
anchor - GridBagConstraints.anchor
insets - GridBagConstraints.insets

clearResult

public void clearResult()
押されたボタンの情報をクリアします。


dialogClosing

protected boolean dialogClosing(int result)
ダイアログが閉じられるときに呼び出されます。 ダイアログを閉じるときに何か実行する必要があるときは、 このメソッドをオーバーライドすると便利です。 デフォルトでは、何も処理をせずに true を返します。

パラメータ:
result - 押されたボタン
戻り値:
閉じても大丈夫な場合は true、 それ以外の場合は false

getMode

protected int getMode()
設定されているモードを返します。

戻り値:
モード

getResult

public int getResult()
どのボタンが押されたかを返します。

戻り値:
押されたボタン

removeButtonActionListener

public void removeButtonActionListener(ActionListener l)
ボタンに対するアクションリスナを解除します。

パラメータ:
l - 解除するアクションリスナ

removeButtonComponentListener

public void removeButtonComponentListener(ComponentListener l)
ボタンに対するコンポーネントリスナを解除します。

パラメータ:
l - 解除するコンポーネントリスナ

removeButtonFocusListener

public void removeButtonFocusListener(FocusListener l)
ボタンに対するフォーカスリスナを解除します。

パラメータ:
l - 解除するフォーカスリスナ

removeButtonKeyListener

public void removeButtonKeyListener(KeyListener l)
ボタンに対するキーリスナを解除します。

パラメータ:
l - 解除するキーリスナ

removeButtonMouseListener

public void removeButtonMouseListener(MouseListener l)
ボタンに対するマウスリスナを解除します。

パラメータ:
l - 解除するマウスリスナ

removeButtonMouseMotionListener

public void removeButtonMouseMotionListener(MouseMotionListener l)
ボタンに対するマウスモーションリスナを解除します。

パラメータ:
l - 解除するマウスモーションリスナ

removeComponentListener

public void removeComponentListener(ComponentListener l)
ダイアログに対するコンポーネントリスナを解除します。

パラメータ:
l - 解除するコンポーネントリスナ

removeContainerListener

public void removeContainerListener(ContainerListener l)
ダイアログに対するコンテナリスナを解除します。

パラメータ:
l - 解除するコンテナリスナ

removeFocusListener

public void removeFocusListener(FocusListener l)
ダイアログに対するフォーカスリスナを解除します。

パラメータ:
l - 解除するフォーカスリスナ

removeKeyListener

public void removeKeyListener(KeyListener l)
ダイアログに対するキーリスナを解除します。

パラメータ:
l - 解除するキーリスナ

removeMouseListener

public void removeMouseListener(MouseListener l)
ダイアログに対するマウスリスナを解除します。

パラメータ:
l - 解除するマウスリスナ

removeMouseMotionListener

public void removeMouseMotionListener(MouseMotionListener l)
ダイアログに対するマウスモーションリスナを解除します。

パラメータ:
l - 解除するマウスモーションリスナ

setButtonLabel

public void setButtonLabel(int index,
                           String label)
ボタンのラベルを変更します。

パラメータ:
index - 最初のボタンが 0 のインデックス番号
label - ラベル

setLocationToCenter

protected void setLocationToCenter()
このダイアログを、親ウィンドウの中央に移動します。


setMode

protected void setMode(int value)
モードを設定します。

パラメータ:
value - モード

setSize

public void setSize(int width,
                    int height)
内容部分が指定された大きさになるように変更します。

パラメータ:
width - 内容部分の幅
height - 内容部分の高さ

Kagetaka

Copyright (c) 2002-2003 The Kagetaka Project 'September 12, 2003'