|
JavaTM Platform Standard Ed. 6 |
|||||||||
전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
public interface TreeCellRenderer
트리 노드를 표시하는 객체의 요건을 정의합니다. 커스텀 아이콘을 표시하는 트리 셀 렌더링의 구현예는, 「The Java Tutorial」의「How to Use Trees」를 참조해 주세요.
메소드의 개요 | |
---|---|
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 의 경우는, 셀은 선택되고 있는 것으로서 draw 됩니다. expanded
가 true 이면, 노드는 현재 전개되고 있습니다. leaf
가 true 이면, 노드는 잎을 나타냅니다. hasFocus
가 true 이면, 노드에 현재 포커스가 있습니다. tree
가 JTree
의 경우, 리시버는 설정중입니다. 렌더링이 값을 draw 하는데 사용하는 Component
를 돌려줍니다.
트리의 현재의 드래그&드롭 위치를 나타내는 셀이 있으면,TableCellRenderer
도 이 셀을 draw 하기 위해서 사용됩니다. 이 렌더링이 드래그&드롭 위치의 draw를 고려하는 경우, 트리를 직접 조회해, 지정의 행이 드롭 위치를 나타내고 있는지 어떤지를 확인하게 되어 있습니다.
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
}
- 반환값:
- 렌더링이 값을 draw 하는데 사용하는
Component
|
JavaTM Platform Standard Ed. 6 |
|||||||||
전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.