JavaTM 2
Platform
Std.  Ed.  v1. 4.0

javax.swing
ÀÎÅÍÆäÀ̽º ListSelectionModel

±âÁ¸ÀÇ ±¸Çö Ŭ·¡½ºÀÇ À϶÷:
DefaultListSelectionModel

public interface ListSelectionModel

°íÁ¤ÀÇ À妽º¸¦ °¡Áö´Â °ªÀÇ ¸®½ºÆ®¸¦ Ç¥½ÃÇÏ´Â ÄÄÆÛ³ÍÆ®ÀÇ, ÇöÀçÀÇ ¼±Åà »óŸ¦ ³ªÅ¸³À´Ï´Ù. ¼±Åà »óÅ´ ±¸°£¼¼Æ®·Î¼­ ¸ðµ¨È­ µÇ¾î °¢ ±¸°£Àº ¼±ÅÃµÈ ¸®½ºÆ® ¿ä¼ÒÀÇ ¿¬¼Ó ¹üÀ§¸¦ ³ªÅ¸³À´Ï´Ù. ¼±ÅÃµÈ ±¸°£¼¼Æ®¸¦ º¯°æÇÏ´Â ¸Þ¼Òµå´Â ¸ðµÎ, ´ÝÀº ±¸°£À» ³ªÅ¸³»´Â index0 ¿Í index1 ¸¦ 1 Á¶¿Í ÇÏ´Â À妽º¸¦ ÃëÇÕ´Ï´Ù. Áï, ±¸°£¿¡´Â index0 ¿Í index1 ÀÇ ¾çÂÊ ¸ðµÎ°¡ Æ÷ÇԵ˴ϴÙ.

°ü·Ã Ç׸ñ:
DefaultListSelectionModel

ÇʵåÀÇ °³¿ä
static int MULTIPLE_INTERVAL_SELECTION
          selectionMode ÇÁ·ÎÆÛƼÀÇ °ªÀÔ´Ï´Ù.
static int SINGLE_INTERVAL_SELECTION
          selectionMode ÇÁ·ÎÆÛƼÀÇ °ªÀÔ´Ï´Ù.
static int SINGLE_SELECTION
          selectionMode ÇÁ·ÎÆÛƼÀÇ °ªÀÔ´Ï´Ù.
 
