mine.whitespacefield
クラス WhiteSpaceVisibleTextField

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 javax.swing.JComponent
              上位を拡張 javax.swing.text.JTextComponent
                  上位を拡張 javax.swing.JTextField
                      上位を拡張 mine.whitespacefield.WhiteSpaceVisibleTextField
すべての実装されたインタフェース:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants

public class WhiteSpaceVisibleTextField
extends JTextField

特定の文字を画像や図形にして表示できるJTextField。
タブにも対応していますが、貼り付けでタブを入れると描画が少し崩れます。 (JTextFieldも同じようになるけど、なぜかはわかりません・・・)

導入されたバージョン:
2013/04/06
作成者:
Mine
関連項目:
直列化された形式

入れ子のクラスの概要
 
クラス javax.swing.JTextField から継承された入れ子のクラス/インタフェース
JTextField.AccessibleJTextField
 
クラス javax.swing.text.JTextComponent から継承された入れ子のクラス/インタフェース
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding
 
クラス javax.swing.JComponent から継承された入れ子のクラス/インタフェース
JComponent.AccessibleJComponent
 
クラス java.awt.Container から継承された入れ子のクラス/インタフェース
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承された入れ子のクラス/インタフェース
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
private  HashMap<String,DrawCharSPInterface> drawCharSPMap
          特定文字と、画像や図形に置き換えて表示するインターフェースを関連付けるマップ
 
クラス 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
 
コンストラクタの概要
WhiteSpaceVisibleTextField()
          デフォルトのコンストラクタ。
WhiteSpaceVisibleTextField(Document doc, String text, int columns)
          ドキュメント、文字列、列数を指定するコンストラクタ。
WhiteSpaceVisibleTextField(int columns)
          列数を指定するコンストラクタ。
WhiteSpaceVisibleTextField(String text)
          文字列を指定するコンストラクタ。
WhiteSpaceVisibleTextField(String text, int columns)
          文字列と列数を指定するコンストラクタ。
 
メソッドの概要
 void clearDrawCharSP()
          特定文字と、画像や図形に置き換えて表示するインターフェースの関連付けを初期化し、特定文字を置き換えないようにします。
 HashMap<String,DrawCharSPInterface> getDrawCharSPMap()
          特定文字と、画像や図形に置き換えて表示するインターフェースを関連付けるマップを取得します。
private  void init()
          特定の文字を画像や図形にして表示するUIの設定と、マップの初期化をします。
 DrawCharSPInterface putDrawCharSP(String c, DrawCharSPInterface charSP)
          置き換える文字と、表示する画像または図形のインターフェースを関連付けます。
 
クラス javax.swing.JTextField から継承されたメソッド
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset
 
クラス javax.swing.text.JTextComponent から継承されたメソッド
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
クラス javax.swing.JComponent から継承されたメソッド
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
クラス java.awt.Container から継承されたメソッド
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
 

フィールドの詳細

drawCharSPMap

private HashMap<String,DrawCharSPInterface> drawCharSPMap
特定文字と、画像や図形に置き換えて表示するインターフェースを関連付けるマップ

コンストラクタの詳細

WhiteSpaceVisibleTextField

public WhiteSpaceVisibleTextField()
デフォルトのコンストラクタ。

関連項目:
JTextField.JTextField()

WhiteSpaceVisibleTextField

public WhiteSpaceVisibleTextField(String text)
文字列を指定するコンストラクタ。

パラメータ:
text - 表示されるテキストまたはnull
関連項目:
JTextField.JTextField(String)

WhiteSpaceVisibleTextField

public WhiteSpaceVisibleTextField(int columns)
列数を指定するコンストラクタ。

パラメータ:
columns - 適切な幅の計算に使用する列数。列数を0に設定すると、適切な幅はコンポーネントの実装から自然に得られる値になる
関連項目:
JTextField.JTextField(int)

WhiteSpaceVisibleTextField

public WhiteSpaceVisibleTextField(String text,
                                  int columns)
文字列と列数を指定するコンストラクタ。

パラメータ:
text - 表示されるテキストまたはnull
columns - 適切な幅の計算に使用する列数。列数を0に設定すると、適切な幅はコンポーネントの実装から自然に得られる値になる

WhiteSpaceVisibleTextField

public WhiteSpaceVisibleTextField(Document doc,
                                  String text,
                                  int columns)
ドキュメント、文字列、列数を指定するコンストラクタ。

パラメータ:
doc - 使用するテキストストレージ。nullの場合は、createDefaultModelメソッドを呼び出すことによってデフォルトの値が提供される
text - 表示されるテキストまたはnull
columns - 適切な幅の計算に使用する列数。列数を0に設定すると、適切な幅はコンポーネントの実装から自然に得られる値になる
メソッドの詳細

init

private void init()
特定の文字を画像や図形にして表示するUIの設定と、マップの初期化をします。


putDrawCharSP

public DrawCharSPInterface putDrawCharSP(String c,
                                         DrawCharSPInterface charSP)
置き換える文字と、表示する画像または図形のインターフェースを関連付けます。

パラメータ:
c - 置き換える文字。1文字でないと置き換えられないので注意
charSP - 表示する画像または図形のインターフェース
戻り値:
以前に関連付けられていたインターフェース。関連付けがなかった場合はnull

clearDrawCharSP

public void clearDrawCharSP()
特定文字と、画像や図形に置き換えて表示するインターフェースの関連付けを初期化し、特定文字を置き換えないようにします。


getDrawCharSPMap

public HashMap<String,DrawCharSPInterface> getDrawCharSPMap()
特定文字と、画像や図形に置き換えて表示するインターフェースを関連付けるマップを取得します。
このメソッドは、WhiteSpaceVisibleViewで使用するためにpublicになっていますが、 取得したマップを変更しないことをお勧めします。

戻り値:
特定文字と、画像や図形に置き換えて表示するインターフェースを関連付けるマップ