Kagetaka

net.hizlab.kagetaka.awt.tate
クラス Button

java.lang.Object
  拡張java.awt.Component
      拡張net.hizlab.kagetaka.awt.tate.Component
          拡張net.hizlab.kagetaka.awt.tate.Button
すべての実装インタフェース:
ImageObserver, MenuContainer, Serializable

public class Button
extends Component

縦表示のボタンです。

バージョン:
$Revision: 1.4 $
関連項目:
直列化された形式
バグ:
直列化は、リスナが保存されないため出来ません。

入れ子クラスの概要
 
クラス java.awt.Component から継承した入れ子クラス
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
 
クラス net.hizlab.kagetaka.awt.tate.Component から継承したフィールド
DISABLE, KEY_DOWN, MOUSE_DOWN, MOUSE_OVER, NORMAL
 
クラス 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
 
コンストラクタの概要
Button(Option option, ImageCreator ic)
          新しいインスタンスを作成します。
Button(Option option, ImageCreator ic, String label)
          指定されたラベルを表示する、新しいインスタンスを作成します。
 
メソッドの概要
 void addActionListener(ActionListener l)
          アクションリスナを登録します。
protected  Dimension createPreferredSize()
          コンポーネントのサイズを計算して返します。
 String getActionCommand()
          このボタンで発生するアクションイベントのコマンド名を返します。
 String getLabel()
          ボタンに表示するラベルを返します。
protected  String paramString()
          このボタンのパラメータ文字列を返します。
protected  void processActionEvent(ActionEvent e)
          このコンポーネントで発生するアクションイベントを、 登録されているすべての ActionListener に送ることにより、 アクションイベントを処理します。
protected  void processEvent(AWTEvent e)
          このコンポーネントで発生するコンポーネントイベントを処理します。
protected  void refresh(Image offscreen, Graphics g, Dimension size, int state, boolean focus)
          現在のステータスにあった状態に、オフスクリーンを再描画します。 このメソッドが呼び出されるときは、必ず状態が変更された場合なので、 このメソッド内で必ず再描画する必要があります。
 void removeActionListener(ActionListener l)
          アクションリスナを解除します。
 void setActionCommand(String command)
          このボタンで発生するアクションイベントのコマンド名を設定します。
 void setLabel(String label)
          ボタンに表示するラベルを設定します。
 
クラス net.hizlab.kagetaka.awt.tate.Component から継承したメソッド
addNotify, getBorder, getName, getPreferredSize, getText, getViewState, invalidate, isFocusTraversable, paint, removeNotify, repaintForce, setBorder, setEnabled, setFont, setName, setViewState, update
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Button

public Button(Option option,
              ImageCreator ic)
新しいインスタンスを作成します。

パラメータ:
option - オプション
ic - イメージクリエータ

Button

public Button(Option option,
              ImageCreator ic,
              String label)
指定されたラベルを表示する、新しいインスタンスを作成します。

パラメータ:
option - オプション
ic - イメージクリエータ
label - ボタンのラベル
メソッドの詳細

addActionListener

public void addActionListener(ActionListener l)
アクションリスナを登録します。

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

createPreferredSize

protected Dimension createPreferredSize()
コンポーネントのサイズを計算して返します。

定義:
クラス Component 内の createPreferredSize
戻り値:
コンポーネントのサイズ

getActionCommand

public String getActionCommand()
このボタンで発生するアクションイベントのコマンド名を返します。

戻り値:
コマンド名

getLabel

public String getLabel()
ボタンに表示するラベルを返します。

戻り値:
ボタンのラベル

paramString

protected String paramString()
このボタンのパラメータ文字列を返します。

オーバーライド:
クラス Component 内の paramString
戻り値:
パラメータ文字列

processActionEvent

protected void processActionEvent(ActionEvent e)
このコンポーネントで発生するアクションイベントを、 登録されているすべての ActionListener に送ることにより、 アクションイベントを処理します。

パラメータ:
e - イベント

processEvent

protected void processEvent(AWTEvent e)
このコンポーネントで発生するコンポーネントイベントを処理します。

パラメータ:
e - イベント

refresh

protected void refresh(Image offscreen,
                       Graphics g,
                       Dimension size,
                       int state,
                       boolean focus)
現在のステータスにあった状態に、オフスクリーンを再描画します。 このメソッドが呼び出されるときは、必ず状態が変更された場合なので、 このメソッド内で必ず再描画する必要があります。

定義:
クラス Component 内の refresh
パラメータ:
offscreen - オフスクリーンイメージ
g - オフスクリーンイメージへのグラフィック
size - オフスクリーンイメージのサイズ
state - 新しい状態
focus - フォーカスを持っているか

removeActionListener

public void removeActionListener(ActionListener l)
アクションリスナを解除します。

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

setActionCommand

public void setActionCommand(String command)
このボタンで発生するアクションイベントのコマンド名を設定します。 デフォルトでは、このコマンド名がボタンのラベルに設定されます。

パラメータ:
command - コマンド名

setLabel

public void setLabel(String label)
ボタンに表示するラベルを設定します。

パラメータ:
label - ボタンのラベル

Kagetaka

Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'