jp.co.fujitsu.reffi.client.swing.util
クラス MessageDialog

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 java.awt.Window
              上位を拡張 java.awt.Dialog
                  上位を拡張 javax.swing.JDialog
                      上位を拡張 jp.co.fujitsu.reffi.client.swing.util.MessageDialog
すべての実装されたインタフェース:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class MessageDialog
extends JDialog
implements WindowListener

[概 要]

メッセージダイアログ画面クラスです。

[詳 細]

MessageDialogUtilの各種メソッドが生成する画面を構築します。

[備 考]

[環 境] JDK 6.0 Update 11

Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.

作成者:
Project Reffi
関連項目:
直列化された形式

入れ子のクラスの概要
 
クラス javax.swing.JDialog から継承された入れ子のクラス/インタフェース
JDialog.AccessibleJDialog
 
クラス java.awt.Dialog から継承された入れ子のクラス/インタフェース
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
クラス java.awt.Window から継承された入れ子のクラス/インタフェース
Window.AccessibleAWTWindow
 
クラス java.awt.Container から継承された入れ子のクラス/インタフェース
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承された入れ子のクラス/インタフェース
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
static String cancelButtonText
          cancelボタン文言です。
static String defaultButtonText
          デフォルトボタン文言です。
static String noButtonText
          noボタン文言です。
static String okButtonText
          okボタン文言です。
static String yesButtonText
          yesボタン文言です。
 
クラス javax.swing.JDialog から継承されたフィールド
accessibleContext, rootPane, rootPaneCheckingEnabled
 
クラス java.awt.Dialog から継承されたフィールド
DEFAULT_MODALITY_TYPE
 
クラス java.awt.Component から継承されたフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース javax.swing.WindowConstants から継承されたフィールド
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
インタフェース java.awt.image.ImageObserver から継承されたフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
protected MessageDialog(Window owner, Dialog.ModalityType modalType, String message, String title, int messageType, int buttonOption)
          [概 要] コンストラクタです。
 
メソッドの概要
 void addMessageDialogListener(MessageDialogListener listener)
          [概 要] ユーザインタラクション取得の為のリスナを追加します。
protected  JButton[] createButtons(int buttonOption)
          [概 要] ボタン構成に沿ったJButton配列を返却します。
protected  Icon createMessageTypeIcon(int messageType)
          [概 要] メッセージタイプに沿ったアイコンを返却します。
 int getReturnValue()
          [概 要] 押下ボタン識別値を返却します。
protected  void initUI()
          [概 要] メッセージダイアログを構築します。
 void removeMessageDialogListener(MessageDialogListener listener)
          [概 要] ユーザインタラクション取得の為のリスナを削除します。
 void setReturnValue(int returnValue)
          [概 要] 押下ボタン識別値を設定します。
protected  int showDialog()
          [概 要] メッセージダイアログを表示します。
 void windowActivated(WindowEvent e)
          [概 要] メッセージダイアログのActivatedイベントをハンドリングします。
 void windowClosed(WindowEvent e)
          [概 要] メッセージダイアログのClosedイベントをハンドリングします。
 void windowClosing(WindowEvent e)
          [概 要] メッセージダイアログのActivatedイベントをハンドリングします。
 void windowDeactivated(WindowEvent e)
          [概 要] メッセージダイアログのDeactivatedイベントをハンドリングします。
 void windowDeiconified(WindowEvent e)
          [概 要] メッセージダイアログのDeiconifiedイベントをハンドリングします。
 void windowIconified(WindowEvent e)
          [概 要] メッセージダイアログのIconifiedイベントをハンドリングします。
 void windowOpened(WindowEvent e)
          [概 要] メッセージダイアログのOpenedイベントをハンドリングします。
 
クラス javax.swing.JDialog から継承されたメソッド
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
クラス java.awt.Dialog から継承されたメソッド
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
クラス java.awt.Window から継承されたメソッド
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront
 
クラス java.awt.Container から継承されたメソッド
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
クラス java.awt.Component から継承されたメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

defaultButtonText

public static String defaultButtonText
デフォルトボタン文言です。


yesButtonText

public static String yesButtonText
yesボタン文言です。


noButtonText

public static String noButtonText
noボタン文言です。


cancelButtonText

public static String cancelButtonText
cancelボタン文言です。


okButtonText

public static String okButtonText
okボタン文言です。

コンストラクタの詳細

MessageDialog

protected MessageDialog(Window owner,
                        Dialog.ModalityType modalType,
                        String message,
                        String title,
                        int messageType,
                        int buttonOption)

[概 要]

コンストラクタです。

[詳 細]

フィールドの初期化、引数のフィールド保存を行った後、initUIメソッドをコールします。

[備 考]

パラメータ:
owner - メッセージダイアログの親ウィンドウ
modalType - Dialog.ModalityType.APPLICATION_MODAL or Dialog.ModalityType.MODELESS
message - 表示メッセージ
title - ダイアログタイトル
messageType - メッセージタイプ
buttonOption - ボタン構成
メソッドの詳細

