|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JToolBar
public class JToolBar
JToolBar
는, 일반적으로 사용되는 Action
또는 컨트롤을 표시하는데 도움이 되는 컴퍼넌트를 제공합니다. 툴바의 사용예 및 자세한 것은, 「The Java Tutorial」의「How to Use Tool Bars」를 참조해 주세요.
대부분의 Look & Feel 에서는,floatable
프로퍼티이 false
로 설정되어 있지 않은 한, 사용자가 툴바를 드래그 아웃 해, 다른 윈도우에 넣을 수가 있습니다. 드래그 아웃을 적절히 기능시키려면 , 레이아웃 매니저가 BorderLayout
인 컨테이너의 4 옆의 1 개에 JToolBar
의 인스턴스를 추가해, 그 이외의 옆에는 아이를 추가하지 않는 것을 추천합니다.
경고: Swing 는 thread에 대해서 안전하지는 않습니다. 자세한 것은,「Swing's Threading Policy」를 참조해 주세요.
경고: 이 클래스의 직렬화 된 객체는, 향후의 Swing 릴리스와 호환은 아니게 될 예정입니다. 현재의 직렬화의 지원는, 단기간의 운용이나, 같은 버젼의 Swing 를 실행하는 어플리케이션간의 RMI 에 적절하고 있습니다. JDK Version 1.4 이후, 모든 JavaBeans™ 의 장기간의 운용 지원는,java.beans
패키지에 추가되고 있습니다. 자세한 것은,XMLEncoder
를 참조해 주세요.
Action
상자의 클래스의 개요 | |
---|---|
protected class |
JToolBar.AccessibleJToolBar
이 클래스는 JToolBar 클래스용의 접근성? 지원를 구현하고 있습니다. |
static class |
JToolBar.Separator
툴바 독자적인 separator입니다. |
클래스 javax.swing. JComponent 로부터 상속된 상자의 클래스/인터페이스 |
---|
JComponent.AccessibleJComponent |
클래스 java.awt. Container 로부터 상속된 상자의 클래스/인터페이스 |
---|
Container.AccessibleAWTContainer |
클래스 java.awt. Component 로부터 상속된 상자의 클래스/인터페이스 |
---|
Component.AccessibleAWTComponent , Component.BaselineResizeBehavior , Component.BltBufferStrategy , Component.FlipBufferStrategy |
필드의 개요 |
---|
클래스 javax.swing. JComponent 로부터 상속된 필드 |
---|
accessibleContext , listenerList , TOOL_TIP_TEXT_KEY , ui , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW |
클래스 java.awt. Component 로부터 상속된 필드 |
---|
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
인터페이스 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 |
인터페이스 java.awt.image. ImageObserver 로부터 상속된 필드 |
---|
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
생성자 의 개요 | |
---|---|
JToolBar ()
새로운 툴바를 작성합니다. |
|
JToolBar (int orientation)
orientation 를 지정해 새로운 툴바를 작성합니다. |
|
JToolBar (String name)
name 를 지정해 신규의 툴바를 작성합니다. |
|
JToolBar (String name,
int orientation)
지정된 name 와 orientation 로 새로운 툴바를 작성합니다. |
메소드의 개요 | |
---|---|
JButton |
add (Action a)
액션을 발송 하는 새로운 JButton 를 추가합니다. |
protected void |
addImpl (Component comp,
Object constraints,
int index)
JButton 가 추가되면(자), 초기 상태에서는 사용 불가로 설정됩니다. |
void |
addSeparator ()
디폴트 사이즈의 separator를 툴바의 끝에 추가합니다. |
void |
addSeparator (Dimension size)
지정된 사이즈의 separator를 툴바의 끝에 추가합니다. |
protected PropertyChangeListener |
createActionChangeListener (JButton b)
Action 에의 변경이 발생하는 경우에 컨트롤을 갱신하기 위한 , 적절히 설정된 PropertyChangeListener 를 돌려줍니다. |
protected JButton |
createActionComponent (Action a)
JToolBar 에 추가된 Action 의 JButton 를 작성하는 팩토리 메소드입니다. |
AccessibleContext |
getAccessibleContext ()
이 JToolBar 에 관련한 AccessibleContext 를 돌려줍니다. |
Component |
getComponentAtIndex (int i)
지정된 인덱스의 요소를 돌려줍니다. |
int |
getComponentIndex (Component c)
지정된 컴퍼넌트의 인덱스를 돌려줍니다. |
Insets |
getMargin ()
툴바의 경계와 그 버튼의 사이의 마진을 돌려줍니다. |
int |
getOrientation ()
현재의 툴바의 방향을 돌려줍니다. |
ToolBarUI |
getUI ()
툴바의 현재의 UI 를 돌려줍니다. |
String |
getUIClassID ()
이 컴퍼넌트를 draw 하는 L&F 클래스의 이름을 돌려줍니다. |
boolean |
isBorderPainted ()
borderPainted 프로퍼티을 돌려줍니다. |
boolean |
isFloatable ()
floatable 프로퍼티을 돌려줍니다. |
boolean |
isRollover ()
롤 오버 상태를 돌려줍니다. |
protected void |
paintBorder (Graphics g)
BorderPainted 프로퍼티이 true 의 경우, pop-up menu의 경계를 그립니다. |
protected String |
paramString ()
이 JToolBar 의 캐릭터 라인 표현을 돌려줍니다. |
void |
setBorderPainted (boolean b)
borderPainted 프로퍼티을 설정합니다. |
void |
setFloatable (boolean b)
floatable 프로퍼티을 설정합니다. |
void |
setLayout (LayoutManager mgr)
이 컨테이너의 레이아웃 매니저를 설정합니다. |
void |
setMargin (Insets m)
툴바의 경계와 그 버튼의 사이의 마진을 설정합니다. |
void |
setOrientation (int o)
툴바의 방향을 설정합니다. |
void |
setRollover (boolean rollover)
이 툴바의 롤 오버 상태를 설정합니다. |
void |
setUI (ToolBarUI ui)
이 컴퍼넌트를 draw 하는 L&F 객체를 설정합니다. |
void |
updateUI ()
L&F 가 변경된 것을 나타내는, UIFactory 로부터의 통지입니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
생성자 의 상세 |
---|
public JToolBar()
HORIZONTAL
입니다.
public JToolBar(int orientation)
orientation
를 지정해 새로운 툴바를 작성합니다. orientation
는,HORIZONTAL
또는 VERTICAL
의 어딘가에 될 필요가 있습니다.
orientation
- 지정될 방향public JToolBar(String name)
name
를 지정해 신규의 툴바를 작성합니다. 이름은 떼어내진 툴바의 타이틀로서 사용합니다. 디폴트의 방향은 HORIZONTAL
입니다.
name
- 툴바의 이름public JToolBar(String name, int orientation)
name
와 orientation
로 새로운 툴바를 작성합니다. 다른 생성자 은 모두, 이 생성자 을 호출합니다. orientation
가 무효인 값의 경우, 예외가 throw 됩니다.
name
- 툴바의 이름orientation
- 초기 상태의 방향. HORIZONTAL
또는 VERTICAL
IllegalArgumentException
- 방향이 HORIZONTAL
도 VERTICAL
도 아닌 경우메소드의 상세 |
---|
public ToolBarUI getUI()
setUI(javax.swing.plaf.ToolBarUI)
public void setUI(ToolBarUI ui)
ui
- ToolBarUI
의 L&F 객체UIDefaults.getUI(javax.swing.JComponent)
public void updateUI()
UIFactory
로부터의 통지입니다. UI 를 UIFactory
로부터의 최신 버젼에 옮겨놓기 위해서(때문에) 불려 갑니다.
JComponent
내의 updateUI
JComponent.updateUI()
public String getUIClassID()
JComponent
내의 getUIClassID
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public int getComponentIndex(Component c)
c
- 검색 대상의 Component
public Component getComponentAtIndex(int i)
i
- 컴퍼넌트의 위치. 0 은 선두 위치
Component
.
인덱스가 무효의 경우는 null
public void setMargin(Insets m)
null
로 설정하면(자), 툴바는 디폴트 마진을 사용합니다. 툴바의 디폴트 Border
객체는, 이 값을 사용해 적절한 마진을 작성합니다. 다만, 툴바에 디폴트 이외의 경계가 설정되는 경우, 적절한 마진은 Border
객체측에서 생성할 필요가 있습니다. 그렇지 않은 경우, 이 프로퍼티은 사실상 무시됩니다.
m
- 경계와 버튼의 사이의 스페이스를 정의하는 Insets
객체Insets
public Insets getMargin()
Insets
객체Insets
public boolean isBorderPainted()
borderPainted
프로퍼티을 돌려줍니다.
borderPainted
프로퍼티의 값setBorderPainted(boolean)
public void setBorderPainted(boolean b)
borderPainted
프로퍼티을 설정합니다. 경계를 페인트 하는 경우는, 이 프로퍼티을 true
로 합니다. 이 프로퍼티의 디폴트 값는 true
입니다. 일부의 Look & Feel 에서는 경계의 페인트가 구현되어 있지 않을 가능성이 있습니다. 구현되어 있지 않은 경우, 이 프로퍼티은 무시됩니다.
b
- true 의 경우는 경계가 페인트 되는isBorderPainted()
protected void paintBorder(Graphics g)
BorderPainted
프로퍼티이 true 의 경우, pop-up menu의 경계를 그립니다.
JComponent
내의 paintBorder
g
- 페인트를 하는 Graphics
문맥JComponent.paint(java.awt.Graphics)
,
JComponent.setBorder(javax.swing.border.Border)
public boolean isFloatable()
floatable
프로퍼티을 돌려줍니다.
floatable
프로퍼티의 값setFloatable(boolean)
public void setFloatable(boolean b)
floatable
프로퍼티을 설정합니다. 사용자가 툴바를 이동할 수 있도록(듯이) 하려면 , 이 프로퍼티을 true
로 할 필요가 있습니다. 일반적으로, floatable, 즉 이동 가능한 툴바는, 같은 컨테이너내의 다른 장소에 드래그 하거나 툴바 전용의 윈도우안에 드래그 아웃 하거나 할 수가 있습니다. 이 프로퍼티의 디폴트 값는 true
입니다. 일부의 Look & Feel 에서는 이동식 툴바가 구현되어 있지 않을 가능성이 있습니다. 구현되어 있지 않은 경우, 이 프로퍼티은 무시됩니다.
b
- 이동 가능한 툴바로 하는 경우는 true
, 그렇지 않은 경우는 false
isFloatable()
public int getOrientation()
HORIZONTAL
또는 VERTICAL
입니다.
HORIZONTAL
또는 VERTICAL
)(을)를 나타내는 정수치setOrientation(int)
public void setOrientation(int o)
HORIZONTAL
또는 VERTICAL
입니다. orientation
가 무효인 값의 경우, 예외가 throw 됩니다.
o
- 신규의 방향. HORIZONTAL
또는 VERTICAL
IllegalArgumentException
- 방향이 HORIZONTAL
도 VERTICAL
도 아닌 경우getOrientation()
public void setRollover(boolean rollover)
Look & Feel 의 구현에 따라서는, 이 프로퍼티이 무시되는 일도 있습니다.
rollover
- 툴바 버튼의 롤 오버를 실시하는 경우는 true, 그렇지 않은 경우는 falsepublic boolean isRollover()
setRollover(boolean)
public void addSeparator()
public void addSeparator(Dimension size)
size
- separator의 Dimension
public JButton add(Action a)
JButton
를 추가합니다.
a
- 새로운 메뉴 항목으로서 추가하는 Action
객체
protected JButton createActionComponent(Action a)
JToolBar
에 추가된 Action
의 JButton
를 작성하는 팩토리 메소드입니다. null
액션이 건네받았을 경우, 디폴트명은 비웁니다.
a
- 추가되는 버튼의 Action
Action
protected PropertyChangeListener createActionChangeListener(JButton b)
Action
에의 변경이 발생하는 경우에 컨트롤을 갱신하기 위한 , 적절히 설정된 PropertyChangeListener
를 돌려줍니다. 컨트롤에 디폴트의 프로퍼티 변경 청취자가 필요한 경우는,null
가 돌려주어집니다.
null
protected void addImpl(Component comp, Object constraints, int index)
JButton
가 추가되면(자), 초기 상태에서는 사용 불가로 설정됩니다.
Container
내의 addImpl
comp
- 확장되는 컴퍼넌트constraints
- 컴퍼넌트로 준수되어야 할 제약index
- 컴퍼넌트의 인덱스Container.add(Component)
,
Container.add(Component, int)
,
Container.add(Component, java.lang.Object)
,
LayoutManager
,
LayoutManager2
protected String paramString()
JToolBar
의 캐릭터 라인 표현을 돌려줍니다. 이 메소드는 디버그 전용이며, 반환되는 캐릭터 라인의 내용 및 형식은 구현에 따라서 다릅니다. 반환되는 캐릭터 라인은 빈 상태(empty)의 경우가 있습니다만,null
로는 되지 않습니다.
JComponent
내의 paramString
JToolBar
의 캐릭터 라인 표현public void setLayout(LayoutManager mgr)
Container
의 기술:
Container
내의 setLayout
mgr
- 지정된 레이아웃 매니저Container.doLayout()
,
Container.getLayout()
public AccessibleContext getAccessibleContext()
Accessible
내의 getAccessibleContext
JComponent
내의 getAccessibleContext
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.