|
JavaTM Platform Standard Ed. 6 |
|||||||||
전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.SwingUtilities
public class 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 내에서 지정된 컴퍼넌트의 내부 페인트 영역의 위치와 사이즈를 포함해,r 를 돌려줍니다. |
static Rectangle [] |
computeDifference (Rectangle rectA,
Rectangle rectB)
rectA 내에서 rectB 와 오버랩 하지 않는 영역을 표현하는 구형의 배열을 돌려주는데 편리합니다. |
static Rectangle |
computeIntersection (int x,
int y,
int width,
int height,
Rectangle dest)
새로운 구형을 할당하지 않고 , 2 개의 구형의 공통 부분을 계산하는데 편리합니다. |
static int |
computeStringWidth (FontMetrics fm,
String str)
지정된 메트릭스 (사이즈)를 가지는 폰트를 사용해 캐릭터 라인의 폭을 계산합니다. |
static Rectangle |
computeUnion (int x,
int y,
int width,
int height,
Rectangle 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 번째의 접근성? 대응의 아이를 돌려줍니다. |
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)
c 의 상위의 최초의 Window 인가,c 가 Window 내에 포함되지 않은 경우는 null 를 돌려줍니다. |
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의 기점 위치, 및 가능하면 클립 한 버젼의 복합 라벨 캐릭터 라인을 계산해 돌려줍니다. |
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의 기점 위치, 및 가능하면 클립 한 버젼의 복합 라벨 캐릭터 라인을 계산해 돌려줍니다. |
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)
지정된 Graphics 로, 컴퍼넌트를 그립니다. |
static void |
paintComponent (Graphics g,
Component c,
Container p,
Rectangle r)
지정된 Graphics 로, 컴퍼넌트를 그립니다. |
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 c)
c 의 상위의 최초의 Window 인가,c 가 Window 내에 포함되지 않은 경우는 null 를 돌려줍니다. |
클래스 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)
c
의 상위의 최초의 Window
인가,c
가 Window
내에 포함되지 않은 경우는 null
를 돌려줍니다.
c
- 상위 Window
를 취득하는 Component
c
의 상위의 최초의 Window
인가,c
가 Window
내에 포함되지 않은 경우는 null
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 c)
c
의 상위의 최초의 Window
인가,c
가 Window
내에 포함되지 않은 경우는 null
를 돌려줍니다.
주:이 메소드의 기능은,getWindowAncestor
와 같습니다.
c
- 상위 Window
를 취득하는 Component
c
의 상위의 최초의 Window
인가,c
가 Window
내에 포함되지 않은 경우는 null
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)
x
- 최초의 구형의 x 좌표y
- 최초의 구형의 y 좌표width
- 최초의 구형의 폭height
- 최초의 구형의 높이dest
- 2 번째의 구형의 좌표.
2 개의 구형의 화집합이 이 구형으로 반환된다
dest
Rectangle
public static Rectangle [] computeDifference(Rectangle rectA, Rectangle rectB)
rectA
내에서 rectB
와 오버랩 하지 않는 영역을 표현하는 구형의 배열을 돌려주는데 편리합니다. 2 개의 구형이 오버랩 하지 않는 경우는, 빈 상태(empty)의 배열을 돌려줍니다.
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)
Graphics
로, 컴퍼넌트를 그립니다. 이 메소드는, 주로 가시의 포함 관계의 계층에는 포함되지 않지만 draw에 사용되는 Component
를 draw 하기 위해서 사용됩니다. 예를 들어, draw시에 텍스트나 HTML 를 draw 하고 싶은 경우는,JLabel
의 텍스트 draw 기능을 이용해, 이 메소드로 직접 페인트 할 수가 있습니다. 이 때, 라벨을 가시의 포함 관계의 계층에 추가할 필요는 없습니다.
이 메소드는,CellRendererPane
를 이용해, 실제의 페인트를 처리합니다. draw에 단일의 컴퍼넌트를 사용하는 경우에게만 사용하도록 해 주세요. JTable
와 같이 복수의 컴퍼넌트를 이용해 draw를 실시하는 경우는,CellRendererPane
를 직접 사용해 주세요. 그렇지 않은 경우는, 다음에 나타내도록(듯이),Component
마다 CellRendererPane
를 호출합니다.
c
의 부모가 CellRendererPane
이 아닌 경우, 새로운 CellRendererPane
가 작성되어 거기에 c
가 추가됩니다. 또,CellRendererPane
이 p
에 추가됩니다. c
의 부모가 CellRendererPane
이며,CellRendererPane
의 부모가 p
가 아닌 경우,CellRendererPane
가 p
에 추가됩니다.
컴퍼넌트는,JComponent
의 하위인지, 다른 종류의 경량 컴퍼넌트인 것이 필요합니다. 경량 컴퍼넌트란,Component
isLightweight
메소드에 의해 반환되는 「경량」프로퍼티이 true 인 것 같은 컴퍼넌트입니다. Component 가 경량이 아닌 경우는, 크래쉬, 예외, 페인트 관련의 문제 등, 부정한 사태가 발생하는 일이 있습니다.
g
- draw처의 Graphics
객체c
- draw 대상의 Component
p
- 중간 Container
x
- draw 영역의 좌단을 나타내는 int 치 (픽셀 단위). 그래픽스 문맥의 좌단을 기준으로 하는y
- draw 영역의 상단을 나타내는 int 치 (픽셀 단위). 그래픽스 문맥의 상단을 기준으로 하는w
- draw 영역의 폭을 나타내는 int 치 (픽셀 단위)h
- draw 영역의 높이를 나타내는 int 치 (픽셀 단위)CellRendererPane
,
Component.isLightweight()
public static void paintComponent(Graphics g, Component c, Container p, Rectangle r)
Graphics
로, 컴퍼넌트를 그립니다. 이것은,paintComponent(Graphics, Component, Container, int, int, int, int)
의 커버 메소드입니다. 자세한 것은, 이 메소드를 참조해 주세요.
g
- draw처의 Graphics
객체c
- draw 대상의 Component
p
- 중간 Container
r
- draw처의 Rectangle
paintComponent(Graphics, Component, Container, int, int, int, int)
,
CellRendererPane
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()가 캐치 되지 않는 예외를 throw 하는 경우는, 이벤트발송쓰레드 (현재의 thread는 아니다)가 상태를 바탕으로 되돌립니다.
이 메소드의 추가의 문서와 예에 대해서는, 「The Java Tutorial」의「How to Use Threads」 를 참조해 주세요.
JDK Version 1.3 이후, 이 메소드는 java.awt.EventQueue.invokeLater()
로만 사용됩니다.
이 메소드는, 다른 Swing 의 메소드와는 달라, 어느 thread로부터에서도 호출할 수 있습니다.
invokeAndWait(java.lang.Runnable)
public static void invokeAndWait(Runnable doRun) throws InterruptedException , InvocationTargetException
doRun.run()
를, AWT 이벤트발송쓰레드로 비동기적으로 실행시킵니다. 이것은, 보류중의 모든 AWT 이벤트가 처리될 때까지 블록 되어 다음에 doRun.run()
가 복귀합니다. 이 메소드는, 어플리케이션 thread가 GUI 를 갱신할 필요가 있을 때 사용됩니다. 이 메소드는,EventDispatchThread
로부터 호출하지 말아 주세요. 새로운 어플리케이션 thread를 생성하는 예를, 다음에 나타냅니다. 이 예에서는, 어플리케이션 thread는 invokeAndWait
를 사용해 이벤트발송쓰레드로부터 캐릭터 라인을 출력해, 그 후, 어플리케이션 thread로부터 캐릭터 라인을 출력합니다.
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
메소드가 캐치 되지 않는 예외를 이벤트발송원thread로 throw 하는 경우는, 그 예외는 호출해 옆의 thread로,InvocationTargetException
로서 캐치 되어 재throw 되기 (위해)때문에, 주의해 주세요. 이 메소드의 추가의 문서와 예에 대해서는, 「The Java Tutorial」의「How to Use Threads」 를 참조해 주세요.
JDK Version 1.3 이후, 이 메소드는 java.awt.EventQueue.invokeAndWait()
로만 사용됩니다.
InterruptedException
- 이벤트발송쓰레드가 doRun.run()
의 실행을 끝내는 것을 기다리는 동안에 인터럽트를 받았을 경우
InvocationTargetException
- doRun
의 실행중에 예외가 throw 되는 경우invokeLater(java.lang.Runnable)
public static boolean isEventDispatchThread()
JDK Version 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
- 제로로부터 시작되는 아이의 인덱스
@Deprecated public static Component findFocusOwner(Component c)
KeyboardFocusManager.getFocusOwner()
로 옮겨졌습니다.
Component
의 아이 Component
가 포커스 소유자인 경우, 그 아이 Component
를 돌려줍니다.
c
- 포커스 소유자를 검색할 때의 Component
계층 루트
comp
가 아닌 경우, 또는 포커스 소유자가 comp
의 아이인 경우는 null
KeyboardFocusManager.getFocusOwner()
public static JRootPane getRootPane(Component c)
null
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
를 사용해 등록되었을 경우는, 건네받은 커멘드 캐릭터 라인 (null
가 건네받았을 경우는 null
).
null
가 아닌 한, Action.ACTION_COMMAND_KEY 라는 이름을 가지는 Action 치.
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
내에서 지정된 컴퍼넌트의 내부 페인트 영역의 위치와 사이즈를 포함해,r
를 돌려줍니다. 위치와 사이즈는, 컴퍼넌트의 경계를 나타내, 경계 영역을 포함하지 않게 조정됩니다 (인 세트). 이 메소드는, 페인트 하는 코드를 구현하는 클래스에 대해서 편리합니다.
c
- 대상의 JComponent. 이 메소드가 null
를 돌려주는 경우는 null
r
- 변경되는 Rectangle 의 인스턴스.
null
의 경우도 있다
null
의 경우는 null
.
그렇지 않은 경우는 건네받은 구형 (null
이외의 경우),
또는 위치 및 사이즈 정보를 지정하는 새로운 구형
|
JavaTM Platform Standard Ed. 6 |
|||||||||
전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.