JavaTM 2
Platform
Std.  Ed.  v1. 4.0

javax.swing.plaf.basic
Ŭ·¡½º BasicMenuItemUI

java.lang.Object 
  |
  +--javax.swing.plaf.ComponentUI 
        |
        +--javax.swing.plaf.ButtonUI 
              |
              +--javax.swing.plaf.MenuItemUI 
                    |
                    +--javax.swing.plaf.basic.BasicMenuItemUI
Á÷°èÀÇ ±âÁ¸ÀÇ ¼­ºê Ŭ·¡½º:
BasicCheckBoxMenuItemUI , BasicMenuUI , BasicRadioButtonMenuItemUI

public class BasicMenuItemUI
extends MenuItemUI

BasicMenuItem ÀÇ ±¸ÇöÀÔ´Ï´Ù.


ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä
protected  class BasicMenuItemUI.MouseInputHandler
           
 
ÇʵåÀÇ °³¿ä
protected  Font acceleratorFont
           
protected  Color acceleratorForeground
           
protected  Color acceleratorSelectionForeground
           
protected  Icon arrowIcon
           
protected  Icon checkIcon
           
protected  int defaultTextIconGap
           
protected  Color disabledForeground
           
protected  MenuDragMouseListener menuDragMouseListener
           
protected  JMenuItem menuItem
           
protected  MenuKeyListener menuKeyListener
           
protected  MouseInputListener mouseInputListener
           
protected  boolean oldBorderPainted
           
protected  Color selectionBackground
           
protected  Color selectionForeground
           
 
»ý¼ºÀÚÀÇ °³¿ä
BasicMenuItemUI ()
           
 
¸Þ¼ÒµåÀÇ °³¿ä
protected  MenuDragMouseListener createMenuDragMouseListener (JComponent  c)
           
protected  MenuKeyListener createMenuKeyListener (JComponent  c)
           
protected  MouseInputListener createMouseInputListener (JComponent  c)
           
static ComponentUI createUI (JComponent  c)
          ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù.
protected  void doClick (MenuSelectionManager  msm)
          ¸Þ´º Ç׸ñÀÇ ±âµ¿½Ã¿¡, ÀÌ ¸Þ¼Òµå¸¦ È£ÃâÇÕ´Ï´Ù.
 Dimension getMaximumSize (JComponent  c)
          Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ´ë »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù.
 Dimension getMinimumSize (JComponent  c)
          Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ¼Ò »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù.
 MenuElement [] getPath ()
           
protected  Dimension getPreferredMenuItemSize (JComponent  c, Icon  checkIcon, Icon  arrowIcon, int defaultTextIconGap)
           
 Dimension getPreferredSize (JComponent  c)
          Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÀûÀýÇÑ »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù.
protected  String getPropertyPrefix ()
           
protected  void installComponents (JMenuItem  menuItem)
           
protected  void installDefaults ()
           
protected  void installKeyboardActions ()
           
protected  void installListeners ()
           
 void installUI (JComponent  c)
          Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ±¸¼ºÇÕ´Ï´Ù.
 void paint (Graphics  g, JComponent  c)
          Look &Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ paint ÇÕ´Ï´Ù.
protected  void paintBackground (Graphics  g, JMenuItem  menuItem, Color  bgColor)
          ¸Þ´º Ç׸ñÀÇ ¹é±×¶ó¿îµå¸¦ Ç¥Çö ÇÕ´Ï´Ù.
protected  void paintMenuItem (Graphics  g, JComponent  c, Icon  checkIcon, Icon  arrowIcon, Color  background, Color  foreground, int defaultTextIconGap)
           
protected  void paintText (Graphics  g, JMenuItem  menuItem, Rectangle  textRect, String  text)
          ÇöÀçÀÇ ¸Þ´º Ç׸ñÀÇ ÅØ½ºÆ®¸¦ Ç¥Çö ÇÕ´Ï´Ù.
protected  void uninstallComponents (JMenuItem  menuItem)
           
protected  void uninstallDefaults ()
           
protected  void uninstallKeyboardActions ()
           
protected  void uninstallListeners ()
           
 void uninstallUI (JComponent  c)
          installUI ½Ã¿¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®·Î ½ÇÇàÇÑ ±¸¼ºÀ» Ãë¼ÒÇÕ´Ï´Ù.
 void update (Graphics  g, JComponent  c)
          paintMenuItem()·Î ¹é±×¶ó¿îµå¸¦ Ç¥Çö ÇÕ´Ï´Ù.
 
