to.tetramorph.starbase.dict
クラス DictTree

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 javax.swing.JComponent
              上位を拡張 javax.swing.JTree
                  上位を拡張 to.tetramorph.starbase.dict.DictTree
すべての実装されたインタフェース:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class DictTree
extends JTree

DnDによるノードの編集をサポートしたツリー。 ノードの挿入・削除等のメソッド内部では、基本的にはエラー検査はせずに簡単に すませる。メニューを開くときに、その状況で使えない機能を判定して選択できない ようにして、例外の発生を抑える方針。

関連項目:
直列化された形式

入れ子のクラスの概要
 
クラス javax.swing.JTree から継承された入れ子のクラス/インタフェース
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
 
クラス javax.swing.JComponent から継承された入れ子のクラス/インタフェース
JComponent.AccessibleJComponent
 
クラス java.awt.Container から継承された入れ子のクラス/インタフェース
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承された入れ子のクラス/インタフェース
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
 
クラス javax.swing.JTree から継承されたフィールド
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
クラス 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
 
インタフェース java.awt.image.ImageObserver から継承されたフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
DictTree()
          辞書ツリーオブジェクトを作成する。
 
メソッドの概要
 void copyNode(List<TreePath> list, to.tetramorph.starbase.dict.DictNode targetNode)
          選択されているパスを内部リストにコピーする。
 DataFlavor getDataFlavor()
          このツリーがサポートするDnD用のフレーバーを返す。
 List<TreePath> getSelectionPathList()
          選択されているパスをリストで返す。
 DataFlavor[] getSupportedFlavors()
          このツリーがサポートするDnD用のフレーバーを配列で返す。
 to.tetramorph.starbase.dict.TreeShell getTreeShell()
           
 boolean isPathEditable(TreePath path)
          ノードがリネームされるなど編集開始前に呼び出される。
 void makeFolder()
          選択されているノードに新規フォルダを追加する。
 void makePage()
          選択されているノードに、新規ページを追加する。
 void moveNode(List<TreePath> paths, to.tetramorph.starbase.dict.DictNode targetNode, boolean aperture)
          ノードを移動する。
 void removeSelectedNodes()
          選択されているノードをすべて削除する。
 void setDefaultTreeModel(DefaultTreeModel treeModel)
          ツリーモデルをセットする。
 void updateNode(TreePath path, to.tetramorph.starbase.dict.DictNode newNode)
          既存のノードを新しいノードと置き換える。
 
クラス javax.swing.JTree から継承されたメソッド
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI
 
クラス 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, 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, addInputMethodListener, 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, getInputMethodRequests, 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, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, 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
 

コンストラクタの詳細

DictTree

public DictTree()
辞書ツリーオブジェクトを作成する。

メソッドの詳細

getDataFlavor

public DataFlavor getDataFlavor()
このツリーがサポートするDnD用のフレーバーを返す。


getSupportedFlavors

public DataFlavor[] getSupportedFlavors()
このツリーがサポートするDnD用のフレーバーを配列で返す。getDataFalvor()の 値を配列に入れただけのもの。


setDefaultTreeModel

public void setDefaultTreeModel(DefaultTreeModel treeModel)
ツリーモデルをセットする。


getSelectionPathList

public List<TreePath> getSelectionPathList()
選択されているパスをリストで返す。一つも選択されていないときは空のリスト を返す。


isPathEditable

public boolean isPathEditable(TreePath path)
ノードがリネームされるなど編集開始前に呼び出される。編集が禁止されている 本の場合はfalseを返しリネームを禁止する。

オーバーライド:
クラス JTree 内の isPathEditable

moveNode

public void moveNode(List<TreePath> paths,
                     to.tetramorph.starbase.dict.DictNode targetNode,
                     boolean aperture)
ノードを移動する。

パラメータ:
paths - 移動するツリーパスのリスト
targetNode - 異動先ノード
aperture - 異動先ノードと同じ親の子として移動する場合はtrue、 移動先ノードの子として移動する場合はfalseを指定する。

updateNode

public void updateNode(TreePath path,
                       to.tetramorph.starbase.dict.DictNode newNode)
既存のノードを新しいノードと置き換える。これはノードの文書やアトリビュート が書き換えられたときに、その情報を更新するのに使用する。 pathの最後のノードが、newNodeに置き換わる。

パラメータ:
path - 編集対象となっているパス
newNode - 編集後、新しく作成されたノード

getTreeShell

public to.tetramorph.starbase.dict.TreeShell getTreeShell()

removeSelectedNodes

public void removeSelectedNodes()
選択されているノードをすべて削除する。

例外:
IllegalArgumentException - 選択された中にルートノードがある場合 、選択ノードがまったく無い場合

copyNode

public void copyNode(List<TreePath> list,
                     to.tetramorph.starbase.dict.DictNode targetNode)
選択されているパスを内部リストにコピーする。 クリップボードを経由してのコピペ風に処理するためのもの。


makePage

public void makePage()
選択されているノードに、新規ページを追加する。

例外:
IllegalArgumentException - ノードが選択されていないとき。

makeFolder

public void makeFolder()
選択されているノードに新規フォルダを追加する。