getReturnValue

public int getReturnValue()

[概 要]

押下ボタン識別値を返却します。

[詳 細]

returnValueフィールドを返却します。

[備 考]

戻り値:
押下ボタン識別値

setReturnValue

public void setReturnValue(int returnValue)

[概 要]

押下ボタン識別値を設定します。

[詳 細]

returnValueフィールドを設定します。

[備 考]

パラメータ:
returnValue - 押下ボタン識別値

addMessageDialogListener

public void addMessageDialogListener(MessageDialogListener listener)

[概 要]

ユーザインタラクション取得の為のリスナを追加します。

[詳 細]

引数listenerをlistenerListフィールドに追加します。

[備 考]

パラメータ:
listener - 押下ボタン取得用リスナ

removeMessageDialogListener

public void removeMessageDialogListener(MessageDialogListener listener)

[概 要]

ユーザインタラクション取得の為のリスナを削除します。

[詳 細]

listenerListフィールドから引数listenerを削除します。

[備 考]

パラメータ:
listener - 押下ボタン取得用リスナ

showDialog

protected int showDialog()

[概 要]

メッセージダイアログを表示します。

[詳 細]

ownerフィールドがnullでない場合、ownerウィンドウの中央にダイアログを表示します。

[備 考]

戻り値:
モーダル表示時のボタン押下値

initUI

protected void initUI()

[概 要]

メッセージダイアログを構築します。

[詳 細]

タイトル、アイコン、ボタンをダイアログに構築します。

[備 考]


createMessageTypeIcon

protected Icon createMessageTypeIcon(int messageType)

[概 要]

メッセージタイプに沿ったアイコンを返却します。

[詳 細]

messageTypeを判別して、
    1. ERROR_MESSAGE
      INFORMATION_MESSAGE
      WARNING_MESSAGE
      QUESTION_MESSAGE
  • に沿ったアイコンの生成をUIManager.getIconメソッドに依頼します。

    [備 考]

    パラメータ:
    messageType - メッセージタイプ
    戻り値:
    生成されたアイコンオブジェクト

    createButtons

    protected JButton[] createButtons(int buttonOption)

    [概 要]

    ボタン構成に沿ったJButton配列を返却します。

    [詳 細]

    buttonOptionを判定して、
    1. DEFAULT_OPTION : デフォルトボタン(-1)
      YES_NO_OPTION : yesボタン (0)、noボタン (1)
      YES_NO_CANCEL_OPTION : yesボタン (0)、noボタン (1)、cancelボタン (2)
      OK_CANCEL_OPTION : okボタン (0)、cancelボタン (2)
  • 上記ボタン構成のJButton配列を返却します。(括弧内は押下ボタン識別値)

    [備 考]

    パラメータ:
    buttonOption - ボタン構成
    戻り値:
    生成されたJButton配列

    windowActivated

    public void windowActivated(WindowEvent e)

    [概 要]

    メッセージダイアログのActivatedイベントをハンドリングします。

    [詳 細]

    処理は有りません。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowActivated
    パラメータ:
    e - ウィンドウイベント

    windowClosed

    public void windowClosed(WindowEvent e)

    [概 要]

    メッセージダイアログのClosedイベントをハンドリングします。

    [詳 細]

    listenerListフィールドに格納されているMessageDialogListener分、 MessageDialogListener.dialogClosed(MessageDialogEvent) をコールします。 dialogClosedの引数MessageDialogEventには押下されたボタンの識別値が格納されます。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowClosed
    パラメータ:
    e - ウィンドウイベント

    windowClosing

    public void windowClosing(WindowEvent e)

    [概 要]

    メッセージダイアログのActivatedイベントをハンドリングします。

    [詳 細]

    処理は有りません。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowClosing
    パラメータ:
    e - ウィンドウイベント

    windowDeactivated

    public void windowDeactivated(WindowEvent e)

    [概 要]

    メッセージダイアログのDeactivatedイベントをハンドリングします。

    [詳 細]

    処理は有りません。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowDeactivated
    パラメータ:
    e - ウィンドウイベント

    windowDeiconified

    public void windowDeiconified(WindowEvent e)

    [概 要]

    メッセージダイアログのDeiconifiedイベントをハンドリングします。

    [詳 細]

    処理は有りません。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowDeiconified
    パラメータ:
    e - ウィンドウイベント

    windowIconified

    public void windowIconified(WindowEvent e)

    [概 要]

    メッセージダイアログのIconifiedイベントをハンドリングします。

    [詳 細]

    処理は有りません。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowIconified
    パラメータ:
    e - ウィンドウイベント

    windowOpened

    public void windowOpened(WindowEvent e)

    [概 要]

    メッセージダイアログのOpenedイベントをハンドリングします。

    [詳 細]

    処理は有りません。

    [備 考]

    定義:
    インタフェース WindowListener 内の windowOpened
    パラメータ:
    e - ウィンドウイベント


    Copyright(C) Fujitsu All Rights Reserved.