Ŭ·¡½º javax.swing.plaf. ComponentUI ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
contains , getAccessibleChild , getAccessibleChildrenCount
 
Ŭ·¡½º java.lang. Object ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

ÇʵåÀÇ »ó¼¼

menuItem

protected JMenuItem  menuItem

selectionBackground

protected Color  selectionBackground

selectionForeground

protected Color  selectionForeground

disabledForeground

protected Color  disabledForeground

acceleratorForeground

protected Color  acceleratorForeground

acceleratorSelectionForeground

protected Color  acceleratorSelectionForeground

defaultTextIconGap

protected int defaultTextIconGap

acceleratorFont

protected Font  acceleratorFont

mouseInputListener

protected MouseInputListener  mouseInputListener

menuDragMouseListener

protected MenuDragMouseListener  menuDragMouseListener

menuKeyListener

protected MenuKeyListener  menuKeyListener

arrowIcon

protected Icon  arrowIcon

checkIcon

protected Icon  checkIcon

oldBorderPainted

protected boolean oldBorderPainted
»ý¼ºÀÚÀÇ »ó¼¼

BasicMenuItemUI

public BasicMenuItemUI()
¸Þ¼ÒµåÀÇ »ó¼¼

createUI

public static ComponentUI  createUI(JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. °¢ ¼­ºê Ŭ·¡½º´Â ±× ÀÚüÀÇ Á¤ÀûÀÎ createUI ¸Þ¼Òµå¸¦ Á¦°øÇØ, ±× UI delegateÀÇ ¼­ºê Ŭ·¡½ºÀÇ ÀνºÅϽº¸¦ µ¹·ÁÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. UI delegateÀÇ ¼­ºê Ŭ·¡½º°¡ »óÅ ¾øÀ½ÀÇ °æ¿ì, º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â ÀνºÅϽº¸¦ µ¹·ÁÁÝ´Ï´Ù. UI delegateÀÌ »óÅ ÀÖ´Â °æ¿ì, ÄÄÆÛ³ÍÆ® ¸¶´Ù »õ·Î¿î ÀνºÅϽº¸¦ µ¹·ÁÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â È£ÃâÇØ¼± ¾È µÇ±â ¶§¹®¿¡, ±× µðÆúÆ® ±¸ÇöÀº ¿¡·¯¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.


installUI

public void installUI(JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ±¸¼ºÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ComponentUI ÀνºÅϽº°¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀ¸·Î¼­ ÀνºÅç µÇ°í ÀÖÀ» ¶§ ºÒ·Á °©´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÀÌÇϸ¦ Æ÷ÇÔÇÑ Look & Feel ¿ëÀÇ ÄÄÆÛ³ÍÆ®¸¦ ¿ÏÀüÇÏ°Ô ±¸¼ºÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
  1. Ä®¶ó, ÆùÆ®, º¸´õ, ¾ÆÀÌÄÜ, ºÒÅõ¸íÇÔ µî ¸ðµç µðÆúÆ® ÇÁ·ÎÆÛƼÀÇ °ªÀ» ÄÄÆÛ³ÍÆ®¿¡ ÀνºÅç ÇÑ´Ù. °¡´ÉÇÑ °æ¿ì´Â Ŭ¶óÀÌ¾ðÆ® ÇÁ·Î±×·¥¿¡ ÀÇÇØ ÃʱâÈ­µÈ ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¿À¹ö¶óÀ̵å(override) ÇØ¼­´Â ¾È µÈ´Ù
  2. Çʿ信 µû¶ó¼­, ÄÄÆÛ³ÍÆ®¿¡ LayoutManager ¸¦ ÀνºÅç ÇÑ´Ù
  3. ÇÊ¿äÇÑ ¼­ºê ÄÄÆÛ³ÍÆ®¸¦, ÄÄÆÛ³ÍÆ®¿¡ ÀÛ¼º ¶Ç´Â Ãß°¡ÇÑ´Ù
  4. À̺¥Æ® ûÃëÀÚ¸¦, ÄÄÆÛ³ÍÆ®¿¡ ÀÛ¼º ¶Ç´Â ÀνºÅç ÇÑ´Ù
  5. ÄÄÆÛ³ÍÆ®ÀÇ ÇÁ·ÎÆÛƼÀÇ º¯°æÀ» ÀûÀýÈ÷ °ËÃâÇØ, ÀÀ´äÇϱâ À§Çؼ­,PropertyChangeListener ¸¦ ÄÄÆÛ³ÍÆ®¿¡ ÀÛ¼º ¶Ç´Â ÀνºÅç ÇÑ´Ù
  6. Űº¸µå UI (¹«¸­ °üÀý ¸ð´ÖÅ©, È£¶ûÀÌ ¿ë±âµî)¸¦, ÄÄÆÛ³ÍÆ®¿¡ ÀνºÅç ÇÑ´Ù
  7. ÀûÀýÇÑ ÀνºÅϽºÀÇ µ¥ÀÌÅ͸¦ ÃʱâÈ­ÇÑ´Ù

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ installUI
ÆÄ¶ó¹ÌÅÍ:
c - UI delegateÀÌ ÀνºÅç µÇ°í ÀÖ´Â ÄÄÆÛ³ÍÆ®
°ü·Ã Ç׸ñ:
ComponentUI.uninstallUI(javax.swing.JComponent) , JComponent.setUI(javax.swing.plaf.ComponentUI) , JComponent.updateUI()

installDefaults

protected void installDefaults()

installComponents

protected void installComponents(JMenuItem  menuItem)
µµÀÔµÈ ¹öÁ¯:
1.3

getPropertyPrefix

protected String  getPropertyPrefix()

installListeners

protected void installListeners()

installKeyboardActions

protected void installKeyboardActions()

uninstallUI

public void uninstallUI(JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
installUI ½Ã¿¡, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®·Î ½ÇÇàÇÑ ±¸¼ºÀ» Ãë¼ÒÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ UI delegateÀ¸·Î¼­ÀÇ UIComponent ÀνºÅϽº°¡ »èÁ¦µÇ°í ÀÖÀ» ¶§ ºÒ·Á °©´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â installUI ¿¡ ÀÇÇØ ½ÇÇàµÈ ±¸¼ºÀ» ¹ÙÅÁÀ¸·Î µÇµ¹¸± Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì,JComponent ÀνºÅϽº¸¦ ±ú²ýÇÑ »óÅ (¿©ºÐÀÇ Ã»ÃëÀÚ³ª, Look & Feel °íÀ¯ÀÇ ÇÁ·ÎÆÛƼ ¿ÀºêÁ§Æ®°¡ ³²Áö ¾Ê°Ô)·Î Çϵµ·Ï(µíÀÌ) ÃæºÐÈ÷ ÁÖÀÇÇØ ÁÖ¼¼¿ä. ¼ø¼­¿¡´Â ´ÙÀ½ÀÇ °ÍÀÌ ÀÖ½À´Ï´Ù.
  1. UI ·Î¼­ ¼³Á¤µÈ ¸ðµç º¸´õ¸¦, ÄÄÆÛ³ÍÆ®·ÎºÎÅÍ »èÁ¦ÇÑ´Ù
  2. UI ·Î¼­ ¼³Á¤µÈ ¸ðµç ·¹À̾ƿô ¸Å´ÏÀú¸¦, ÄÄÆÛ³ÍÆ®·ÎºÎÅÍ »èÁ¦ÇÑ´Ù
  3. UI ·Î¼­ Ãß°¡µÈ ¸ðµç ¼­ºê ÄÄÆÛ³ÍÆ®¸¦, ÄÄÆÛ³ÍÆ®·ÎºÎÅÍ »èÁ¦ÇÑ´Ù
  4. UI ·Î¼­ Ãß°¡µÈ ¸ðµç À̺¥Æ®/ûÃëÀÚ¸¦, ÄÄÆÛ³ÍÆ®·ÎºÎÅÍ »èÁ¦ÇÑ´Ù
  5. UI ·Î¼­ ÀνºÅç µÈ ¸ðµç Űº¸µå UI ¸¦, ÄÄÆÛ³ÍÆ®·ÎºÎÅÍ »èÁ¦ÇÑ´Ù
  6. GC ¿ëÀ¸·Î ÇÒ´çÇÒ ¼ö ÀÖ´ø ¸ðµç ÀνºÅϽºÀÇ µ¥ÀÌÅÍ ¿ÀºêÁ§Æ®¸¦ ¹«È¿·Î ÇÑ´Ù

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ uninstallUI
ÆÄ¶ó¹ÌÅÍ:
c - ÀÌ UI delegateÀÌ »èÁ¦µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Â
°ü·Ã Ç׸ñ:
ComponentUI.installUI(javax.swing.JComponent) , JComponent.updateUI()

uninstallDefaults

protected void uninstallDefaults()

uninstallComponents

protected void uninstallComponents(JMenuItem  menuItem)
µµÀÔµÈ ¹öÁ¯:
1.3

uninstallListeners

protected void uninstallListeners()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

createMouseInputListener

protected MouseInputListener  createMouseInputListener(JComponent  c)

createMenuDragMouseListener

protected MenuDragMouseListener  createMenuDragMouseListener(JComponent  c)

createMenuKeyListener

protected MenuKeyListener  createMenuKeyListener(JComponent  c)

getMinimumSize

public Dimension  getMinimumSize(JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ¼Ò »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. null °¡ µ¹·ÁÁÖ¾îÁö´Â °æ¿ì, ÃÖ¼Ò »çÀÌÁî´Â ´ë½Å¿¡ ÄÄÆÛ³ÍÆ®ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÀÇÇØ °è»êµË´Ï´Ù (À̰ÍÀº ƯÁ¤ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¸¦ ÀνºÅç µÇ¾î ÀÖ´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ¿ì¿¡ Ãßõ ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù). ÀÌ ¸Þ¼ÒµåÀÇ µðÆúÆ® ±¸ÇöÀº getPreferredSize ¸¦ È£ÃâÇØ, ±× °ªÀ» µ¹·ÁÁÝ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ getMinimumSize
ÆÄ¶ó¹ÌÅÍ:
c - ÃÖ¼Ò »çÀÌÁî°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Ù
¹Ýȯ°ª:
Dimension ¿ÀºêÁ§Æ®, ¶Ç´Â null
°ü·Ã Ç׸ñ:
JComponent.getMinimumSize() , LayoutManager.minimumLayoutSize(java.awt.Container) , ComponentUI.getPreferredSize(javax.swing.JComponent)

getPreferredSize

public Dimension  getPreferredSize(JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÀûÀýÇÑ »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. null °¡ µ¹·ÁÁÖ¾îÁö´Â °æ¿ì, ÀûÀýÇÑ »çÀÌÁî´Â ´ë½Å¿¡ ÄÄÆÛ³ÍÆ®ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÀÇÇØ °è»êµË´Ï´Ù (À̰ÍÀº ƯÁ¤ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¸¦ ÀνºÅç µÇ¾î ÀÖ´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ¿ì¿¡ Ãßõ ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù). ÀÌ ¸Þ¼ÒµåÀÇ µðÆúÆ® ±¸ÇöÀº null ¸¦ µ¹·ÁÁÝ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ getPreferredSize
ÆÄ¶ó¹ÌÅÍ:
c - ÀûÀýÇÑ »çÀÌÁî°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Â
°ü·Ã Ç׸ñ:
JComponent.getPreferredSize() , LayoutManager.preferredLayoutSize(java.awt.Container)

getMaximumSize

public Dimension  getMaximumSize(JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
Look & Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ´ë »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. null °¡ µ¹·ÁÁÖ¾îÁö´Â °æ¿ì, ÃÖ´ë »çÀÌÁî´Â ´ë½Å¿¡ ÄÄÆÛ³ÍÆ®ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÀÇÇØ °è»êµË´Ï´Ù (À̰ÍÀº ƯÁ¤ÀÇ ·¹À̾ƿô ¸Å´ÏÀú¸¦ ÀνºÅç µÇ¾î ÀÖ´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ¿ì¿¡ Ãßõ ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù). ÀÌ ¸Þ¼ÒµåÀÇ µðÆúÆ® ±¸ÇöÀº getPreferredSize ¸¦ È£ÃâÇØ, ±× °ªÀ» µ¹·ÁÁÝ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ getMaximumSize
ÆÄ¶ó¹ÌÅÍ:
c - ÃÖ´ë »çÀÌÁî°¡ Á¶È¸µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Ù
¹Ýȯ°ª:
Dimension ¿ÀºêÁ§Æ®, ¶Ç´Â null
°ü·Ã Ç׸ñ:
JComponent.getMaximumSize() , LayoutManager2.maximumLayoutSize(java.awt.Container)

getPreferredMenuItemSize

protected Dimension  getPreferredMenuItemSize(JComponent  c,
                                             Icon  checkIcon,
                                             Icon  arrowIcon,
                                             int defaultTextIconGap)

update

public void update(Graphics  g,
                   JComponent  c)
paintMenuItem()·Î ¹é±×¶ó¿îµå¸¦ Ç¥Çö ÇÕ´Ï´Ù. ±× ¶§¹®¿¡(À§ÇØ), µðÆúÆ®·Î ºÒÅõ¸íÇÑ ÄÄÆÛ³ÍÆ®ÀÇ ¹é±×¶ó¿îµå¸¦ ÀüºÎ Ä¥ÇÏ´Â update ¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, paint()¸¦ È£ÃâÇÏ´Â ¸¸Å­ ÇÕ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ update
ÆÄ¶ó¹ÌÅÍ:
g - paintó°¡ µÇ´Â Graphics ¹®¸Æ
c - paint µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Â
°ü·Ã Ç׸ñ:
ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent) , JComponent.paintComponent(java.awt.Graphics)

paint

public void paint(Graphics  g,
                  JComponent  c)
Ŭ·¡½º ComponentUI ÀÇ ±â¼ú:
Look &Feel ¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ paint ÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ComponentUI.update ¸Þ¼Òµå·ÎºÎÅÍ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®°¡ paint µÉ ¶§ ºÒ·Á °©´Ï´Ù. ¼­ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ÁöÁ¤µÈ Graphics ¿ÀºêÁ§Æ®¸¦ »ç¿ëÇØ ÄÄÆÛ³ÍÆ®ÀÇ ³»¿ëÀ» Ç¥Çö ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º ComponentUI ³»ÀÇ paint
ÆÄ¶ó¹ÌÅÍ:
g - paintó°¡ µÇ´Â Graphics ¹®¸Æ
c - paint µÇ´Â ÄÄÆÛ³ÍÆ®. ÀÌ Àμö´Â ÀÚÁÖ ¹«½ÃµÇÁö¸¸, UI ¿ÀºêÁ§Æ®°¡ »óžøÀÌ º¹¼öÀÇ ÄÄÆÛ³ÍÆ®¿¡ °øÀ¯µÇ´Â °æ¿ì¿¡ »ç¿ëµÇ´Â ÀÏÀÌ ÀÖ´Â
°ü·Ã Ç׸ñ:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

paintMenuItem

protected void paintMenuItem(Graphics  g,
                             JComponent  c,
                             Icon  checkIcon,
                             Icon  arrowIcon,
                             Color  background,
                             Color  foreground,
                             int defaultTextIconGap)

paintBackground

protected void paintBackground(Graphics  g,
                               JMenuItem  menuItem,
                               Color  bgColor)
¸Þ´º Ç׸ñÀÇ ¹é±×¶ó¿îµå¸¦ Ç¥Çö ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
g - paintÀÇ ±×·¡ÇȽº
menuItem - paint µÇ´Â ¸Þ´º Ç׸ñ
bgColor - ¼±Åà ¹é±×¶ó¿îµå Ä®¶ó
µµÀÔµÈ ¹öÁ¯:
1.4

paintText

protected void paintText(Graphics  g,
                         JMenuItem  menuItem,
                         Rectangle  textRect,
                         String  text)
ÇöÀçÀÇ ¸Þ´º Ç׸ñÀÇ ÅØ½ºÆ®¸¦ Ç¥Çö ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
g - ±×·¡ÇȽº ¹®¸Æ
menuItem - Ç¥Çö ÇÏ´Â ¸Þ´º Ç׸ñ
textRect - ÅØ½ºÆ®¸¦ Ç¥Çö ÇÏ´Â °æ°èÀÇ ±¸Çü
text - Ç¥Çö Çϴ ij¸¯ÅÍ ¶óÀÎ
µµÀÔµÈ ¹öÁ¯:
1.4

getPath

public MenuElement [] getPath()

doClick

protected void doClick(MenuSelectionManager  msm)
¸Þ´º Ç׸ñÀÇ ±âµ¿½Ã¿¡, ÀÌ ¸Þ¼Òµå¸¦ È£ÃâÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â ¼±ÅÃÇÑ ÆÐ½º¸¦ ¼Ò°ÅÇϰųª JMenuItem ÀÇ doClick() ¸Þ¼Òµå¸¦ ¸Þ¼¼Áö·Î¼­ º¸³»´Â µî, ¸Þ´º Ç׸ñ ±âµ¿ÀÇ »ó¼¼ÇÑ ÀϺθ¦ ó¸®ÇÕ´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
msm - MenuSelectionManager. È­»ó Çǵå¹é°ú ³»ºÎ ºÎ±â ÀÛ¾÷Àº ÀÌ MenuSelectionManager ¿¡ delegate µË´Ï´Ù. Àμö·Î¼­ null °¡ °Ç³×¹Þ¾ÒÀ» °æ¿ì,MenuSelectionManager.defaultManager °¡ »ç¿ëµË´Ï´Ù.
µµÀÔµÈ ¹öÁ¯:
1.4
°ü·Ã Ç׸ñ:
MenuSelectionManager , AbstractButton.doClick(int)

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.