|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.plaf.ComponentUI
Swing ÀÇ Ç÷¯±× ÀÎ °¡´ÉÇÑ Look & Feel ¾ÆÅ°ÅØÃÄ¿¡ Á¸ÀçÇÏ´Â ¸ðµç UI delegate ¿ÀºêÁ§Æ®¿¡ÀÇ base classÀÔ´Ï´Ù. Swing ÄÄÆÛ³ÍÆ®ÀÇ UI delegate ¿ÀºêÁ§Æ®´Â Look & Feel ¿¡ ÀÇÁ¸ÇÏ´Â ÄÄÆÛ³ÍÆ®ÀÇ Ãø¸éÀÇ ±¸ÇöÀ» Ãë±ÞÇÕ´Ï´Ù. JComponent
Ŭ·¡½º´Â ÀνºÅç ÇÑ Look & Feel ¿¡ µû¶ó¼ ´Ù¸¥ ¿ÀÆÛ·¹ÀÌ¼Ç (paint, ·¹À̾ƿôÀÇ °è»êµî)À» delegate Çϱâ À§Çؼ, ÀÌ Å¬·¡½º·ÎºÎÅÍ ¸Þ¼Òµå¸¦ È£ÃâÇÕ´Ï´Ù. Ŭ¶óÀ̾ðÆ®ÀÇ ÇÁ·Î±×·¥Àº Á÷Á¢ ÀÌ Å¬·¡½ºÀÇ ¸Þ¼Òµå¸¦ È£ÃâÇØ µÇÁö ¾Ê½À´Ï´Ù.
JComponent
,
UIManager
»ý¼ºÀÚÀÇ °³¿ä | |
ComponentUI ()
À¯ÀÏÇÑ constructor ÀÔ´Ï´Ù. |
¸Þ¼ÒµåÀÇ °³¿ä | |
boolean |
contains (JComponent c,
int x,
int y)
ÁöÁ¤µÈ x, y ÀÇ À§Ä¡°¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ Look & Feel Á¤ÀÇÀÇ Çü»ó³»¿¡ ÀÖ´Â °æ¿ì´Â true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static ComponentUI |
createUI (JComponent c)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Accessible |
getAccessibleChild (JComponent c,
int i)
¿ÀºêÁ§Æ®³»ÀÇ i ¹øÂ°ÀÇ Accessible ±â´ÉÀ» °¡Áö´Â ¾ÆÀ̸¦ µ¹·ÁÁÝ´Ï´Ù. |
int |
getAccessibleChildrenCount (JComponent c)
¿ÀºêÁ§Æ®³»ÀÇ À¯Àú º¸Á¶ÀÇ ¾ÆÀÌÀÇ ¼ö¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Dimension |
getMaximumSize (JComponent c)
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ´ë »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. |
Dimension |
getMinimumSize (JComponent c)
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ¼Ò »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. |
Dimension |
getPreferredSize (JComponent c)
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÀûÀýÇÑ »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. |
void |
installUI (JComponent c)
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ±¸¼ºÇÕ´Ï´Ù. |
void |
paint (Graphics g,
JComponent c)
Look &Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ paint ÇÕ´Ï´Ù. |
void |
uninstallUI (JComponent c)
installUI ½Ã¿¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®·Î ½ÇÇàÇÑ ±¸¼ºÀ» Ãë¼ÒÇÕ´Ï´Ù. |
void |
update (Graphics g,
JComponent c)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ paint ÇÒ ½Ã°£ÀÌ µÈ °ÍÀ», ÀÌ UI delegate¿¡ ÅëÁöÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public ComponentUI()
¸Þ¼ÒµåÀÇ »ó¼¼ |
public void installUI(JComponent c)
ComponentUI
ÀνºÅϽº°¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀ¸·Î¼ ÀνºÅç µÇ°í ÀÖÀ» ¶§ ºÒ·Á °©´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÀÌÇϸ¦ Æ÷ÇÔÇÑ Look & Feel ¿ëÀÇ ÄÄÆÛ³ÍÆ®¸¦ ¿ÏÀüÇÏ°Ô ±¸¼ºÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
LayoutManager
¸¦ ÀνºÅç ÇÑ´Ù
PropertyChangeListener
¸¦ ÄÄÆÛ³ÍÆ®¿¡ ÀÛ¼º ¶Ç´Â ÀνºÅç ÇÑ´Ù
c
- UI delegateÀÌ ÀνºÅç µÇ°í ÀÖ´Â ÄÄÆÛ³ÍÆ®uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
installUI
½Ã¿¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®·Î ½ÇÇàÇÑ ±¸¼ºÀ» Ãë¼ÒÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀ¸·Î¼ÀÇ UIComponent
ÀνºÅϽº°¡ »èÁ¦µÇ°í ÀÖÀ» ¶§ ºÒ·Á °©´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â installUI
¿¡ ÀÇÇØ ½ÇÇàµÈ ±¸¼ºÀ» ¹ÙÅÁÀ¸·Î µÇµ¹¸± Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì,JComponent
ÀνºÅϽº¸¦ ±ú²ýÇÑ »óÅ (¿©ºÐÀÇ Ã»ÃëÀÚ³ª, Look & Feel °íÀ¯ÀÇ ÇÁ·ÎÆÛƼ ¿ÀºêÁ§Æ®°¡ ³²Áö ¾Ê°Ô)·Î Çϵµ·Ï(µíÀÌ) ÃæºÐÈ÷ ÁÖÀÇÇØ ÁÖ¼¼¿ä. ¼ø¼¿¡´Â ´ÙÀ½ÀÇ °ÍÀÌ ÀÖ½À´Ï´Ù.
c
- ÀÌ UI delegateÀÌ »èÁ¦µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´ÂinstallUI(javax.swing.JComponent)
,
JComponent.updateUI()
public void paint(Graphics g, JComponent c)
ComponentUI.update
¸Þ¼Òµå·ÎºÎÅÍ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®°¡ paint µÉ ¶§ ºÒ·Á °©´Ï´Ù. ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ÁöÁ¤µÈ Graphics
¿ÀºêÁ§Æ®¸¦ »ç¿ëÇØ ÄÄÆÛ³ÍÆ®ÀÇ ³»¿ëÀ» Ç¥Çö ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
g
- paintó°¡ µÇ´Â Graphics
¹®¸Æc
- paint µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Âupdate(java.awt.Graphics, javax.swing.JComponent)
public void update(Graphics g, JComponent c)
JComponent
¿¡ ÀÇÇØ ºÒ·Á °©´Ï´Ù. opaque
ÇÁ·ÎÆÛƼ°¡ true
ÀÇ °æ¿ì, ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ±× µðÆúÆ®ÀÇ ¹é±×¶ó¿îµå Ä®¶ó·Î ÀüºÎ Ä¥ÇØ, °ð¹Ù·Î paint
¸¦ È£ÃâÇÕ´Ï´Ù. ÀϹÝÀûÀ¸·Î, ÀÌ ¸Þ¼Òµå´Â ¼ºê Ŭ·¡½º¿¡ ÀÇÇØ ¿À¹ö¶óÀ̵å(override) ÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù. ¸ðµç Look & Feel Ç¥Çö ÄÚµå´Â paint
¸Þ¼Òµå¿¡ »óÁÖÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
g
- paintó°¡ µÇ´Â Graphics
¹®¸Æc
- paint µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Âpaint(java.awt.Graphics, javax.swing.JComponent)
,
JComponent.paintComponent(java.awt.Graphics)
public Dimension getPreferredSize(JComponent c)
null
°¡ µ¹·ÁÁÖ¾îÁö´Â °æ¿ì, ÀûÀýÇÑ »çÀÌÁî´Â ´ë½Å¿¡ ÄÄÆÛ³ÍÆ®ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÀÇÇØ °è»êµË´Ï´Ù (À̰ÍÀº ƯÁ¤ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¸¦ ÀνºÅç µÇ¾î ÀÖ´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ¿ì¿¡ Ãßõ ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù). ÀÌ ¸Þ¼ÒµåÀÇ µðÆúÆ® ±¸ÇöÀº null
¸¦ µ¹·ÁÁÝ´Ï´Ù.
c
- ÀûÀýÇÑ »çÀÌÁî°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´ÂJComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMinimumSize(JComponent c)
null
°¡ µ¹·ÁÁÖ¾îÁö´Â °æ¿ì, ÃÖ¼Ò »çÀÌÁî´Â ´ë½Å¿¡ ÄÄÆÛ³ÍÆ®ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÀÇÇØ °è»êµË´Ï´Ù (À̰ÍÀº ƯÁ¤ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¸¦ ÀνºÅç µÇ¾î ÀÖ´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ¿ì¿¡ Ãßõ ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù). ÀÌ ¸Þ¼ÒµåÀÇ µðÆúÆ® ±¸ÇöÀº getPreferredSize
¸¦ È£ÃâÇØ, ±× °ªÀ» µ¹·ÁÁÝ´Ï´Ù.
c
- ÃÖ¼Ò »çÀÌÁî°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Ù
Dimension
¿ÀºêÁ§Æ®, ¶Ç´Â null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
null
°¡ µ¹·ÁÁÖ¾îÁö´Â °æ¿ì, ÃÖ´ë »çÀÌÁî´Â ´ë½Å¿¡ ÄÄÆÛ³ÍÆ®ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÀÇÇØ °è»êµË´Ï´Ù (À̰ÍÀº ƯÁ¤ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¸¦ ÀνºÅç µÇ¾î ÀÖ´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ¿ì¿¡ Ãßõ ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù). ÀÌ ¸Þ¼ÒµåÀÇ µðÆúÆ® ±¸ÇöÀº getPreferredSize
¸¦ È£ÃâÇØ, ±× °ªÀ» µ¹·ÁÁÝ´Ï´Ù.
c
- ÃÖ´ë »çÀÌÁî°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Ù
Dimension
¿ÀºêÁ§Æ®, ¶Ç´Â null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
public boolean contains(JComponent c, int x, int y)
true
¸¦ µ¹·ÁÁÝ´Ï´Ù. x
¿Í y
´Â ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÁÂÇ¥ ü°è¸¦ ±âÁØ¿¡ Á¤Àǵ˴ϴÙ. ÄÄÆÛ³ÍÆ®ÀÇ bounds
´Â ±¸Çü¿¡ Á¦Çѵ˴ϴٸ¸, ÀÌ ¸Þ¼Òµå´Â È÷Æ®ÀÇ °ËÃâÀ» À§Çؼ(¶§¹®¿¡) ÀÌ·¯ÇÑ °æ°è³»¿¡¼ ±¸Çü ÀÌ¿ÜÀÇ Çü»óÀ» Á¤ÀÇÇÏ´Â ¹æ¹ýÀ» Á¦°øÇÕ´Ï´Ù.
c
- x, y ÀÇ À§Ä¡°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Âx
- Á¡ÀÇ x ÁÂÇ¥y
- Á¡ÀÇ y ÁÂÇ¥JComponent.contains(int, int)
,
Component.contains(int, int)
public static ComponentUI createUI(JComponent c)
createUI
¸Þ¼Òµå¸¦ Á¦°øÇØ, ±× UI delegateÀÇ ¼ºê Ŭ·¡½ºÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. UI delegateÀÇ ¼ºê Ŭ·¡½º°¡ »óÅ ¾øÀ½ÀÇ °æ¿ì, º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. UI delegateÀÌ »óÅ ÀÖ´Â °æ¿ì, ÄÄÆÛ³ÍÆ® ¸¶´Ù »õ·Î¿î ÀνºÅϽº¸¦ µ¹·ÁÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â È£ÃâÇØ¼± ¾È µÇ±â ¶§¹®¿¡, ±× µðÆúÆ® ±¸ÇöÀº ¿¡·¯¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.
public int getAccessibleChildrenCount(JComponent c)
Accessible
¸¦ ±¸ÇöÇÏ´Â °æ¿ì, ¸Þ¼Òµå´Â ÀÌ ¿ÀºêÁ§Æ®ÀÇ ¾ÆÀÌÀÇ ¼ö¸¦ µ¹·ÁÁÝ´Ï´Ù. UI °¡, ȸé»ó¿¡ ÄÄÆÛ³ÍÆ®·Î¼ Ç¥½ÃµÇ´Â area¸¦ ³ªÅ¸³»Áö¸¸, ÀÌ area¸¦ Á¦°øÇϴµ¥ ½ÇÁ¦ÀÇ ÄÄÆÛ³ÍÆ®¸¦ »ç¿ëÇÏÁö ¾Ê´Â °æ¿ì, UI ´Â Çʿ信 µû¶ó¼ ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÏ·Á°í ÇÕ´Ï´Ù. ¹öÁ¯ 1.3 ÀÌÈÄ´Â ÀÌ ¸Þ¼Òµå ´ë½Å¿¡ Component.AccessibleAWTComponent.getAccessibleChildrenCount()
¸¦ È£ÃâÇÏ´Â °ÍÀÌ Ãßõ µÇ°í ÀÖ½À´Ï´Ù.
getAccessibleChild(javax.swing.JComponent, int)
public Accessible getAccessibleChild(JComponent c, int i)
i
¹øÂ°ÀÇ Accessible
±â´ÉÀ» °¡Áö´Â ¾ÆÀ̸¦ µ¹·ÁÁÝ´Ï´Ù. UI °¡, ȸé»ó¿¡ ÄÄÆÛ³ÍÆ®·Î¼ Ç¥½ÃµÇ´Â area´Â Á¦°øÇÏÁö¸¸, ÀÌ area¸¦ Á¦°øÇϴµ¥ ½ÇÁ¦ÀÇ ÄÄÆÛ³ÍÆ®¸¦ »ç¿ëÇÏÁö ¾Ê´Â °æ¿ì, UI ´Â Çʿ信 µû¶ó¼ ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÕ´Ï´Ù.
ÁÖ: ¹öÁ¯ 1.3 ÀÌÈÄ´Â ÀÌ ¸Þ¼Òµå ´ë½Å¿¡ Component.AccessibleAWTComponent.getAccessibleChildrenCount()
¸¦ È£ÃâÇÏ´Â °ÍÀÌ Ãßõ µÇ°í ÀÖ½À´Ï´Ù.
i
- Á¦·Î·ÎºÎÅÍ ½ÃÀ۵Ǵ ¾ÆÀÌÀÇ À妽º
i
¹øÂ°ÀÇ Accessible
±â´ÉÀ» °¡Áö´Â ¾ÆÀÌgetAccessibleChildrenCount(javax.swing.JComponent)
|
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.