¸Þ¼ÒµåÀÇ °³¿ä
 void addListSelectionListener (ListSelectionListener  x)
          ¼±Åà ¹üÀ§ÀÇ º¯°æÀÌ ÅëÁöµÇ´Â ûÃëÀÚ¸¦ ¸®½ºÆ®¿¡ Ãß°¡ÇÕ´Ï´Ù.
 void addSelectionInterval (int index0, int index1)
          ¼±Åà ¹üÀ§¸¦, ÇöÀçÀÇ ¼±Åà ¹üÀ§¿Í index0 ÀÌ»ó index1 ÀÌÇÏÀÇ À妽º°¡ °¡¸®Å°´Â ¹üÀ§¿ÍÀÇ È­ÁýÇÕÀ¸·Î º¯°æÇÕ´Ï´Ù.
 void clearSelection ()
          ¼±Åà ¹üÀ§¸¦ Çϴü¼Æ®·Î º¯°æÇÕ´Ï´Ù.
 int getAnchorSelectionIndex ()
          setSelectionInterval(), addSelectionInterval(), ¶Ç´Â removeSelectionInterval()ÀÇ Á÷ÀüÀÇ È£Ãâ·ÎºÎÅÍ, ÃÖÃÊÀÇ À妽º Àμö¸¦ µ¹·ÁÁÝ´Ï´Ù.
 int getLeadSelectionIndex ()
          setSelectionInterval(), addSelectionInterval(), ¶Ç´Â removeSelectionInterval()ÀÇ Á÷ÀüÀÇ È£Ãâ·ÎºÎÅÍ, 2 ¹øÂ°ÀÇ À妽º Àμö¸¦ µ¹·ÁÁÝ´Ï´Ù.
 int getMaxSelectionIndex ()
          ¸¶Áö¸·¿¡ ¼±ÅÃµÈ À妽º¸¦ µ¹·ÁÁÖ´ÂÁö ¼±Åà ¹üÀ§°¡ ºñ¾úÀ» °æ¿ì¿¡ -1 ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 int getMinSelectionIndex ()
          ÃÖÃÊ·Î ¼±ÅÃµÈ À妽º¸¦ µ¹·ÁÁÖ´ÂÁö ¼±Åà ¹üÀ§°¡ ºñ¾úÀ» °æ¿ì¿¡ -1 ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 int getSelectionMode ()
          ÇöÀçÀÇ ¼±Åà ¸ðµå¸¦ µ¹·ÁÁÝ´Ï´Ù.
 boolean getValueIsAdjusting ()
          °ªÀÌ ÀÏ·ÃÀÇ º¯°æÀ» ¹Þ°í ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 void insertIndexInterval (int index, int length, boolean before)
          index ÀÇ Àü/ÈĺÎÅÍ ½ÃÀ۵Ǵ length À妽º¸¦ »ðÀÔÇÕ´Ï´Ù.
 boolean isSelectedIndex (int index)
          ÁöÁ¤ÀÇ À妽º°¡ ¼±Åõǰí ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 boolean isSelectionEmpty ()
          À妽º°¡ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
 void removeIndexInterval (int index0, int index1)
          ¼±Åà ¸ðµ¨·ÎºÎÅÍ, index0 ¿Í index1 ¸¦ ¾ç´ÜÀ¸·Î¼­ Æ÷ÇÔÇÑ ±¸°£ÀÇ À妽º¸¦ »èÁ¦ÇÕ´Ï´Ù.
 void removeListSelectionListener (ListSelectionListener  x)
          ¼±Åà ¹üÀ§ÀÇ º¯°æÀÌ ÅëÁöµÇ´Â ûÃëÀÚ¸¦ ¸®½ºÆ®·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù.
 void removeSelectionInterval (int index0, int index1)
          ¼±Åà ¹üÀ§¸¦, ÇöÀçÀÇ ¼±Åà ¹üÀ§¿Í index0 ÀÌ»ó index1 ÀÌÇÏÀÇ À妽º°¡ °¡¸®Å°´Â ¹üÀ§¿ÍÀÇ Â÷ÀÌ ÁýÇÕÀ¸·Î º¯°æÇÕ´Ï´Ù.
 void setAnchorSelectionIndex (int index)
          ¼±Åà ¹üÀ§ÀÇ ¿¨Ä¿ À妽º¸¦ ¼³Á¤ÇÕ´Ï´Ù.
 void setLeadSelectionIndex (int index)
          ¼±Åà ¹üÀ§ÀÇ ¸®µå À妽º¸¦ ¼³Á¤ÇÕ´Ï´Ù.
 void setSelectionInterval (int index0, int index1)
          ¼±Åà ¹üÀ§¸¦ index0 ÀÌ»ó index1 ÀÌÇÏ·Î º¯°æÇÕ´Ï´Ù.
 void setSelectionMode (int selectionMode)
          ¼±Åà ¸ðµå¸¦ ¼³Á¤ÇÕ´Ï´Ù.
 void setValueIsAdjusting (boolean valueIsAdjusting)
          ÀÌ ÇÁ·ÎÆÛƼ´Â ¸ðµ¨ÀÇ °ª¿¡ Àû¿ëµÇ°í ÀÖ´Â º¯°æÀÌ ´ÜÀÏÀÇ À̺¥Æ®¶ó°í »ý°¢µÇ´Â °æ¿ì¿¡ true °¡ µË´Ï´Ù.
 

ÇʵåÀÇ »ó¼¼

SINGLE_SELECTION

public static final int SINGLE_SELECTION
selectionMode ÇÁ·ÎÆÛƼÀÇ °ªÀÔ´Ï´Ù. ¸®½ºÆ® À妽º¸¦ 1 ȸ¿¡ 1 °³ ¼±ÅÃÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
setSelectionMode(int) , Á¤¼ö ÇʵåÄ¡

SINGLE_INTERVAL_SELECTION

public static final int SINGLE_INTERVAL_SELECTION
selectionMode ÇÁ·ÎÆÛƼÀÇ °ªÀÔ´Ï´Ù. À妽ºÀÇ ¿¬¼Ó ¹üÀ§¸¦ 1 ȸ¿¡ 1 °³ ¼±ÅÃÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
setSelectionMode(int) , Á¤¼ö ÇʵåÄ¡

MULTIPLE_INTERVAL_SELECTION

public static final int MULTIPLE_INTERVAL_SELECTION
selectionMode ÇÁ·ÎÆÛƼÀÇ °ªÀÔ´Ï´Ù. À妽ºÀÇ ¿¬¼Ó ¹üÀ§¸¦ 1 ȸ¿¡ 1 °³ ÀÌ»ó ¼±ÅÃÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
setSelectionMode(int) , Á¤¼ö ÇʵåÄ¡
¸Þ¼ÒµåÀÇ »ó¼¼

