|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.text.JTextComponent javax.swing.JTextField javax.swing.JFormattedTextField jp.go.aist.dmrc.platform.beans.gui.text.PFMaskField
マスク入力フィールド。
マスク入力フィールドは、入力形式や入力可能文字を指定できるテキストフィールドです。
実装上は、MaskFormatterをフォーマッタとしたJFormattedTextFieldです。
入力形式を指定したいときは、setMask(String)
メソッドを使ってください。
形式として、以下の文字を指定することができます。
また、同時に入力可能文字や入力不可能文字を指定することも可能です。
以下のメソッドを使ってください。
setValidCharacters(String)
setInvalidCharacters(String)
マスクフィールドを利用する際、以下の点に注意してください。
setValue(Object)
の引数には、java.lang.String型のオブジェクトを
設定してください。
JTextComponent.setText(String)
で値を設定した場合、直後にcommitEdit()
を
呼び出さないと設定値は確定されません。
このコンポーネントから以下のイベントが発生します。
トリガー | 対象データ | イベント番号 |
---|---|---|
setValue(Object) 呼出 |
設定された値 String |
0 |
トリガー | 対象データ | 更新データ | イベント番号 |
---|---|---|---|
値がコミットされたとき | 値 String |
値 String |
0 |
入れ子クラスの概要 |
クラス javax.swing.JFormattedTextField から継承した入れ子クラス |
javax.swing.JFormattedTextField.AbstractFormatter, javax.swing.JFormattedTextField.AbstractFormatterFactory |
クラス javax.swing.JTextField から継承した入れ子クラス |
javax.swing.JTextField.AccessibleJTextField |
クラス javax.swing.text.JTextComponent から継承した入れ子クラス |
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding |
クラス javax.swing.JComponent から継承した入れ子クラス |
javax.swing.JComponent.AccessibleJComponent |
クラス java.awt.Container から継承した入れ子クラス |
java.awt.Container.AccessibleAWTContainer |
クラス java.awt.Component から継承した入れ子クラス |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
フィールドの概要 |
クラス javax.swing.JFormattedTextField から継承したフィールド |
COMMIT, COMMIT_OR_REVERT, PERSIST, REVERT |
クラス javax.swing.JTextField から継承したフィールド |
notifyAction |
クラス javax.swing.text.JTextComponent から継承したフィールド |
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
クラス 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 |
インタフェース javax.swing.SwingConstants から継承したフィールド |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
インタフェース java.awt.image.ImageObserver から継承したフィールド |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
コンストラクタの概要 | |
PFMaskField()
コンストラクタ。 |
メソッドの概要 | |
void |
addPFDataSetListener(PFDataSetListener lis)
引数で与えられたイベントリスナを登録し、 データ設定イベント発生時に処理を行う対象とする。 |
void |
addPFDataUpdateListener(PFDataUpdateListener lis)
引数で与えられたイベントリスナを登録し、 データ更新イベント発生時に処理を行う対象とする。 |
void |
commitEdit()
現在表示されている文字列で値を確定する。 |
void |
commitText(java.lang.String text)
文字列を設定した後、その文字列で値を確定する。 |
protected void |
firePFDataSet(PFDataSetEvent event)
データ設定をリスナーに通知する。 |
protected void |
firePFDataUpdated(PFDataUpdateEvent event)
データ更新をリスナーに通知する。 |
int |
getComponentID()
コンポーネントIDを取得する。 |
java.lang.String |
getComponentKey()
コンポーネントキーを取得する。 |
PFMultiLocaleString |
getComponentKeys()
全ロケール分のコンポーネントキーを返す。 |
java.lang.String |
getComponentName()
コンポーネント名称を取得する。 |
java.lang.String |
getComponentString()
コンポーネントの文字列表現を取得する。 |
java.awt.Color |
getDisabledTextColor()
無効時のテキストの色を取得する。 |
java.lang.String |
getInvalidCharacters()
入力不可能な文字を取得する。 |
java.lang.String |
getMask()
書式マスクを取得する。 |
PFMultiLocaleString |
getMultiLocaleToolTipText()
ツールチップテキストを取得する。 |
java.util.Iterator |
getPFDataSetListenerList()
データ設定イベントリスナ配列を取得する。 |
java.util.Iterator |
getPFDataUpdateListenerList()
データ更新イベントリスナ配列を取得する。 |
java.lang.String |
getPlaceholder()
値がマスクを完全に埋めていない場合に使用する文字列を取得する。 |
char |
getPlaceholderCharacter()
値がマスクを完全に埋めていない場合に使用される文字を取得する。 |
protected javax.swing.JPopupMenu |
getPopupMenu()
ポップアップメニューを取得する。 |
boolean |
getPropertyEditable()
画面上から属性が編集可能かどうかを取得する。 |
java.awt.Color |
getSelectedTextColor()
選択されているテキストの色を返す。 |
java.awt.Color |
getSelectionColor()
選択領域の色を返す。 |
java.lang.String |
getToolTipText()
ツールチップテキストを取得する。 |
java.lang.String |
getValidCharacters()
入力可能な有効文字を取得する。 |
boolean |
getValueContainsLiteralCharacters()
getValue()の戻り値がマスクリテラル文字を含んでいるかどうかを取得する。 |
protected void |
init()
初期化処理。 |
void |
inputFocus()
マスク入力フィールドに入力フォーカスを設定する。 |
void |
localeUpdated()
ロケール変更に対応する。 |
void |
readExternal(java.io.ObjectInput in)
コンポーネントのデシリアライズ。 |
void |
readXML(PFXMLLoader in)
コンポーネントのXML入力. |
void |
removePFDataSetListener(PFDataSetListener lis)
引数で与えられたイベントリスナを削除し、 データ設定イベント発生時に処理を行う対象から外す。 |
void |
removePFDataUpdateListener(PFDataUpdateListener lis)
引数で与えられたイベントリスナを削除し、 データ更新イベント発生時に処理を行う対象から外す。 |
void |
revalidate()
レイアウト再配置を行なう。 |
void |
setCaretColor(java.awt.Color color)
キャレットの色を設定する。 |
void |
setColumns(int columns)
列数を返す。 |
void |
setComponentID(int id)
コンポーネントIDを設定する。 |
void |
setComponentKey(java.lang.String key)
コンポーネントキーを設定する。 |
void |
setComponentKeys(PFMultiLocaleString keys)
全ロケール分のコンポーネントキーを設定する。 |
void |
setDisabledTextColor(java.awt.Color color)
無効時のテキストの色を設定する。 |
void |
setFont(java.awt.Font font)
フォントを設定する。 |
void |
setInvalidCharacters(java.lang.String invalidCharacters)
入力不可能な文字を設定する。 |
void |
setMask(java.lang.String mask)
書式マスクを設定する。 |
void |
setMultiLocaleToolTipText(PFMultiLocaleString text)
ツールチップテキストを設定する。 |
void |
setPlaceholder(java.lang.String placeholder)
値がマスクを完全に埋めていない場合に使用する文字列を設定する。 |
void |
setPlaceholderCharacter(char placeholder)
値がマスクを完全に埋めていない場合に使用される文字を設定する。 |
void |
setPreferredSize(java.awt.Dimension d)
推奨サイズを設定する。 |
void |
setPropertyEditable(boolean flag)
画面上から属性が編集可能かどうかを設定する。 |
void |
setSelectedTextColor(java.awt.Color color)
選択されているテキストの色を設定する。 |
void |
setSelectionColor(java.awt.Color color)
選択領域の色を設定する。 |
void |
setToolTipText(java.lang.String text)
ツールチップテキストを設定する。 |
void |
setValidCharacters(java.lang.String validCharacters)
入力可能な有効文字を設定する。 |
void |
setValue(java.lang.Object value)
値を設定する。 |
void |
setValueContainsLiteralCharacters(boolean containsLiteralChars)
getValue()の戻り値がマスクリテラル文字を含んでいるかどうかを設定する。 |
void |
writeExternal(java.io.ObjectOutput out)
コンポーネントのシリアライズ。 |
void |
writeXML(PFXMLGenerator out)
コンポーネントのXML出力. |
クラス javax.swing.JFormattedTextField から継承したメソッド |
getActions, getFocusLostBehavior, getFormatter, getFormatterFactory, getUIClassID, getValue, invalidEdit, isEditValid, processFocusEvent, processInputMethodEvent, setDocument, setFocusLostBehavior, setFormatter, setFormatterFactory |
クラス javax.swing.JTextField から継承したメソッド |
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setHorizontalAlignment, setScrollOffset |
クラス javax.swing.text.JTextComponent から継承したメソッド |
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretPosition, setComponentOrientation, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write |
クラス javax.swing.JComponent から継承したメソッド |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
クラス java.awt.Container から継承したメソッド |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
クラス java.awt.Component から継承したメソッド |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
public PFMaskField()
メソッドの詳細 |
public java.lang.String getComponentName()
PFComponent
内の getComponentName
public java.lang.String getComponentKey()
PFComponent
内の getComponentKey
public void setComponentKey(java.lang.String key)
PFComponent
内の setComponentKey
key
- コンポーネントキーpublic PFMultiLocaleString getComponentKeys()
public void setComponentKeys(PFMultiLocaleString keys)
keys
- 全ロケール分のコンポーネントキーpublic int getComponentID()
PFComponent
内の getComponentID
public void setComponentID(int id)
PFComponentBus
から設定される。
各コンポーネント内では操作しないこと。
PFComponent
内の setComponentID
id
- 設定するコンポーネントIDpublic java.lang.String getComponentString()
PFComponent
内の getComponentString
public boolean getPropertyEditable()
PFPropertyEditableComponent
内の getPropertyEditable
public void setPropertyEditable(boolean flag)
PFPropertyEditableComponent
内の setPropertyEditable
flag
- 編集可否(true/false)public java.util.Iterator getPFDataSetListenerList()
PFDataSetEventSource
内の getPFDataSetListenerList
public void addPFDataSetListener(PFDataSetListener lis)
PFDataSetEventSource
内の addPFDataSetListener
lis
- 追加対象イベントリスナpublic void removePFDataSetListener(PFDataSetListener lis)
PFDataSetEventSource
内の removePFDataSetListener
lis
- 削除対象イベントリスナprotected void firePFDataSet(PFDataSetEvent event)
event
- データ設定イベントpublic java.util.Iterator getPFDataUpdateListenerList()
PFDataUpdateEventSource
内の getPFDataUpdateListenerList
public void addPFDataUpdateListener(PFDataUpdateListener lis)
PFDataUpdateEventSource
内の addPFDataUpdateListener
lis
- 追加対象イベントリスナpublic void removePFDataUpdateListener(PFDataUpdateListener lis)
PFDataUpdateEventSource
内の removePFDataUpdateListener
lis
- 削除対象イベントリスナprotected void firePFDataUpdated(PFDataUpdateEvent event)
event
- データ更新イベントpublic void localeUpdated()
PFComponent
内の localeUpdated
public void setValue(java.lang.Object value)
value
- 値public void commitEdit() throws java.text.ParseException
java.text.ParseException
public void commitText(java.lang.String text) throws java.text.ParseException
text
- 文字列
java.text.ParseException
public java.lang.String getMask()
public void setMask(java.lang.String mask) throws PFComponentException
mask
- マスク
PFComponentException
- マスクが適切でない場合public java.lang.String getValidCharacters()
public void setValidCharacters(java.lang.String validCharacters)
validCharacters
- 入力可能な有効文字public java.lang.String getInvalidCharacters()
public void setInvalidCharacters(java.lang.String invalidCharacters)
invalidCharacters
- 入力不可能な文字public java.lang.String getPlaceholder()
public void setPlaceholder(java.lang.String placeholder)
placeholder
- 文字列public char getPlaceholderCharacter()
public void setPlaceholderCharacter(char placeholder)
placeholder
- 文字public boolean getValueContainsLiteralCharacters()
public void setValueContainsLiteralCharacters(boolean containsLiteralChars)
containsLiteralChars
- マスクリテラル文字を含む場合truepublic void setColumns(int columns)
columns
- 列数public void setFont(java.awt.Font font)
font
- フォントpublic java.lang.String getToolTipText()
public void setToolTipText(java.lang.String text)
text
- ツールチップテキストpublic PFMultiLocaleString getMultiLocaleToolTipText()
public void setMultiLocaleToolTipText(PFMultiLocaleString text)
text
- ツールチップテキスト(マルチロケール)public java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color color)
color
- 選択領域の色public java.awt.Color getSelectedTextColor()
public void setSelectedTextColor(java.awt.Color color)
color
- 選択時のテキストの色public java.awt.Color getDisabledTextColor()
public void setDisabledTextColor(java.awt.Color color)
color
- 無効時のテキストの色public void setCaretColor(java.awt.Color color)
color
- キャレットの色public void setPreferredSize(java.awt.Dimension d)
d
- 推奨サイズpublic void revalidate()
protected void init()
protected javax.swing.JPopupMenu getPopupMenu()
public void inputFocus()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.Externalizable
内の readExternal
in
- 入力元ストリーム
java.io.IOException
- I/Oエラー
java.lang.ClassNotFoundException
- クラスが見つからないpublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
java.io.Externalizable
内の writeExternal
out
- 出力先ストリーム
java.io.IOException
- I/Oエラーpublic void readXML(PFXMLLoader in)
PFXMLSerializable
内の readXML
in
- XML入力ユーティリティpublic void writeXML(PFXMLGenerator out) throws java.io.IOException
PFXMLSerializable
内の writeXML
out
- XML出力ユーティリティ
java.io.IOException
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |