public interface TreeCellRenderer
| 修飾子と型 | メソッドと説明 | 
|---|---|
| Component | getTreeCellRendererComponent(JTree tree,                             Object value,                             boolean selected,                             boolean expanded,                             boolean leaf,                             int row,                             boolean hasFocus)現在のツリーセルの値を  valueに設定します。 | 
Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
value に設定します。selected が true の場合は、セルは選択されているものとして描画されます。expanded が true であれば、ノードは現在展開されています。leaf が true であれば、ノードは葉を表します。hasFocus が true であれば、ノードに現在フォーカスがあります。tree が JTree の場合、レシーバは設定中です。レンダリングが値を描画するのに使う Component を返します。
 
ツリーの現在のドラッグ & ドロップ位置を示すセルがあれば、TreeCellRenderer もこのセルを描画するために使用されます。このレンダリングがドラッグ & ドロップ位置の描画を考慮する場合、ツリーを直接照会して、指定の行がドロップ位置を表しているかどうかを確認することになっています。
 
     JTree.DropLocation dropLocation = tree.getDropLocation();
     if (dropLocation != null
             && dropLocation.getChildIndex() == -1
             && tree.getRowForPath(dropLocation.getPath()) == row) {
         // this row represents the current drop location
         // so render it specially, perhaps with a different color
     }
 Component バグまたは機能を送信 
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.