setSelectionInterval

public void setSelectionInterval(int index0,
                                 int index1)
¼±Åà ¹üÀ§¸¦ index0 ÀÌ»ó index1 ÀÌÇÏ·Î º¯°æÇÕ´Ï´Ù. À̰Ϳ¡ ÀÇÇØ ÇöÀçÀÇ ¼±Åà ¹üÀ§°¡ º¯°æµÇ´Â °æ¿ì¿¡´Â °¢ ListSelectionListener ¿¡ ÅëÁöÇÕ´Ï´Ù. ´Ù¸¸, index0 ´Â index1 ÀÌÇϰ¡ ¾Æ´Ï¾îµµ ±¦Âú½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
index0 - ±¸°£ÀÇ ÇÑÆíÀÇ ±¸¼®ÀÇ °ª
index1 - ±¸°£ÀÇ ÇÑÆíÀÇ ±¸¼®ÀÇ °ª
°ü·Ã Ç׸ñ:
addListSelectionListener(javax.swing.event.ListSelectionListener)

addSelectionInterval

public void addSelectionInterval(int index0,
                                 int index1)
¼±Åà ¹üÀ§¸¦, ÇöÀçÀÇ ¼±Åà ¹üÀ§¿Í index0 ÀÌ»ó index1 ÀÌÇÏÀÇ À妽º°¡ °¡¸®Å°´Â ¹üÀ§¿ÍÀÇ È­ÁýÇÕÀ¸·Î º¯°æÇÕ´Ï´Ù. À̰Ϳ¡ ÀÇÇØ ÇöÀçÀÇ ¼±Åà ¹üÀ§°¡ º¯°æµÇ´Â °æ¿ì¿¡´Â °¢ ListSelectionListener ¿¡ ÅëÁöÇÕ´Ï´Ù. ´Ù¸¸, index0 ´Â index1 ÀÌÇϰ¡ ¾Æ´Ï¾îµµ ±¦Âú½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
index0 - ±¸°£ÀÇ ÇÑÆíÀÇ ±¸¼®ÀÇ °ª
index1 - ±¸°£ÀÇ ÇÑÆíÀÇ ±¸¼®ÀÇ °ª
°ü·Ã Ç׸ñ:
addListSelectionListener(javax.swing.event.ListSelectionListener)

removeSelectionInterval

public void removeSelectionInterval(int index0,
                                    int index1)
¼±Åà ¹üÀ§¸¦, ÇöÀçÀÇ ¼±Åà ¹üÀ§¿Í index0 ÀÌ»ó index1 ÀÌÇÏÀÇ À妽º°¡ °¡¸®Å°´Â ¹üÀ§¿ÍÀÇ Â÷ÀÌ ÁýÇÕÀ¸·Î º¯°æÇÕ´Ï´Ù. À̰Ϳ¡ ÀÇÇØ ÇöÀçÀÇ ¼±Åà ¹üÀ§°¡ º¯°æµÇ´Â °æ¿ì¿¡´Â °¢ ListSelectionListener ¿¡ ÅëÁöÇÕ´Ï´Ù. ´Ù¸¸, index0 ´Â index1 ÀÌÇϰ¡ ¾Æ´Ï¾îµµ ±¦Âú½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
index0 - ±¸°£ÀÇ ÇÑÆíÀÇ ±¸¼®ÀÇ °ª
index1 - ±¸°£ÀÇ ÇÑÆíÀÇ ±¸¼®ÀÇ °ª
°ü·Ã Ç׸ñ:
addListSelectionListener(javax.swing.event.ListSelectionListener)

getMinSelectionIndex

public int getMinSelectionIndex()
ÃÖÃÊ·Î ¼±ÅÃµÈ À妽º¸¦ µ¹·ÁÁÖ´ÂÁö ¼±Åà ¹üÀ§°¡ ºñ¾úÀ» °æ¿ì¿¡ -1 ¸¦ µ¹·ÁÁÝ´Ï´Ù.


getMaxSelectionIndex

public int getMaxSelectionIndex()
¸¶Áö¸·¿¡ ¼±ÅÃµÈ À妽º¸¦ µ¹·ÁÁÖ´ÂÁö ¼±Åà ¹üÀ§°¡ ºñ¾úÀ» °æ¿ì¿¡ -1 ¸¦ µ¹·ÁÁÝ´Ï´Ù.


isSelectedIndex

