|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
| °³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
public class JTree
°èÃþ µ¥ÀÌÅͼ¼Æ®¸¦ ¾Æ¿ìÆ®¶óÀÎÀ¸·Î Ç¥½ÃÇÏ´Â ÄÁÆ®·ÑÀÔ´Ï´Ù. ŽºÅ© ÁöÇâÀÇ ¸Þ´º¾ó ¹× Æ®¸®ÀÇ »ç¿ë¿¹¿¡ ´ëÇØ¼´Â ¡¸The Java Tutorial¡¹ÀÇ ¡¸How to Use Trees¡¹¸¦ ÂüÁ¶ÇϽʽÿÀ.
Æ®¸®ÀÇ Æ¯Á¤ÀÇ ³ëµå´Â ³ëµå ¹× ¸ðµç »óÀ§ ³ëµå¸¦ ĸ½¶ÈÇÏ´Â °´Ã¼ÀÎ TreePath, ¶Ç´Â Ç¥½Ã ¿µ¿ªÀÇ °¢ ÇàÀÌ 1°³ÀÇ ³ëµå¸¦ Ç¥½ÃÇϴ ǥ½ÃÇà¿¡ ÀÇÇØ ½Äº°µË´Ï´Ù. ¡¸Àü°³µÇ¾ú´Ù¡¹³ëµå´Â ÀÙ ÀÌ¿ÜÀÇ ³ëµå (TreeModel.isLeaf(node)°¡ false¸¦ µ¹·ÁÁÖ´Â °ÍÀ¸·Î ½Äº°µÈ´Ù)À̸ç, ±× ¸ðµç »óÀ§ ³ëµå°¡ ¡¸Àü°³µÇ¾ú´Ù¡¹¶ó°í ³ª¹«¿¡ ÀÚ½ÄÀ» Ç¥½ÃÇÕ´Ï´Ù. ¡¸¼ö³³µÇ¾ú´Ù¡¹³ëµå´Â ÀÚ½ÄÀ» ¼û±é´Ï´Ù. ¡¸¼û°ÜÁ³´Ù¡¹³ëµå´Â ¼ö³³µÈ ºÎ¸ð¾Æ·¡¿¡ ÀÖ½À´Ï´Ù. ¸ðµç ¡¸Ç¥½Ã °¡´É¡¹³ëµåÀÇ ºÎ¸ð´Â Àü°³µË´Ï´Ù¸¸, Ç¥½ÃµÇ´Â °æ¿ì·Î ¿©°ÜÁöÁö ¾Ê´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ¡¸Ç¥½Ã¡¹³ëµå´Â Ç¥½Ã °¡´ÉÇϰí, Ç¥½Ã ¿µ¿ª¿¡ ÀÖ½À´Ï´Ù.
´ÙÀ½ÀÇ JTree ¸Þ¼µå´Â ¡¸visible¡¹¸¦ »ç¿ëÇØ ¡¸displayed¡¹¸¦ ³ªÅ¸³À´Ï´Ù.
isRootVisible() setRootVisible() scrollPathToVisible() scrollRowToVisible() getVisibleRowCount() setVisibleRowCount()
JTree
´ÙÀ½ÀÇ ¸Þ¼µå´Â ¡¸visible¡¹¸¦ »ç¿ëÇØ ¡¸viewable¡¹¸¦ ³ªÅ¸³À´Ï´Ù (Àü°³µÈ ºÎ¸ð¾Æ·¡).
isVisible() makeVisible()
¾ðÁ¦ ¼±ÅÃÀÌ º¯°æµÇ¾ú´ÂÁö¸¦ ¾Ë°í ½ÍÀº °æ¿ì´Â TreeSelectionListenerÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇØ, addTreeSelectionListener ¸Þ¼µå¸¦ »ç¿ëÇØ ±× ÀνºÅϽº¸¦ Ãß°¡ÇÕ´Ï´Ù. valueChanged´Â
¼±ÅÃÀÌ º¯°æµÇ¾úÀ» ¶§¿¡ È£ÃâÇÕ´Ï´Ù. Áï, »ç¿ëÀÚ°¡ °°Àº ³ëµå¸¦ 2ȸ Ŭ¸¯ÇßÀ» ¶§¿¡ valueChanged´Â ÇÑ ¹ø¸¸ È£ÃâÇÕ´Ï´Ù.
³ëµå°¡ ¼±Åõǰí ÀÖ¾ú´ÂÁö ¾î¶°Çß´ÂÁö¿¡ °ü°è¾øÀÌ, ´õºí Ŭ¸¯ À̺¥Æ® ¶Ç´Â »ç¿ëÀÚ°¡ ³ëµå¸¦ ¾ðÁ¦ Ŭ¸¯Çß´ÂÁö¸¦ ¾Ë°í ½ÍÀº °æ¿ì´Â ´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù.
final JTree tree = ...;
MouseListener ml = new MouseAdapter() {
public void mousePressed(MouseEvent e) {
int selRow = tree.getRowForLocation(e.getX(), e.getY());
TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
if(selRow ! = -1) {
if(e.getClickCount() == 1) {
mySingleClick(selRow, selPath);
}
else if(e.getClickCount() == 2) {
myDoubleClick(selRow, selPath);
}
}
}
};
tree.addMouseListener(ml);
ÁÖ: ÀÌ ¿¹´Â ÆÐ½º¿Í ÇàÀÇ ¾çÂÊ ¸ðµÎ¸¦ ÃëµæÇÕ´Ï´Ù¸¸, ÇÊ¿äÇÑ °Í¸¸À» ÃëµæÇØ ÁÖ¼¼¿ä.
JTree¸¦ »ç¿ëÇØ º¹ÇÕ ³ëµå (¿¹¸¦ µé¾î
±×·¡ÇÈÀڽľÆÀÌÄܰú ÅØ½ºÆ®ÀÇ ¾çÂÊ ¸ðµÎ¸¦ °¡Áö´Â ³ëµå)¸¦ Ç¥½ÃÇÏ·Á¸é,
TreeCellRenderer¸¦
»ó¼ÓÇØ, setCellRenderer(javax.swing.tree.TreeCellRenderer)¸¦
»ç¿ëÇØ Æ®¸®¿¡ ±×°ÍÀ» »ç¿ëÇÏ´Â °ÍÀ» Áö½ÃÇÕ´Ï´Ù. º¹ÇÕ ³ëµå¸¦ ÆíÁýÇÏ·Á¸é,
TreeCellEditor¸¦
»ó¼ÓÇØ, setCellEditor(javax.swing.tree.TreeCellEditor)¸¦
»ç¿ëÇÕ´Ï´Ù.
¸ðµç JComponent Ŭ·¡½º¿Í °°°Ô, InputMap ¿Í
ActionMap¸¦
»ç¿ëÇØ Action °´Ã¼¿Í KeyStroke¸¦
°ü·ÃÁö¾î ÁöÁ¤ÇÑ Á¶°ÇÀ¸·Î ¾×¼ÇÀ» ½ÇÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.
°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í
ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ Áö¿øÀº
´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. JDK ¹öÀü
1.4 ÀÌÈÄ, ¸ðµç JavaBeans™
Àå±â°£ÀÇ ¿î¿ë Áö¿øÀº
java.beans ÆÐŰÁö¿¡ Ãß°¡µÇ°í ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº XMLEncoder¸¦
ÂüÁ¶ÇϽʽÿÀ.
| Áßø(Nested) Ŭ·¡½º °³¿ä | |
|---|---|
protected class |
JTree.AccessibleJTree
ÀÌ Å¬·¡½º´Â JTree Ŭ·¡½º¿ëÀÇ »ç¿ëÀÚ
º¸Á¶ ±â´ÉÀÇ Áö¿ø¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
static class |
JTree.DynamicUtilTreeNode
DynamicUtilTreeNode´Â
º¤ÅÍ, ÇØ½Ã Å×À̺í, ¹è¿ ¹× ij¸¯ÅÍ ¶óÀÎÀ» ·¦ ÇØ, Çʿ信 µû¶ó¼ ÀûÀýÇÑÀÚ½Ä
Æ®¸® ³ëµå¸¦ ÀÛ¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù. |
protected static class |
JTree.EmptySelectionModel
EmptySelectionModel´Â
¾î¶² ¼±Åõµ Çã°¡ÇÏÁö ¾Ê´Â TreeSelectionModel ÀÔ´Ï´Ù. |
protected class |
JTree.TreeModelHandler
¸ðµ¨À» °¨½ÃÇØ, ³ëµå°¡ »èÁ¦ ¶Ç´Â º¯°æµÇ¾úÀ» °æ¿ì¿¡ °Å±â¿¡ ÀÀÇØ expandedState¸¦ °»½ÅÇÕ´Ï´Ù. |
protected class |
JTree.TreeSelectionRedirector
JTree¸¦ ¼Ò½º·Î¼ »õ·Î¿î TreeSelectionEvent¸¦ »ý¼ºÇØ, ±×°ÍÀ» ¸ðµç ¸®½º³Ê¿¡°Ô Àü¼Û ÇÕ´Ï´Ù. |
| Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
|---|
JComponent.AccessibleJComponent |
| Ŭ·¡½º java.awt. Container ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
|---|
Container.AccessibleAWTContainer |
| Ŭ·¡½º java.awt. Component ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
|---|
Component.AccessibleAWTComponent,
Component.BltBufferStrategy,
Component.FlipBufferStrategy |
| ÇÊµå °³¿ä | |
|---|---|
static String |
ANCHOR_SELECTION_PATH_PROPERTY
¿¨Ä¿ ¼±Åà ÆÐ½ºÀÇ ¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
static String |
CELL_EDITOR_PROPERTY
cellEditor
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
static String |
CELL_RENDERER_PROPERTY
cellRenderer
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected TreeCellEditor |
cellEditor
¿£Æ®¸®ÀÇ ¿¡µðÅÍÀÔ´Ï´Ù. |
protected TreeCellRenderer |
cellRenderer
³ëµå¸¦ ·»´õ¸µ Çϱâ À§Çؼ »ç¿ëµÇ´Â ¼¿ÀÔ´Ï´Ù. |
protected boolean |
editable
Æ®¸®¸¦ ÆíÁýÇÒ ¼ö ÀÖÀ»Áö ¾î¶³Áö¸¦ ³ªÅ¸³À´Ï´Ù. |
static String |
EDITABLE_PROPERTY
editable
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
static String |
EXPANDS_SELECTED_PATHS_PROPERTY
¼±Åà ÆÐ½ºÀÇ ÇÁ·ÎÆÛƼ¸¦ Àü°³ÇÏ´Â ¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
static String |
INVOKES_STOP_CELL_EDITING_PROPERTY
messagesStopCellEditing
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected boolean |
invokesStopCellEditing
trueÀÎ °æ¿ì, ¼±ÅÃÀÇ º¯°æ, Æ®¸®³»ÀÇ µ¥ÀÌÅÍÀÇ º¯°æ, ¶Ç´Â ´Ù¸¥ ¼ö´Ü¿¡ ÀÇÇØ ÆíÁýÀÌ Á¤ÁöµÇ¾úÀ» ¶§¿¡ stopCellEditing°¡ ºÒ·Á°¡
º¯°æÀÌ º¸Á¸µË´Ï´Ù. |
static String |
LARGE_MODEL_PROPERTY
largeModel
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected boolean |
largeModel
ÀÌ Æ®¸®°¡ Å« ¸ðµ¨Àΰ¡ ¾î¶²°¡¸¦ ³ªÅ¸³À´Ï´Ù. |
static String |
LEAD_SELECTION_PATH_PROPERTY
leadSelectionPath
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
static String |
ROOT_VISIBLE_PROPERTY
rootVisible
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected boolean |
rootVisible
·çÆ® ³ëµå°¡ Ç¥½ÃµÇ°í ÀÖ´Â °æ¿ì´Â true, ±× ÀÚ½ÄÀÌ ÃÖ»óÁ¤µµÀÇ °¡½Ã ³ëµåÀÎ °æ¿ì´Â false ÀÔ´Ï´Ù. |
static String |
ROW_HEIGHT_PROPERTY
rowHeight
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected int |
rowHeight
°¢ Ç¥½ÃÇà¿¡ »ç¿ëÇÏ´Â ³ôÀÌÀÔ´Ï´Ù. |
static String |
SCROLLS_ON_EXPAND_PROPERTY
scrollsOnExpand
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected boolean |
scrollsOnExpand
trueÀÎ °æ¿ì, ³ëµå°¡ Àü°³µÇ¸é, ±× ¸ðµç ÇÏÀ§ ³ëµå°¡ °¡½Ã°¡ µÇµµ·Ï ½ºÅ©·Ñ µË´Ï´Ù. |
static String |
SELECTION_MODEL_PROPERTY
selectionModel ¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected TreeSelectionModel |
selectionModel
ÀÌ Æ®¸®³»ÀÇ ¼±ÅÃµÈ ³ëµå¼¼Æ®¸¦ ¸ðµ¨ÈÇÕ´Ï´Ù. |
protected JTree.TreeSelectionRedirector |
selectionRedirector
»õ·Î¿î À̺¥Æ®¸¦ »ý¼ºÇØ, ±×°ÍÀ» selectionListeners¿¡ °Ç³×ÁÝ´Ï´Ù. |
static String |
SHOWS_ROOT_HANDLES_PROPERTY
showsRootHandles
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected boolean |
showsRootHandles
ÇÚµéÀÌ Æ®¸®ÀÇ ÃÖ»óÁ¤µµ ·¹º§¿¡ Ç¥½ÃµÇ°í ÀÖ´Â °æ¿ì´Â true ÀÔ´Ï´Ù. |
static String |
TOGGLE_CLICK_COUNT_PROPERTY
toggleClickCount
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected int |
toggleClickCount
³ëµå¸¦ Àü°³Çϱâ À§Çؼ ÇÊ¿äÇÑ ¸¶¿ì½º Ŭ¸¯ÀÇ ¼öÀÔ´Ï´Ù. |
static String |
TREE_MODEL_PROPERTY
treeModel
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected TreeModel |
treeModel
ÀÌ °´Ã¼¿¡ ÀÇÇØ Ç¥½ÃµÇ´Â Æ®¸®¸¦ Á¤ÀÇÇÏ´Â ¸ðµ¨ÀÔ´Ï´Ù. |
protected TreeModelListener |
treeModelListener
expandedState¸¦ °»½ÅÇÕ´Ï´Ù. |
static String |
VISIBLE_ROW_COUNT_PROPERTY
visibleRowCount
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù. |
protected int |
visibleRowCount
ÇÑ ¹ø¿¡ °¡½Ã·Î ÇÏ´Â Çà¼öÀÔ´Ï´Ù. |
| Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
|---|
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
| Ŭ·¡½º java.awt. Component ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
|---|
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| ÀÎÅÍÆäÀ̽º java.awt.image. ImageObserver ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
|---|
ABORT,
ALLBITS,
ERROR,
FRAMEBITS,
HEIGHT,
PROPERTIES,
SOMEBITS,
WIDTH |
| »ý¼ºÀÚ °³¿ä | |
|---|---|
JTree ()
»ùÇà ¸ðµ¨À» °¡Áö´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
JTree (Hashtable <?,?> value)
Hashtable·Î
ºÎÅÍ »ý¼ºµÈ, ·çÆ®¸¦ Ç¥½ÃÇÏÁö ¾Ê´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
JTree (Object [] value)
ÁöÁ¤µÈ ¹è¿ÀÇ °¢ ¿ä¼Ò¸¦, Ç¥½ÃµÇ¾î ÀÖÁö ¾ÊÀº »õ·Î¿î ·çÆ® ³ëµåÀÇÀÚ½Ä ·Î¼ °¡Áö´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
JTree (TreeModel newModel)
·çÆ® ³ëµå¸¦ Ç¥½ÃÇÏ´Â JTree
ÀνºÅϽº¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
JTree (TreeNode root)
ÁöÁ¤µÈ TreeNode¸¦ ·çÆ®¿¡ °¡Áö´Â ·çÆ® ³ëµå¸¦ Ç¥½ÃÇÏ´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
JTree (TreeNode root,
boolean asksAllowsChildren)
·çÆ® ³ëµå¸¦ Ç¥½ÃÇØ, ³ëµå°¡ ÀÙ³ëµåÀΰ¡ ¾î¶²°¡¸¦ ÁöÁ¤µÈ ¹æ¹ýÀ¸·Î °áÁ¤ÇÏ´Â ÁöÁ¤µÈ TreeNode¸¦ ·çÆ®·Î¼ °¡Áö´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
JTree (Vector <? > value)
ÁöÁ¤µÈ Vector
°¢ ¿ä¼Ò¸¦, Ç¥½ÃµÇ¾î ÀÖÁö ¾ÊÀº »õ·Î¿î ·çÆ® ³ëµåÀÇÀÚ½Ä
·Î¼ °¡Áö´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
| ¸Þ¼µå °³¿ä | |
|---|---|
void |
addSelectionInterval (int index0,
int index1)
index0 ·ÎºÎÅÍ index1 ±îÁöÀÇ ÆÐ½º¸¦ ¼±Åÿ¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addSelectionPath (TreePath path)
ÁöÁ¤µÈ TreePath¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ ÇöÀçÀÇ ¼±Åÿ¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addSelectionPaths (TreePath [] paths)
ÆÐ½ºÀÇ ¹è¿ÀÇ °¢ ÆÐ½º¸¦ ÇöÀçÀÇ ¼±Åÿ¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addSelectionRow (int row)
ÁöÁ¤µÈ Çà¿¡ ÀÖ´Â ÆÐ½º¸¦ ÇöÀçÀÇ ¼±Åÿ¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addSelectionRows (int[] rows)
ÁöÁ¤µÈ °¢ Çà¿¡ ÀÖ´Â ÆÐ½º¸¦ ÇöÀçÀÇ ¼±Åÿ¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addTreeExpansionListener (TreeExpansionListener tel)
TreeExpansion À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addTreeSelectionListener (TreeSelectionListener tsl)
TreeSelection À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addTreeWillExpandListener (TreeWillExpandListener tel)
TreeWillExpand À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
cancelEditing ()
ÇöÀçÀÇ ÆíÁý ¼¼¼ÇÀ» Ãë¼ÒÇÕ´Ï´Ù. |
void |
clearSelection ()
¼±ÅÃÀ» Ŭ¸®¾î ÇÕ´Ï´Ù. |
protected void |
clearToggledPaths ()
±³Ã¼µÈ Æ®¸® ÆÐ½ºÀÇ Ä³½¬¸¦ Ŭ¸®¾î ÇÕ´Ï´Ù. |
void |
collapsePath (TreePath path)
ÁöÁ¤µÈ ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå°¡ ¼ö³³µÇ¾î Ç¥½Ã °¡´ÉÇÏ°Ô µÇµµ·Ï ÇÕ´Ï´Ù. |
void |
collapseRow (int row)
ÁöÁ¤µÈ Çà¿¡ ÀÖ´Â ³ëµå°¡ ¼ö³³µÇ°í ÀÖµµ·Ï ÇÕ´Ï´Ù. |
String |
convertValueToText (Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
·»´õ¸µ¿¡ ÀÇÇØ ºÒ·Á°¡ ÁöÁ¤µÈ °ªÀ» ÅØ½ºÆ®·Î º¯È¯ÇÕ´Ï´Ù. |
protected static TreeModel |
createTreeModel (Object value)
ÁöÁ¤µÈ °´Ã¼¸¦°¨½Î´Â TreeModelÀ»
¸®ÅÏÇÕ´Ï´Ù. |
protected TreeModelListener |
createTreeModelListener ()
TreeModelHandler
ÀνºÅϽº¸¦ »ý¼ºÇØ ¸®ÅÏÇÕ´Ï´Ù. |
void |
expandPath (TreePath path)
ÁöÁ¤µÈ ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå°¡ Àü°³µÇ¾î Ç¥½Ã °¡´ÉÇÏ°Ô µÇµµ·Ï ÇÕ´Ï´Ù. |
void |
expandRow (int row)
ÁöÁ¤µÈ Çà¿¡ ÀÖ´Â ³ëµå°¡ Àü°³µÇ¾î Ç¥½Ã °¡´ÉÇÏ°Ô µÇµµ·Ï ÇÕ´Ï´Ù. |
void |
fireTreeCollapsed (TreePath path)
ÀÌ À̺¥Æ®ÇüÀÇ ÅëÁö¸¦ Àü´Þ ´ë»óÀ¸·ÎÀÇÇØ µî·ÏÇϰí ÀÖ´Â ¸®½º³Ê ¸ðµÎ¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
void |
fireTreeExpanded (TreePath path)
ÀÌ À̺¥Æ®ÇüÀÇ ÅëÁö¸¦ Àü´Þ ´ë»óÀ¸·ÎÀÇÇØ µî·ÏÇϰí ÀÖ´Â ¸®½º³Ê ¸ðµÎ¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
void |
fireTreeWillCollapse (TreePath path)
ÀÌ À̺¥Æ®ÇüÀÇ ÅëÁö¸¦ Àü´Þ ´ë»óÀ¸·ÎÀÇÇØ µî·ÏÇϰí ÀÖ´Â ¸®½º³Ê ¸ðµÎ¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
void |
fireTreeWillExpand (TreePath path)
ÀÌ À̺¥Æ®ÇüÀÇ ÅëÁö¸¦ Àü´Þ ´ë»óÀ¸·ÎÀÇÇØ µî·ÏÇϰí ÀÖ´Â ¸®½º³Ê ¸ðµÎ¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
protected void |
fireValueChanged (TreeSelectionEvent e)
ÅëÁöÀÇ Àü´Þ ´ë»óÀ» ÁöÁ¤µÈ À̺¥Æ®ÇüÀ¸·Î µî·ÏÇÑ ¸ðµç ¸®½º³Ê¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
AccessibleContext |
getAccessibleContext ()
ÀÌ JTree¿¡ °ü·ÃÇÑ AccessibleContext¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getAnchorSelectionPath ()
¿¨Ä¿¿Í ½Äº°µÈ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreeCellEditor |
getCellEditor ()
Æ®¸®ÀÇ ¿£Æ®¸®¸¦ ÆíÁýÇϱâ À§Çؼ »ç¿ëµÇ´Â ¿¡µðÅ͸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreeCellRenderer |
getCellRenderer ()
°¢ ¼¿À» ·»´õ¸µ Çϰí ÀÖ´Â ÇöÀçÀÇ TreeCellRenderer¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getClosestPathForLocation (int x,
int y)
x, y¿¡ °¡Àå °¡±î¿î ³ëµåÀÇ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getClosestRowForLocation (int x,
int y)
x, y¿¡ °¡Àå °¡±î¿î ³ëµåÀÇ ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. |
protected static TreeModel |
getDefaultTreeModel ()
»ùÇÃ TreeModelÀ»
»ý¼ºÇØ, ±×°ÍÀ» ¸®ÅÏÇÕ´Ï´Ù. |
protected Enumeration <TreePath > |
getDescendantToggledPaths (TreePath parent)
parent
ÇÏÀ§ ³ëµåÀ̸ç, Àü°³µÇ°í ÀÖ´Â TreePaths
EnumerationÀ»
¸®ÅÏÇÕ´Ï´Ù. |
boolean |
getDragEnabled ()
dragEnabled ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getEditingPath ()
ÇöÀç ÆíÁýµÇ°í ÀÖ´Â ¿ä¼ÒÀÇ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Enumeration <TreePath > |
getExpandedDescendants (TreePath parent)
ÇöÀç Àü°³µÇ°í ÀÖ´Â ÆÐ½º parent
ÇÏÀ§ ³ëµå·ÎºÎÅÍ ¿Ï¼ºµÇ´Â EnumerationÀ»
¸®ÅÏÇÕ´Ï´Ù. |
boolean |
getExpandsSelectedPaths ()
expandsSelectedPaths ÇÁ·ÎÆÛƼ¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
getInvokesStopCellEditing ()
ÆíÁýÀÌ ³¢¾îµé¾îÁ³À» ¶§¿¡ ¹«¾ùÀ» ÇÏ´ÂÁö¸¦ ³ªÅ¸³»´Â ÀεðÄÉÀÌÅÍ(indicator)¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Object |
getLastSelectedPathComponent ()
ÇöÀçÀÇ ¼±ÅÃÀÇ ÃÖÃÊÀÇ ³ëµå¿¡ ÀÖ´Â ¸¶Áö¸· ÆÄ½ºÄÜÆ÷³ÙÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getLeadSelectionPath ()
¸®µå¿Í ½Äº°µÈ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getLeadSelectionRow ()
¸®µå ÆÐ½º¿¡ ´ëÀÀÇÏ´Â ÇàÀÇ À妽º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getMaxSelectionRow ()
¼±Åõǰí ÀÖ´Â ¸¶Áö¸· ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getMinSelectionRow ()
¼±Åõǰí ÀÖ´Â ÃÖÃÊÀÇ ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. |
TreeModel |
getModel ()
µ¥ÀÌÅ͸¦ Á¦°øÇϰí ÀÖ´Â TreeModelÀ»
¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getNextMatch (String prefix,
int startingRow,
Position.Bias bias)
prefix ·Î ½ÃÀ۵Ǵ ´ÙÀ½ÀÇ Æ®¸® ¿ä¼Ò¿¡ÀÇ TreePath¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
protected TreePath [] |
getPathBetweenRows (int index0,
int index1)
index0 ·ÎºÎÅÍ index1 ±îÁöÀÇ ÆÐ½º¸¦ ³ªÅ¸³»´Â JTreePath
ÀνºÅϽº¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Rectangle |
getPathBounds (TreePath path)
ÁöÁ¤µÈ ³ëµå°¡ ·»´õ¸µ µÇ´Â Rectangle¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getPathForLocation (int x,
int y)
ÁöÁ¤µÈ À§Ä¡¿¡ ÀÖ´Â ³ëµåÀÇ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getPathForRow (int row)
ÁöÁ¤µÈ ÇàÀÇ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Dimension |
getPreferredScrollableViewportSize ()
JTree
ÀûÀýÇÑ Ç¥½Ã »çÀÌÁ ¸®ÅÏÇÕ´Ï´Ù. |
Rectangle |
getRowBounds (int row)
ÁöÁ¤µÈ Çà¿¡ ÀÖ´Â ³ëµå°¡ ·»´õ¸µ µÇ´Â Rectangle¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getRowCount ()
ÇöÀç Ç¥½ÃµÇ°í ÀÖ´Â Çà¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getRowForLocation (int x,
int y)
ÁöÁ¤µÈ À§Ä¡¿¡ ÀÖ´Â ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getRowForPath (TreePath path)
ÁöÁ¤µÈ ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ Ç¥½ÃÇÏ´Â ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getRowHeight ()
°¢ ÇàÀÇ ³ôÀ̸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getScrollableBlockIncrement (Rectangle visibleRect,
int orientation,
int direction)
¡¸ºí·Ï¡¹ÁõºÐÄ¡ÀÇ ¾çÀ» ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
getScrollableTracksViewportHeight ()
Æ®¸®ÀÇ ÀûÀýÇÑ ³ôÀ̰¡ ºäÆ÷Æ®ÀÇ ³ôÀ̺¸´Ù ÀÛÁö ¾ÊÀº ÇÑ, false¸¦ µ¹·ÁÁÖ°í, ºäÆ÷Æ®ÀÇ ³ôÀ̰¡ Å×À̺íÀÇ ³ôÀ̸¦ °áÁ¤ÇÏÁö ¾Ê´Â °ÍÀ» ³ªÅ¸³À´Ï´Ù. |
boolean |
getScrollableTracksViewportWidth ()
Æ®¸®ÀÇ ÀûÀýÇÑ ÆøÀÌ ºäÆ÷Æ®ÀÇ Æøº¸´Ù ÀÛÁö ¾ÊÀº ÇÑ, false¸¦ µ¹·ÁÁÖ°í, ºäÆ÷Æ®ÀÇ ÆøÀÌ Å×À̺íÀÇ ³ÐÀ̸¦ °áÁ¤ÇÏÁö ¾Ê´Â °ÍÀ» ³ªÅ¸³À´Ï´Ù. |
int |
getScrollableUnitIncrement (Rectangle visibleRect,
int orientation,
int direction)
½ºÅ©·Ñ½Ã¿¡ ÁõºÐ ÇÏ´Â ¾çÀ» ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
getScrollsOnExpand ()
scrollsOnExpand ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getSelectionCount ()
¼±ÅÃµÈ ³ëµåÀÇ ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreeSelectionModel |
getSelectionModel ()
¼±ÅÃÀÇ ¸ðµ¨À» ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getSelectionPath ()
¼±ÅÃµÈ ÃÖÃÊÀÇ ³ëµåÀÇ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath [] |
getSelectionPaths ()
¼±ÅÃµÈ ¸ðµç °ªÀÇ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int[] |
getSelectionRows ()
ÇöÀç ¼±Åà ¶°³¯ ¼ö ÀÖ¾î ¸ðµç ÇàÀ» ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
getShowsRootHandles ()
showsRootHandles ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getToggleClickCount ()
³ëµå¸¦ Àü°³Çϰųª ´ÝÀ» ¶§ ÇÊ¿äÇÑ ¸¶¿ì½º Ŭ¸¯ÀÇ È¸¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
String |
getToolTipText (MouseEvent event)
JComponent
getToolTipText ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ·»´õ¸µÀÇ ÈùÆ® (ÅØ½ºÆ® ¼¼Æ®°¡ ÀÖ´Â °æ¿ì)¸¦ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. |
TreeExpansionListener [] |
getTreeExpansionListeners ()
addTreeExpansionListener()¿¡ ÀÇÇØ ÀÌ JTree¿¡ Ãß°¡µÈ ¸ðµç TreeExpansionListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
TreeSelectionListener [] |
getTreeSelectionListeners ()
addTreeSelectionListener()¿¡ ÀÇÇØ ÀÌ JTree¿¡ Ãß°¡µÈ ¸ðµç TreeSelectionListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
TreeWillExpandListener [] |
getTreeWillExpandListeners ()
addTreeWillExpandListener()¿¡ ÀÇÇØ ÀÌ JTree¿¡ Ãß°¡µÈ ¸ðµç TreeWillExpandListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
TreeUI |
getUI ()
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ ·»´õ¸µ ÇÏ´Â L&F °´Ã¼¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
String |
getUIClassID ()
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ ·»´õ¸µ ÇÏ´Â L&F Ŭ·¡½ºÀÇ À̸§À» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getVisibleRowCount ()
Ç¥½Ã ¿µ¿ª¿¡ Ç¥½ÃµÇ°í ÀÖ´Â Çà¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
hasBeenExpanded (TreePath path)
ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå°¡ Áö±Ý±îÁö Àü°³µÇ¾ú´ø ÀûÀÌ ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isCollapsed (int row)
ÁöÁ¤µÈ Ç¥½ÃÇà¿¡ ÀÖ´Â ³ëµå°¡ ¼ö³³µÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isCollapsed (TreePath path)
ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â °ªÀÌ ÇöÀç ¼ö³³µÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isEditable ()
Æ®¸®°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isEditing ()
Æ®¸®°¡ ÆíÁýµÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isExpanded (int row)
ÁöÁ¤µÈ Ç¥½ÃÇà¿¡ ÀÖ´Â ³ëµå°¡ ÇöÀç Àü°³µÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isExpanded (TreePath path)
ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå°¡ ÇöÀç Àü°³µÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isFixedRowHeight ()
°¢ Ç¥½ÃÇàÀÇ ³ôÀ̰¡ °íÁ¤ »çÀÌÁîÀÇ °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isLargeModel ()
Æ®¸®°¡ Å« ¸ðµ¨¿ëÀ¸·Î ¼³Á¤µÇ¾î ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isPathEditable (TreePath path)
isEditableÀ»
¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isPathSelected (TreePath path)
ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â Ç׸ñÀÌ ÇöÀç ¼±Åõǰí ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isRootVisible ()
Æ®¸®ÀÇ ·çÆ® ³ëµå°¡ Ç¥½ÃµÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isRowSelected (int row)
Çà¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå°¡ ¼±Åõǰí ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isSelectionEmpty ()
¼±Åà ¹üÀ§°¡ ÇöÀçºñ¾îÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isVisible (TreePath path)
ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â °ªÀÌ ÇöÀç Ç¥½Ã °¡´ÉÇÑ °æ¿ì, Áï ±×°ÍÀÌ ·çÆ®ÀÎÁö, ±× ¸ðµç ºÎ¸ð°¡ Àü°³µÇ°í ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
makeVisible (TreePath path)
ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå°¡ ÇöÀç Ç¥½Ã °¡´ÉÇϵµ·Ï ÇÕ´Ï´Ù. |
protected String |
paramString ()
ÀÌ JTree
ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. |
protected boolean |
removeDescendantSelectedPaths (TreePath path,
boolean includePath)
path
ÇÏÀ§ ³ëµåÀÎ ¼±ÅÃµÈ ¸ðµç ÆÐ½º¸¦ »èÁ¦ÇÕ´Ï´Ù. |
protected void |
removeDescendantToggledPaths (Enumeration <TreePath > toRemove)
toRemove¿¡ ÀÖ´Â Àü°³µÇ°í ÀÖ´Â TreePaths
ÇÏÀ§ ³ëµå¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeSelectionInterval (int index0,
int index1)
index0 ·ÎºÎÅÍ index1 ±îÁöÀÇ ³ëµå¸¦ ¼±ÅÃÀ¸·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeSelectionPath (TreePath path)
ÁöÁ¤µÈ ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ ÇöÀçÀÇ ¼±ÅÃÀ¸·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeSelectionPaths (TreePath [] paths)
ÁöÁ¤µÈ ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ ÇöÀçÀÇ ¼±ÅÃÀ¸·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeSelectionRow (int row)
À妽º row¿¡ ÀÖ´Â ÇàÀ» ÇöÀçÀÇ ¼±ÅÃÀ¸·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeSelectionRows (int[] rows)
ÁöÁ¤µÈ °¢ ÇàÀ¸·Î ¼±Åõǰí ÀÖ´Â ÇàÀ» »èÁ¦ÇÕ´Ï´Ù. |
void |
removeTreeExpansionListener (TreeExpansionListener tel)
TreeExpansion À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeTreeSelectionListener (TreeSelectionListener tsl)
TreeSelection ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeTreeWillExpandListener (TreeWillExpandListener tel)
TreeWillExpand À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
scrollPathToVisible (TreePath path)
ÆÐ½º¿¡ ÀÖ´Â ¸ðµç ÆÄ½ºÄÜÆ÷³ÙÆ® (¸¶Áö¸· ÆÄ½ºÄÜÆ÷³ÙÆ®´Â Á¦¿ÜÇÏ´Ù)¸¦ Àü°³ÇØ, ÆÐ½º¿¡ ÀÇÇØ ÁöÁ¤µÇ´Â ³ëµå°¡ Ç¥½ÃµÇµµ·Ï ½ºÅ©·Ñ ÇÕ´Ï´Ù. |
void |
scrollRowToVisible (int row)
Çà¿¡ ÀÇÇØ ½Äº°µÇ´Â Ç׸ñÀÌ Ç¥½ÃµÉ ¶§±îÁö ½ºÅ©·Ñ ÇÕ´Ï´Ù. |
void |
setAnchorSelectionPath (TreePath newPath)
¿¨Ä¿·Î¼ ½Äº°ÇÏ´Â ÆÐ½º¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setCellEditor (TreeCellEditor cellEditor)
¼¿ ¿¡µðÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setCellRenderer (TreeCellRenderer x)
°¢ ¼¿À» ·»´õ¸µ Çϱâ À§Çؼ »ç¿ëÇÏ´Â TreeCellRenderer¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setDragEnabled (boolean b)
dragEnabled ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setEditable (boolean flag)
Æ®¸®°¡ ÆíÁý °¡´ÉÇѰ¡ ¾î¶²°¡¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
protected void |
setExpandedState (TreePath path,
boolean state)
ÀÌ JTree
Àü°³ »óŸ¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setExpandsSelectedPaths (boolean newValue)
expandsSelectedPaths ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setInvokesStopCellEditing (boolean newValue)
Æ®¸®ÀÇ ´Ù¸¥ ³ëµåÀÇ ¼±ÅÃ, Æ®¸®ÀÇ µ¥ÀÌÅÍÀÇ º¯°æ, ¶Ç´Â ´Ù¸¥ ¼ö´Ü¿¡ ÀÇÇØ ÆíÁýÀÌ ³¢¾îµé¾îÁ³À» ¶§¿¡ ¹«¾ùÀ» ÇÏ´ÂÁö¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLargeModel (boolean newValue)
UI°¡ Å« ¸ðµ¨À» »ç¿ëÇÒÁö ¾î¶³Áö¸¦ ¼³Á¤ÇÕ´Ï´Ù (¸ðµç UI°¡ À̰ÍÀ» ±¸ÇöÇÏ´Â °ÍÀº ¾Æ´Ï´Ù). |
void |
setLeadSelectionPath (TreePath newPath)
¸®µå·Î¼ ½Äº°ÇÏ´Â ÆÐ½º¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setModel (TreeModel newModel)
µ¥ÀÌÅ͸¦ Á¦°øÇÏ´Â TreeModelÀ»
¼³Á¤ÇÕ´Ï´Ù. |
void |
setRootVisible (boolean rootVisible)
TreeModel
·çÆ® ³ëµå°¡ °¡½ÃÀΰ¡ ¾î¶²°¡¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
void |
setRowHeight (int rowHeight)
°¢ ¼¿ÀÇ ³ôÀ̸¦ Çȼ¿ ´ÜÀ§·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setScrollsOnExpand (boolean newValue)
scrollsOnExpand ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setSelectionInterval (int index0,
int index1)
index0 ·ÎºÎÅÍ index1 ±îÁöÀÇ ³ëµå¸¦ ¼±ÅÃÇÕ´Ï´Ù. |
void |
setSelectionModel (TreeSelectionModel selectionModel)
Æ®¸®ÀÇ ¼±Åà ¸ðµ¨À» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setSelectionPath (TreePath path)
ÁöÁ¤µÈ ÆÐ½º·Î ½Äº°µÇ´Â ³ëµå¸¦ ¼±ÅÃÇÕ´Ï´Ù. |
void |
setSelectionPaths (TreePath [] paths)
ÁöÁ¤µÈ ÆÐ½ºÀÇ ¹è¿¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ ¼±ÅÃÇÕ´Ï´Ù. |
void |
setSelectionRow (int row)
ÁöÁ¤µÈ Ç¥½ÃÇà¿¡ ÀÖ´Â ³ëµå¸¦ ¼±ÅÃÇÕ´Ï´Ù. |
void |
setSelectionRows (int[] rows)
ÁöÁ¤µÈ °¢ Ç¥½ÃÇà¿¡ ´ëÀÀÇÏ´Â ³ëµå¸¦ ¼±ÅÃÇÕ´Ï´Ù. |
void |
setShowsRootHandles (boolean newValue)
³ëµå ÇÚµéÀ» Ç¥½ÃÇÒÁö ¾î¶³Áö¸¦ ³ªÅ¸³»´Â showsRootHandles ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setToggleClickCount (int clickCount)
³ëµå¸¦ Àü°³Çϰųª ´Ý±â À§Çؼ ÇÊ¿äÇÑ ¸¶¿ì½º Ŭ¸¯ÀÇ È¸¼ö¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setUI (TreeUI ui)
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ ·»´õ¸µ ÇÏ´Â L&F °´Ã¼¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setVisibleRowCount (int newCount)
Ç¥½ÃÇÏ´Â Çà¼ö¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
startEditingAtPath (TreePath path)
ÁöÁ¤µÈ ÆÐ½º¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ ¼±ÅÃÇØ, ÆíÁýÀ» °³½ÃÇÕ´Ï´Ù. |
boolean |
stopEditing ()
ÇöÀçÀÇ ÆíÁý ¼¼¼ÇÀ» Á¾·áÇÕ´Ï´Ù. |
void |
treeDidChange ()
Æ®¸®ÀÇ º¯°æÀÌ, °æ°è¸¦ »çÀÌÁî º¯°æÇÒ Çʿ䰡 ÀÖÀ» ¸¸Å Å©Áö¸¸, Àü°³µÈ ³ëµå ¼¼Æ®¸¦ »èÁ¦ÇÒ Á¤µµ°¡ ¾Æ´Ñ °æ¿ì¿¡ º¸³»Áý´Ï´Ù (¿¹¸¦ µé¾î ³ëµå°¡ Àü°³µÇ´ÂÁö, ¼ö³³µÇ¾úÀ» ¶§, ¶Ç´Â ³ëµå°¡ Æ®¸®¿¡ »ðÀԵǾúÀ» ¶§). |
void |
updateUI ()
L&F°¡ º¯°æµÇ¾ú´Ù°í ÇÏ´Â UIManager·Î
ºÎÅÍÀÇ ÅëÁöÀÔ´Ï´Ù. |
| Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
|---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| ÇʵåÀÇ »ó¼¼ |
|---|
protected transient TreeModel treeModel
protected transient TreeSelectionModel selectionModel
protected boolean rootVisible
protected transient TreeCellRenderer cellRenderer
nullÀÎ °æ¿ì, UI´Â µðÆúÆ®ÀÇ cellRenderer¸¦ »ç¿ëÇÕ´Ï´Ù.
protected int rowHeight
protected boolean showsRootHandles
ÇÚµé°ú´Â ³ëµåÀÇ ¿·¿¡ Ç¥½ÃµÇ´Â ÀÛÀºÀڽľÆÀÌÄÜÀ̸ç, »ç¿ëÀÚ°¡ Ŭ¸¯ÇÏ¸é ³ëµå°¡ Àü°³µÇ´ÂÁö, ¼ö³³µË´Ï´Ù. °øÅëÀÇ ÀÎÅÍÆäÀ̽º´Â Àü°³ÇÒ ¼ö ÀÖ´Â ³ëµå·Î Ç÷¯½º ºÎÈ£ (+)¸¦ Ç¥½ÃÇØ, ¼ö³³ÇÒ ¼ö ÀÖ´Â ³ëµå¿¡¼´Â ¸¶À̳ʽº ºÎÈ£ (-)¸¦ Ç¥½ÃÇÕ´Ï´Ù. ÇÚµéÀº ÃÖ»óÁ¤µµ ·¹º§º¸´Ù ¾Æ·¡ÀÇ ³ëµå·Î Ç×»ó Ç¥½ÃµË´Ï´Ù.
rootVisible
¼³Á¤ÀÌ ·çÆ® ³ëµåÀÇ Ç¥½Ã¸¦ ÁöÁ¤ÇÏ´Â °æ¿ì´Â ±×°ÍÀÌ ÃÖ»óÁ¤µµ ·¹º§ÀÇ À¯ÀÏÇÑ ³ëµåÀÔ´Ï´Ù. ·çÆ® ³ëµå°¡ Ç¥½ÃµÇÁö ¾Ê´Â °æ¿ì, ±× ¸ðµç ÀÚ½ÄÀÌ Æ®¸®ÀÇ ÃÖ»óÁ¤µµ ·¹º§¿¡ ÀÖ½À´Ï´Ù. ÇÚµéÀº ÃÖ»óÁ¤µµ ÀÌ¿ÜÀÇ ³ëµå·Î Ç×»ó Ç¥½ÃµË´Ï´Ù.
·çÆ® ³ëµå°¡ °¡½Ã°¡ ¾Æ´Ñ °æ¿ì, ÀϹÝÀûÀ¸·Î ÀÌ °ªÀ» true ·Î ¼³Á¤ÇÕ´Ï´Ù. true ·Î ¼³Á¤ÇÏÁö ¾ÊÀ¸¸é Æ®¸®´Â ¸®½ºÆ®¿Í °°ÀÌ Ç¥½ÃµÇ¾î »ç¿ëÀÚ´Â ¡¸¸®½ºÆ® ¿£Æ®¸®¡¹°¡ ½ÇÁ¦·Î´Â Æ®¸® ³ëµåÀÎ °ÍÀ» ÀνÄÇÒ ¼ö ¾ø½À´Ï´Ù.
rootVisible protected transient JTree.TreeSelectionRedirector selectionRedirector
selectionListeners¿¡ °Ç³×ÁÝ´Ï´Ù.
protected transient TreeCellEditor cellEditor
null (Æ®¸®´Â ÆíÁýÇÒ ¼ö ¾ø´Ù)ÀÔ´Ï´Ù.
protected boolean editable
protected boolean largeModel
ÀÌ °ªÀº UI ¿¡ÀÇ ´Ü¼øÇÑ Á¦¾ÈÀÔ´Ï´Ù. ¸ðµç UI°¡ ÀÌ °ªÀ» ÀÌ¿ëÇÏ´Â °ÍÀº ¾Æ´Õ´Ï´Ù. ±âº»°ª´Â false ÀÔ´Ï´Ù.
protected int visibleRowCount
ScrollableÀÎÅÍÆäÀ̽º·Î »ç¿ëµË´Ï´Ù. ÀÌ °ªÀº Ç¥½Ã ¿µ¿ªÀÇ ÀûÀýÇÑ »çÀÌÁ °áÁ¤ÇÕ´Ï´Ù.
protected boolean invokesStopCellEditing
stopCellEditing°¡ ºÒ·Á°¡
º¯°æÀÌ º¸Á¸µË´Ï´Ù. falseÀÎ °æ¿ì, cancelCellEditing°¡ ºÒ·Á°¡
º¯°æÀº ÆÄ±âµË´Ï´Ù. µðÆúÆ®´Â false ÀÔ´Ï´Ù.
protected boolean scrollsOnExpand
protected int toggleClickCount
protected transient TreeModelListener treeModelListener
expandedState¸¦ °»½ÅÇÕ´Ï´Ù.
public static final String CELL_RENDERER_PROPERTY
cellRenderer
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String TREE_MODEL_PROPERTY
treeModel
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String ROOT_VISIBLE_PROPERTY
rootVisible
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String SHOWS_ROOT_HANDLES_PROPERTY
showsRootHandles
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String ROW_HEIGHT_PROPERTY
rowHeight
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String CELL_EDITOR_PROPERTY
cellEditor
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String EDITABLE_PROPERTY
editable
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String LARGE_MODEL_PROPERTY
largeModel
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String SELECTION_MODEL_PROPERTY
public static final String VISIBLE_ROW_COUNT_PROPERTY
visibleRowCount
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String INVOKES_STOP_CELL_EDITING_PROPERTY
messagesStopCellEditing
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String SCROLLS_ON_EXPAND_PROPERTY
scrollsOnExpand
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String TOGGLE_CLICK_COUNT_PROPERTY
toggleClickCount
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String LEAD_SELECTION_PATH_PROPERTY
leadSelectionPath
¹Ù¿îµå ÇÁ·ÎÆÛƼ¸íÀÔ´Ï´Ù.
public static final String ANCHOR_SELECTION_PATH_PROPERTY
public static final String EXPANDS_SELECTED_PATHS_PROPERTY
| »ý¼ºÀÚ »ó¼¼ |
|---|
public JTree()
JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. Æ®¸®°¡ »ç¿ëÇÏ´Â µðÆúÆ® ¸ðµ¨Àº ÀÙ³ëµå¸¦ ÀÚ½ÄÀÌ ¾ø´Â ÀÓÀÇ ³ëµå·Î¼ Á¤ÀÇÇÕ´Ï´Ù.
DefaultTreeModel.asksAllowsChildren public JTree(Object [] value)
JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â Æ®¸®´Â ÀÙ³ëµå¸¦ ÀÚ½ÄÀÌ ¾ø´Â ÀÓÀÇ ³ëµå·Î¼ Á¤ÀÇÇÕ´Ï´Ù.
value - Object
¹è¿DefaultTreeModel.asksAllowsChildren public JTree(Vector <? > value)
Vector
°¢ ¿ä¼Ò¸¦, Ç¥½ÃµÇ¾î ÀÖÁö ¾ÊÀº »õ·Î¿î ·çÆ® ³ëµåÀÇÀÚ½Ä
·Î¼ °¡Áö´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â Æ®¸®´Â ÀÙ³ëµå¸¦ ÀÚ½ÄÀÌ ¾ø´Â ÀÓÀÇ ³ëµå·Î¼ Á¤ÀÇÇÕ´Ï´Ù.
value - VectorDefaultTreeModel.asksAllowsChildren public JTree(Hashtable <?,?> value)
Hashtable·Î
ºÎÅÍ »ý¼ºµÈ, ·çÆ®¸¦ Ç¥½ÃÇÏÁö ¾Ê´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. HashTable
Ű¿Í °ªÀÇ Á¶ÀÇ Ä¡ÃøÀÌ »õ·Î¿î ·çÆ® ³ëµåÀÇ ÀÚ½ÄÀÌ µË´Ï´Ù. µðÆúÆ®¿¡¼´Â Æ®¸®´Â ÀÙ³ëµå¸¦ ÀÚ½ÄÀÌ ¾ø´Â ÀÓÀÇÀÇ ³ëµå·Î¼ Á¤ÀÇÇÕ´Ï´Ù.
value - HashtableDefaultTreeModel.asksAllowsChildren public JTree(TreeNode root)
TreeNode¸¦ ·çÆ®¿¡ °¡Áö´Â ·çÆ® ³ëµå¸¦ Ç¥½ÃÇÏ´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â Æ®¸®´Â ÀÙ³ëµå¸¦ ÀÚ½ÄÀÌ ¾ø´Â ÀÓÀÇÀÇ ³ëµå·Î¼ Á¤ÀÇÇÕ´Ï´Ù.
root - TreeNode °´Ã¼DefaultTreeModel.asksAllowsChildren
public JTree(TreeNode root,
boolean asksAllowsChildren)
TreeNode¸¦ ·çÆ®·Î¼ °¡Áö´Â JTree¸¦ ¸®ÅÏÇÕ´Ï´Ù.
root - TreeNode °´Ã¼asksAllowsChildren - falseÀÎ °æ¿ì, ÀÚ½ÄÀ» °¡ÁöÁö ¾Ê´Â ¸ðµç ³ëµå°¡ ÀÙ³ëµå. trueÀÎ °æ¿ì, ÀÚ½ÄÀ» Çã°¡ÇÏÁö ¾Ê´Â ³ëµå¸¸ÀÌ ÀÙ³ëµåDefaultTreeModel.asksAllowsChildren public JTree(TreeModel newModel)
JTree
ÀνºÅϽº¸¦ ¸®ÅÏÇÕ´Ï´Ù. Æ®¸®´Â ÁöÁ¤µÈ µ¥ÀÌÅÍ ¸ðµ¨À» »ç¿ëÇØ »ý¼ºµË´Ï´Ù.
newModel - µ¥ÀÌÅÍ ¸ðµ¨·Î¼ »ç¿ëÇÏ´Â TreeModel| ¸Þ¼µåÀÇ »ó¼¼ |
|---|
protected static TreeModel getDefaultTreeModel()
TreeModelÀ»
»ý¼ºÇØ, ±×°ÍÀ» ¸®ÅÏÇÕ´Ï´Ù. ¹«¾ùÀΰ¡¸¦ Èï¹Ì·Ó°Ô º¸ÀÌ°Ô Çϱâ À§Çؼ
ÁÖ·Î Beanbuilder ·Î »ç¿ëµË´Ï´Ù.
TreeModelprotected static TreeModel createTreeModel(Object value)
TreeModelÀ»
¸®ÅÏÇÕ´Ï´Ù. °´Ã¼°¡ ´ÙÀ½ÀÇ ¾î¶² °ÍÀΰ¡ÀÇ °æ¿ìÀÔ´Ï´Ù. Object
¹è¿HashtableVector
value - TreeModel
±âÃʷμ »ç¿ëµÇ´Â Object
TreeModelpublic TreeUI getUI()
TreeUI °´Ã¼public void setUI(TreeUI ui)
ui - TreeUI
L&F °´Ã¼UIDefaults.getUI(javax.swing.JComponent) public void updateUI()
UIManager·Î
ºÎÅÍÀÇ ÅëÁöÀÔ´Ï´Ù. ÇöÀçÀÇ UI °´Ã¼¸¦ UIManager·Î
ºÎÅÍÀÇ ÃֽйöÀü¿¡ ¿Å°Ü³õ½À´Ï´Ù.
JComponent ³»ÀÇ updateUI JComponent.updateUI() public String getUIClassID()
JComponent ³»ÀÇ getUIClassID JComponent.getUIClassID(),
UIDefaults.getUI(javax.swing.JComponent) public TreeCellRenderer getCellRenderer()
TreeCellRenderer¸¦ ¸®ÅÏÇÕ´Ï´Ù.
TreeCellRendererpublic void setCellRenderer(TreeCellRenderer x)
TreeCellRenderer¸¦ ¼³Á¤ÇÕ´Ï´Ù.
x - °¢ ¼¿À» ·»´õ¸µ ÇÏ´Â TreeCellRendererpublic void setEditable(boolean flag)
flag - boolean Ä¡. Æ®¸®°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì´Â truepublic boolean isEditable()
public void setCellEditor(TreeCellEditor cellEditor)
null°ªÀº
Æ®¸®¸¦ ÆíÁýÇÒ ¼ö ¾ø´Â °ÍÀ» ³ªÅ¸³À´Ï´Ù. À̰ÍÀÌ cellEditor¿¡
¼ÀÇ º¯°æÀ» ³ªÅ¸³»´Â °æ¿ì, propertyChange ¸Þ¼µå°¡ ¸ðµç ¸®½º³Ê·Î È£ÃâÇÕ´Ï´Ù.
cellEditor - »ç¿ëÇÏ´Â TreeCellEditorpublic TreeCellEditor getCellEditor()
TreeCellEditor. Æ®¸®¸¦ ÆíÁýÇÒ ¼ö ¾ø´Â °æ¿ì´Â nullpublic TreeModel getModel()
TreeModelÀ»
¸®ÅÏÇÕ´Ï´Ù.
TreeModelpublic void setModel(TreeModel newModel)
TreeModelÀ»
¼³Á¤ÇÕ´Ï´Ù.
newModel - µ¥ÀÌÅ͸¦ Á¦°øÇÏ´Â TreeModelpublic boolean isRootVisible()
rootVisible public void setRootVisible(boolean rootVisible)
TreeModel
·çÆ® ³ëµå°¡ °¡½ÃÀΰ¡ ¾î¶²°¡¸¦ ÆÇÁ¤ÇÕ´Ï´Ù.
rootVisible - Æ®¸®ÀÇ ·çÆ® ³ëµå°¡ Ç¥½ÃµÇ´Â °æ¿ì´Â truerootVisible public void setShowsRootHandles(boolean newValue)
showsRootHandles ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. ÀÌ ÇÁ·ÎÆÛƼÀÇ ±âº»°ª´Â JTree
ÀÛ¼º¿¡ »ç¿ëÇÏ´Â »ý¼ºÀÚ¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù. ÀϺÎÀÇ Look & Feel ¿¡¼´Â ÇÚµéÀÌ Áö¿ø
µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì°¡ ÀÖ½À´Ï´Ù. ±× °æ¿ì, ÀÌ ÇÁ·ÎÆÛƼ´Â ¹«½ÃµË´Ï´Ù.
newValue - ·çÆ® ÇÚµéÀ» Ç¥½ÃÇÏÁö ¾Ê´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´ÂfalseshowsRootHandles,
getShowsRootHandles() public boolean getShowsRootHandles()
showsRootHandles ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù.
showsRootHandles ÇÁ·ÎÆÛƼÀÇ °ªshowsRootHandles public void setRowHeight(int rowHeight)
rowHeight - °¢ ¼¿ÀÇ Çȼ¿ ´ÜÀ§ÀÇ ³ôÀÌpublic int getRowHeight()
public boolean isFixedRowHeight()
public void setLargeModel(boolean newValue)
newValue - UI¿¡ ´ëÇØ¼ Å« ¸ðµ¨À» Á¦¾ÈÇÏ´Â °æ¿ì´Â truelargeModel public boolean isLargeModel()
largeModel public void setInvokesStopCellEditing(boolean newValue)
true·Î
¼³Á¤Çϸé, ÆíÁýÀÌ ³¢¾îµé¾îÁ³À» ¶§¿¡ º¯°æÀÌ ÀÚµ¿ÀûÀ¸·Î º¸Á¸µË´Ï´Ù.
INVOKES_STOP_CELL_EDITING_PROPERTY ÇÁ·ÎÆÛƼ º¯°æÀ» Æ®¸®°Å ÇÕ´Ï´Ù.
newValue - trueÀÎ °æ¿ì´Â ÆíÁýÀÌ ³¢¾îµé¾îÁ³À» ¶§¿¡ stopCellEditing°¡ ºÒ·Á°¡
µ¥ÀÌÅͰ¡ º¸Á¸µÈ´Ù. falseÀÎ °æ¿ì´Â cancelCellEditing°¡ ºÒ·Á°¡
º¯°æÀÌ ¾ø¾îÁø´Ùpublic boolean getInvokesStopCellEditing()
setInvokesStopCellEditing(boolean) public void setScrollsOnExpand(boolean newValue)
scrollsOnExpand ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. ÀÌ ÇÁ·ÎÆÛƼ´Â Æ®¸®¸¦ ½ºÅ©·Ñ ÇßÀ» ¶§¿¡
¼û°ÜÁö°í ÀÖ´ø ÀÚ½ÄÀ» Ç¥½ÃÇÒÁö ¾î¶³Áö¸¦ ³ªÅ¸³À´Ï´Ù. true (µðÆúÆ®)ÀÇ °æ¿ì, ³ëµå¸¦ Àü°³Çϸé, ÇÏÀ§ ³ëµå°¡ °¡´ÉÇÑ ÇÑ ¸¹ÀÌ °¡½Ã »óŰ¡ µÇµµ·Ï Æ®¸®°¡ ½ºÅ©·Ñ µË´Ï´Ù. ÀϺÎÀÇ Look & Feel ¿¡¼´Â ³ëµåÀÇ Àü°³½Ã¿¡ ½ºÅ©·ÑÀ» ÇÊ¿ä·Î ÇÏÁö ¾Ê±â ¶§¹®¿¡
ÀÌ ÇÁ·ÎÆÛƼ´Â ¹«½ÃµË´Ï´Ù.
newValue - Àü°³½ÃÀÇ ½ºÅ©·ÑÀ» »ç¿ë ºÒ°¡·Î ÇÏ´Â °æ¿ì´Â false, »ç¿ë °¡´ÉÇÏ°Ô ÇÏ´Â °æ¿ì´Â truegetScrollsOnExpand() public boolean getScrollsOnExpand()
scrollsOnExpand ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù.
scrollsOnExpand ÇÁ·ÎÆÛƼÀÇ °ªpublic void setToggleClickCount(int clickCount)
public int getToggleClickCount()
public void setExpandsSelectedPaths(boolean newValue)
expandsSelectedPaths ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. trueÀÎ °æ¿ì¿¡´Â TreeSelectionModel ¶Ç´Â JTree°¡ Á¦°øÇÏ´Â Ä¿¹ö ¸Þ¼µå¿¡ ÀÇÇØ ¾ðÁ¦¶óµµ ¼±ÅÃÀ» º¯°æÇÒ ¼ö ÀÖ¾îTreePath
ºÎ¸ð°¡ Àü°³µÇ°í °¡½Ã°¡ µË´Ï´Ù. °¡½Ã¶õ
JTree
°¡½Ã ±¸Çü¿¡ ÇÑÇÏÁö ¾Ê°í ºÎ¸ð ÆÐ½º°¡ Àü°³µÇ°í ÀÖ´Â »óŸ¦ÀǹÌÇÕ´Ï´Ù. falseÀÎ °æ¿ì, ³ëµå ¼±ÅÃÀ» º¯°æÇÏ¸é ºÎ¸ð´Â ¸ðµÎ Àü°³µÇ¾îµµ °¡½Ã·Î´Â µÇÁö ¾Ê½À´Ï´Ù. ¼±Åà ¸ðµ¨ ÆÐ½º¸¦, ¸ðµç ºÎ¸ð¸¦ Àü°³ÇØ Ç×»ó ºñÇ¥½Ã·Î ÇÏ´Â °æ¿ì¿¡´Â Æí¸®ÇÕ´Ï´Ù.
newValue - expandsSelectedPaths
»õ·Î¿îÀÇ °ªpublic boolean getExpandsSelectedPaths()
expandsSelectedPaths ÇÁ·ÎÆÛƼ¸¦ ¸®ÅÏÇÕ´Ï´Ù.
setExpandsSelectedPaths(boolean) public void setDragEnabled(boolean b)
dragEnabled ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. ÀÌ ÇÁ·ÎÆÛƼ´Â ÀÌ ÄÄÆÛ³ÍÆ®ÀÇ ÀÚµ¿ µå·¡±×
ó¸® (µå·¡±×£¦µå·ÓÀÇ ÃÖÃÊÀÇ Ã³¸®)¸¦ À¯È¿ÇÏ°Ô Çϱâ À§Çؼ true°¡ µÇ¾î ÀÖÀ» Çʿ䰡 ÀÖ½À´Ï´Ù. transferHandler ÇÁ·ÎÆÛƼ´Â µå·¡±×
·Î ¹¹µçÁö ÇÒ ¼ö ÀÖµµ·Ï null ÀÌ¿ÜÀÇ °ªÀ¸·Î ¼³Á¤ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. dragEnabled ÇÁ·ÎÆÛƼÀÇ µðÆúÆ®ÀÇ °ªÀº false ÀÔ´Ï´Ù.
ÀÚµ¿ µå·¡±×
󸮰¡ À¯È¿ÀÇ °æ¿ì, ´ëºÎºÐÀÇ Look & Feel´Â
»ç¿ëÀÚ°¡ ¼±ÅÃÀ» À§Çؼ mouse button¸¦ ´·¯, ¸¶¿ì½º¸¦ ¼öÇȼ¿ À̵¿Çϸé Ç×»ó µå·¡±×£¦µå·Ó Á¶ÀÛÀÌ ½ÃÀ۵˴ϴÙ. µû¶ó¼, ÀÌ ÇÁ·ÎÆÛƼ¸¦ true·Î
¼³Á¤ÇÏ´Â °ÍÀ¸·Î½á, ¼±ÅÃÀÇ µ¿ÀÛ¿¡ ¹Ì¹¦ÇÑ È¿°ú°¡ ÀÖ½À´Ï´Ù.
ÀϺÎÀÇ Look & Feel´Â ÀÚµ¿ µå·¡±×£¦µå·Ó Á¶ÀÛÀ» Áö¿ø
ÇÏÁö ¾Ê´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. À̰͵éÀº ÀÌ ÇÁ·ÎÆÛƼ¸¦ ¹«½ÃÇÕ´Ï´Ù. Á÷Á¢ TransferHandler
exportAsDrag ¸Þ¼µå¸¦ È£ÃâÇØ ÄÄÆÛ³ÍÆ®¸¦ º¯°æÇÏ´Â °ÍÀ¸·Î½á, ÀÌ·¯ÇÑ Look & Feel¸¦ Á¶ÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù
.
b - dragEnabled ÇÁ·ÎÆÛƼ·Î ¼³Á¤µÇ´Â °ª
HeadlessException - b°¡ trueÀÎ °æ¿ì·Î GraphicsEnvironment.isHeadless()°¡ true¸¦ µ¹·ÁÁÖ´Â °æ¿ìGraphicsEnvironment.isHeadless(),
getDragEnabled(),
JComponent.setTransferHandler(javax.swing.TransferHandler),
TransferHandler public boolean getDragEnabled()
dragEnabled ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù.
dragEnabled ÇÁ·ÎÆÛƼÀÇ °ªsetDragEnabled(boolean) public boolean isPathEditable(TreePath path)
isEditableÀ»
¸®ÅÏÇÕ´Ï´Ù. ÀÌ ¸Þ¼µå´Â ÆíÁýÀÌ ½ÃÀ۵DZâ Àü¿¡ UI ·ÎºÎÅÍ ºÒ·Á°¡
ÁöÁ¤µÈ ÆÐ½º¸¦ ÆíÁýÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. ÀÌ ¸Þ¼µå´Â »õ·Î¿î ¿¡µðÅ͸¦ ÀÛ¼ºÇÏ´Â ÀÏ ¾øÀÌ ÇÊÅÍ ÆíÁýÀ» Ãß°¡Çϱâ À§ÇÑ »çºêÅ©¶ó»çÀÇ ¿£Æ®¸® Æ÷ÀÎÆ®·Î¼ Á¦°øµË´Ï´Ù.
isEditable() public String getToolTipText(MouseEvent event)
JComponent
getToolTipText ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ·»´õ¸µÀÇ ÈùÆ® (ÅØ½ºÆ® ¼¼Æ®°¡ ÀÖ´Â °æ¿ì)¸¦ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù.
ÁÖ: JTree°¡ ·»´õ¸µÀÇ Åø ÈùÆ®¸¦ ¿Ã¹Ù¸£°Ô Ç¥½ÃÇϱâ À§Çؼ´Â JTree°¡ ÄÄÆÛ³ÍÆ®·Î¼ ToolTipManager¿¡ µî·ÏµÇ¾î ÀÖÀ» Çʿ䰡 ÀÖ½À´Ï´Ù. µî·ÏÇÏ·Á¸é,
ToolTipManager.sharedInstance(). registerComponent(tree)¸¦ È£ÃâÇÕ´Ï´Ù. À̰ÍÀº ÀÚµ¿ÀûÀ¸·Î ÇÏÇà ±úÁöÁö ¾Ê½À´Ï´Ù.
JComponent ³»ÀÇ getToolTipText event - ToolTip
Ç¥½Ã¸¦ ½ÃÀÛÇÑ MouseEvent
eventÀÌ nullÀÎ °æ¿ì´Â null
public String convertValueToText(Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
value.toString¸¦ µ¹·ÁÁÖ°í, ´Ù¸¥ ¸ðµç Àμö¸¦ ¹«½ÃÇÕ´Ï´Ù. º¯È¯À» Á¦¾îÇÏ·Á¸é,
ÀÌ ¸Þ¼µå¸¦ »ó¼ÓÇØ, ÇÊ¿äÇÑ ÀÓÀÇÀÇ Àμö¸¦ »ç¿ëÇÕ´Ï´Ù.
value - ÅØ½ºÆ®·Î º¯È¯ÇÏ´Â Objectselected - ³ëµå°¡ ¼±Åõǰí ÀÖ´Â °æ¿ì´Â trueexpanded - ³ëµå°¡ Àü°³µÇ°í ÀÖ´Â °æ¿ì´Â trueleaf - ³ëµå°¡ ÀÙ³ëµåÀÇ °æ¿ì´Â truerow - ³ëµåÀÇ Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ ÇàhasFocus - ³ëµå°¡ Æ÷Ä¿½º¸¦ °¡Áö´Â °æ¿ì´Â true
String Ç¥Çöpublic int getRowCount()
public void setSelectionPath(TreePath path)
getExpandsSelectedPaths°¡ trueÀÎ °æ¿ì¿¡´Â Ç¥½Ã °¡´ÉÇÏ°Ô µË´Ï´Ù.
path - ¼±ÅÃÇÏ´Â ³ëµå¸¦ ÁöÁ¤ÇÏ´Â TreePathpublic void setSelectionPaths(TreePath [] paths)
getExpandsSelectedPaths°¡ trueÀÎ °æ¿ì¿¡´Â Ç¥½Ã °¡´ÉÇÏ°Ô µË´Ï´Ù.
paths - ¼±ÅÃÇÏ´Â ³ëµå¸¦ ÁöÁ¤ÇÏ´Â TreePath °´Ã¼ÀÇ ¹è¿public void setLeadSelectionPath(TreePath newPath)
JTree¿¡ ÀÇÇØ À¯ÁöµÇ´Â °ÍÀÌ ¾Æ´Ï¶ó, UI°¡ °»½ÅÇÕ´Ï´Ù.
newPath - »õ·Î¿î ¸®µå ÆÐ½ºpublic void setAnchorSelectionPath(TreePath newPath)
JTree¿¡ ÀÇÇØ À¯ÁöµÇ´Â °ÍÀÌ ¾Æ´Ï¶ó, UI°¡ °»½ÅÇÕ´Ï´Ù.
newPath - »õ·Î¿î ¿¨Ä¿ ÆÐ½ºpublic void setSelectionRow(int row)
row - ¼±ÅÃÇÏ´Â Çà. 0 Àº ÃÖÃÊÀÇ Çàpublic void setSelectionRows(int[] rows)
rows
ƯÁ¤ÀÇ ¿ä¼Ò°¡ 0 º¸´Ù ÀÛÀºÁö, getRowCount ÀÌ»óÀÇ °æ¿ì, ±× ¿ä¼Ò´Â ¹«½ÃµË´Ï´Ù. rows
¸ðµç ¿ä¼Ò°¡ ¹«È¿ÀÎ ÇàÀÎ °æ¿ì, ¼±ÅÃÀº Ŭ¸®¾î µË´Ï´Ù. Áï, clearSelection°¡ ºÒ·Á °¬À» °æ¿ì¿Í °°½À´Ï´Ù.
rows - ¼±ÅÃÇÏ´Â ÇàÀ» ÁöÁ¤ÇÏ´Â int
¹è¿. 0 Àº ÃÖÃÊÀÇ ÇàÀ» ³ªÅ¸³½´Ùpublic void addSelectionPath(TreePath path)
TreePath¿¡ ÀÇÇØ ½Äº°µÇ´Â ³ëµå¸¦ ÇöÀçÀÇ ¼±Åÿ¡ Ãß°¡ÇÕ´Ï´Ù. ±× ÆÐ½ºÀÇ ÄÄÆÛ³ÍÆ®°¡ Ç¥½Ã °¡´ÉÇÏÁö ¾Ê°í, getExpandsSelectedPaths°¡ trueÀÎ °æ¿ì¿¡´Â Ç¥½Ã °¡´ÉÇÏ°Ô µË´Ï´Ù.
JTree¿¡
¼´Â °°Àº ºÎ¸ðÀÇÀÚ½Ä
·Î¼ °°Àº ³ëµå¸¦ Áߺ¹ ½Ãų ¼ö ¾ø½À´Ï´Ù. °¢ ÇüÁ¦ À§Á¦Æ®´Â ÀÏÀÇÀÇ °´Ã¼ÀÎ °ÍÀÌ ÇÊ¿äÇÕ´Ï´Ù.
path - Ãß°¡ÇÏ´Â TreePathpublic void addSelectionPaths(TreePath [] paths)
getExpandsSelectedPaths°¡ trueÀÎ °æ¿ì¿¡´Â Ç¥½Ã °¡´ÉÇÏ°Ô µË´Ï´Ù.
JTree¿¡
¼´Â °°Àº ºÎ¸ðÀÇÀÚ½Ä
·Î¼ °°Àº ³ëµå¸¦ Áߺ¹ ½Ãų ¼ö ¾ø½À´Ï´Ù. °¢ ÇüÁ¦ À§Á¦Æ®´Â ÀÏÀÇÀÇ °´Ã¼ÀÎ °ÍÀÌ ÇÊ¿äÇÕ´Ï´Ù.
paths - Ãß°¡ÇÏ´Â ³ëµå¸¦ ÁöÁ¤ÇÏ´Â TreePath °´Ã¼ÀÇ ¹è¿public void addSelectionRow(int row)
row - Ãß°¡ÇÏ´Â ³ëµåÀÇ ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàpublic void addSelectionRows(int[] rows)
rows - Ãß°¡ÇÏ´Â ÇàÀ» ÁöÁ¤ÇÏ´Â int
¹è¿. 0 Àº ÃÖÃÊÀÇ ÇàÀ» ³ªÅ¸³½´Ùpublic Object getLastSelectedPathComponent()
TreePath¿¡ ÀÖ´Â ¸¶Áö¸· Object. ¾Æ¹«°Íµµ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì´Â nullTreePath.getLastPathComponent() public TreePath getLeadSelectionPath()
public TreePath getAnchorSelectionPath()
public TreePath getSelectionPath()
TreePath. ÇöÀç ¾Æ¹«°Íµµ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì´Â nullpublic TreePath [] getSelectionPaths()
TreePath °´Ã¼ÀÇ ¹è¿. ÇöÀç ¾Æ¹«°Íµµ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì´Â nullpublic int[] getSelectionRows()
TreeSelectionModel¿¡ Àü¼Û µË´Ï´Ù. ¾Æ¹«°Íµµ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì´Â null ¶Ç´Â ºñ¾îÀÖ´Â ¹è¿ÀÌ ¸®Åϵ˴ϴÙ
. ¾î´À ÂÊÀÌ µ¹·ÁÁÖ°íÁú±î´Â TreeSelectionModel
±¸Çö¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù.
public int getSelectionCount()
public int getMinSelectionRow()
public int getMaxSelectionRow()
public int getLeadSelectionRow()
leadPath°¡ nullÀÎ °æ¿ì´Â -1public boolean isPathSelected(TreePath path)
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePath
public boolean isRowSelected(int row)
row - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çà
public Enumeration <TreePath > getExpandedDescendants(TreePath parent)
parent
ÇÏÀ§ ³ëµå·ÎºÎÅÍ ¿Ï¼ºµÇ´Â EnumerationÀ»
¸®ÅÏÇÕ´Ï´Ù. parentÀÌ ÇöÀç Àü°³µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì, ÀÌ ¸Þ¼µå´Â nullÀ»
¸®ÅÏÇÕ´Ï´Ù. ¸®ÅÏµÈ Enumeration·Î
¹Ýº¹Çϰí ÀÖ´Â µ¿¾È ³ëµå¸¦ Àü°³ÇÏ´ÂÁö, ¼ö³³Çϸé, ÀÌ ¸Þ¼µå´Â Àü°³µÈ ¸ðµç ÆÐ½º¸¦ µ¹·ÁÁÖ´Â °ÍÀÌ ¾Æ´Ï¶ó, ±× ÀÌ»ó Àü°³µÇ¾î ÀÖÁö ¾ÊÀº ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù.
parent - Á¶»çÇÒ ¼ö ÀÖ´Â ÆÐ½º
parent
ÇÏÀ§ ³ëµåÀÇ Enumeration. parentÀÌ ÇöÀç Àü°³µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â nullpublic boolean hasBeenExpanded(TreePath path)
path°¡ Áö±Ý±îÁö Àü°³µÇ¾úÀ» °æ¿ì´Â truepublic boolean isExpanded(TreePath path)
path - Á¶»çÇÏ´Â ³ëµå¸¦ ÁöÁ¤ÇÏ´Â TreePath
public boolean isExpanded(int row)
row - Á¶»çÇÏ´Â Çà. 0 Àº ÃÖÃÊÀÇ Çà
public boolean isCollapsed(TreePath path)
path - Á¶»çÇÏ´Â TreePath
public boolean isCollapsed(int row)
row - Á¶»çÇÏ´Â Çà. 0 Àº ÃÖÃÊÀÇ Çà
public void makeVisible(TreePath path)
path - °¡½Ã·Î ÇÏ´Â TreePathpublic boolean isVisible(TreePath path)
public Rectangle getPathBounds(TreePath path)
Rectangle¸¦ ¸®ÅÏÇÕ´Ï´Ù. ÆÐ½º¿¡ ÀÖ´Â ÄÄÆÛ³ÍÆ®°¡ ¼û¾î ÀÖ´Â (¼ö³³µÈ ºÎ¸ð¾Æ·¡¿¡ ÀÖ´Ù) °æ¿ì´Â nullÀ»
¸®ÅÏÇÕ´Ï´Ù.
ÁÖ:
ÀÌ ¸Þ¼µå´Â ÁöÁ¤µÈ ³ëµå°¡ ÇöÀç Ç¥½ÃµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì¿¡¼µµ À¯È¿ÇÑ ±¸ÇüÀ» ¸®ÅÏÇÕ´Ï´Ù.
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePath
Rectangle ¶Ç´Â nullpublic Rectangle getRowBounds(int row)
Rectangle¸¦ ¸®ÅÏÇÕ´Ï´Ù.
row - ·»´õ¸µ µÇ´Â Çà. 0 Àº ÃÖÃÊÀÇ Çà
Rectanglepublic void scrollPathToVisible(TreePath path)
JTree°¡ JScrollPane¿¡ Æ÷ÇԵǰí ÀÖ´Â °æ¿ì¸¸ ±â´ÉÇÕ´Ï´Ù.
path - Ç¥½ÃÇÏ´Â ³ëµå¸¦ ½Äº°ÇÏ´Â TreePathpublic void scrollRowToVisible(int row)
JTree°¡ JScrollPane¿¡ Æ÷ÇԵǰí ÀÖ´Â °æ¿ì¸¸ ±â´ÉÇÕ´Ï´Ù.
row - ½ºÅ©·Ñ ÇÏ´Â ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàpublic TreePath getPathForRow(int row)
row°¡ °¡½Ã°¡ ¾Æ´Ñ °æ¿ì´Â nullÀÌ ¸®Åϵ˴ϴÙ
.
row - ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
TreePath. row < 0 ¶Ç´Â row > getRowCount()ÀÎ °æ¿ì´Â nullpublic int getRowForPath(TreePath path)
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePath
public void expandPath(TreePath path)
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePathpublic void expandRow(int row)
row°¡ 0 º¸´Ù ÀÛÀºÁö, getRowCount ÀÌ»óÀÇ °æ¿ì´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù.
row - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàpublic void collapsePath(TreePath path)
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePathpublic void collapseRow(int row)
row°¡ 0 º¸´Ù ÀÛÀºÁö, getRowCount ÀÌ»óÀÇ °æ¿ì´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù.
row - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çà
public TreePath getPathForLocation(int x,
int y)
x - Ç¥½Ã ¿µ¿ª (¿ÞÂÊ ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ Á´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÆò°Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)y - Ç¥½Ã ¿µ¿ª (»ó ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ »ó´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÁ÷ °Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)
TreePath
public int getRowForLocation(int x,
int y)
x - Ç¥½Ã ¿µ¿ª (¿ÞÂÊ ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ Á´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÆò°Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)y - Ç¥½Ã ¿µ¿ª (»ó ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ »ó´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÁ÷ °Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)
getClosestRowForLocation(int, int)
public TreePath getClosestPathForLocation(int x,
int y)
nullÀÌ ¸®Åϵ˴ϴÙ
. ±×·¸Áö ¾ÊÀº °æ¿ì, ÀÌ ¸Þ¼µå´Â Ç×»ó À¯È¿ÇÑ ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. ³ëµå°¡ Á¤È®ÇÏ°Ô x, y
À§Ä¡¿¡ ÀÖÀ»Áö ¾î¶³Áö¸¦ Å×½ºÆ®ÇÏ·Á¸é,
³ëµåÀÇ °æ°è¸¦ ÃëµæÇØ, ±×°ÍÀ» ±âÁØ¿¡ x, y¸¦ Å×½ºÆ®ÇÕ´Ï´Ù.
x - Ç¥½Ã ¿µ¿ª (¿ÞÂÊ ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ Á´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÆò°Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)y - Ç¥½Ã ¿µ¿ª (»ó ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ »ó´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÁ÷ °Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)
TreePath. Ç¥½Ã °¡´ÉÇÑ ³ëµå°¡ ¾ø´Â °æ¿ì, ¶Ç´Â ¸ðµ¨ÀÌ ¾ø´Â °æ¿ì´Â nullgetPathForLocation(int, int),
getPathBounds(javax.swing.tree.TreePath)
public int getClosestRowForLocation(int x,
int y)
x - Ç¥½Ã ¿µ¿ª (¿ÞÂÊ ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ Á´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÆò°Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)y - Ç¥½Ã ¿µ¿ª (»ó ¸¶ÁøÀº Á¦¿ÜÇÏ´Ù)ÀÇ »ó´ÜÀ¸·ÎºÎÅÍÀÇ ¼öÁ÷ °Å¸®¸¦ ³ªÅ¸³»´Â int°ª
(Çȼ¿ ´ÜÀ§)
getRowForLocation(int, int),
getRowBounds(int) public boolean isEditing()
getSelectionPath¸¦ »ç¿ëÇØ ÃëµæÇÒ ¼ö ÀÖ½À´Ï´Ù.
getSelectionPath() public boolean stopEditing()
DefaultTreeCellEditor°´Ã¼´Â
¼¿»ó¿¡¼ ÁøÇàÁßÀÇ ÆíÁýÀ» ¸ðµÎ ÀúÀåÇÕ´Ï´Ù. ´Ù¸¥ ±¸ÇöÀº ´Ù¸¥ µ¿ÀÛÀ» ÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. Æ®¸®°¡ ÆíÁýµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù. ÁÖ:
»ç¿ëÀÚ°¡ Æ®¸®³»¿¡¼ À̵¿ÇßÀ» ¶§¿¡ ÀÚµ¿ÀûÀ¸·Î ÆíÁýÀ» º¸Á¸ÇÏ·Á¸é,setInvokesStopCellEditing(boolean)¸¦ »ç¿ëÇÕ´Ï´Ù.
public void cancelEditing()
public void startEditingAtPath(TreePath path)
CellEditor°¡ ÁöÁ¤µÈ Ç׸ñÀÇ ÆíÁýÀ» Çã°¡ÇÏÁö ¾Ê´Â °æ¿ì, ÆíÁýÀÇ ½Ãµµ´Â ½ÇÆÐÇÕ´Ï´Ù.
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePathpublic TreePath getEditingPath()
TreePathpublic void setSelectionModel(TreeSelectionModel selectionModel)
null°ªÀ» ÁöÁ¤Çϸé, ¼±ÅÃÀ» Çã°¡ÇÏÁö ¾Ê´Â ºñ¾îÀÖ´Â selectionModel°¡ »ç¿ëµË´Ï´Ù.
selectionModel - »ç¿ëÇÏ´Â TreeSelectionModel. ¼±ÅÃÀ» ¹«È¿·Î ÇÏ´Â °æ¿ì´Â nullTreeSelectionModel public TreeSelectionModel getSelectionModel()
null ÀÌ¿ÜÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù. ¼±ÅÃÀ» Çã°¡ÇÏ°í ½ÍÁö ¾ÊÀº °æ¿ì´Â ¼±Åà ¸ðµ¨À» null·Î
¼³Á¤ÇØ °Á¦ÀûÀ¸·Î ºñ¾îÀÖ´Â ¼±Åà ¸ðµ¨À» »ç¿ëÇÕ´Ï´Ù.
setSelectionModel(javax.swing.tree.TreeSelectionModel)
protected TreePath [] getPathBetweenRows(int index0,
int index1)
JTreePath
ÀνºÅϽº¸¦ ¸®ÅÏÇÕ´Ï´Ù. Æ®¸®°¡ ¾ø´Â °æ¿ì´Â nullÀ»
¸®ÅÏÇÕ´Ï´Ù.
index0 - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàindex1 - 2¹øÂ°ÀÇ ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
TreePath °´Ã¼ (index0 ·ÎºÎÅÍ index1 ±îÁöÀÇ °¢ ³ëµå¿¡ 1°³)ÀÇ ¹è¿. Æ®¸®°¡ ¾ø´Â °æ¿ì´Â null
public void setSelectionInterval(int index0,
int index1)
index0 - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàindex1 - 2¹øÂ°ÀÇ ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
public void addSelectionInterval(int index0,
int index1)
index0 - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàindex1 - 2¹øÂ°ÀÇ ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
public void removeSelectionInterval(int index0,
int index1)
index0 - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
. 0 Àº ÃÖÃÊÀÇ Çàindex1 - 2¹øÂ°ÀÇ ÇàÀ» ÁöÁ¤ÇÏ´Â int°ª
public void removeSelectionPath(TreePath path)
path - ³ëµå¸¦ ½Äº°ÇÏ´Â TreePathpublic void removeSelectionPaths(TreePath [] paths)
paths - »èÁ¦ÇÏ´Â ³ëµå¸¦ ÁöÁ¤ÇÏ´Â TreePath °´Ã¼ÀÇ ¹è¿public void removeSelectionRow(int row)
row¿¡ ÀÖ´Â ÇàÀ» ÇöÀçÀÇ ¼±ÅÃÀ¸·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù.
row - »èÁ¦ÇÏ´Â Çàpublic void removeSelectionRows(int[] rows)
rows - Ç¥½ÃÇàÀ» ÁöÁ¤ÇÏ´Â int
¹è¿. 0 Àº ÃÖÃÊÀÇ Çàpublic void clearSelection()
public boolean isSelectionEmpty()
public void addTreeExpansionListener(TreeExpansionListener tel)
TreeExpansion À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù.
tel - Æ®¸® ³ëµå°¡ Àü°³µÇ¾úÀ» ¶§, ¶Ç´Â ¼ö³³µÇ¾úÀ» ¶§ (ºÎÀÇ Àü°³)¿¡ ÅëÁöµÇ´Â TreeExpansionListenerpublic void removeTreeExpansionListener(TreeExpansionListener tel)
TreeExpansion À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù.
tel - »èÁ¦ÇÏ´Â TreeExpansionListenerpublic TreeExpansionListener [] getTreeExpansionListeners()
TreeExpansionListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
TreeExpansionListener. ¸®½º³Ê°¡ Ãß°¡µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿public void addTreeWillExpandListener(TreeWillExpandListener tel)
TreeWillExpand À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù.
tel - Æ®¸® ³ëµå°¡ Àü°³µÉ ¶§, ¶Ç´Â ¼ö³³µÉ ¶§ (ºÎÀÇ Àü°³)¿¡ ÅëÁöµÇ´Â TreeWillExpandListenerpublic void removeTreeWillExpandListener(TreeWillExpandListener tel)
TreeWillExpand À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù.
tel - »èÁ¦ÇÏ´Â TreeWillExpandListenerpublic TreeWillExpandListener [] getTreeWillExpandListeners()
TreeWillExpandListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
TreeWillExpandListener. ¸®½º³Ê°¡ Ãß°¡µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿public void fireTreeExpanded(TreePath path)
path ÆÄ¶ó¹ÌÅ͸¦ »ç¿ëÇØ »ý¼ºµË´Ï´Ù.
path - Àü°³µÈ ³ëµå¸¦ ³ªÅ¸³»´Â TreePathEventListenerList public void fireTreeCollapsed(TreePath path)
path ÆÄ¶ó¹ÌÅ͸¦ »ç¿ëÇØ »ý¼ºµË´Ï´Ù.
path - ¼ö³³µÈ ³ëµå¸¦ ³ªÅ¸³»´Â TreePathEventListenerList
public void fireTreeWillExpand(TreePath path)
throws ExpandVetoException
path ÆÄ¶ó¹ÌÅ͸¦ »ç¿ëÇØ »ý¼ºµË´Ï´Ù.
path - Àü°³µÈ ³ëµå¸¦ ³ªÅ¸³»´Â TreePath
ExpandVetoException EventListenerList
public void fireTreeWillCollapse(TreePath path)
throws ExpandVetoException
path ÆÄ¶ó¹ÌÅ͸¦ »ç¿ëÇØ »ý¼ºµË´Ï´Ù.
path - Àü°³µÈ ³ëµå¸¦ ³ªÅ¸³»´Â TreePath
ExpandVetoException EventListenerList public void addTreeSelectionListener(TreeSelectionListener tsl)
TreeSelection À̺¥Æ®ÀÇ ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù.
tsl - ³ëµå°¡ ¼±ÅõǾúÀ» ¶§, ¶Ç´Â ¼±ÅÃÀÌ ÇØÁ¦µÇ¾úÀ» ¶§ (ºÎÀÇ ¼±ÅÃ)¿¡ ÅëÁöµÇ´Â TreeSelectionListenerpublic void removeTreeSelectionListener(TreeSelectionListener tsl)
TreeSelection ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù.
tsl - »èÁ¦ÇÏ´Â TreeSelectionListenerpublic TreeSelectionListener [] getTreeSelectionListeners()
TreeSelectionListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
TreeSelectionListener. ¸®½º³Ê°¡ Ãß°¡µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿protected void fireValueChanged(TreeSelectionEvent e)
e - Æ®¸®°Å ÇÏ´Â TreeSelectionEvent. ÀÌ À̺¥Æ®´Â ³ëµå°¡ ¼±ÅõǴÂÁö, ¼±ÅÃÀÌ ÇØÁ¦µÉ ¶§ TreeSelectionModel¿¡ ÀÇÇØ »ý¼ºµÇ´ÂEventListenerList public void treeDidChange()
public void setVisibleRowCount(int newCount)
JScrollPane¿¡ Æ÷ÇԵǰí ÀÖ´Â °æ¿ì¸¸ ±â´ÉÇØ, ½ºÅ©·Ñ ±¸È¹ÀÇ ÀûÀýÇÑ »çÀÌÁ Á¶Á¤ÇÕ´Ï´Ù.
newCount - Ç¥½ÃÇÏ´Â Çà¼öpublic int getVisibleRowCount()
public TreePath getNextMatch(String prefix,
int startingRow,
Position.Bias bias)
TreePath·Î
ºÎÅÍ Ä³¸¯ÅÍ ¶óÀο¡ÀÇ º¯È¯À» ó¸®ÇÏ·Á¸é,
convertValueToText¸¦ »ç¿ëÇÕ´Ï´Ù.
prefix - ÀÏÄ¡¸¦ Å×½ºÆ®Çϴ ij¸¯ÅÍ ¶óÀÎstartingRow - °Ë»öÀ» °³½ÃÇÏ´Â Çàbias - °Ë»ö ¹æÇâ. Position.Bias.Forward ¶Ç´Â Position.Bias.Backward
IllegalArgumentException - prefix°¡ nullÀÎ °æ¿ì, ȤÀº startingRow°¡ ¹üÀ§¿ÜÀÇ °æ¿ìpublic Dimension getPreferredScrollableViewportSize()
JTree
ÀûÀýÇÑ Ç¥½Ã »çÀÌÁ ¸®ÅÏÇÕ´Ï´Ù. ³ôÀÌ´Â getVisibleRowCount¿¡ ÀÇÇØ °áÁ¤ÇÒ ¼ö ÀÖ¾î ÆøÀº ÇöÀçÀÇ ÀûÀýÇÑ ÆøÀÔ´Ï´Ù.
Scrollable ³»ÀÇ getPreferredScrollableViewportSize Dimension °´Ã¼JComponent.getPreferredSize()
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Scrollable ³»ÀÇ getScrollableUnitIncrement visibleRect - ºäÆ÷Æ®³»ÀÇ °¡½ÃÀÇ ºä ¿µ¿ªorientation - SwingConstants.VERTICAL ¶Ç´Â SwingConstants.HORIZONTALdirection - »ó¶Ç´Â¿ÞÂÊÀ¸·Î ½ºÅ©·Ñ ÇÏ´Â °æ¿ì´Â 0 º¸´Ù ÀÛ°í, ¾Æ·¡ ¶Ç´Â ¿À¸¥ÂÊÀ¸·Î ½ºÅ©·Ñ ÇÏ´Â °æ¿ì´Â 0 º¸´Ù Å©´Ù
JScrollBar.setUnitIncrement(int)
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
orientation¿¡ ±Ù°ÅÇÑ visibleRect
³ôÀÌ ¶Ç´Â ÆøÀÔ´Ï´Ù.
Scrollable ³»ÀÇ getScrollableBlockIncrement visibleRect - ºäÆ÷Æ®³»ÀÇ °¡½ÃÀÇ ºä ¿µ¿ªorientation - SwingConstants.VERTICAL ¶Ç´Â SwingConstants.HORIZONTALdirection - »ó¶Ç´Â¿ÞÂÊÀ¸·Î ½ºÅ©·Ñ ÇÏ´Â °æ¿ì´Â 0 º¸´Ù ÀÛ°í, ¾Æ·¡ ¶Ç´Â ¿À¸¥ÂÊÀ¸·Î ½ºÅ©·Ñ ÇÏ´Â °æ¿ì´Â 0 º¸´Ù Å©´Ù
JScrollBar.setBlockIncrement(int) public boolean getScrollableTracksViewportWidth()
Scrollable ³»ÀÇ getScrollableTracksViewportWidth Scrollable.getScrollableTracksViewportWidth() public boolean getScrollableTracksViewportHeight()
Scrollable ³»ÀÇ getScrollableTracksViewportHeight Scrollable.getScrollableTracksViewportHeight()
protected void setExpandedState(TreePath path,
boolean state)
JTree
Àü°³ »óŸ¦ ¼³Á¤ÇÕ´Ï´Ù. state°¡ trueÀÎ °æ¿ì, path
¸ðµç ºÎ¸ð ¹× ÆÐ½º¿¡ Àü°³ÀÇ ¸¶Å©¸¦ ºÙÀÏ ¼ö ÀÖ½À´Ï´Ù. state°¡ falseÀÎ °æ¿ì, path
¸ðµç ºÎ¸ð´Â EXPANDED ·Î ³ªÅ¸³³´Ï´Ù¸¸, path ÀÚü´Â ¼ö³³µÇ°í ÀÖ´Â °ÍÀÌ ³ªÅ¸³³´Ï´Ù. À̰ÍÀº, TreeWillExpandListener¿¡ °ÅºÎµÇ´Â °æ¿ì´Â ½ÇÆÐÇÕ´Ï´Ù.
protected Enumeration <TreePath > getDescendantToggledPaths(TreePath parent)
parent
ÇÏÀ§ ³ëµåÀ̸ç, Àü°³µÇ°í ÀÖ´Â TreePaths
EnumerationÀ»
¸®ÅÏÇÕ´Ï´Ù.
protected void removeDescendantToggledPaths(Enumeration <TreePath > toRemove)
toRemove¿¡ ÀÖ´Â Àü°³µÇ°í ÀÖ´Â TreePaths
ÇÏÀ§ ³ëµå¸¦ »èÁ¦ÇÕ´Ï´Ù.
protected void clearToggledPaths()
TreeExpansionListener À̺¥Æ®¸¦ ¼ÛÃâÇÏÁö ¾Ê½À´Ï´Ù.
protected TreeModelListener createTreeModelListener()
TreeModelHandler
ÀνºÅϽº¸¦ »ý¼ºÇØ ¸®ÅÏÇÕ´Ï´Ù. ¸®ÅÏµÈ °´Ã¼´Â TreeModel°¡ º¯°æµÇ¾úÀ» ¶§¿¡ Àü°³ »óŸ¦ °»½ÅÇÕ´Ï´Ù.
Àü°³ »óÅÂÀÇ ÀÚ¼¼ÇÑ °ÍÀº »ó±âÀÇ JTree ¼³¸íÀ» ÂüÁ¶ÇϽʽÿÀ.
protected boolean removeDescendantSelectedPaths(TreePath path,
boolean includePath)
path
ÇÏÀ§ ³ëµåÀÎ ¼±ÅÃµÈ ¸ðµç ÆÐ½º¸¦ »èÁ¦ÇÕ´Ï´Ù. includePath°¡ true ·Î path°¡ ¼±Åõǰí ÀÖ´Â °æ¿ì´Â ¼±ÅÃÀ¸·ÎºÎÅÍ »èÁ¦µË´Ï´Ù.
protected String paramString()
JTree
ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. ÀÌ ¸Þ¼µå´Â µð¹ö±× Àü¿ëÀ̸ç, ¸®ÅϵÈ
ij¸¯ÅÍ ¶óÀÎÀÇ ³»¿ë ¹× Çü½ÄÀº ±¸Çö¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù. ¸®ÅϵÈ
ij¸¯ÅÍ ¶óÀÎÀº ºñ¾îÀÖ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù¸¸, null·Î´Â µÇÁö ¾Ê½À´Ï´Ù.
JComponent ³»ÀÇ paramString JTree
ij¸¯ÅÍ ¶óÀΠǥÇöpublic AccessibleContext getAccessibleContext()
Accessible ³»ÀÇ getAccessibleContext JComponent ³»ÀÇ getAccessibleContext
|
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 µµ ÂüÁ¶ÇϽʽÿÀ.