|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.plaf.ComponentUI | +--javax.swing.plaf.TreeUI | +--javax.swing.plaf.basic.BasicTreeUI | +--javax.swing.plaf.metal.MetalTreeUI
TreeUI
ÀÇ Metal Look & Feel ¿¡ ÀÇÇÑ ±¸ÇöÀÔ´Ï´Ù.
MetalTreeUI
°¡ ³ëµå°£ÀÇ °£°Ý°ú À±°ûÀ» °¡½ÃÀûÀ¸·Î Ç¥Çö ÇÏ´Â ¹æ¹ýÀ» ±¸¼ºÇÒ ¼ö ÀÖ°Ô ÇÕ´Ï´Ù. ´ÙÀ½ÀÇ ÈùÆ®¸¦ ¼Æ÷Æ®ÇÕ´Ï´Ù.
»ç¼± | ¾ÆÀÌ¿Í ºÎ¸ð¸¦ ¿¬°áÇÏ´Â ¼±ÀÌ ±×·ÁÁø´Ù. ·çÆ® ³ëµåÀÇ Ã³¸®¿¡ ´ëÇØ¼´Â JTree.setRootVisible(boolean) ¹× JTree.setShowsRootHandles(boolean) ÂüÁ¶
|
¼öÆò¼± | ·çÆ® ³ëµåÀÇ ¾ÆÀ̸¦ ±¸ºÐÇÏ´Â ¼öÆò¼±ÀÌ ±×·ÁÁø´Ù |
¼±¾øÀ½ | ³ëµå°£¿¡ ½Ã°¢ÀûÀÎ Áö½Ã¸¦ ÁÖ´Â ¼±À» ±×¸®Áö ¾Ê´Â´Ù |
Åë»ó,JTree
·ÎºÎÅÍ TreeUI
¸¦ ÃëµæÇØ MetalTreeUI
ÀÇ ÀνºÅϽº¿¡ ij½ºÆ® ÇÏ´Â °ÍÀº ½ÇÁ¦ÀûÀÎ ¹æ¹ýÀº ¾Æ´Ï±â ¶§¹®¿¡, Ŭ¶óÀÌ¾ðÆ® ÇÁ·ÎÆÛƼ JTree.lineStyle
¸¦ »ç¿ëÇØ ÀÌ ÇÁ·ÎÆÛƼ¸¦ À¯È¿ÇÏ°Ô ÇÕ´Ï´Ù. ¿¹¸¦ µé¾î,Horizontal
½ºÅ¸ÀÏ·Î ÀüȯÇÏ·Á¸é , ÀÌÇϸ¦ ½ÇÇàÇÕ´Ï´Ù. tree.putClientProperty("JTree.lineStyle", "Horizontal");
µðÆúÆ®´Â Angled
ÀÔ´Ï´Ù.
ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä |
ÇʵåÀÇ °³¿ä |
Ŭ·¡½º javax.swing.plaf.basic. BasicTreeUI ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
cellEditor , collapsedIcon , createdCellEditor , createdRenderer , currentCellRenderer , depthOffset , drawingCache , editingComponent , editingPath , editingRow , editorHasDifferentSize , expandedIcon , largeModel , lastSelectedRow , leftChildIndent , nodeDimensions , preferredMinSize , preferredSize , rendererPane , rightChildIndent , stopEditingInCompleteEditing , totalChildIndent , tree , treeModel , treeSelectionModel , treeState , validCachedPreferredSize |
»ý¼ºÀÚÀÇ °³¿ä | |
MetalTreeUI ()
|
¸Þ¼ÒµåÀÇ °³¿ä | |
static ComponentUI |
createUI (JComponent x)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. |
protected void |
decodeLineStyle (Object lineStyleFlag)
Ŭ¶óÀÌ¾ðÆ® ÇÁ·ÎÆÛƼ¿¡°Ô °Ç³×Áø ij¸¯ÅÍ ¶óÀΰú ³»ºÎ Ç¥Çö (currently ¹× int)°úÀÇ »çÀÌÀÇ º¯È¯À» ½Ç½ÃÇÕ´Ï´Ù. |
protected int |
getHorizontalLegBuffer ()
³ëµå°£ÀÇ ´Ù¸®ÀÇ ¼öÆò ¿ä¼Ò´Â µðÆúÆ®¿¡¼´Â ¾ÆÀÌ ³ëµåÀÇ ÁÂÃøÀÇ ¿À¸¥ÂÊ¿¡¼ ½ÃÀ۵˴ϴÙ. |
void |
installUI (JComponent c)
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ±¸¼ºÇÕ´Ï´Ù. |
protected boolean |
isLocationInExpandControl (int row,
int rowLevel,
int mouseX,
int mouseY)
|
void |
paint (Graphics g,
JComponent c)
Look &Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ paint ÇÕ´Ï´Ù. |
protected void |
paintHorizontalPartOfLeg (Graphics g,
Rectangle clipBounds,
Insets insets,
Rectangle bounds,
TreePath path,
int row,
boolean isExpanded,
boolean hasBeenExpanded,
boolean isLeaf)
´Ù¸®ÀÇ ¼öÆò ºÎºÐÀ» paint ÇÕ´Ï´Ù. |
protected void |
paintHorizontalSeparators (Graphics g,
JComponent c)
|
protected void |
paintVerticalPartOfLeg (Graphics g,
Rectangle clipBounds,
Insets insets,
TreePath path)
´Ù¸®ÀÇ ¼öÁ÷ ºÎºÐÀ» paint ÇÕ´Ï´Ù. |
void |
uninstallUI (JComponent c)
installUI ½Ã¿¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®·Î ½ÇÇàÇÑ ±¸¼ºÀ» Ãë¼ÒÇÕ´Ï´Ù. |
Ŭ·¡½º javax.swing.plaf. ComponentUI ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
contains , getAccessibleChild , getAccessibleChildrenCount , update |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public MetalTreeUI()
¸Þ¼ÒµåÀÇ »ó¼¼ |
public static ComponentUI createUI(JComponent x)
ComponentUI
ÀÇ ±â¼ú: createUI
¸Þ¼Òµå¸¦ Á¦°øÇØ, ±× UI delegateÀÇ ¼ºê Ŭ·¡½ºÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. UI delegateÀÇ ¼ºê Ŭ·¡½º°¡ »óÅ ¾øÀ½ÀÇ °æ¿ì, º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. UI delegateÀÌ »óÅ ÀÖ´Â °æ¿ì, ÄÄÆÛ³ÍÆ® ¸¶´Ù »õ·Î¿î ÀνºÅϽº¸¦ µ¹·ÁÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â È£ÃâÇØ¼± ¾È µÇ±â ¶§¹®¿¡, ±× µðÆúÆ® ±¸ÇöÀº ¿¡·¯¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.
protected int getHorizontalLegBuffer()
BasicTreeUI
ÀÇ ±â¼ú:
BasicTreeUI
³»ÀÇ getHorizontalLegBuffer
public void installUI(JComponent c)
ComponentUI
ÀÇ ±â¼ú: ComponentUI
ÀνºÅϽº°¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀ¸·Î¼ ÀνºÅç µÇ°í ÀÖÀ» ¶§ ºÒ·Á °©´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÀÌÇϸ¦ Æ÷ÇÔÇÑ Look & Feel ¿ëÀÇ ÄÄÆÛ³ÍÆ®¸¦ ¿ÏÀüÇÏ°Ô ±¸¼ºÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
LayoutManager
¸¦ ÀνºÅç ÇÑ´Ù
PropertyChangeListener
¸¦ ÄÄÆÛ³ÍÆ®¿¡ ÀÛ¼º ¶Ç´Â ÀνºÅç ÇÑ´Ù
BasicTreeUI
³»ÀÇ installUI
c
- UI delegateÀÌ ÀνºÅç µÇ°í ÀÖ´Â ÄÄÆÛ³ÍÆ®ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
ComponentUI
ÀÇ ±â¼ú: installUI
½Ã¿¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®·Î ½ÇÇàÇÑ ±¸¼ºÀ» Ãë¼ÒÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀ¸·Î¼ÀÇ UIComponent
ÀνºÅϽº°¡ »èÁ¦µÇ°í ÀÖÀ» ¶§ ºÒ·Á °©´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â installUI
¿¡ ÀÇÇØ ½ÇÇàµÈ ±¸¼ºÀ» ¹ÙÅÁÀ¸·Î µÇµ¹¸± Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì,JComponent
ÀνºÅϽº¸¦ ±ú²ýÇÑ »óÅ (¿©ºÐÀÇ Ã»ÃëÀÚ³ª, Look & Feel °íÀ¯ÀÇ ÇÁ·ÎÆÛƼ ¿ÀºêÁ§Æ®°¡ ³²Áö ¾Ê°Ô)·Î Çϵµ·Ï(µíÀÌ) ÃæºÐÈ÷ ÁÖÀÇÇØ ÁÖ¼¼¿ä. ¼ø¼¿¡´Â ´ÙÀ½ÀÇ °ÍÀÌ ÀÖ½À´Ï´Ù.
BasicTreeUI
³»ÀÇ uninstallUI
c
- ÀÌ UI delegateÀÌ »èÁ¦µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´ÂComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
protected void decodeLineStyle(Object lineStyleFlag)
protected boolean isLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY)
public void paint(Graphics g, JComponent c)
ComponentUI
ÀÇ ±â¼ú: ComponentUI.update
¸Þ¼Òµå·ÎºÎÅÍ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®°¡ paint µÉ ¶§ ºÒ·Á °©´Ï´Ù. ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ÁöÁ¤µÈ Graphics
¿ÀºêÁ§Æ®¸¦ »ç¿ëÇØ ÄÄÆÛ³ÍÆ®ÀÇ ³»¿ëÀ» Ç¥Çö ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
BasicTreeUI
³»ÀÇ paint
g
- paintó°¡ µÇ´Â Graphics
¹®¸Æc
- paint µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´ÂComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
protected void paintHorizontalSeparators(Graphics g, JComponent c)
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
BasicTreeUI
ÀÇ ±â¼ú: clipBounds
³ª insets
¸¦ º¯°æÇÏ´Â °ÍÀº ¿ë¼µÇÁö ¾Ê½À´Ï´Ù.
BasicTreeUI
³»ÀÇ paintVerticalPartOfLeg
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
BasicTreeUI
ÀÇ ±â¼ú: clipBounds
³ª insets
¸¦ º¯°æÇÏ´Â °ÍÀº ¿ë¼µÇÁö ¾Ê½À´Ï´Ù.
ÁÖ: ·çÆ®°¡ °¡½Ã°¡ ¾Æ´Ñ °æ¿ì,parentRow
´Â -1 ÀÌ µÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
BasicTreeUI
³»ÀÇ paintHorizontalPartOfLeg
|
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.