public boolean isSelectedIndex(int index)
ÁöÁ¤ÀÇ À妽º°¡ ¼±Åõǰí ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.


getAnchorSelectionIndex

public int getAnchorSelectionIndex()
setSelectionInterval(), addSelectionInterval(), ¶Ç´Â removeSelectionInterval()ÀÇ Á÷ÀüÀÇ È£Ãâ·ÎºÎÅÍ, ÃÖÃÊÀÇ À妽º Àμö¸¦ µ¹·ÁÁÝ´Ï´Ù. Á÷ÀüÀÇ index0 °¡ ¡¸¿¨Ä¿¡¹, Á÷ÀüÀÇ index1 °¡ ¡¸¸®µå¡¹¶ó°í º¸¿©Áý´Ï´Ù. ÀÎÅÍÆäÀ̽º¿¡ µû¶ó¼­´Â ÀÌ·¯ÇÑ À妽º°¡ Ưº°È÷ Ç¥½ÃµË´Ï´Ù. ¿¹¸¦ µé¾î Windows95 ¿¡¼­´Â ¸®µå À妽º°¡ ³ë¶õ Á¡¼±ÀÇ À±°ûÀ¸·Î Ç¥½ÃµË´Ï´Ù.

°ü·Ã Ç׸ñ:
getLeadSelectionIndex() , setSelectionInterval(int, int) , addSelectionInterval(int, int)

setAnchorSelectionIndex

public void setAnchorSelectionIndex(int index)
¼±Åà ¹üÀ§ÀÇ ¿¨Ä¿ À妽º¸¦ ¼³Á¤ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
getAnchorSelectionIndex()

getLeadSelectionIndex

public int getLeadSelectionIndex()
setSelectionInterval(), addSelectionInterval(), ¶Ç´Â removeSelectionInterval()ÀÇ Á÷ÀüÀÇ È£Ãâ·ÎºÎÅÍ, 2 ¹øÂ°ÀÇ À妽º Àμö¸¦ µ¹·ÁÁÝ´Ï´Ù.

°ü·Ã Ç׸ñ:
getAnchorSelectionIndex() , setSelectionInterval(int, int) , addSelectionInterval(int, int)

setLeadSelectionIndex

public void setLeadSelectionIndex(int index)
¼±Åà ¹üÀ§ÀÇ ¸®µå À妽º¸¦ ¼³Á¤ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
getLeadSelectionIndex()

clearSelection

public void clearSelection()
¼±Åà ¹üÀ§¸¦ Çϴü¼Æ®·Î º¯°æÇÕ´Ï´Ù. À̰Ϳ¡ ÀÇÇØ ÇöÀçÀÇ ¼±Åà ¹üÀ§°¡ º¯°æµÇ´Â °æ¿ì¿¡´Â °¢ ListSelectionListener ¿¡ ÅëÁöÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
addListSelectionListener(javax.swing.event.ListSelectionListener)

isSelectionEmpty

public boolean isSelectionEmpty()
À妽º°¡ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.


insertIndexInterval

public void insertIndexInterval(int index,
                                int length,
                                boolean before)
index ÀÇ Àü/ÈĺÎÅÍ ½ÃÀ۵Ǵ length À妽º¸¦ »ðÀÔÇÕ´Ï´Ù. Åë»ó, ÀÌ ¸Þ¼Òµå´Â µ¥ÀÌÅÍ ¸ðµ¨³»ÀÇ ´ëÀÀÇÏ´Â º¯°æ¿¡ ¼±Åà ¸ðµ¨À» µ¿±â ½Ã۱â À§Çؼ­(¶§¹®¿¡) ºÒ·Á °©´Ï´Ù.


removeIndexInterval

public void removeIndexInterval(int index0,
                                int index1)
¼±Åà ¸ðµ¨·ÎºÎÅÍ, index0 ¿Í index1 ¸¦ ¾ç´ÜÀ¸·Î¼­ Æ÷ÇÔÇÑ ±¸°£ÀÇ À妽º¸¦ »èÁ¦ÇÕ´Ï´Ù. Åë»ó, ÀÌ ¸Þ¼Òµå´Â µ¥ÀÌÅÍ ¸ðµ¨³»ÀÇ ´ëÀÀÇÏ´Â º¯°æ¿¡ ¼±Åà ¸ðµ¨À» µ¿±â ½Ã۱â À§Çؼ­(¶§¹®¿¡) ºÒ·Á °©´Ï´Ù.


setValueIsAdjusting

