クラスBasicTreeUI

直系の既知のサブクラス:
MetalTreeUI, SynthTreeUI

public class BasicTreeUI extends TreeUI
階層データ構造の基本L&Fです。
  • ネストされたクラスのサマリー

    ネストされたクラス
    修飾子と型
    クラス
    説明
    class 
    セル編集イベントを取得し、それに応じてツリーを更新するリスナーです。
    class 
    スクロール時に推奨サイズを更新します(必要に応じて)。
    class 
    フォーカスを失ったとき、または取得したときに、リード選択行をペイントし直します。
    class 
    これは、複数のキー押下イベントを取得して適切にイベントを生成するために使用されます。
    class 
    TreeMouseListenerはマウス・イベントに基づいて選択を更新します。
    class 
    MouseInputHandlerは、マウスが放されて構築済みの送信先に送られるまで、すべてのマウス・イベント(マウス・モーション・イベントなど)を渡します。
    class 
    ノードのサイズを取得するクラス、メソッドはBasicTreeUIメソッドに転送されます。
    class 
    ツリーのPropertyChangeListenerです。
    class 
    TreeSelectionModelのリスナー、モデルのプロパティが変更された場合に行選択をリセットします。
    class 
    アクションが実行されたときにcancelEditingを呼び出すActionListenerです。
    class 
    ノードの展開または折りたたみに応じてTreeStateを更新します。
    class 
    TreeHomeActionは、終了またはホーム・アクションを処理するために使用されます。
    class 
    TreeIncrementActionは、上下のアクションを処理するために使われます。
    class 
    すべてのTreeModelイベントをTreeStateに転送します。
    class 
    TreePageActionは、ページ・アップとページ・ダウンのイベントを処理します。
    class 
    選択モデルの変更を待機し、それに応じて表示を更新します。
    class 
    最初に選択された行で、展開状態が切り替えられます。
    class 
    TreeTraverseActionは、左または右キーのために使用されるアクションです。
  • フィールドのサマリー

    フィールド
    修飾子と型
    フィールド
    説明
    protected TreeCellEditor
    ツリーのエディタです。
    protected Icon
    折りたたまれたアイコン。
    protected boolean
    現在ツリーにあるエディタがこのインスタンスによって作成された場合にtrueに設定されます。
    protected boolean
    現在ツリーにあるレンダラがこのインスタンスによって作成された場合にtrueに設定されます。
    実際のセルの描画を行うために使われているレンダラです。
    protected int
    x位置を正確に計算するための深さのオフセットの量です。
    垂直線の描画を最小化するために使われます。
    protected Component
    これは編集時に、実際の編集を行うComponentになります。
    protected TreePath
    編集中のパスです。
    protected int
    編集中の行です。
    protected boolean
    エディタのサイズがレンダラと異なる場合にtrueに設定されます。
    protected Icon
    拡張アイコン。
    protected boolean
    largeModelの最適化を行なっている場合はtrueです。
    protected int
    最後に選択された行のインデックスです。
    protected int
    左マージンと垂直の破線が描画される位置の間の距離です。
    TreeStateにノードに必要なサイズを指示します。
    protected Dimension
    推奨される最小サイズです。
    protected Dimension
    すべてのノードを完全に表示するために必要なサイズです。
    TreeCellRendererをペイントするために使われます。
    protected int
    セルの内容が描画される位置を決定するためにleftChildIndentに加算される距離です。
    protected boolean
    編集時に、shouldSelectCell()がtrueを返した場合にfalseに設定されます。これは、completeEditingで使用され、ノードが編集前に選択されなければならないことを意味しています。
    protected int
    インデントされる総距離です。
    protected JTree
    描画先のコンポーネントです。
    protected TreeModel
    何を表示するかを決定するために使われます。
    選択を維持するモデルです。
    サイズ変更や展開されているかどうかを処理するオブジェクトです。
    protected boolean
    preferredSizeが有効かどうかを示します。
  • コンストラクタのサマリー

    コンストラクタ
    コンストラクタ
    説明
    BasicTreeUIの新しいインスタンスを構築します。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    void
    現在の編集セッションを取り消します。
    protected void
    checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
    mouseXおよびmouseYrowの展開または折りたたみの領域にある場合、このメソッドは行の展開状態を切り替えます。
    protected void
    編集中セッションを中止するメッセージを送ります。
    protected void
    completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
    編集中セッションを中止します。
    protected void
    すべてのデフォルトおよびリスナーがインストールされたあとにinstallUIから呼び出されます。
    protected void
    UIをアンインストールします。
    protected void
    Look & Feelを提供しているツリーに基づいてTreeStateのインスタンスをリセットします。
    現在のエディタからのイベントを処理するリスナーを作成します。
    レンダラ・コンポーネントが配置されているレンダラ・ペインを返します。
    新しいComponentHandlerを作成し、それを返します。
    protected TreeCellEditor
    デフォルトのセル・エディタを作成します。
    各ノードをスタンプするために使われるデフォルトのセル・レンダラを返します。
    protected FocusListener
    フォーカスを喪失または取得したときに表示を更新するリスナーを作成します。
    protected KeyListener
    ツリーからキー・イベントを取得するリスナーを作成します。
    何が展開されているかおよびノードのサイズを管理するオブジェクトを作成します。
    protected MouseListener
    マウス・イベントに基づいて選択を更新するリスナーを作成します。
    ツリー内の特定のノードのサイズを決定できるNodeDimensionsのインスタンスを作成します。
    ツリーの変更に基づいてUIを更新するリスナーを作成します。
    選択モデルからプロパティ変更イベントを取得するリスナーを作成します。
    ノードの展開状態が変更されたときにツリーの状態を更新するオブジェクトを作成し、それを返します。
    モデルが変更されたときにツリーを更新できるリスナーを返します。
    選択変更メソッドに基づいて表示を更新するリスナーを作成します。
    BasicTreeUIの新しいインスタンスを構築します。
    protected void
    drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
    (x,y)を中心とするiconを描画します。
    protected void
    drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
    水平破線を描画します。
    protected void
    drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
    垂直破線を描画します。
    protected void
    ensureRowsAreVisible(int beginRow, int endRow)
    beginRowからendRowで識別される行が表示されることを確認します。
    int
    getBaseline(JComponent c, int width, int height)
    ベースラインを返します。
    サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
    protected TreeCellEditor
    描画されたツリー・コンポーネントのエントリの編集に使用されるエディタを返します。ツリーを編集できない場合はnullを返します。
    各セルをレンダリングするTreeCellRendererの現在のインスタンスを返します。
    getClosestPathForLocation(JTree tree, int x, int y)
    x、yにもっとも近いノードへのパスを返します。
    折りたたまれたアイコンを返します。
    protected Rectangle
    ドロップ・ラインのアンバウンディング・ボックスを返します。
    編集中の要素へのパスを返します。
    展開されたアイコンを返します。
    protected Color
    ハッシュの色を返します。
    protected int
    ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。
    protected TreePath
    parentの最後の子のパスを返します。
    protected int
    選択のリード行を返します。
    int
    左の子インデントを返します。
    このコンポーネントの最大サイズを返します。インスタンスが現在JTreeにある場合は推奨サイズ、そうでない場合は0, 0です。
    このコンポーネントの最小サイズを返します。
    protected TreeModel
    ツリー・モデルを返します。
    パスの最後の項目が描画されるラベル部分を囲むRectangleを返します。
    getPathForRow(JTree tree, int row)
    渡されたrowのパスを返します。
    推奨される最小サイズを返します。
    ツリーを正しく表示するための優先サイズを返します。これは、getPreferredSize(c, true)のカバー・メソッドです。
    getPreferredSize(JComponent c, boolean checkConsistency)
    cでツリーを表すための推奨サイズを返します。
    int
    適切な子インデントを返します。
    int
    表示されている行数を返します。
    int
    pathで識別される最後の項目が可視である行を返します。
    protected int
    描画されたツリー・コンポーネントの各行の高さを返します。
    protected int
    getRowX(int row, int depth)
    x軸に沿って特定の行をレンダリングする位置を返します。
    選択のモデルであるTreeSelectionModelの現在のインスタンスを返します。
    protected boolean
    ルート・ハンドルを表示する場合は、trueを返します。
    protected int
    ノード間の脚の垂直要素は、デフォルトでは親ノードの下端から始まります。
    protected void
    handleExpandControlClick(TreePath path, int mouseX, int mouseY)
    ユーザーが特定の行をクリックすると、toggleExpandStateが呼び出されます。
    protected void
    レンダラ・ペインであるツリーのサブコンポーネントをインストールします。
    protected void
    デフォルトのプロパティをインストールします。
    protected void
    キーボード操作を登録します。
    protected void
    リスナーを登録します。
    protected boolean
    DropLocationをノード間のラインによって示すかどうかを通知します。
    protected boolean
    描画されたツリー・コンポーネントの編集を有効にするかどうかを返します。
    boolean
    ツリーが編集中の場合にtrueを返します。
    protected boolean
    ラージ・モデルが設定されている場合は、trueを返します。
    protected boolean
    isLeaf(int row)
    rowのノードがリーフの場合、trueを返します。
    protected boolean
    isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
    mouseXおよびmouseYがノードの展開/縮小に使用される行の領域にあり、rowのノードがリーフを表していない場合は、trueを返します。
    protected boolean
    trueを返すと、ノード上のマウス・イベントがアンカー・ポイントから選択されることを示します。
    protected boolean
    描画されたツリー・コンポーネントのルート・ノードを表示するかどうかを返します。
    protected boolean
    trueを返すことは、イベントに基づいてマウスの下の行を切り替える必要があることを示します。
    protected boolean
    trueを返すと、ノード上のマウス・イベントによって、マウスの下にある行の選択のみが切り替わります。
    protected void
    ドロップ・ラインをペイントします。
    protected void
    paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
    行の展開(切り替え)部分をペイントします。
    protected void
    paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
    水平線をペイントします。
    protected void
    paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
    脚の水平部分をペイントします。
    protected void
    paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
    行のレンダラ部分をペイントします。
    protected void
    paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
    垂直線をペイントします。
    protected void
    paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
    脚の垂直部分をペイントします。
    protected void
    VisibleTreeNodeが縮小された後にメッセージを送信します。
    protected void
    VisibleTreeNodeが展開された後に、メッセージを送信します。
    protected void
    treeインスタンス変数の設定後、デフォルトおよびリスナーがインストールされる前に呼び出されます。
    protected void
    UIのアンインストール前に起動されます。
    protected void
    特定の行に対するMouseEventに基づいて選択を更新するためにメッセージ化されます。
    protected void
    セル・エディタを設定します。
    protected void
    TreeCellRenderertcrに設定します。
    void
    折りたたまれたアイコンを設定します。
    protected void
    setEditable(boolean newValue)
    レシーバが編集を許可するかどうかを設定します。
    void
    展開アイコンを設定します。
    protected void
    ハッシュの色を設定します。
    protected void
    setLargeModel(boolean largeModel)
    largeModelを設定します。
    void
    setLeftChildIndent(int newAmount)
    左の子のインデントを設定します。
    protected void
    TreeModelを設定します。
    void
    推奨される最小サイズを設定します。
    void
    setRightChildIndent(int newAmount)
    適切な子インデントを設定します。
    protected void
    setRootVisible(boolean newValue)
    ルートを可視に設定します。
    protected void
    setRowHeight(int rowHeight)
    treeStateに転送される、行の高さを設定します。
    protected void
    選択モデルをリセットします。
    protected void
    setShowsRootHandles(boolean newValue)
    ノードのハンドルが表示されるかどうかを決めます。
    protected boolean
    shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
    指定した行に対して展開(toggle)コントロールを描画する必要がある場合、trueを返します。
    protected boolean
    cellEditorがあり、shouldSelectCelltrueを返した場合、ノードの編集を開始します。
    void
    pathの最後の項目を選択し、その項目の編集を試みます。
    boolean
    現在の編集セッションを中止します。
    protected void
    パスが展開されてない場合は展開し、行が展開されている場合は折りたたみます。
    protected void
    レンダラ・ペインをアンインストールします。
    protected void
    既定のプロパティをアンインストールします。
    protected void
    キーボード操作の登録を解除します。
    protected void
    リスナーを登録解除します。
    protected void
    getPreferredSize()から返されるpreferredSizeインスタンス変数を更新します。
    protected void
    現在含まれているJTreeが編集できるかどうかに応じてcellEditorを更新します。
    protected void
    各深さをどのくらいオフセットするべきかを更新します。
    protected void
    ツリーから展開されている子孫を取得し、ツリー状態に転送することで、pathのすべての子孫の展開状態を更新します。
    protected void
    JTreeで展開されているすべてのノードをLayoutCacheで展開します。
    protected void
    選択のリード行を更新します。
    protected void
    レンダラが変更されたときにツリーからメッセージとして送られます。
    protected void
    キャッシュされているサイズを無効とマークし、treeDidChangeでメッセージをツリーに送ります。

    クラスで宣言されたメソッド ComponentUI

    contains, getAccessibleChild, getAccessibleChildrenCount, installUI, paint, uninstallUI, update
    修飾子と型
    メソッド
    説明
    boolean
    contains(JComponent c, int x, int y)
    指定された x,yの位置が、指定されたコンポーネントのLook & Feel定義の形状内にある場合は、trueを返します。
    オブジェクトのi番目のAccessibleの子を返します。
    int
    オブジェクト内のアクセシビリティ対応の子の数を返します。
    void
    指定されたコンポーネントをLook & Feelに応じて適切に構成します。
    void
    指定されたコンポーネントをLook & Feelに合わせてペイントします。
    void
    installUI時に、指定されたコンポーネントに対して行われた構成を取り消します。
    void
    指定されたコンポーネントをペイントする時間になったことを、このUI委譲に通知します。

    クラスオブジェクトで宣言されたメソッド

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    修飾子と型
    メソッド
    説明
    protected Object
    このオブジェクトのコピーを作成して、返します。
    boolean
    このオブジェクトと他のオブジェクトが等しいかどうかを示します。
    protected void
    削除予定のため非推奨: このAPI要素は、将来のバージョンで削除される可能性があります。
    最終決定は非推奨であり、将来のリリースで削除される可能性があります。
    final Class<?>
    このObjectの実行時クラスを返します。
    int
    このオブジェクトに対するハッシュ・コード値を返します。
    final void
    このオブジェクトのモニターで待機中のスレッドを1つ再開します。
    final void
    このオブジェクトのモニターで待機中のすべてのスレッドを再開します。
    オブジェクトの文字列表現を返します。
    final void
    現在のスレッドが目覚めるまで待機します。通常、notifiedまたはinterruptedです。
    final void
    wait(long timeoutMillis)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
    final void
    wait(long timeoutMillis, int nanos)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
  • フィールド詳細

    • collapsedIcon

      protected transient Icon collapsedIcon
      折りたたまれたアイコン。
    • expandedIcon

      protected transient Icon expandedIcon
      拡張アイコン。
    • leftChildIndent

      protected int leftChildIndent
      左マージンと垂直の破線が描画される位置の間の距離です。
    • rightChildIndent

      protected int rightChildIndent
      セルの内容が描画される位置を決定するためにleftChildIndentに加算される距離です。
    • totalChildIndent

      protected int totalChildIndent
      インデントされる総距離です。 leftChildIndentとrightChildIndentの合計です。
    • preferredMinSize

      protected Dimension preferredMinSize
      推奨される最小サイズです。
    • lastSelectedRow

      protected int lastSelectedRow
      最後に選択された行のインデックスです。
    • tree

      protected JTree tree
      描画先のコンポーネントです。
    • currentCellRenderer

      protected transient TreeCellRenderer currentCellRenderer
      実際のセルの描画を行うために使われているレンダラです。
    • createdRenderer

      protected boolean createdRenderer
      現在ツリーにあるレンダラがこのインスタンスによって作成された場合にtrueに設定されます。
    • cellEditor

      protected transient TreeCellEditor cellEditor
      ツリーのエディタです。
    • createdCellEditor

      protected boolean createdCellEditor
      現在ツリーにあるエディタがこのインスタンスによって作成された場合にtrueに設定されます。
    • stopEditingInCompleteEditing

      protected boolean stopEditingInCompleteEditing
      編集時に、shouldSelectCell()がtrueを返した場合にfalseに設定されます。これは、completeEditingで使用され、ノードが編集前に選択されなければならないことを意味しています。
    • rendererPane

      protected CellRendererPane rendererPane
      TreeCellRendererをペイントするために使われます。
    • preferredSize

      protected Dimension preferredSize
      すべてのノードを完全に表示するために必要なサイズです。
    • validCachedPreferredSize

      protected boolean validCachedPreferredSize
      preferredSizeが有効かどうかを示します。
    • treeState

      protected AbstractLayoutCache treeState
      サイズ変更や展開されているかどうかを処理するオブジェクトです。
    • drawingCache

      protected Hashtable<TreePath,Boolean> drawingCache
      垂直線の描画を最小化するために使われます。
    • largeModel

      protected boolean largeModel
      largeModelの最適化を行なっている場合はtrueです。 これをサポートしないサブクラスは、FixedHeightLayoutCacheのインスタンスを返さないようにcreateLayoutCacheをオーバーライドすることをお勧めします。
    • nodeDimensions

      protected AbstractLayoutCache.NodeDimensions nodeDimensions
      TreeStateにノードに必要なサイズを指示します。
    • treeModel

      protected TreeModel treeModel
      何を表示するかを決定するために使われます。
    • treeSelectionModel

      protected TreeSelectionModel treeSelectionModel
      選択を維持するモデルです。
    • depthOffset

      protected int depthOffset
      x位置を正確に計算するための深さのオフセットの量です。 これは、ルートが可視かどうか、ルート・ハンドルが可視どうかによって決まります。
    • editingComponent

      protected Component editingComponent
      これは編集時に、実際の編集を行うComponentになります。
    • editingPath

      protected TreePath editingPath
      編集中のパスです。
    • editingRow

      protected int editingRow
      編集中の行です。 editingComponentがnullではない場合だけ参照されます。
    • editorHasDifferentSize

      protected boolean editorHasDifferentSize
      エディタのサイズがレンダラと異なる場合にtrueに設定されます。
  • コンストラクタの詳細

    • BasicTreeUI

      public BasicTreeUI()
      BasicTreeUIの新しいインスタンスを構築します。
  • メソッドの詳細

    • createUI

      public static ComponentUI createUI(JComponent x)
      BasicTreeUIの新しいインスタンスを構築します。
      パラメータ:
      x - コンポーネント
      戻り値:
      BasicTreeUIの新しいインスタンス
    • getHashColor

      protected Color getHashColor()
      ハッシュの色を返します。
      戻り値:
      ハッシュ・カラー
    • setHashColor

      protected void setHashColor(Color color)
      ハッシュの色を設定します。
      パラメータ:
      color - ハッシュ・カラー
    • setLeftChildIndent

      public void setLeftChildIndent(int newAmount)
      左の子のインデントを設定します。
      パラメータ:
      newAmount - 左の子インデント
    • getLeftChildIndent

      public int getLeftChildIndent()
      左の子インデントを返します。
      戻り値:
      左の子インデント
    • setRightChildIndent

      public void setRightChildIndent(int newAmount)
      適切な子インデントを設定します。
      パラメータ:
      newAmount - 右の子インデント
    • getRightChildIndent

      public int getRightChildIndent()
      適切な子インデントを返します。
      戻り値:
      右の子インデント
    • setExpandedIcon

      public void setExpandedIcon(Icon newG)
      展開アイコンを設定します。
      パラメータ:
      newG - 展開されたアイコン
    • getExpandedIcon

      public Icon getExpandedIcon()
      展開されたアイコンを返します。
      戻り値:
      展開されたアイコン
    • setCollapsedIcon

      public void setCollapsedIcon(Icon newG)
      折りたたまれたアイコンを設定します。
      パラメータ:
      newG - 折りたたまれたアイコン
    • getCollapsedIcon

      public Icon getCollapsedIcon()
      折りたたまれたアイコンを返します。
      戻り値:
      折りたたまれたアイコン
    • setLargeModel

      protected void setLargeModel(boolean largeModel)
      largeModelを設定します。 描画されたツリー・コンポーネントでlargeModelプロパティが変更されたときに呼び出されます。
      パラメータ:
      largeModel - largeModelプロパティの新しい値
    • isLargeModel

      protected boolean isLargeModel()
      ラージ・モデルが設定されている場合は、trueを返します。
      戻り値:
      大型モデルが設定されている場合はtrue
    • setRowHeight

      protected void setRowHeight(int rowHeight)
      treeStateに転送される、行の高さを設定します。 描画されたツリー・コンポーネントでrowHeightプロパティが変更されたときに呼び出されます。
      パラメータ:
      rowHeight - rowHeightプロパティの新しい値
    • getRowHeight

      protected int getRowHeight()
      描画されたツリー・コンポーネントの各行の高さを返します。 戻り値が0以下の場合、各行の高さはレンダリングによって決められます。
      戻り値:
      各行の高さ(ピクセル単位)
    • setCellRenderer

      protected void setCellRenderer(TreeCellRenderer tcr)
      TreeCellRenderertcrに設定します。 これにより、updateRendererが呼び出されます。 描画されたツリー・コンポーネントでcellRendererプロパティが変更されたときに呼び出されます。
      パラメータ:
      tcr - cellRendererプロパティの新しい値
    • getCellRenderer

      protected TreeCellRenderer getCellRenderer()
      各セルをレンダリングするTreeCellRendererの現在のインスタンスを返します。
      戻り値:
      TreeCellRendererインスタンス
    • setModel

      protected void setModel(TreeModel model)
      TreeModelを設定します。
      パラメータ:
      model - 新しい価値
    • getModel

      protected TreeModel getModel()
      ツリー・モデルを返します。
      戻り値:
      ツリー・モデル
    • setRootVisible

      protected void setRootVisible(boolean newValue)
      ルートを可視に設定します。 描画されたツリー・コンポーネントでrootVisibleプロパティが変更されたときに呼び出されます。
      パラメータ:
      newValue - rootVisibleプロパティの新しい値
    • isRootVisible

      protected boolean isRootVisible()
      描画されたツリー・コンポーネントのルート・ノードを表示するかどうかを返します。
      戻り値:
      ツリーのルート・ノードが表示されている場合はtrue
    • setShowsRootHandles

      protected void setShowsRootHandles(boolean newValue)
      ノードのハンドルが表示されるかどうかを決めます。 描画されたツリー・コンポーネントでshowsRootHandlesプロパティが変更されたときに呼び出されます。
      パラメータ:
      newValue - showsRootHandlesプロパティの新しい値
    • getShowsRootHandles

      protected boolean getShowsRootHandles()
      ルート・ハンドルを表示する場合は、trueを返します。
      戻り値:
      ルート・ハンドルが表示される場合はtrue
    • setCellEditor

      protected void setCellEditor(TreeCellEditor editor)
      セル・エディタを設定します。 描画されたツリー・コンポーネントでcellEditorプロパティが変更されたときに呼び出されます。
      パラメータ:
      editor - cellEditorプロパティの新しい値
    • getCellEditor

      protected TreeCellEditor getCellEditor()
      描画されたツリー・コンポーネントのエントリの編集に使用されるエディタを返します。ツリーを編集できない場合はnullを返します。
      戻り値:
      TreeCellEditorインスタンスまたはnull
    • setEditable

      protected void setEditable(boolean newValue)
      レシーバが編集を許可するかどうかを設定します。 描画されたツリー・コンポーネントでeditableプロパティが変更されたときに呼び出されます。
      パラメータ:
      newValue - editableプロパティの新しい値
    • isEditable

      protected boolean isEditable()
      描画されたツリー・コンポーネントの編集を有効にするかどうかを返します。
      戻り値:
      ツリーが編集可能な場合はtrue
    • setSelectionModel

      protected void setSelectionModel(TreeSelectionModel newLSM)
      選択モデルをリセットします。 適切なリスナーがモデルでインストールされます。 描画されたツリー・コンポーネントでselectionModelプロパティが変更されたときに呼び出されます。
      パラメータ:
      newLSM - selectionModelプロパティの新しい値
    • getSelectionModel

      protected TreeSelectionModel getSelectionModel()
      選択のモデルであるTreeSelectionModelの現在のインスタンスを返します。
      戻り値:
      TreeSelectionModelインスタンス
    • getPathBounds

      public Rectangle getPathBounds(JTree tree, TreePath path)
      パスの最後の項目が描画されるラベル部分を囲むRectangleを返します。 パス内のいずれかのコンポーネントが現在無効な場合はnullを返します。
      定義:
      getPathBounds、クラスTreeUI
      パラメータ:
      tree - pathJTree
      path - ノードを識別するTreePath
      戻り値:
      パス内の最後の項目が描画されるラベル部分を含むRectangle。パス内のいずれかのコンポーネントが現在有効な場合はnull
    • getPathForRow

      public TreePath getPathForRow(JTree tree, int row)
      渡されたrowのパスを返します。 rowが可視でない場合は、nullが返されます。
      定義:
      getPathForRow、クラスTreeUI
      パラメータ:
      tree - JTreeオブジェクト
      row - 行を指定する整数
      戻り値:
      rowが表示されない場合はrowまたはnullpath
    • getRowForPath

      public int getRowForPath(JTree tree, TreePath path)
      pathで識別される最後の項目が可視である行を返します。 path内のどの要素も現在は可視でない場合は、-1を返します。
      定義:
      getRowForPath、クラスTreeUI
      パラメータ:
      tree - pathJTree
      path - 見るTreePathオブジェクト
      戻り値:
      識別された最後の項目が表示される行を指定する整数。path内のいずれかの要素が現在表示されていない場合は -1
    • getRowCount

      public int getRowCount(JTree tree)
      表示されている行数を返します。
      定義:
      getRowCount、クラスTreeUI
      パラメータ:
      tree - 行数をカウントするJTree
      戻り値:
      表示されている行の数を指定する整数
    • getClosestPathForLocation

      public TreePath getClosestPathForLocation(JTree tree, int x, int y)
      x、yにもっとも近いノードへのパスを返します。 現在可視のものがない場合は、nullを返します。そうでない場合は、常に有効なパスを返します。 返されたオブジェクトが正確にx, yにあるかどうかを判定する必要がある場合は、返されたパスの矩形を取得して、x, yと比較するようにしてください。
      定義:
      getClosestPathForLocation、クラスTreeUI
      パラメータ:
      tree - JTreeオブジェクト
      x - 表示領域の左端から水平方向にピクセル数を与える整数。
      y - 表示領域の上端からの垂直距離をピクセル単位で示す整数値(上マージンは除く)
      戻り値:
      現在表示されているものがない場合は、x,yまたはnullに最も近いTreePathノード
    • isEditing

      public boolean isEditing(JTree tree)
      ツリーが編集中の場合にtrueを返します。 編集中の項目を取得するには、getEditingPath()を使います。
      定義:
      isEditing、クラスTreeUI
      パラメータ:
      tree - JTreeオブジェクト
      戻り値:
      treeが編集中の場合はtrue
    • stopEditing

      public boolean stopEditing(JTree tree)
      現在の編集セッションを中止します。 ツリーが編集中でない場合は、このメソッドは何も行いません。 エディタが編集セッションの中止を許可した場合は、trueを返します。
      定義:
      stopEditing、クラスTreeUI
      パラメータ:
      tree - JTreeオブジェクト
      戻り値:
      エディタが編集セッションを停止できる場合はtrue
    • cancelEditing

      public void cancelEditing(JTree tree)
      現在の編集セッションを取り消します。
      定義:
      cancelEditing、クラスTreeUI
      パラメータ:
      tree - JTreeオブジェクト
    • startEditingAtPath

      public void startEditingAtPath(JTree tree, TreePath path)
      pathの最後の項目を選択し、その項目の編集を試みます。 CellEditorが選択された項目の編集を許可しない場合、編集は失敗します。
      定義:
      startEditingAtPath、クラスTreeUI
      パラメータ:
      tree - 編集中のJTree
      path - 編集するTreePath
    • getEditingPath

      public TreePath getEditingPath(JTree tree)
      編集中の要素へのパスを返します。
      定義:
      getEditingPath、クラスTreeUI
      パラメータ:
      tree - パスを返すJTree
      戻り値:
      treeへのパスを含むTreePath
    • prepareForUIInstall

      protected void prepareForUIInstall()
      treeインスタンス変数の設定後、デフォルトおよびリスナーがインストールされる前に呼び出されます。
    • completeUIInstall

      protected void completeUIInstall()
      すべてのデフォルトおよびリスナーがインストールされたあとにinstallUIから呼び出されます。
    • installDefaults

      protected void installDefaults()
      デフォルトのプロパティをインストールします。
    • installListeners

      protected void installListeners()
      リスナーを登録します。
    • installKeyboardActions

      protected void installKeyboardActions()
      キーボード操作を登録します。
    • installComponents

      protected void installComponents()
      レンダラ・ペインであるツリーのサブコンポーネントをインストールします。
    • createNodeDimensions

      protected AbstractLayoutCache.NodeDimensions createNodeDimensions()
      ツリー内の特定のノードのサイズを決定できるNodeDimensionsのインスタンスを作成します。
      戻り値:
      NodeDimensionsのインスタンス
    • createPropertyChangeListener

      protected PropertyChangeListener createPropertyChangeListener()
      ツリーの変更に基づいてUIを更新するリスナーを作成します。
      戻り値:
      PropertyChangeListenerのインスタンス
    • createMouseListener

      protected MouseListener createMouseListener()
      マウス・イベントに基づいて選択を更新するリスナーを作成します。
      戻り値:
      MouseListenerのインスタンス
    • createFocusListener

      protected FocusListener createFocusListener()
      フォーカスを喪失または取得したときに表示を更新するリスナーを作成します。
      戻り値:
      FocusListenerのインスタンス
    • createKeyListener

      protected KeyListener createKeyListener()
      ツリーからキー・イベントを取得するリスナーを作成します。
      戻り値:
      KeyListenerのインスタンス
    • createSelectionModelPropertyChangeListener

      protected PropertyChangeListener createSelectionModelPropertyChangeListener()
      選択モデルからプロパティ変更イベントを取得するリスナーを作成します。
      戻り値:
      PropertyChangeListenerのインスタンス
    • createTreeSelectionListener

      protected TreeSelectionListener createTreeSelectionListener()
      選択変更メソッドに基づいて表示を更新するリスナーを作成します。
      戻り値:
      TreeSelectionListenerのインスタンス
    • createCellEditorListener

      protected CellEditorListener createCellEditorListener()
      現在のエディタからのイベントを処理するリスナーを作成します。
      戻り値:
      CellEditorListenerのインスタンス
    • createComponentListener

      protected ComponentListener createComponentListener()
      新しいComponentHandlerを作成し、それを返します。 これは、大きなモデルで、コンポーネントが移動したときにvalidCachedPreferredSizeを無効にするために使用されます。
      戻り値:
      ComponentListenerのインスタンス
    • createTreeExpansionListener

      protected TreeExpansionListener createTreeExpansionListener()
      ノードの展開状態が変更されたときにツリーの状態を更新するオブジェクトを作成し、それを返します。
      戻り値:
      TreeExpansionListenerのインスタンス
    • createLayoutCache

      protected AbstractLayoutCache createLayoutCache()
      何が展開されているかおよびノードのサイズを管理するオブジェクトを作成します。
      戻り値:
      拡張されたものを管理するオブジェクト
    • createCellRendererPane

      protected CellRendererPane createCellRendererPane()
      レンダラ・コンポーネントが配置されているレンダラ・ペインを返します。
      戻り値:
      CellRendererPaneのインスタンス
    • createDefaultCellEditor

      protected TreeCellEditor createDefaultCellEditor()
      デフォルトのセル・エディタを作成します。
      戻り値:
      デフォルトのセル・エディタ
    • createDefaultCellRenderer

      protected TreeCellRenderer createDefaultCellRenderer()
      各ノードをスタンプするために使われるデフォルトのセル・レンダラを返します。
      戻り値:
      TreeCellRendererのインスタンス
    • createTreeModelListener

      protected TreeModelListener createTreeModelListener()
      モデルが変更されたときにツリーを更新できるリスナーを返します。
      戻り値:
      TreeModelListenerのインスタンス。
    • prepareForUIUninstall

      protected void prepareForUIUninstall()
      UIのアンインストール前に起動されます。
    • completeUIUninstall

      protected void completeUIUninstall()
      UIをアンインストールします。
    • uninstallDefaults

      protected void uninstallDefaults()
      既定のプロパティをアンインストールします。
    • uninstallListeners

      protected void uninstallListeners()
      リスナーを登録解除します。
    • uninstallKeyboardActions

      protected void uninstallKeyboardActions()
      キーボード操作の登録を解除します。
    • uninstallComponents

      protected void uninstallComponents()
      レンダラ・ペインをアンインストールします。
    • getBaseline

      public int getBaseline(JComponent c, int width, int height)
      ベースラインを返します。
      オーバーライド:
      getBaseline、クラスComponentUI
      パラメータ:
      c - ベースラインが要求されるJComponent
      width - ベースラインを取得する幅
      height - ベースラインを取得する高さ
      戻り値:
      ベースラインまたは0より小さい値(適切なベースラインがないことを示す)
      スロー:
      NullPointerException - cnullである場合
      IllegalArgumentException - 幅または高さが0より小さい場合
      導入されたバージョン:
      1.6
      関連項目:
    • getBaselineResizeBehavior

      public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
      サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
      オーバーライド:
      getBaselineResizeBehavior、クラスComponentUI
      パラメータ:
      c - ベースラインのサイズ変更の動作を返すJComponent
      戻り値:
      コンポーネント・サイズの変化に合わせてベースラインがどのように変化するかを示す列挙
      スロー:
      NullPointerException - cnullである場合
      導入されたバージョン:
      1.6
      関連項目:
    • isDropLine

      protected boolean isDropLine(JTree.DropLocation loc)
      DropLocationをノード間のラインによって示すかどうかを通知します。 これはjavax.swing.DropMode.INSERTおよびjavax.swing.DropMode.ON_OR_INSERTドロップ・モードで使用されます。
      パラメータ:
      loc - DropLocation
      戻り値:
      ドロップ位置をラインとして示す場合はtrue
      導入されたバージョン:
      1.7
    • paintDropLine

      protected void paintDropLine(Graphics g)
      ドロップ・ラインをペイントします。
      パラメータ:
      g - 描画するGraphicsオブジェクト
      導入されたバージョン:
      1.7
    • getDropLineRect

      protected Rectangle getDropLineRect(JTree.DropLocation loc)
      ドロップ・ラインのアンバウンディング・ボックスを返します。
      パラメータ:
      loc - DropLocation
      戻り値:
      ドロップ・ラインのバウンディング・ボックス
      導入されたバージョン:
      1.7
    • paintHorizontalPartOfLeg

      protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
      脚の水平部分をペイントします。 レシーバは、clipBoundsinsetsを変更しないようにしてください。

      ノート: ルートが可視でない場合、parentRowは -1になることがあります。

      パラメータ:
      g - グラフィックス・コンテキスト
      clipBounds - クリップされた矩形
      insets - insets
      bounds - 外接する矩形
      path - ツリー・パス
      row - 行
      isExpanded - パスが展開されている場合はtrue
      hasBeenExpanded - パスが展開されている場合はtrue
      isLeaf - パスがリーフの場合はtrue
    • paintVerticalPartOfLeg

      protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
      脚の垂直部分をペイントします。 レシーバは、clipBoundsinsetsを変更しないようにしてください。
      パラメータ:
      g - グラフィックス・コンテキスト
      clipBounds - クリップされた矩形
      insets - insets
      path - ツリー・パス
    • paintExpandControl

      protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
      行の展開(切り替え)部分をペイントします。 レシーバは、clipBoundsinsetsを変更しないようにしてください。
      パラメータ:
      g - グラフィックス・コンテキスト
      clipBounds - クリップされた矩形
      insets - insets
      bounds - 外接する矩形
      path - ツリー・パス
      row - 行
      isExpanded - パスが展開されている場合はtrue
      hasBeenExpanded - パスが展開されている場合はtrue
      isLeaf - 行がリーフの場合はtrue
    • paintRow

      protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
      行のレンダラ部分をペイントします。 レシーバは、clipBoundsinsetsを変更しないようにしてください。
      パラメータ:
      g - グラフィックス・コンテキスト
      clipBounds - クリップされた矩形
      insets - insets
      bounds - 外接する矩形
      path - ツリー・パス
      row - 行
      isExpanded - パスが展開されている場合はtrue
      hasBeenExpanded - パスが展開されている場合はtrue
      isLeaf - パスがリーフの場合はtrue
    • shouldPaintExpandControl

      protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
      指定した行に対して展開(toggle)コントロールを描画する必要がある場合、trueを返します。
      パラメータ:
      path - ツリー・パス
      row - 行
      isExpanded - パスが展開されている場合はtrue
      hasBeenExpanded - パスが展開されている場合はtrue
      isLeaf - 行がリーフの場合はtrue
      戻り値:
      指定された行の(toggle)コントロールを展開する必要がある場合はtrue
    • paintVerticalLine

      protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
      垂直線をペイントします。
      パラメータ:
      g - グラフィックス・コンテキスト
      c - コンポーネント
      x - X座標
      top - Y1座標
      bottom - Y2座標
    • paintHorizontalLine

      protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
      水平線をペイントします。
      パラメータ:
      g - グラフィックス・コンテキスト
      c - コンポーネント
      y - Y座標
      left - X1座標
      right - X2座標
    • getVerticalLegBuffer

      protected int getVerticalLegBuffer()
      ノード間の脚の垂直要素は、デフォルトでは親ノードの下端から始まります。 このメソッドは、脚がそれより下で始まるようにします。
      戻り値:
      垂直バッファ
    • getHorizontalLegBuffer

      protected int getHorizontalLegBuffer()
      ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。 このメソッドは、脚がそれより前で終わるようにします。
      戻り値:
      水平バッファ
    • drawCentered

      protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
      (x,y)を中心とするiconを描画します。
      パラメータ:
      c - コンポーネント
      graphics - グラフィックス・コンテキスト
      icon - アイコン
      x - X座標
      y - Y座標
    • drawDashedHorizontalLine

      protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
      水平破線を描画します。 x1 <= x2とします。 x1x2より大きい場合、メソッドは何も描画しません。
      パラメータ:
      g - Graphicsのインスタンス
      y - Y座標
      x1 - X1座標
      x2 - X2座標
    • drawDashedVerticalLine

      protected void drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
      垂直破線を描画します。 y1 <= y2とします。 y1y2より大きい場合、メソッドは何も描画しません。
      パラメータ:
      g - Graphicsのインスタンス
      x - X座標
      y1 - Y1座標
      y2 - Y2座標
    • getRowX

      protected int getRowX(int row, int depth)
      x軸に沿って特定の行をレンダリングする位置を返します。 戻り値には、JTreeで指定されたイン・セット値は一切含まれません。 このメソッドでは、行または深さの有効性は確認しないため、行または深さがツリーのそれと一致しない場合でも、正しいと見なされて、例外をスローしません。
      パラメータ:
      row - x位置を返す行
      depth - 行の深さ
      戻り値:
      指定された行をインデントする量。
      導入されたバージョン:
      1.5
    • updateLayoutCacheExpandedNodes

      protected void updateLayoutCacheExpandedNodes()
      JTreeで展開されているすべてのノードをLayoutCacheで展開します。 これにより、ルート・パスでupdateExpandedDescendantsが呼び出されます。
    • updateExpandedDescendants

      protected void updateExpandedDescendants(TreePath path)
      ツリーから展開されている子孫を取得し、ツリー状態に転送することで、pathのすべての子孫の展開状態を更新します。
      パラメータ:
      path - ツリー・パス
    • getLastChildPath

      protected TreePath getLastChildPath(TreePath parent)
      parentの最後の子のパスを返します。
      パラメータ:
      parent - ツリー・パス
      戻り値:
      parentの最後の子へのパス
    • updateDepthOffset

      protected void updateDepthOffset()
      各深さをどのくらいオフセットするべきかを更新します。
    • updateCellEditor

      protected void updateCellEditor()
      現在含まれているJTreeが編集できるかどうかに応じてcellEditorを更新します。 ツリーが編集できるが、cellEditorがない場合、基本的なセル・エディタが使われます。
    • updateRenderer

      protected void updateRenderer()
      レンダラが変更されたときにツリーからメッセージとして送られます。
    • configureLayoutCache

      protected void configureLayoutCache()
      Look & Feelを提供しているツリーに基づいてTreeStateのインスタンスをリセットします。
    • updateSize

      protected void updateSize()
      キャッシュされているサイズを無効とマークし、treeDidChangeでメッセージをツリーに送ります。
    • updateCachedPreferredSize

      protected void updateCachedPreferredSize()
      getPreferredSize()から返されるpreferredSizeインスタンス変数を更新します。

      左から右方向の場合、サイズは現在のAbstractLayoutCacheから決定されます。 右から左方向の場合、推奨サイズは幅から最小のx位置を引いた値になります。

    • pathWasExpanded

      protected void pathWasExpanded(TreePath path)
      VisibleTreeNodeが展開された後に、メッセージを送信します。
      パラメータ:
      path - ツリー・パス
    • pathWasCollapsed

      protected void pathWasCollapsed(TreePath path)
      VisibleTreeNodeが縮小された後にメッセージを送信します。
      パラメータ:
      path - ツリー・パス
    • ensureRowsAreVisible

      protected void ensureRowsAreVisible(int beginRow, int endRow)
      beginRowからendRowで識別される行が表示されることを確認します。
      パラメータ:
      beginRow - 開始行
      endRow - 最後の行
    • setPreferredMinSize

      public void setPreferredMinSize(Dimension newSize)
      推奨される最小サイズを設定します。
      パラメータ:
      newSize - 新しい優先サイズ
    • getPreferredMinSize

      public Dimension getPreferredMinSize()
      推奨される最小サイズを返します。
      戻り値:
      最小優先サイズ
    • getPreferredSize

      public Dimension getPreferredSize(JComponent c)
      ツリーを正しく表示するための優先サイズを返します。これは、getPreferredSize(c, true)のカバー・メソッドです。
      オーバーライド:
      getPreferredSize、クラスComponentUI
      パラメータ:
      c - コンポーネント
      戻り値:
      コンポーネント内のツリーを表すのに優先されるサイズ
      関連項目:
    • getPreferredSize

      public Dimension getPreferredSize(JComponent c, boolean checkConsistency)
      cでツリーを表すための推奨サイズを返します。 checkConsistencytrueの場合は、最初にcheckConsistencyがメッセージされます。
      パラメータ:
      c - コンポーネント
      checkConsistency - trueの整合性がチェックされている場合
      戻り値:
      コンポーネント内のツリーを表すのに優先されるサイズ
    • getMinimumSize

      public Dimension getMinimumSize(JComponent c)
      このコンポーネントの最小サイズを返します。 推奨される最小サイズまたは0, 0になります。
      オーバーライド:
      getMinimumSize、クラスComponentUI
      パラメータ:
      c - 最小サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
      戻り値:
      Dimensionオブジェクトまたはnull
      関連項目:
    • getMaximumSize

      public Dimension getMaximumSize(JComponent c)
      このコンポーネントの最大サイズを返します。インスタンスが現在JTreeにある場合は推奨サイズ、そうでない場合は0, 0です。
      オーバーライド:
      getMaximumSize、クラスComponentUI
      パラメータ:
      c - 最大サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
      戻り値:
      Dimensionオブジェクトまたはnull
      関連項目:
    • completeEditing

      protected void completeEditing()
      編集中セッションを中止するメッセージを送ります。 レシーバがLook & Feelを提供しているUIがgetInvokesStopCellEditingからtrueを返す場合、stopCellEditingが現在のエディタで呼び出されます。 次にcompleteEditingがfalseまたはtrueでメッセージとして送られます。falseは、中途の編集を取り消します。
    • completeEditing

      protected void completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
      編集中セッションを中止します。 messageStoptrueの場合、stopEditingでエディタにメッセージが送信されます。messageCanceltrueであれば、エディタはcancelEditingでメッセージされます。 messageTreetrueの場合、treeModelvalueForPathChangedでメッセージされます。
      パラメータ:
      messageStop - 編集を中止するメッセージ
      messageCancel - 編集を取消するメッセージ
      messageTree - ツリーへのメッセージ
    • startEditing

      protected boolean startEditing(TreePath path, MouseEvent event)
      cellEditorがあり、shouldSelectCelltrueを返した場合、ノードの編集を開始します。

      このメソッドは、パスが有効であり、可視であると見なします。

      パラメータ:
      path - ツリー・パス
      event - マウス・イベント
      戻り値:
      true編集が成功した場合
    • checkForClickInExpandControl

      protected void checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
      mouseXおよびmouseYrowの展開または折りたたみの領域にある場合、このメソッドは行の展開状態を切り替えます。
      パラメータ:
      path - ツリー・パス
      mouseX - X座標
      mouseY - Y座標
    • isLocationInExpandControl

      protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
      mouseXおよびmouseYがノードの展開/縮小に使用される行の領域にあり、rowのノードがリーフを表していない場合は、trueを返します。
      パラメータ:
      path - ツリー・パス
      mouseX - X座標
      mouseY - Y座標
      戻り値:
      true:マウス・カーソルがノードの展開/縮小に使用される行の領域にあり、ノードがリーフでない場合。
    • handleExpandControlClick

      protected void handleExpandControlClick(TreePath path, int mouseX, int mouseY)
      ユーザーが特定の行をクリックすると、toggleExpandStateが呼び出されます。
      パラメータ:
      path - ツリー・パス
      mouseX - X座標
      mouseY - Y座標
    • toggleExpandState

      protected void toggleExpandState(TreePath path)
      パスが展開されてない場合は展開し、行が展開されている場合は折りたたみます。 パスを展開し、JTreeが展開時にスクロールする場合、ensureRowsAreVisibleが呼び出され、できるだけ多くの子をスクロールして(パスの最後の子孫にスクロールしようとします。)が表示されます。
      パラメータ:
      path - ツリー・パス
    • isToggleSelectionEvent

      protected boolean isToggleSelectionEvent(MouseEvent event)
      trueを返すと、ノード上のマウス・イベントによって、マウスの下にある行の選択のみが切り替わります。
      パラメータ:
      event - マウス・イベント
      戻り値:
      trueノード上のマウス・イベントで選択項目を切り替える必要がある場合
    • isMultiSelectEvent

      protected boolean isMultiSelectEvent(MouseEvent event)
      trueを返すと、ノード上のマウス・イベントがアンカー・ポイントから選択されることを示します。
      パラメータ:
      event - マウス・イベント
      戻り値:
      ノード上のマウス・イベントがアンカー・ポイントから選択する必要がある場合はtrue
    • isToggleEvent

      protected boolean isToggleEvent(MouseEvent event)
      trueを返すことは、イベントに基づいてマウスの下の行を切り替える必要があることを示します。 これは、checkForClickInExpandControlの後に呼び出されます。これは、ロケーションがexpand (toggle)コントロールにないことを示します。
      パラメータ:
      event - マウス・イベント
      戻り値:
      trueマウスの下の行をトグルする必要がある場合
    • selectPathForEvent

      protected void selectPathForEvent(TreePath path, MouseEvent event)
      特定の行に対するMouseEventに基づいて選択を更新するためにメッセージ化されます。 イベントが選択切替えイベントの場合、行が選択または選択解除されます。 イベントが複数選択イベントを示す場合、選択はアンカー・ポイントから更新されます。 そうでない場合は行が選択され、イベントが切替えイベントを示す場合は行の展開または折りたたみが行われます。
      パラメータ:
      path - 選択されたパス
      event - マウス・イベント
    • isLeaf

      protected boolean isLeaf(int row)
      rowのノードがリーフの場合、trueを返します。
      パラメータ:
      row - 行
      戻り値:
      rowのノードがリーフの場合はtrue
    • updateLeadSelectionRow

      protected void updateLeadSelectionRow()
      選択のリード行を更新します。
      導入されたバージョン:
      1.7
    • getLeadSelectionRow

      protected int getLeadSelectionRow()
      選択のリード行を返します。
      戻り値:
      選択リード行
      導入されたバージョン:
      1.7