|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Object javax.swing.tree.DefaultTreeSelectionModel
public class DefaultTreeSelectionModel
TreeSelectionModel 의 디폴트 구현입니다. 청취자는, 행이 변경되었을 때는 아니게 선택 범위의 패스가 변경되었을 때에 통지를 받습니다. 행의 변경을 추적할 수 있도록(듯이) 하려면 , 트리상에서 전개 이벤트의 청취자가 되는 것으로, 행의 변경을 판정합니다.
resetRowSelection 는 선택된 패스를 갱신하는 메소드로부터 불려 갑니다. 선택할 수 있는 것을 필터링 하기 위해서, 이러한 메소드의 어떤 것인지를 서브 클래스화하는 경우, 슈퍼 클래스에 메세지를 보내지 않으면, 반드시 resetRowSelection
메세지를 보내도록(듯이) 합니다.
경고: 이 클래스의 직렬화 된 객체는, 향후의 Swing 릴리스와 호환은 아니게 될 예정입니다. 현재의 직렬화의 지원는, 단기간의 운용이나, 같은 버젼의 Swing 를 실행하는 어플리케이션간의 RMI 에 적절하고 있습니다. JDK Version 1.4 이후, 모든 JavaBeans™ 의 장기간의 운용 지원는,java.beans
패키지에 추가되고 있습니다. 자세한 것은,XMLEncoder
를 참조해 주세요.
JTree
필드의 개요 | |
---|---|
protected SwingPropertyChangeSupport |
changeSupport
메세지를 받아들이는 등록이 끝난 청취자를 위해서(때문에) 사용합니다. |
protected int |
leadIndex
선택 범위의 리드 패스의 인덱스입니다. |
protected TreePath |
leadPath
추가된 마지막 패스입니다. |
protected int |
leadRow
리드행입니다. |
protected EventListenerList |
listenerList
이벤트 청취자 리스트입니다. |
protected DefaultListSelectionModel |
listSelectionModel
리스트 선택 모델의 갱신을 처리합니다. |
protected RowMapper |
rowMapper
지정의 패스에 행을 제공합니다. |
protected TreePath [] |
selection
현재 선택되고 있는 패스입니다. |
static String |
SELECTION_MODE_PROPERTY
selectionMode 의 프로퍼티명입니다. |
protected int |
selectionMode
선택 모드는, SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION 의 어떤 것인가가 됩니다. |
인터페이스 javax.swing.tree. TreeSelectionModel 로부터 상속된 필드 |
---|
CONTIGUOUS_TREE_SELECTION , DISCONTIGUOUS_TREE_SELECTION , SINGLE_TREE_SELECTION |
생성자 의 개요 | |
---|---|
DefaultTreeSelectionModel ()
빈 상태(empty)의 새로운 DefaultTreeSelectionMode 의 인스턴스를 생성합니다. |
메소드의 개요 | ||
---|---|---|
void |
addPropertyChangeListener (PropertyChangeListener listener)
PropertyChangeListener 를 청취자 리스트에 추가합니다. |
|
void |
addSelectionPath (TreePath path)
현재의 선택 범위에 패스를 추가합니다. |
|
void |
addSelectionPaths (TreePath [] paths)
현재의 선택 범위에 패스를 추가합니다. |
|
void |
addTreeSelectionListener (TreeSelectionListener x)
선택된 TreePath 의 설정이 변경될 때마다 통지를 받는 청취자의 리스트에 x 를 추가합니다. |
|
protected boolean |
arePathsContiguous (TreePath [] paths)
패스가 연속하고 있는지, 이 객체에 RowMapper 가 없는 경우, true 를 돌려줍니다. |
|
protected boolean |
canPathsBeAdded (TreePath [] paths)
TreePath 의 특정의 설정을 추가할 수 있을지 어떨지 판정하기 위해서 사용합니다. |
|
protected boolean |
canPathsBeRemoved (TreePath [] paths)
모델의 연속성을 부수지 않고 패스를 삭제할 수 있는 경우에 true 를 돌려줍니다. |
|
void |
clearSelection ()
현재의 선택 범위를 비웁니다. |
|
Object |
clone ()
같은 선택 범위를 가지는 이 객체의 복제를 돌려줍니다. |
|
protected void |
fireValueChanged (TreeSelectionEvent e)
이 객체의 트리 선택 이벤트의 대상으로 해 등록하고 있는 청취자 모두에게 통지합니다. |
|
TreePath |
getLeadSelectionPath ()
추가된 마지막 패스를 돌려줍니다. |
|
int |
getLeadSelectionRow ()
선택 범위의 리드 인덱스를 돌려줍니다. |
|
|
getListeners (Class <T> listenerType)
이 모델에 FooListener 로서 현재 등록되어 모든 객체의 배열을 돌려줍니다. |
|
int |
getMaxSelectionRow ()
선택한 현재의 TreePath 의 설정의 RowMapper 로부터 취득한 최대치를 돌려줍니다. |
|
int |
getMinSelectionRow ()
선택한 현재의 TreePath 의 설정의 RowMapper 로부터 취득한 최소치를 돌려줍니다. |
|
PropertyChangeListener [] |
getPropertyChangeListeners ()
이 DefaultTreeSelectionModel 에 등록되어 모든 프로퍼티 변경 청취자의 배열을 돌려줍니다. |
|
RowMapper |
getRowMapper ()
TreePath 를 행에 맵 할 수 있는 RowMapper 의 인스턴스를 돌려줍니다. |
|
int |
getSelectionCount ()
선택되고 있는 패스의 수를 돌려줍니다. |
|
int |
getSelectionMode ()
선택 모드를 돌려줍니다. |
|
TreePath |
getSelectionPath ()
선택 범위의 선두의 패스를 돌려줍니다. |
|
TreePath [] |
getSelectionPaths ()
선택 범위의 패스를 돌려줍니다. |
|
int[] |
getSelectionRows ()
현재 선택 떠날 수 있어 모든 행을 돌려줍니다. |
|
TreeSelectionListener [] |
getTreeSelectionListeners ()
이 모델에 등록된, 모든 트리 선택 청취자로부터 완성되는 배열을 돌려줍니다. |
|
protected void |
insureRowContinuity ()
현재 선택되고 있는 TreePath 가 현재의 선택 모드로 유효한가를 확인합니다. |
|
protected void |
insureUniqueness ()
이 메소드는 폐지되었기 때문에, 그 구현은 조작 불능입니다. |
|
boolean |
isPathSelected (TreePath path)
패스 path 가 현재의 선택 범위에 있는 경우에 true 를 돌려줍니다. |
|
boolean |
isRowSelected (int row)
row 로 식별되는 행이 선택되고 있는 경우에 true 를 돌려줍니다. |
|
boolean |
isSelectionEmpty ()
선택 범위가 현재빈 상태(empty)의 경우에 true 를 돌려줍니다. |
|
protected void |
notifyPathChange (Vector <javax.swing.tree.PathPlaceHolder> changedPaths,
TreePath oldLeadSelection)
path 내의 변경을 청취자에게 통지합니다. |
|
void |
removePropertyChangeListener (PropertyChangeListener listener)
PropertyChangeListener 를 청취자 리스트로부터 삭제합니다. |
|
void |
removeSelectionPath (TreePath path)
선택 범위로부터 패스를 삭제합니다. |
|
void |
removeSelectionPaths (TreePath [] paths)
선택 범위로부터 패스를 삭제합니다. |
|
void |
removeTreeSelectionListener (TreeSelectionListener x)
선택된 TreePath 의 설정이 변경될 때마다 통지를 받는 청취자의 리스트로부터 x 를 삭제합니다. |
|
void |
resetRowSelection ()
이 객체의 TreePath 로부터 행에의 매핑을 갱신합니다. |
|
void |
setRowMapper (RowMapper newMapper)
RowMapper 의 인스턴스를 설정합니다. |
|
void |
setSelectionMode (int mode)
선택 모드를 설정합니다. |
|
void |
setSelectionPath (TreePath path)
선택 범위를 패스로 설정합니다. |
|
void |
setSelectionPaths (TreePath [] pPaths)
선택 범위를 paths 의 패스로 설정합니다. |
|
String |
toString ()
이 객체의 프로퍼티을 표시 및 식별하는 캐릭터 라인을 돌려줍니다. |
|
protected void |
updateLeadIndex ()
leadIndex 인스턴스 변수를 갱신합니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
필드의 상세 |
---|
public static final String SELECTION_MODE_PROPERTY
protected SwingPropertyChangeSupport changeSupport
protected TreePath [] selection
protected EventListenerList listenerList
protected transient RowMapper rowMapper
protected DefaultListSelectionModel listSelectionModel
protected int selectionMode
protected TreePath leadPath
protected int leadIndex
protected int leadRow
생성자 의 상세 |
---|
public DefaultTreeSelectionModel()
메소드의 상세 |
---|
public void setRowMapper(RowMapper newMapper)
TreeSelectionModel
내의 setRowMapper
public RowMapper getRowMapper()
TreeSelectionModel
내의 getRowMapper
public void setSelectionMode(int mode)
DISCONTIGUOUS_TREE_SELECTION
모델이라고 보여집니다.
현재의 선택 범위가 새로운 모드에 대해서 유효하지 않은 경우는 선택 범위를 변경할 수 있습니다. 예를 들어, 모드가 SINGLE_TREE_SELECTION
으로 변경했을 때에 3 개의 TreePath 가 선택되었을 경우, 하나의 TreePath 만을 선택할 수 있습니다. 어느 TreePath 를 선택할까는 사용하는 특정의 구현에 의해 정해집니다.
모드를 정의되어 있지 않은 타입으로 설정하면(자), 모드는 DISCONTIGUOUS_TREE_SELECTION
가 됩니다.
TreeSelectionModel
내의 setSelectionMode
public int getSelectionMode()
SINGLE_TREE_SELECTION
,DISCONTIGUOUS_TREE_SELECTION
,CONTIGUOUS_TREE_SELECTION
의 어떤 것인가가 됩니다.
TreeSelectionModel
내의 getSelectionMode
public void setSelectionPath(TreePath path)
path
가 null 의 경우는 clearSelection
를 호출했을 경우와 같게 됩니다.
TreeSelectionModel
내의 setSelectionPath
path
- 선택하는 새로운 패스public void setSelectionPaths(TreePath [] pPaths)
paths
가 null 의 경우, 이것은 clearSelection
를 호출하는 것과 같은 효과가 있습니다.
리드 패스는 pPaths
의 마지막 패스로 설정됩니다.
선택 모드가 CONTIGUOUS_TREE_SELECTION
의 경우에, 신규 패스의 추가에 의해 선택 범위가 불연속이 되면(자), 선택 범위는 paths
의 최초의 TreePath 에 리셋 됩니다.
TreeSelectionModel
내의 setSelectionPaths
pPaths
- 새로운 선택 범위public void addSelectionPath(TreePath path)
path
가 null 의 경우는 영향은 없습니다.
TreeSelectionModel
내의 addSelectionPath
path
- 현재의 선택 범위에 추가하는 새로운 패스public void addSelectionPaths(TreePath [] paths)
path
가 null 의 경우는 영향은 없습니다.
리드 패스는 paths
의 마지막 패스로 설정됩니다.
선택 모드가 CONTIGUOUS_TREE_SELECTION
의 경우, 패스를 새롭게 추가하면(자) 선택 범위가 불연속이 됩니다. 즉, 선택 범위가 2 개가 됩니다. paths
의 TreePath 가 연속하고 있는 경우는, 선택 범위는 이러한 TreePath 가 됩니다. 그렇지 않은 경우는, TreePath 가 연속하지 않기 때문에, 선택 범위는 paths
의 최초의 TreePath 가 됩니다.
TreeSelectionModel
내의 addSelectionPaths
paths
- 현재의 선택 범위에 추가하는 새로운 패스public void removeSelectionPath(TreePath path)
path
가 null 의 경우는 영향은 없습니다.
TreeSelectionModel
내의 removeSelectionPath
path
- 선택 범위로부터 삭제하는 패스public void removeSelectionPaths(TreePath [] paths)
path
가 null 의 경우는 영향은 없습니다.
TreeSelectionModel
내의 removeSelectionPaths
paths
- 선택 범위로부터 삭제하는 패스public TreePath getSelectionPath()
TreeSelectionModel
내의 getSelectionPath
public TreePath [] getSelectionPaths()
TreeSelectionModel
내의 getSelectionPaths
public int getSelectionCount()
TreeSelectionModel
내의 getSelectionCount
public boolean isPathSelected(TreePath path)
path
가 현재의 선택 범위에 있는 경우에 true 를 돌려줍니다.
TreeSelectionModel
내의 isPathSelected
public boolean isSelectionEmpty()
TreeSelectionModel
내의 isSelectionEmpty
public void clearSelection()
TreeSelectionModel
내의 clearSelection
public void addTreeSelectionListener(TreeSelectionListener x)
TreeSelectionModel
내의 addTreeSelectionListener
x
- 추가되는 새로운 청취자public void removeTreeSelectionListener(TreeSelectionListener x)
TreeSelectionModel
내의 removeTreeSelectionListener
x
- 삭제하는 청취자public TreeSelectionListener [] getTreeSelectionListeners()
TreeSelectionListener
전부.
트리 선택 청취자가 현재 등록되지 않은 경우는
빈 상태(empty)의 배열addTreeSelectionListener(javax.swing.event.TreeSelectionListener)
,
removeTreeSelectionListener(javax.swing.event.TreeSelectionListener)
protected void fireValueChanged(TreeSelectionEvent e)
addTreeSelectionListener(javax.swing.event.TreeSelectionListener)
,
EventListenerList
public <T extends EventListener > T[] getListeners(Class <T> listenerType)
FooListener
로서 현재 등록되어 모든 객체의 배열을 돌려줍니다. FooListener
는,addFooListener
메소드를 사용해 등록합니다.
FooListener.class
라고 하는 클래스 리터럴을 사용해,listenerType
인수를 지정할 수 있습니다. 예를 들어, 다음의 코드를 사용해,DefaultTreeSelectionModel
m
를 그 트리 선택 청취자에게 조회할 수 있습니다.
TreeSelectionListener[] tsls = (TreeSelectionListener[])(m.getListeners(TreeSelectionListener.class));이러한 청취자가 없는 경우는 빈 상태(empty)의 배열을 돌려줍니다.
listenerType
- 요구되는 청취자의 형태. 이 파라미터는,
java.util.EventListener
의
인터페이스를 지정한다
FooListener
로서 등록되어 모든 객체의 배열.
이 컴퍼넌트상의 FooListener
.
그러한 청취자가 추가되어 있지 않은 경우는
빈 상태(empty)의 배열
ClassCastException
- listenerType
가
java.util.EventListener
를 구현하는 클래스 또는
인터페이스를 지정하지 않는 경우getTreeSelectionListeners()
,
getPropertyChangeListeners()
public int[] getSelectionRows()
TreeSelectionModel
내의 getSelectionRows
public int getMinSelectionRow()
TreeSelectionModel
내의 getMinSelectionRow
public int getMaxSelectionRow()
TreeSelectionModel
내의 getMaxSelectionRow
public boolean isRowSelected(int row)
row
로 식별되는 행이 선택되고 있는 경우에 true 를 돌려줍니다.
TreeSelectionModel
내의 isRowSelected
public void resetRowSelection()
일반적으로은 호출할 필요는 없습니다. JTree 와 거기에 관련하는 Listeners 가 호출합니다. 독자적인 View 클래스를 구현중의 경우는 스스로 호출할 필요가 있습니다.
insureRowContinuity
를 호출해, 현재 선택되고 있는 TreePaths 가 아직 선택 모드로 유효한 것을 확인합니다.
TreeSelectionModel
내의 resetRowSelection
public int getLeadSelectionRow()
TreeSelectionModel
내의 getLeadSelectionRow
public TreePath getLeadSelectionPath()
TreeSelectionModel
내의 getLeadSelectionPath
public void addPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeEvent 는, 선택 범위 모드가 변경되면(자) 트리거됩니다.
TreeSelectionModel
내의 addPropertyChangeListener
listener
- 추가하는 PropertyChangeListenerpublic void removePropertyChangeListener(PropertyChangeListener listener)
TreeSelectionModel
내의 removePropertyChangeListener
listener
- 삭제하는 PropertyChangeListenerpublic PropertyChangeListener [] getPropertyChangeListeners()
DefaultTreeSelectionModel
에 등록되어 모든 프로퍼티 변경 청취자의 배열을 돌려줍니다.
PropertyChangeListener
전부.
프로퍼티 변경 청취자가 현재 등록되지 않은 경우는
빈 상태(empty)의 배열addPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
protected void insureRowContinuity()
TreePath
가 현재의 선택 모드로 유효한가를 확인합니다. 선택 모드가 CONTIGUOUS_TREE_SELECTION
때에 RowMapper
가 존재하고 있는 경우, 이 메소드는 모든 행이 연속하고 있는지 (소트 했을 때에, 모든 행이 간격을 비우지 않고 순서 자주(잘) 줄지어 있는지)를 확인합니다. 선택 범위가 연속하지 않은 경우는, 소트 했을 때에 연속한 행의 최초세트가 포함되도록(듯이) 리셋 됩니다.
선택 모드가 SINGLE_TREE_SELECTION
의 경우에, 복수의 TreePath 가 선택되면(자), 선택 범위는, 현재 선택되고 있는 최초의 패스를 포함하도록(듯이) 리셋 됩니다.
protected boolean arePathsContiguous(TreePath [] paths)
protected boolean canPathsBeAdded(TreePath [] paths)
TreePath
의 특정의 설정을 추가할 수 있을지 어떨지 판정하기 위해서 사용합니다. paths
가 null (또는 빈 상태(empty))의 경우, 이 객체가 RowMapper 를 가지지 않는 경우, 현재 선택되어 있지 않은 경우, 선택 모드가 DISCONTIGUOUS_TREE_SELECTION
의 경우, 또는 현재의 선택 범위에 패스를 추가해도,TreePath
가 연속 설정인 경우에, true 를 돌려줍니다.
protected boolean canPathsBeRemoved(TreePath [] paths)
protected void notifyPathChange(Vector <javax.swing.tree.PathPlaceHolder> changedPaths, TreePath oldLeadSelection)
protected void updateLeadIndex()
protected void insureUniqueness()
public String toString()
Object
내의 toString
public Object clone() throws CloneNotSupportedException
Object
내의 clone
CloneNotSupportedException
- 이 클래스의 인스턴스에서는
throw 되지 않는Cloneable
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.