|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.tree.DefaultTreeSelectionModel
TreeSelectionModel ÀÇ µðÆúÆ® ±¸ÇöÀÔ´Ï´Ù. ûÃëÀÚ´Â ÇàÀÌ º¯°æµÇ¾úÀ» ¶§´Â ¾Æ´Ï°Ô ¼±Åà ¹üÀ§ÀÇ ÆÐ½º°¡ º¯°æµÇ¾úÀ» ¶§¿¡ ÅëÁö¸¦ ¹Þ½À´Ï´Ù. ÇàÀÇ º¯°æÀ» ÃßÀûÇÒ ¼ö ÀÖ°Ô ÇÏ·Á¸é , Æ®¸®»ó¿¡¼ Àü°³ À̺¥Æ®ÀÇ Ã»ÃëÀÚ°¡ µÇ´Â °ÍÀ¸·Î, ÇàÀÇ º¯°æÀ» ÆÇÁ¤ÇÕ´Ï´Ù.
resetRowSelection ´Â ¼±ÅÃµÈ ÆÐ½º¸¦ °»½ÅÇÏ´Â ¸Þ¼Òµå·ÎºÎÅÍ ºÒ·Á °©´Ï´Ù. ¼±ÅÃÇÒ ¼ö ÀÖ´Â °ÍÀ» ÇÊÅ͸µ Çϱâ À§Çؼ, ÀÌ·¯ÇÑ ¸Þ¼ÒµåÀÇ ¾î¶² °ÍÀÎÁö¸¦ ¼ºê Ŭ·¡½ºÈÇÏ´Â °æ¿ì, ½´ÆÛ Ŭ·¡½º¿¡ ¸Þ¼¼Áö¸¦ º¸³»Áö ¾ÊÀ¸¸é, ¹Ýµå½Ã resetRowSelection
¸Þ¼¼Áö¸¦ º¸³»µµ·Ï(µíÀÌ) ÇÕ´Ï´Ù.
°æ°í:
ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ ¿ÀºêÁ§Æ®´Â ÇâÈÄÀÇ Swing ÀÇ ¸±¸®½º¿Í´Â ȣȯ¼ºÀ» °¡ÁöÁö ¾Ê½À´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈ ¼Æ÷Æ®´Â ´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÁ¯ÀÇ Swing ¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI ¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. 1.4 ¿¡¼´Â ¸ðµç JavaBeansTM ÀÇ Àå±â ¿î¿ë ¼Æ÷Æ®°¡, 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 ()
¼±Åà ¹üÀ§ÀÇ ¸®µå À妽º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
EventListener [] |
getListeners (Class listenerType)
ÀÌ ¸ðµ¨»ó¿¡¼ FooListener ·Î¼ ÇöÀç µî·ÏµÇ¾î ÀÖ´Â ¸ðµç ¿ÀºêÁ§Æ®·ÎºÎÅÍ µÇ´Â ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
int |
getMaxSelectionRow ()
¼±ÅÃÇÑ ÇöÀçÀÇ TreePath ÀÇ ¼³Á¤ÀÇ RowMapper ·ÎºÎÅÍ ÃëµæÇÑ ÃÖ´ëÄ¡¸¦ µ¹·ÁÁÝ´Ï´Ù. |
int |
getMinSelectionRow ()
¼±ÅÃÇÑ ÇöÀçÀÇ TreePath ÀÇ ¼³Á¤ÀÇ RowMapper ·ÎºÎÅÍ ÃëµæÇÑ ÃÖ¼ÒÄ¡¸¦ µ¹·ÁÁÝ´Ï´Ù. |
PropertyChangeListener [] |
getPropertyChangeListeners ()
ÀÌ DefaultTreeSelectionModel ¿¡ µî·ÏµÈ, ¸ðµç ÇÁ·ÎÆÛƼ º¯°æ ûÃëÀڷκÎÅÍ µÇ´Â ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
RowMapper |
getRowMapper ()
TreePath ¸¦ Çà¿¡ MAP ÇÒ ¼ö ÀÖ´Â RowMapper ÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. |
int |
getSelectionCount ()
¼±Åõǰí ÀÖ´Â ÆÐ½ºÀÇ ¼ö¸¦ µ¹·ÁÁÝ´Ï´Ù. |
int |
getSelectionMode ()
ÇöÀçÀÇ ¼±Åà ¸ðµå¸¦ µ¹·ÁÁÝ´Ï´Ù. |
TreePath |
getSelectionPath ()
¼±Åà ¹üÀ§ÀÇ ÃÖÃÊÀÇ ÆÐ½º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
TreePath [] |
getSelectionPaths ()
¼±Åà ¹üÀ§ÀÇ ÆÐ½º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
int[] |
getSelectionRows ()
ÇöÀç ¼±Åà ¶°³¯ ¼ö ÀÖ¾î ¸ðµç ÇàÀ» µ¹·ÁÁÝ´Ï´Ù. |
TreeSelectionListener [] |
getTreeSelectionListeners ()
ÀÌ ¸ðµ¨¿¡ µî·ÏµÈ, ¸ðµç Æ®¸® ¼±Åà ûÃëÀڷκÎÅÍ µÇ´Â ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
protected void |
insureRowContinuity ()
ÇöÀç ¼±Åõǰí ÀÖ´Â TreePaths °¡ ÇöÀçÀÇ ¼±Åà ¸ðµå·Î À¯È¿ÇѰ¡¸¦ È®ÀÎÇÕ´Ï´Ù. |
protected void |
insureUniqueness ()
ÀÌ ¸Þ¼Òµå´Â ÇöÀç »ç¿ëµÇ¾î ÀÖÁö ¾ÊÀº µ¥´Ù°¡, ±× ±¸ÇöÀº Á¶ÀÛ ºÒ´ÉÀÔ´Ï´Ù. |
boolean |
isPathSelected (TreePath path)
ÆÐ½º path °¡ ÇöÀçÀÇ ¼±Åà ¹üÀ§¿¡ ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
boolean |
isRowSelected (int row)
row ·Î ½Äº°µÇ´Â ÇàÀÌ ¼±Åõǰí ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
boolean |
isSelectionEmpty ()
¼±Åà ¹üÀ§°¡ ÇöÀçºñ¾úÀ» °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
protected void |
notifyPathChange (Vector 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 °¡ ¼±ÅõǾúÀ» °æ¿ì, ÇϳªÀÇ 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
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
,
EventListenerList
public EventListener [] getListeners(Class 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()
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 changedPaths, TreePath oldLeadSelection)
protected void updateLeadIndex()
protected void insureUniqueness()
public String toString()
Object
³»ÀÇ toString
public Object clone() throws CloneNotSupportedException
Object
³»ÀÇ clone
CloneNotSupportedException
- ÀÌ Å¬·¡½ºÀÇ ÀνºÅϽº·Î ½½·Î¿ì µÇÁö ¾Ê´ÂCloneable
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ ÀÖ¾î¼ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.