|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjavax.swing.tree.DefaultTreeSelectionModel
public class DefaultTreeSelectionModel
TreeSelectionModel µðÆúÆ® ±¸ÇöÀÔ´Ï´Ù. ¸®½º³Ê´Â ÇàÀÌ º¯°æµÇ¾úÀ» ¶§´Â ¾Æ´Ï°Ô ¼±Åà ¹üÀ§ÀÇ ÆÐ½º°¡ º¯°æµÇ¾úÀ» ¶§¿¡ ÅëÁö¸¦ ¹Þ½À´Ï´Ù. ÇàÀÇ º¯°æÀ» ÃßÀûÇÒ ¼ö ÀÖµµ·Ï ÇÏ·Á¸é, Æ®¸®»ó¿¡¼ Àü°³ À̺¥Æ®ÀÇ ¸®½º³Ê°¡ µÇ´Â °ÍÀ¸·Î ÇàÀÇ º¯°æÀ» ÆÇÁ¤ÇÕ´Ï´Ù.
resetRowSelection´Â ¼±ÅÃµÈ ÆÐ½º¸¦ °»½ÅÇÏ´Â ¸Þ¼µå·ÎºÎÅÍ È£ÃâÇÕ´Ï´Ù. ¼±ÅÃÇÒ ¼ö ÀÖ´Â °ÍÀ» ÇÊÅ͸µ Çϱâ À§Çؼ
ÀÌ·¯ÇÑ ¸Þ¼µåÀÇ ¾î¶² °ÍÀÎÁö¸¦ »ó¼ÓÇÏ´Â °æ¿ì, ½´ÆÛ Ŭ·¡½º¿¡ ¸Þ¼¼Áö¸¦ º¸³»Áö ¾ÊÀ¸¸é, ¹Ýµå½Ã resetRowSelection
¸Þ¼¼Áö¸¦ º¸³»µµ·Ï
ÇÕ´Ï´Ù.
°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í
ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ Áö¿øÀº
´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. JDK ¹öÀü
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 ()
ºñ¾îÀÖ´Â »õ·Î¿î 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 ()
¼±Åà ¹üÀ§°¡ ÇöÀçºñ¾îÀÖ´Â °æ¿ì¿¡ 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 ()
ÀÌ °´Ã¼ÀÇ ÇÁ·ÎÆÛƼ¸¦ Ç¥½Ã ¹× ½Äº°Çϴ ij¸¯ÅÍ ¶óÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. |
|
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°¡ ¼±ÅõǾúÀ» °æ¿ì, 1°³ÀÇ 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)
paths
°¡ 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
. Æ®¸® ¼±Åà ¸®½º³Ê°¡ µî·ÏµÇÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿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));ÀÌ·¯ÇÑ ¸®½º³Ê°¡ ¾ø´Â °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
listenerType
- ¿ä±¸µÇ´Â ¸®½º³ÊÀÇ ÇüÅÂ. java.util.EventListener
ÇÏÀ§ ÀÎÅÍÆäÀ̽º¸¦ ÁöÁ¤
FooListener
·Î
¼ µî·ÏµÇ¾î ¸ðµç °´Ã¼ÀÇ ¹è¿. ¸®½º³Ê°¡ µî·ÏµÇÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿À» µ¹·ÁÁØ´Ù
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
. ÇÁ·ÎÆÛƼ º¯°æ ¸®½º³Ê°¡ µî·ÏµÇÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿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 (¶Ç´Â °ø¹é)ÀÇ °æ¿ì, ÀÌ °´Ã¼°¡ 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 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.