|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.SwingUtilities
Swing ÀÇ À¯Æ¿¸®Æ¼ ¸Þ¼ÒµåÀÇ ÄÝ·º¼ÇÀÔ´Ï´Ù.
ÇʵåÀÇ °³¿ä |
ÀÎÅÍÆäÀ̽º javax.swing. SwingConstants ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
¸Þ¼ÒµåÀÇ °³¿ä | |
static Rectangle |
calculateInnerArea (JComponent c,
Rectangle r)
r ³»¿¡¼ ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ³»ºÎ paint areaÀÇ À§Ä¡¿Í »çÀÌÁ ÀúÀåÇØ,r ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static Rectangle [] |
computeDifference (Rectangle rectA,
Rectangle rectB)
rectA ³»¿¡¼ rectB ¿Í ¿À¹ö·¦ ÇÏÁö ¾Ê´Â area¸¦ Ç¥ÇöÇÏ´Â ±¸ÇüÀÇ ¹è¿À» µ¹·ÁÁִµ¥ Æí¸®ÇÕ´Ï´Ù. |
static Rectangle |
computeIntersection (int x,
int y,
int width,
int height,
Rectangle dest)
»õ·Î¿î ±¸ÇüÀ» ÇÒ´çÇÏÁö ¾Ê°í , 2 °³ÀÇ ±¸ÇüÀÇ °øÅë ºÎºÐÀ» °è»êÇϴµ¥ Æí¸®ÇÕ´Ï´Ù. |
static int |
computeStringWidth (FontMetrics fm,
String str)
ÁöÁ¤µÈ ¸ÞÆ®¸¯½º (»çÀÌÁî)¸¦ °¡Áö´Â ÆùÆ®¸¦ »ç¿ëÇØ ij¸¯ÅÍ ¶óÀÎÀÇ ÆøÀ» °è»êÇÕ´Ï´Ù. |
static Rectangle |
computeUnion (int x,
int y,
int width,
int height,
Rectangle dest)
»õ·Î¿î ±¸Çü dest ¸¦ ÇÒ´çÇÏÁö ¾Ê°í , 2 °³ÀÇ ±¸ÇüÀÇ ÈÁýÇÕÀ» °è»êÇϴµ¥ Æí¸®ÇÕ´Ï´Ù. |
static MouseEvent |
convertMouseEvent (Component source,
MouseEvent sourceEvent,
Component destination)
±× x ¿Í y ¸â¹ö°¡ destination ÀÇ ÁÂÇ¥ ü°è¿¡ º¯È¯ ³¡³ °æ¿ì¸¦ Á¦¿ÜÇØ,sourceEvent ¿Í °°Àº MouseEvent ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static Point |
convertPoint (Component source,
int x,
int y,
Component destination)
source ÁÂÇ¥ ü°èÀÇ Á¡ (x, y) À» destination ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. |
static Point |
convertPoint (Component source,
Point aPoint,
Component destination)
source ÁÂÇ¥ ü°èÀÇ aPoint ¸¦ destination ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. |
static void |
convertPointFromScreen (Point p,
Component c)
Æ÷ÀÎÆ®¸¦ ȸé ÁÂÇ¥·ÎºÎÅÍ ÄÄÆÛ³ÍÆ®ÀÇ ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. |
static void |
convertPointToScreen (Point p,
Component c)
Æ÷ÀÎÆ®¸¦ ÄÄÆÛ³ÍÆ®ÀÇ ÁÂÇ¥ ü°è·ÎºÎÅÍ È¸é ÁÂÇ¥·Î º¯È¯ÇÕ´Ï´Ù. |
static Rectangle |
convertRectangle (Component source,
Rectangle aRectangle,
Component destination)
source ÁÂÇ¥ ü°èÀÇ aRectangle ¸¦ destination ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. |
static Component |
findFocusOwner (Component c)
Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. ¹öÁ¯ 1.4 ÀÌÈÄ, KeyboardFocusManager.getFocusOwner() ·Î ¿Å°ÜÁ³½À´Ï´Ù. |
static Accessible |
getAccessibleAt (Component c,
Point p)
·ÎÄà ÁÂÇ¥ÀÇ Point ¿¡ Accessible ÀÇ ¾ÆÀ̰¡ º¸°ü À¯ÁöµÇ°í ÀÖ´Â °æ¿ì´Â ±×°ÍÀ» µ¹·ÁÁÝ´Ï´Ù. |
static Accessible |
getAccessibleChild (Component c,
int i)
¿ÀºêÁ§Æ®ÀÇ n ¹øÂ°ÀÇ Accessible ÀÇ ¾ÆÀ̸¦ µ¹·ÁÁÝ´Ï´Ù. |
static int |
getAccessibleChildrenCount (Component c)
¿ÀºêÁ§Æ®³»ÀÇ À¯Àú º¸Á¶ÀÇ ¾ÆÀÌÀÇ ¼ö¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static int |
getAccessibleIndexInParent (Component c)
À¯Àú º¸Á¶ÀÇ ºÎ¸ð¿¡¼ÀÇ ¿ÀºêÁ§Æ®ÀÇ À妽º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static AccessibleStateSet |
getAccessibleStateSet (Component c)
ÀÌ ¿ÀºêÁ§Æ®ÀÇ À¯Àú º¸Á¶ ±â´É »óŸ¦ µ¹·ÁÁÝ´Ï´Ù. |
static Container |
getAncestorNamed (String name,
Component comp)
ÄÄÆÛ³ÍÆ® °èÃþ¿¡¼ comp ÀÇ »óÀ§¸¦ °Ë»öÇϱâ À§ÇÑ °£ÀÌ ¸Þ¼ÒµåÀ̸ç, ¹ß°ßµÈ name ÀÇ ÃÖÃÊÀÇ ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static Container |
getAncestorOfClass (Class c,
Component comp)
ÄÄÆÛ³ÍÆ® °èÃþ¿¡¼ comp ÀÇ »óÀ§¸¦ °Ë»öÇϱâ À§ÇÑ °£ÀÌ ¸Þ¼ÒµåÀ̸ç, ¹ß°ßµÈ c Ŭ·¡½ºÀÇ ÃÖÃÊÀÇ ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static Component |
getDeepestComponentAt (Component parent,
int x,
int y)
À§Ä¡ x ,y ¸¦ ³»Æ÷ ÇÏ´Â parent ¸¦ ºÎ¸ð·Î¼ °¡Áö´Â ÃÖÇÏÁ¤µµÀÇ °¡½Ã ÄÄÆÛ³ÍÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static Rectangle |
getLocalBounds (Component aComponent)
aComponent ÄÄÆÛ³ÍÆ®ÀÇ ±¸Çü (0,0, bounds.width, bounds.height)À» µ¹·ÁÁÝ´Ï´Ù. |
static Component |
getRoot (Component c)
ÇöÀçÀÇ ÄÄÆÛ³ÍÆ® Æ®¸®ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static JRootPane |
getRootPane (Component c)
c °¡ ÇÏÀ§ JRootPane ¿ÀºêÁ§Æ®ÀÇ °æ¿ì´Â °Ô´Ù°¡ À§ JRootPane ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static ActionMap |
getUIActionMap (JComponent component)
UI °¡ component ·Î ÁöÁ¤ÇÑ ActionMap ¸¦ µ¹·ÁÁÝ´Ï´Ù.
|
static InputMap |
getUIInputMap (JComponent component,
int condition)
UI °¡ component ÀÇ condition ·Î ÁöÁ¤ÇÑ InputMap ¸¦ µ¹·ÁÁÝ´Ï´Ù.
|
static Window |
getWindowAncestor (Component c)
|
static void |
invokeAndWait (Runnable doRun)
doRun.run() ¸¦, AWT À̺¥Æ®µð½ºÆÌÄ¡½º·¿µå·Î ºñµ¿±âÀûÀ¸·Î ½ÇÇà½Ãŵ´Ï´Ù. |
static void |
invokeLater (Runnable doRun)
doRun.run() ¸¦, AWT À̺¥Æ®µð½ºÆÌÄ¡½º·¿µå·Î ºñµ¿±âÀûÀ¸·Î ½ÇÇà½Ãŵ´Ï´Ù. |
static boolean |
isDescendingFrom (Component a,
Component b)
ÄÄÆÛ³ÍÆ® a °¡ ÄÄÆÛ³ÍÆ® b ÀÇ ÇÏÀ§¿¡ ÀÖ´Â °æ¿ì,true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
isEventDispatchThread ()
ÇöÀçÀÇ thread°¡ AWT À̺¥Æ®µð½ºÆÌÄ¡½º·¿µåÀÇ °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
isLeftMouseButton (MouseEvent anEvent)
¸¶¿ì½º À̺¥Æ®°¡ ¿ÞÂÊ mouse button¸¦ ³ªÅ¸³»´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
isMiddleMouseButton (MouseEvent anEvent)
¸¶¿ì½º À̺¥Æ®°¡ Áß¾ÓÀÇ mouse button¸¦ ³ªÅ¸³»´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
isRectangleContainingRectangle (Rectangle a,
Rectangle b)
a °¡ b ¸¦ º¸°ü À¯ÁöÇÏ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
isRightMouseButton (MouseEvent anEvent)
¸¶¿ì½º À̺¥Æ®°¡ ¿À¸¥ÂÊ mouse button¸¦ ³ªÅ¸³»´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static String |
layoutCompoundLabel (FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int textIconGap)
¾ÆÀÌÄÜÀÇ ±âÁ¡ À§Ä¡, ÅØ½ºÆ®ÀÇ baselineÀÇ ±âÁ¡ À§Ä¡, ¹× °¡´ÉÇϸé Ŭ¸³ ÇÑ ¹öÁ¯ÀÇ º¹ÇÕ label ij¸¯ÅÍ ¶óÀÎÀ» °è»êÇØ µ¹·ÁÁÝ´Ï´Ù. |
static String |
layoutCompoundLabel (JComponent c,
FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int textIconGap)
¾ÆÀÌÄÜÀÇ ±âÁ¡ À§Ä¡, ÅØ½ºÆ®ÀÇ baselineÀÇ ±âÁ¡ À§Ä¡, ¹× °¡´ÉÇϸé Ŭ¸³ ÇÑ ¹öÁ¯ÀÇ º¹ÇÕ label ij¸¯ÅÍ ¶óÀÎÀ» °è»êÇØ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
notifyAction (Action action,
KeyStroke ks,
KeyEvent event,
Object sender,
int modifiers)
action °¡ »ç¿ë °¡´ÉÇÑ (ÇÑÆí null °¡ ¾Æ´Ï´Ù) °æ¿ì,action ÀÇ actionPerformed ¸¦ È£ÃâÇÕ´Ï´Ù. |
static void |
paintComponent (Graphics g,
Component c,
Container p,
int x,
int y,
int w,
int h)
±¸ÇüÀÇ Á»󱸼® ¹× »çÀÌÁ ÁöÁ¤ÇØ, ÁöÁ¤µÈ ±¸Çü³»ÀÇ ÀÓÀÇÀÇ ±×·¡ÇȽº g ·Î ÄÄÆÛ³ÍÆ® c ¸¦ paint ÇÕ´Ï´Ù. |
static void |
paintComponent (Graphics g,
Component c,
Container p,
Rectangle r)
Rectangle ¿ÀºêÁ§Æ®¸¦ ÁöÁ¤ÇØ, ÁöÁ¤µÈ ±¸Çü³»ÀÇ ÀÓÀÇÀÇ ±×·¡ÇȽº g ·Î ÄÄÆÛ³ÍÆ® c ¸¦ paint ÇÕ´Ï´Ù. |
static boolean |
processKeyBindings (KeyEvent event)
event ¿¡ °ü·ÃÁöÀ» ¼ö ÀÖ¾ú´ø Component ÀÇ Å° ¹ÙÀεùÀ» ó¸®ÇÕ´Ï´Ù. |
static void |
replaceUIActionMap (JComponent component,
ActionMap uiActionMap)
component ÀÇ UI ActionMap ¸¦ uiActionMap ·Î º¯°æÇϴµ¥ Æí¸®ÇÑ ¸Þ¼ÒµåÀÔ´Ï´Ù. |
static void |
replaceUIInputMap (JComponent component,
int type,
InputMap uiInputMap)
component ÀÇ UI InputMap ¸¦ uiInputMap ·Î º¯°æÇϴµ¥ Æí¸®ÇÑ ¸Þ¼ÒµåÀÔ´Ï´Ù. |
static void |
updateComponentTreeUI (Component c)
´Ü¼øÇÑ Look & Feel ÀÇ º¯°æÀ¸·Î, Æ®¸®³»ÀÇ °¢ ³ëµå¿¡ updateUI() 󸮸¦ ½Ç½ÃÇÏ´Â °Í, Áï ÇöÀçÀÇ Look & Feel ·Î ±× UI ÇÁ·ÎÆÛƼ¸¦ ÃʱâÈÇÏ´Â °ÍÀ» ¿ä±¸ÇÕ´Ï´Ù. |
static Window |
windowForComponent (Component aComponent)
aComponent ÀÇ À©µµ¿ì¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
¸Þ¼ÒµåÀÇ »ó¼¼ |
public static final boolean isRectangleContainingRectangle(Rectangle a, Rectangle b)
a
°¡ b
¸¦ º¸°ü À¯ÁöÇÏ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Rectangle getLocalBounds(Component aComponent)
aComponent
ÄÄÆÛ³ÍÆ®ÀÇ ±¸Çü (0,0, bounds.width, bounds.height)À» µ¹·ÁÁÝ´Ï´Ù.
public static Window getWindowAncestor(Component c)
public static Point convertPoint(Component source, Point aPoint, Component destination)
source
ÁÂÇ¥ ü°èÀÇ aPoint
¸¦ destination
ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. source
°¡ null ÀÇ °æ¿ì,aPoint
´Â destination
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ ÀÖ´Â °Í°ú »óÁ¤µË´Ï´Ù. destination
°¡ null ÀÇ °æ¿ì,aPoint
´Â source
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ º¯È¯µË´Ï´Ù. source
¿Í destination
°¡ ¾î´À Âʰúµµ null ÀÇ °æ¿ì´Â º¯È¯ÇÏÁö ¾Ê°í aPoint
¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Point convertPoint(Component source, int x, int y, Component destination)
source
ÁÂÇ¥ ü°èÀÇ Á¡ (x, y)
À» destination
ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. source
°¡ null ÀÇ °æ¿ì,(x, y)
´Â destination
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ ÀÖ´Â °Í°ú »óÁ¤µË´Ï´Ù. destination
°¡ null ÀÇ °æ¿ì,(x, y)
´Â source
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ º¯È¯µË´Ï´Ù. source
¿Í destination
°¡ ¾î´À Âʰúµµ null ÀÇ °æ¿ì´Â º¯È¯ÇÏÁö ¾Ê°í (x, y)
¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Rectangle convertRectangle(Component source, Rectangle aRectangle, Component destination)
source
ÁÂÇ¥ ü°èÀÇ aRectangle
¸¦ destination
ÁÂÇ¥ ü°è·Î º¯È¯ÇÕ´Ï´Ù. source
°¡ null ÀÇ °æ¿ì,aRectangle
´Â destination
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ ÀÖ´Â °Í°ú »óÁ¤µË´Ï´Ù. destination
°¡ null ÀÇ °æ¿ì,aRectangle
´Â source
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ º¯È¯µË´Ï´Ù. source
¿Í destination
°¡ ¾î´À Âʰúµµ null ÀÇ °æ¿ì´Â º¯È¯ÇÏÁö ¾Ê°í aRectangle
¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Container getAncestorOfClass(Class c, Component comp)
comp
ÀÇ »óÀ§¸¦ °Ë»öÇϱâ À§ÇÑ °£ÀÌ ¸Þ¼ÒµåÀ̸ç, ¹ß°ßµÈ c
Ŭ·¡½ºÀÇ ÃÖÃÊÀÇ ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. c
Ŭ·¡½º°¡ ¹ß°ßµÇÁö ¾Ê´Â °æ¿ì´Â null ¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Container getAncestorNamed(String name, Component comp)
comp
ÀÇ »óÀ§¸¦ °Ë»öÇϱâ À§ÇÑ °£ÀÌ ¸Þ¼ÒµåÀ̸ç, ¹ß°ßµÈ name
ÀÇ ÃÖÃÊÀÇ ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. name
°¡ ¹ß°ßµÇÁö ¾Ê´Â °æ¿ì´Â null ¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Component getDeepestComponentAt(Component parent, int x, int y)
x
,y
¸¦ ³»Æ÷ ÇÏ´Â parent
¸¦ ºÎ¸ð·Î¼ °¡Áö´Â ÃÖÇÏÁ¤µµÀÇ °¡½Ã ÄÄÆÛ³ÍÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù. parent
°¡ ÁöÁ¤µÈ À§Ä¡¸¦ ³»Æ÷ Çϰí ÀÖÁö ¾Ê´Â °æ¿ì´Â null
°¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù. parent
°¡ ÄÁÅ×À̳ʰ¡ ¾Æ´Ñ °æ¿ì, ȤÀº parent
ÀÇ °¡½ÃÀÇ ¾ÆÀ̰¡ ¾î´À °Íµµ ÁöÁ¤µÈ À§Ä¡¸¦ ³»Æ÷ Çϰí ÀÖÁö ¾Ê´Â °æ¿ì´Â parent
°¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù.
parent
- °Ë»öÀ» °³½ÃÇÏ´Â ·çÆ® ÄÄÆÛ³ÍÆ®x
- x Ÿ°Ù À§Ä¡y
- y Ÿ°Ù À§Ä¡public static MouseEvent convertMouseEvent(Component source, MouseEvent sourceEvent, Component destination)
destination
ÀÇ ÁÂÇ¥ ü°è¿¡ º¯È¯ ³¡³ °æ¿ì¸¦ Á¦¿ÜÇØ,sourceEvent
¿Í °°Àº MouseEvent ¸¦ µ¹·ÁÁÝ´Ï´Ù. source
°¡ null ÀÇ °æ¿ì,sourceEvent
ÀÇ x ¿Í y ¸â¹ö´Â destination
ÀÇ ·çÆ® ÄÄÆÛ³ÍÆ® ÁÂÇ¥ ü°è¿¡ µé¾î°¡´Â °Í°ú »óÁ¤µË´Ï´Ù. destination
°¡ null
ÀÇ °æ¿ì, µ¹·ÁÁÖ¾îÁø MouseEvent ´Â source
ÀÇ ÁÂÇ¥ ü°è¿¡ µé¾î°©´Ï´Ù. sourceEvent
´Â º¯°æµÇÁö ¾Ê½À´Ï´Ù. »õ·Î¿î À̺¥Æ®°¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù. destination °¡ null ÀÌ¿ÜÀÇ °æ¿ì, µ¹·ÁÁÖ¾îÁø À̺¥Æ®ÀÇ source
Çʵå´Â destination
·Î ¼³Á¤µË´Ï´Ù. translateMouseEvent() ¸Þ¼Òµå¸¦ »ç¿ëÇϸé(ÀÚ), source ¸¦ º¯°æÇÏÁö ¾Ê°í , ÄÄÆÛ³ÍÆ®ÀÇ ¸¶¿ì½º À̺¥Æ®¸¦ ´Ù¸¥ ÄÄÆÛ³ÍÆ®·Î º¯È¯ÇÒ ¼ö ÀÖ½À´Ï´Ù.
public static void convertPointToScreen(Point p, Component c)
p
- »õ·Î¿î ÁÂÇ¥ ü°è¿¡ º¯È¯µÇ´Â Point ¿ÀºêÁ§Æ®c
- Component ¿ÀºêÁ§Æ®public static void convertPointFromScreen(Point p, Component c)
p
- »õ·Î¿î ÁÂÇ¥ ü°è¿¡ º¯È¯µÇ´Â Point ¿ÀºêÁ§Æ®c
- Component ¿ÀºêÁ§Æ®public static Window windowForComponent(Component aComponent)
aComponent
ÀÇ À©µµ¿ì¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static boolean isDescendingFrom(Component a, Component b)
a
°¡ ÄÄÆÛ³ÍÆ® b
ÀÇ ÇÏÀ§¿¡ ÀÖ´Â °æ¿ì,true
¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Rectangle computeIntersection(int x, int y, int width, int height, Rectangle dest)
x
- ÃÖÃÊÀÇ ±¸ÇüÀÇ Á»óÀÇ Á¡ÀÇ X ÁÂÇ¥y
- ÃÖÃÊÀÇ ±¸ÇüÀÇ Á»óÀÇ Á¡ÀÇ Y ÁÂÇ¥width
- ÃÖÃÊÀÇ ±¸ÇüÀÇ Æøheight
- ÃÖÃÊÀÇ ±¸ÇüÀÇ ³ôÀÌdest
- 2 ¹øÂ°ÀÇ ±¸Çü
dest
public static Rectangle computeUnion(int x, int y, int width, int height, Rectangle dest)
public static Rectangle [] computeDifference(Rectangle rectA, Rectangle rectB)
rectA
³»¿¡¼ rectB
¿Í ¿À¹ö·¦ ÇÏÁö ¾Ê´Â area¸¦ Ç¥ÇöÇÏ´Â ±¸ÇüÀÇ ¹è¿À» µ¹·ÁÁִµ¥ Æí¸®ÇÕ´Ï´Ù. 2 °³ÀÇ ±¸ÇüÀÌ ¿À¹ö·¦ ÇÏÁö ¾Ê´Â °æ¿ì´Â ÇÏ´ÃÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù.
public static boolean isLeftMouseButton(MouseEvent anEvent)
anEvent
- MouseEvent ¿ÀºêÁ§Æ®
public static boolean isMiddleMouseButton(MouseEvent anEvent)
anEvent
- MouseEvent ¿ÀºêÁ§Æ®
public static boolean isRightMouseButton(MouseEvent anEvent)
anEvent
- MouseEvent ¿ÀºêÁ§Æ®
public static int computeStringWidth(FontMetrics fm, String str)
fm
- °è»ê¿¡ »ç¿ëÇÏ´Â FontMetrics ¿ÀºêÁ§Æ®str
- °è»ê ´ë»óÀÇ String
public static String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)
public static String layoutCompoundLabel(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)
public static void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h)
g
·Î ÄÄÆÛ³ÍÆ® c
¸¦ paint ÇÕ´Ï´Ù. ÄÄÆÛ³ÍÆ®´Â c.validate()
È£Ãâ°ú c.repaint()
È£ÃâÀÌ Æ®¸®¿¡ ÀüÆÄ ÇÏÁö ¾Ê°Ô ÇÏ´Â ÇÁ¶óÀ̺ø ÄÁÅ×ÀÌ³Ê (±× ºÎ¸ð°¡ p °¡ µÈ´Ù)¸¦ ºÎ¸ð·Î ¼³Á¤ÇÕ´Ï´Ù. ÀÌ Áß°£ ÄÁÅ×À̳ʿ¡´Â ÀÌ¿ÜÀÇ È¿°ú´Â ¾ø½À´Ï´Ù.
ÄÄÆÛ³ÍÆ®´Â JComponent
ÀÇ ÇÏÀ§ÀÎÁö ´Ù¸¥ Á¾·ùÀÇ °æ·® ÄÄÆÛ³ÍÆ®ÀÎ °ÍÀÌ ÇÊ¿äÇÕ´Ï´Ù. °æ·® ÄÄÆÛ³ÍÆ®¶õ,Component
isLightweight
¸Þ¼Òµå¿¡ ÀÇÇØ µ¹·ÁÁÖ¾îÁö´Â ¡¸°æ·®¡¹ÇÁ·ÎÆÛƼ°¡ true ÀÎ °Í °°Àº ÄÄÆÛ³ÍÆ®ÀÔ´Ï´Ù.
g
- Ç¥ÇöóÀÇ Graphics
¿ÀºêÁ§Æ®c
- Ç¥Çö ´ë»óÀÇ Component
p
- Áß°£ Container
x
- Ç¥Çö areaÀÇ Á´ÜÀ» ³ªÅ¸³»´Â int Ä¡ (Çȼ¿ ´ÜÀ§). ±×·¡ÇȽº ¹®¸ÆÀÇ Á´ÜÀ» ±âÁØÀ¸·Î ÇÏ´Ây
- Ç¥Çö areaÀÇ »ó´ÜÀ» ³ªÅ¸³»´Â int Ä¡ (Çȼ¿ ´ÜÀ§). ±×·¡ÇȽº ¹®¸ÆÀÇ »ó´ÜÀ» ±âÁØÀ¸·Î ÇÏ´Âw
- Ç¥Çö areaÀÇ ÆøÀ» ³ªÅ¸³»´Â int Ä¡ (Çȼ¿ ´ÜÀ§)h
- Ç¥Çö areaÀÇ ³ôÀ̸¦ ³ªÅ¸³»´Â int Ä¡ (Çȼ¿ ´ÜÀ§)Component.isLightweight()
public static void paintComponent(Graphics g, Component c, Container p, Rectangle r)
g
·Î ÄÄÆÛ³ÍÆ® c
¸¦ paint ÇÕ´Ï´Ù. ÄÄÆÛ³ÍÆ®´Â c.validate()
È£Ãâ°ú c.repaint()
È£ÃâÀÌ Æ®¸®¿¡ ÀüÆÄ ÇÏÁö ¾Ê°Ô ÇÏ´Â ÇÁ¶óÀ̺ø ÄÁÅ×ÀÌ³Ê (±× ºÎ¸ð°¡ p
°¡ µÈ´Ù)¸¦ ºÎ¸ð·Î ¼³Á¤ÇÕ´Ï´Ù. ÀÌ Áß°£ ÄÁÅ×À̳ʿ¡´Â ÀÌ¿ÜÀÇ È¿°ú´Â ¾ø½À´Ï´Ù.
ÄÄÆÛ³ÍÆ®´Â JComponent
ÀÇ ÇÏÀ§ÀÎÁö ´Ù¸¥ Á¾·ùÀÇ °æ·® ÄÄÆÛ³ÍÆ®ÀÎ °ÍÀÌ ÇÊ¿äÇÕ´Ï´Ù. °æ·® ÄÄÆÛ³ÍÆ®¶õ,Component
isLightweight
¸Þ¼Òµå¿¡ ÀÇÇØ µ¹·ÁÁÖ¾îÁö´Â ¡¸°æ·®¡¹ÇÁ·ÎÆÛƼ°¡ true ÀÎ °Í °°Àº ÄÄÆÛ³ÍÆ®ÀÔ´Ï´Ù.
g
- Ç¥ÇöóÀÇ Graphics
¿ÀºêÁ§Æ®c
- Ç¥Çö ´ë»óÀÇ Component
p
- Áß°£ Container
r
- Ç¥ÇöóÀÇ Rectangle
Component.isLightweight()
public static void updateComponentTreeUI(Component c)
updateUI()
󸮸¦ ½Ç½ÃÇÏ´Â °Í, Áï ÇöÀçÀÇ Look & Feel ·Î ±× UI ÇÁ·ÎÆÛƼ¸¦ ÃʱâÈÇÏ´Â °ÍÀ» ¿ä±¸ÇÕ´Ï´Ù.
public static void invokeLater(Runnable doRun)
invokeLater
È£ÃâÀº À̺¥Æ®µð½ºÆÌÄ¡½º·¿µå¿¡ Runnable
¿ÀºêÁ§Æ®ÀÇ doHelloWorld
ÀÇ Å¥¸¦ È£ÃâÇÏ°í ³ª¼, ¸Þ¼¼Áö¸¦ Ãâ·ÂÇÕ´Ï´Ù.
Runnable doHelloWorld = new Runnable() { public void run() { System.out.println("Hello World on " + Thread.currentThread()); } }; SwingUtilities.invokeLater(doHelloWorld); System.out.println("This might well be displayed before the other message. ");invokeLater °¡ À̺¥Æ®µð½ºÆÌÄ¡½º·¿µå, ¿¹¸¦ µé¾î JButton ÀÇ ActionListener ·ÎºÎÅÍ ºÒ·Á °¬À» °æ¿ì,doRun.run() ´Â º¸·ùÁßÀÇ ¸ðµç À̺¥Æ®°¡ ó¸®µÉ ¶§±îÁö ½ÇÇàÀÌ ¿¬±âµË´Ï´Ù. ´Ù¸¸,doRun.run() °¡ ijġ µÇÁö ¾Ê´Â ¿¹¿Ü¸¦ ½½·Î¿ì ÇÏ´Â °æ¿ì´Â À̺¥Æ®µð½ºÆÌÄ¡½º·¿µå (ÇöÀçÀÇ thread´Â ¾Æ´Ï´Ù)°¡ »óŸ¦ ¹ÙÅÁÀ¸·Î µÇµ¹¸³´Ï´Ù.
ÀÌ ¸Þ¼ÒµåÀÇ Ãß°¡ÀÇ ¹®¼¿Í ¿¹¿¡ ´ëÇØ¼´Â ¡¸The Java Tutorial¡¹ÀÇ¡¸How to Use Threads¡¹¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
JDK ¹öÁ¯ 1.3 ÀÌÈÄ, ÀÌ ¸Þ¼Òµå´Â java.awt.EventQueue.invokeLater()
·Î¸¸ »ç¿ëµË´Ï´Ù.
invokeAndWait(java.lang.Runnable)
public static void invokeAndWait(Runnable doRun) throws InterruptedException , InvocationTargetException
final Runnable doHelloWorld = new Runnable() { public void run() { System.out.println("Hello World on " + Thread.currentThread()); } }; Thread appThread = new Thread() { public void run() { try { SwingUtilities.invokeAndWait(doHelloWorld); } catch (Exception e) { e.printStackTrace(); } System.out.println("Finished on " + Thread.currentThread()); } }; appThread.start();Runnable.run() ¸Þ¼Òµå°¡ ijġ µÇÁö ¾Ê´Â ¿¹¿Ü¸¦ À̺¥Æ®µð½ºÆÌÄ¡¿øthread·Î ½½·Î¿ì ÇÏ´Â °æ¿ì´Â ±× ¿¹¿Ü´Â È£ÃâÇØ ¿·thread·Î, InvocationTargetException ·Î¼ ijġ µÇ¾î Àç½½·Î¿ì µÇ±â (À§ÇØ)¶§¹®¿¡, ÁÖÀÇÇØ ÁÖ¼¼¿ä.
ÀÌ ¸Þ¼ÒµåÀÇ Ãß°¡ÀÇ ¹®¼¿Í ¿¹¿¡ ´ëÇØ¼´Â ¡¸The Java Tutorial¡¹ÀÇ¡¸How to Use Threads¡¹¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
JDK ¹öÁ¯ 1.3 ÀÌÈÄ, ÀÌ ¸Þ¼Òµå´Â java.awt.EventQueue.invokeAndWait()
·Î¸¸ »ç¿ëµË´Ï´Ù.
InterruptedException
- À̺¥Æ®µð½ºÆÌÄ¡½º·¿µå°¡ doRun.run() ÀÇ ½ÇÇàÀ» ³¡³»´Â °ÍÀ» ±â´Ù¸®´Â µ¿¾È¿¡ ¼¼Ä¡±â¸¦ ¹Þ¾ÒÀ» °æ¿ì
InvocationTargetException
- doRun.run() °¡ ½½·Î¿ì ÇÏ´Â °æ¿ìinvokeLater(java.lang.Runnable)
public static boolean isEventDispatchThread()
JDK ¹öÁ¯ 1.3 ÀÌÈÄ, ÀÌ ¸Þ¼Òµå´Â java.awt.EventQueue.isDispatchThread()
·Î¸¸ »ç¿ëµË´Ï´Ù.
public static int getAccessibleIndexInParent(Component c)
ÁÖ: Java 2 Ç÷§Æû v1. 3 ÀÌÈÄ, °³¹ßÀÚ´Â ÀÌ ¸Þ¼Òµå¸¦ »ç¿ëÇÏ´Â ´ë½Å¿¡, Component.AccessibleAWTComponent.getAccessibleIndexInParent()¸¦ È£ÃâÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
public static Accessible getAccessibleAt(Component c, Point p)
Point
¿¡ Accessible
ÀÇ ¾ÆÀ̰¡ º¸°ü À¯ÁöµÇ°í ÀÖ´Â °æ¿ì´Â ±×°ÍÀ» µ¹·ÁÁÝ´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â null
¸¦ µ¹·ÁÁÝ´Ï´Ù.
Accessible
. ±×·¸Áö ¾ÊÀº °æ¿ì´Â null
public static AccessibleStateSet getAccessibleStateSet(Component c)
ÁÖ: Java 2 Ç÷§Æû v1. 3 ÀÌÈÄ, °³¹ßÀÚ´Â ÀÌ ¸Þ¼Òµå¸¦ »ç¿ëÇÏ´Â ´ë½Å¿¡, Component.AccessibleAWTComponent.getAccessibleIndexInParent()¸¦ È£ÃâÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
AccessibleState
public static int getAccessibleChildrenCount(Component c)
ÁÖ: Java 2 Ç÷§Æû v1. 3 ÀÌÈÄ, °³¹ßÀÚ´Â ÀÌ ¸Þ¼Òµå¸¦ »ç¿ëÇÏ´Â ´ë½Å¿¡, Component.AccessibleAWTComponent.getAccessibleIndexInParent()¸¦ È£ÃâÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
public static Accessible getAccessibleChild(Component c, int i)
ÁÖ: Java 2 Ç÷§Æû v1. 3 ÀÌÈÄ, °³¹ßÀÚ´Â ÀÌ ¸Þ¼Òµå¸¦ »ç¿ëÇÏ´Â ´ë½Å¿¡, Component.AccessibleAWTComponent.getAccessibleIndexInParent()¸¦ È£ÃâÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
i
- Á¦·Î·ÎºÎÅÍ ½ÃÀ۵Ǵ ¾ÆÀÌÀÇ À妽º
public static Component findFocusOwner(Component c)
KeyboardFocusManager.getFocusOwner()
·Î ¿Å°ÜÁ³½À´Ï´Ù.
Component
ÀÇ ¾ÆÀÌ Component
°¡ Æ÷Ä¿½º ¼ÒÀ¯ÀÚÀÎ °æ¿ì, ±× ¾ÆÀÌ Component
¸¦ µ¹·ÁÁÝ´Ï´Ù.
comp
°¡ ¾Æ´Ñ °æ¿ì, ¶Ç´Â Æ÷Ä¿½º ¼ÒÀ¯ÀÚ°¡ comp
ÀÇ ¾ÆÀÌÀÎ °æ¿ì´Â null
KeyboardFocusManager.getFocusOwner()
public static JRootPane getRootPane(Component c)
public static Component getRoot(Component c)
public static boolean processKeyBindings(KeyEvent event)
event
¿¡ °ü·ÃÁöÀ» ¼ö ÀÖ¾ú´ø Component
ÀÇ Å° ¹ÙÀεùÀ» ó¸®ÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå°¡ Æí¸®ÇÑ °ÍÀº event.getComponent()
°¡ JComponent
ÀÇ ÇÏÀ§ÀÎ °æ¿ì, ¶Ç´Â JComponent
¼ºê Ŭ·¡½º³»·ÎºÎÅÍ super.processKeyEvent
¸¦ È£ÃâÇÏÁö ¾ÊÀº °æ¿ì »ÓÀÔ´Ï´Ù. JComponent
´Â ÀÚ½ÅÀÇ processKeyEvent
¸Þ¼Òµå³»·ÎºÎÅÍ ÀÚµ¿ÀûÀ¸·Î ¹ÙÀεùÀ» ó¸®Çϱâ À§ÇØ(¶§¹®¿¡), ÀÌ ¸Þ¼Òµå¸¦ Á÷Á¢ È£ÃâÇÏ´Â °ÍÀÌ ÇÊ¿äÇÑ °æ¿ì´Â °ÅÀÇ ¾ø½À´Ï´Ù.
event
- Æ÷Ä¿½º¸¦ °¡Áö´Â Component ¹× ó¸® ´ë»óÀÇ ¹ÙÀεùÀ» ÁöÁ¤ÇÏ´Â KeyEvent
public static boolean notifyAction(Action action, KeyStroke ks, KeyEvent event, Object sender, int modifiers)
action
°¡ »ç¿ë °¡´ÉÇÑ (ÇÑÆí null °¡ ¾Æ´Ï´Ù) °æ¿ì,action
ÀÇ actionPerformed
¸¦ È£ÃâÇÕ´Ï´Ù. ActionEvent ÀÇ Ä¿¸àµå´Â ´ÙÀ½ÀÇ °ªÀ¸·Î ÁöÁ¤µË´Ï´Ù.
registerKeyboardAction
¸¦ »ç¿ëÇØ µî·ÏµÇ¾úÀ» °æ¿ì´Â °Ç³×¹ÞÀº Ä¿¸àµå ij¸¯ÅÍ ¶óÀÎ (null °¡ °Ç³×¹Þ¾ÒÀ» °æ¿ì´Â null °¡ »ç¿ëµÈ´Ù)
getKeyChar
°¡ KeyEvent.CHAR_UNDEFINED ¸¦ µ¹·ÁÁÖÁö ¾Ê´Â ÀÌ»ó KeyEvent ÀÇ String Ä¡
action
°¡ null Àܷ̿Î, actionPerformed °¡ ºÒ·Á °¡¸é(ÀÚ), true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static void replaceUIInputMap(JComponent component, int type, InputMap uiInputMap)
component
ÀÇ UI InputMap ¸¦ uiInputMap
·Î º¯°æÇϴµ¥ Æí¸®ÇÑ ¸Þ¼ÒµåÀÔ´Ï´Ù. uiInputMap
°¡ null ÀÇ °æ¿ì, ÀÌ ¸Þ¼Òµå´Â ÀÌÀü¿¡ ÀνºÅç µÈ UI InputMap ¸¦ »èÁ¦ÇÕ´Ï´Ù.
public static void replaceUIActionMap(JComponent component, ActionMap uiActionMap)
component
ÀÇ UI ActionMap ¸¦ uiActionMap
·Î º¯°æÇϴµ¥ Æí¸®ÇÑ ¸Þ¼ÒµåÀÔ´Ï´Ù. uiActionMap
°¡ null ÀÇ °æ¿ì, ÀÌ ¸Þ¼Òµå´Â ÀÌÀü¿¡ ÀνºÅç µÈ UI ActionMap ¸¦ »èÁ¦ÇÕ´Ï´Ù.
public static InputMap getUIInputMap(JComponent component, int condition)
component
ÀÇ condition
·Î ÁöÁ¤ÇÑ InputMap ¸¦ µ¹·ÁÁÝ´Ï´Ù.
ÀÌ ¸Þ¼Òµå´Â UI °¡ ÁöÁ¤µÈ ÇüÅÂÀÇ InputMap ¸¦ ÀνºÅç Çϰí ÀÖÁö ¾Ê´Â °æ¿ì¿¡ null ¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static ActionMap getUIActionMap(JComponent component)
component
·Î ÁöÁ¤ÇÑ ActionMap ¸¦ µ¹·ÁÁÝ´Ï´Ù.
ÀÌ ¸Þ¼Òµå´Â UI °¡ ÁöÁ¤µÈ ÇüÅÂÀÇ ActionMap ¸¦ ÀνºÅç Çϰí ÀÖÁö ¾Ê´Â °æ¿ì¿¡ null ¸¦ µ¹·ÁÁÝ´Ï´Ù.
public static Rectangle calculateInnerArea(JComponent c, Rectangle r)
r
³»¿¡¼ ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ³»ºÎ paint areaÀÇ À§Ä¡¿Í »çÀÌÁ ÀúÀåÇØ,r
¸¦ µ¹·ÁÁÝ´Ï´Ù. À§Ä¡¿Í »çÀÌÁî´Â ÄÄÆÛ³ÍÆ®ÀÇ °æ°è¸¦ ³ªÅ¸³», º¸´õ area¸¦ Æ÷ÇÔÇÏÁö ¾Ê°Ô Á¶Á¤µË´Ï´Ù (ÀÎ ¼¼Æ®). ÀÌ ¸Þ¼Òµå´Â paint ÇÏ´Â Äڵ带 ±¸ÇöÇϴ Ŭ·¡½º¿¡ ´ëÇØ¼ Æí¸®ÇÕ´Ï´Ù.
c
- ´ë»óÀÇ JComponent. ÀÌ ¸Þ¼Òµå°¡ null ¸¦ µ¹·ÁÁÖ´Â °æ¿ì´Â nullr
- º¯°æµÇ´Â Rectangle ÀνºÅϽº ¶Ç´Â null
|
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.