JavaTM 2 Platform
Standard Ed. 5.0

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

java.lang.Object 
  »óÀ§¸¦ È®Àå javax.swing.plaf.ComponentUI 
      »óÀ§¸¦ È®Àå javax.swing.plaf.ButtonUI 
          »óÀ§¸¦ È®Àå javax.swing.plaf.basic.BasicButtonUI
¾Ë·ÁÁø Á÷°è ¼­ºê Ŭ·¡½º:
BasicToggleButtonUI, MetalButtonUI

public class BasicButtonUI
extends ButtonUI

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


ÇÊµå °³¿ä
protected  int defaultTextIconGap
           
protected  int defaultTextShiftOffset
           
 
»ý¼ºÀÚ °³¿ä
BasicButtonUI ()
           
 
¸Þ¼­µå °³¿ä
protected  void clearTextShiftOffset ()
           
protected  BasicButtonListener createButtonListener (AbstractButton  b)
           
static ComponentUI createUI (JComponent  c)
           
 int getDefaultTextIconGap (AbstractButton  b)
           
 Dimension getMaximumSize (JComponent  c)
          Look & Feel¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ´ë »çÀÌÁ ¸®ÅÏÇÕ´Ï´Ù.
 Dimension getMinimumSize (JComponent  c)
          Look & Feel¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÃÖ¼Ò »çÀÌÁ ¸®ÅÏÇÕ´Ï´Ù.
 Dimension getPreferredSize (JComponent  c)
          Look & Feel¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ÀûÀýÇÑ »çÀÌÁ ¸®ÅÏÇÕ´Ï´Ù.
protected  String getPropertyPrefix ()
           
protected  int getTextShiftOffset ()
           
protected  void installDefaults (AbstractButton  b)
           
protected  void installKeyboardActions (AbstractButton  b)
           
protected  void installListeners (AbstractButton  b)
           
 void installUI (JComponent  c)
          Look & Feel¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ±¸¼ºÇÕ´Ï´Ù.
 void paint (Graphics  g, JComponent  c)
          Look &Feel¿¡ ÀûÀýÇÑ, ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ÆäÀÎÆ® ÇÕ´Ï´Ù.
protected  void paintButtonPressed (Graphics  g, AbstractButton  b)
           
protected  void paintFocus (Graphics  g, AbstractButton  b, Rectangle  viewRect, Rectangle  textRect, Rectangle  iconRect)
           
protected  void paintIcon (Graphics  g, JComponent  c, Rectangle  iconRect)
           
protected  void paintText (Graphics  g, AbstractButton  b, Rectangle  textRect, String  text)
          ÇöÀçÀÇ ¹öÆ°ÀÇ ÅؽºÆ®¸¦ ·»´õ¸µ ÇÏ´Â ¸Þ¼­µåÀÔ´Ï´Ù.
protected  void paintText (Graphics  g, JComponent  c, Rectangle  textRect, String  text)
          Java 2 Ç÷§Æû v 1.4 ÀÌÈÄ¿¡¼­´Â ÀÌ ¸Þ¼­µå¸¦ »ç¿ëÇϰųª ¿À¹ö¶óÀ̵å(override) Çϰųª ÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
protected  void setTextShiftOffset ()
           
protected  void uninstallDefaults (AbstractButton  b)
           
protected  void uninstallKeyboardActions (AbstractButton  b)
           
protected  void uninstallListeners (AbstractButton  b)
           
 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
 

ÇʵåÀÇ »ó¼¼

defaultTextIconGap

protected int defaultTextIconGap

defaultTextShiftOffset

protected int defaultTextShiftOffset
»ý¼ºÀÚ »ó¼¼

BasicButtonUI

public BasicButtonUI()
¸Þ¼­µåÀÇ »ó¼¼

createUI

public static ComponentUI  createUI(JComponent  c)

getPropertyPrefix

protected String  getPropertyPrefix()

installUI

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

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

installDefaults

protected void installDefaults(AbstractButton  b)

installListeners

protected void installListeners(AbstractButton  b)

installKeyboardActions

protected void installKeyboardActions(AbstractButton  b)

uninstallUI

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

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

uninstallKeyboardActions

protected void uninstallKeyboardActions(AbstractButton  b)

uninstallListeners

protected void uninstallListeners(AbstractButton  b)

uninstallDefaults

protected void uninstallDefaults(AbstractButton  b)

createButtonListener

protected BasicButtonListener  createButtonListener(AbstractButton  b)

getDefaultTextIconGap

public int getDefaultTextIconGap(AbstractButton  b)

paint

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

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

paintIcon

protected void paintIcon(Graphics  g,
                         JComponent  c,
                         Rectangle  iconRect)

paintText

protected void paintText(Graphics  g,
                         JComponent  c,
                         Rectangle  textRect,
                         String  text)
Java 2 Ç÷§Æû v 1.4 ÀÌÈÄ¿¡¼­´Â ÀÌ ¸Þ¼­µå¸¦ »ç¿ëÇϰųª ¿À¹ö¶óÀ̵å(override) Çϰųª ÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä. AbstractButton Àμö¸¦ ÃëÇÏ´Â paintText ¸Þ¼­µå¸¦ »ç¿ëÇÕ´Ï´Ù.


paintText

protected void paintText(Graphics  g,
                         AbstractButton  b,
                         Rectangle  textRect,
                         String  text)
ÇöÀçÀÇ ¹öÆ°ÀÇ ÅؽºÆ®¸¦ ·»´õ¸µ ÇÏ´Â ¸Þ¼­µåÀÔ´Ï´Ù.

ÆĶó¹ÌÅÍ:
g - ±×·¡ÇÈ ÄÁÅؽºÆ®
b - ·»´õ¸µ ÇÏ´Â ÇöÀçÀÇ ¹öÆ°
textRect - ÅؽºÆ®¸¦ ·»´õ¸µ ÇÏ´Â °æ°èÀÇ ±¸Çü
text - ·»´õ¸µ Çϴ ij¸¯ÅÍ ¶óÀÎ
µµÀÔµÈ ¹öÀü :
1.4

paintFocus

protected void paintFocus(Graphics  g,
                          AbstractButton  b,
                          Rectangle  viewRect,
                          Rectangle  textRect,
                          Rectangle  iconRect)

paintButtonPressed

protected void paintButtonPressed(Graphics  g,
                                  AbstractButton  b)

clearTextShiftOffset

protected void clearTextShiftOffset()

setTextShiftOffset

protected void setTextShiftOffset()

getTextShiftOffset

protected int getTextShiftOffset()

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)

JavaTM 2 Platform
Standard Ed. 5.0

Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.