public void setValueIsAdjusting(boolean valueIsAdjusting)
ÀÌ ÇÁ·ÎÆÛƼ´Â ¸ðµ¨ÀÇ °ª¿¡ Àû¿ëµÇ°í ÀÖ´Â º¯°æÀÌ ´ÜÀÏÀÇ À̺¥Æ®¶ó°í »ý°¢µÇ´Â °æ¿ì¿¡ true °¡ µË´Ï´Ù. ¿¹¸¦ µé¾î, ¸ðµ¨ÀÌ À¯ÀúÀÇ µå·¯±×¿¡ ÀÀÇØ °»½ÅµÇ°í ÀÖ´Â °æ¿ì, valueIsAdjusting ÇÁ·ÎÆÛƼÀÇ °ªÀº µå·¯±×°¡ °³½ÃµÇ¾úÀ» ¶§¿¡ true, µå·¯±×°¡ Á¾·áÇßÀ» ¶§¿¡ false ·Î ¼³Á¤µË´Ï´Ù. Ç×»ó Áß°£ÀÇ °ªÀ» ¸ðµÎ ó¸®ÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó, º¯°æÀÌ ÆÄÀ̳ª¶óÀÌÁî µÇ¾úÀ» °æ¿ì¿¡¸¸, ÀÌ ÇÁ·ÎÆÛƼ¿¡ ÀÇÇØ ûÃëÀÚÀÇ °»½ÅÀÌ °¡´ÉÇÏ°Ô µË´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
valueIsAdjusting - ÇÁ·ÎÆÛƼÀÇ »õ·Î¿î °ª
°ü·Ã Ç׸ñ:
getValueIsAdjusting()

getValueIsAdjusting

public boolean getValueIsAdjusting()
°ªÀÌ ÀÏ·ÃÀÇ º¯°æÀ» ¹Þ°í ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
Ä¡°¡ ÇöÀç Á¶Á¤µÇ°í ÀÖ´Â °æ¿ì´Â true
°ü·Ã Ç׸ñ:
setValueIsAdjusting(boolean)

setSelectionMode

public void setSelectionMode(int selectionMode)
¼±Åà ¸ðµå¸¦ ¼³Á¤ÇÕ´Ï´Ù. selectionMode ÀÇ °ªÀº ´ÙÀ½°ú °°½À´Ï´Ù.

°ü·Ã Ç׸ñ:
getSelectionMode()

getSelectionMode

public int getSelectionMode()
ÇöÀçÀÇ ¼±Åà ¸ðµå¸¦ µ¹·ÁÁÝ´Ï´Ù.

¹Ýȯ°ª:
selectionMode ÇÁ·ÎÆÛƼÀÇ °ª
°ü·Ã Ç׸ñ:
setSelectionMode(int)

addListSelectionListener

public void addListSelectionListener(ListSelectionListener  x)
¼±Åà ¹üÀ§ÀÇ º¯°æÀÌ ÅëÁöµÇ´Â ûÃëÀÚ¸¦ ¸®½ºÆ®¿¡ Ãß°¡ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
removeListSelectionListener(javax.swing.event.ListSelectionListener) , setSelectionInterval(int, int) , addSelectionInterval(int, int) , removeSelectionInterval(int, int) , clearSelection() , insertIndexInterval(int, int, boolean) , removeIndexInterval(int, int)

removeListSelectionListener

public void removeListSelectionListener(ListSelectionListener  x)
¼±Åà ¹üÀ§ÀÇ º¯°æÀÌ ÅëÁöµÇ´Â ûÃëÀÚ¸¦ ¸®½ºÆ®·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù.

°ü·Ã Ç׸ñ:
addListSelectionListener(javax.swing.event.ListSelectionListener)

JavaTM 2
Platform
Std.  Ed.  v1. 4.0

¹ö±×ÀÇ º¸°í¿Í ±â´ÉÀÇ ¸®Äù½ºÆ®
ÀÌ¿ÜÀÇ API ·¹ÆÛ·±½º ¹× °³¹ßÀÚ¿ë ¹®¼­¿¡ ´ëÇØ¼­´Â Java 2 SDK SE °³¹ßÀÚ¿ë ¹®¼­¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. °³¹ßÀÚÀü¿ëÀÇ »ó¼¼ÇÑ ÇØ¼³, °³³äÀÇ °³¿ä, ¿ë¾îÀÇ Á¤ÀÇ, ¹ö±×ÀÇ È¸ÇÇÃ¥, ¹× ÄÚµå ½Ç·Ê°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.

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.