|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.LookAndFeel
javax.swing.plaf.basic.BasicLookAndFeel
public abstract class BasicLookAndFeel
Swing 의 Look & Feel 의 작성에 사용하는 base class입니다.
BasicLookAndFeel
가 제공하는 각 ComponentUI
는, 그 동작을 디폴트 테이블에서 가져옵니다. 특히 명기되어 있지 않은 한, 이 패키지의 각 ComponentUI
구현에는, 사용하는 디폴트세트가 문서화 되고 있습니다. 특히 명기되어 있지 않은 한, 디폴트는 installUI
의 호출시에 인스톨 됩니다. 디폴트의 인스톨은,LookAndFeel
에 기재되어 있는 추천 사항에 따라 실시합니다.
경고: 이 클래스의 직렬화 된 객체는, 향후의 Swing 릴리스와 호환은 아니게 될 예정입니다. 현재의 직렬화의 지원는, 단기간의 운용이나, 같은 버젼의 Swing 를 실행하는 어플리케이션간의 RMI 에 적절하고 있습니다. JDK Version 1.4 이후, 모든 JavaBeans™ 의 장기간의 운용 지원는,java.beans
패키지에 추가되고 있습니다. 자세한 것은,XMLEncoder
를 참조해 주세요.
생성자 의 개요 | |
---|---|
BasicLookAndFeel ()
|
메소드의 개요 | |
---|---|
protected Action |
createAudioAction (Object key)
사운드의 재생에 사용하는 Action 를 작성해, 돌려줍니다. |
protected ActionMap |
getAudioActionMap ()
이 Look & Feel 의 오디오 액션을 포함한 ActionMap 를 돌려줍니다. |
UIDefaults |
getDefaults ()
Look & Feel 의 디폴트를 돌려줍니다. |
protected void |
initClassDefaults (UIDefaults table)
uiClassID 와 UI 클래스의 완전 지정명의 매핑을 포함한 table 를 생성합니다. |
protected void |
initComponentDefaults (UIDefaults table)
기본 Look & Feel 의 디폴트가 포함된 table 를 생성합니다. |
void |
initialize ()
Look & Feel 를 초기화합니다. |
protected void |
initSystemColorDefaults (UIDefaults table)
시스템 칼라의 table 를 생성합니다. |
protected void |
loadSystemColors (UIDefaults table,
String [] systemColors,
boolean useNative)
systemColors 내에 이름과 색 의 페어가 들어가 있는 table 를 생성합니다. |
protected void |
playSound (Action audioAction)
필요에 따라서, audioAction 상에서 actionPerformed 를 호출해, 사운드를 재생합니다. |
void |
uninitialize ()
Look & Feel 의 초기화를 해제합니다. |
클래스 javax.swing. LookAndFeel 로부터 상속된 메소드 |
---|
getDescription , getDesktopPropertyValue , getDisabledIcon , getDisabledSelectedIcon , getID , getLayoutStyle , getName , getSupportsWindowDecorations , installBorder , installColors , installColorsAndFont , installProperty , isNativeLookAndFeel , isSupportedLookAndFeel , loadKeyBindings , makeComponentInputMap , makeIcon , makeInputMap , makeKeyBindings , provideErrorFeedback , toString , uninstallBorder |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
생성자 의 상세 |
---|
public BasicLookAndFeel()
메소드의 상세 |
---|
public UIDefaults getDefaults()
UIDefaults
는,initClassDefaults
,initSystemColorDefaults
, 및 initComponentDefaults
를 이 차례로 호출하는 것에 의해 생성됩니다.
이 메소드는 public 메소드입니다만, 항상, 임의의 Look & Feel 가 현재의 Look & Feel 로서 설정되어initialize
가 불려 간 뒤,UIManager
에 의해 불려 가도록 해 주세요.
LookAndFeel
내의 getDefaults
initClassDefaults(javax.swing.UIDefaults)
,
initSystemColorDefaults(javax.swing.UIDefaults)
,
initComponentDefaults(javax.swing.UIDefaults)
public void initialize()
UIManager
에 의해 불려 가도록 해 주세요. 이 메소드는,UIManager
가 getDefaults
를 호출하기 전에 불려 갑니다. 이 메소드는, Look & Feel 의 모든 초기화를 실행하기 위한 메소드입니다. 서브 클래스는, static 초기화자는 아니고, 이 메소드로 필요한 1 회나 의리의 설정을 모두 실행합니다. Look & Feel 클래스의 객체는,isSupportedLookAndFeel()
가 false
를 돌려주는 것을 확인하기 위해서만 로드 되는 경우가 있기 때문입니다.
LookAndFeel
내의 initialize
LookAndFeel.uninitialize()
,
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public void uninitialize()
UIManager
에 의해 불려 가도록 해 주세요. 예를 들어,UIManager.setLookAndFeel
는, Look & Feel 의 변경시에 이 메소드를 호출합니다. 서브 클래스는, 이 메소드로 몇개의 자원을 해제할 수 있습니다.
LookAndFeel
내의 uninitialize
LookAndFeel.initialize()
,
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
protected void initClassDefaults(UIDefaults table)
uiClassID
와 UI 클래스의 완전 지정명의 매핑을 포함한 table
를 생성합니다. 개개의 uiClassID
의 값은,「javax.swing.plaf.basic.Basic」+「uiClassID」
가 됩니다. 예를 들어,uiClassID
TreeUI
의 값은 javax.swing.plaf.basic.BasicTreeUI
입니다.
table
- 엔트리가 추가되는 UIDefaults
인스턴스
NullPointerException
- table
가 null
의 경우LookAndFeel
,
getDefaults()
protected void initSystemColorDefaults(UIDefaults table)
table
를 생성합니다. 이것에 의해,이름과 색
의 페어로부터 완성되는 배열이 작성되어loadSystemColors
가 불려 갑니다.
이름은,SystemColor
클래스내의 임의의 static SystemColor
필드의 이름에 대응하는 String
입니다. 이름과 색의 페어는, 이러한 SystemColor
필드 마다 작성됩니다.
color
는,Color.decode
의 인식 대로, 16 진 String
에 대응하고 있습니다. 예를 들어,「desktop」와「#005 C5C」
의 이름과 색
의 페어가 있다고 합니다. 이것은,SystemColor
필드의 desktop
(색의 값은 new Color(0x005C5C)
)에 대응하고 있습니다.
다음에,이름과 색
의 페어를 2 개 가리킵니다.
String[] nameColorPairs = new String[] { "desktop", "#005C5C", "activeCaption", "#000080" }; loadSystemColors(table, nameColorPairs, isNativeLookAndFeel());이전에 말한 것처럼, 이 코드는, 지정된
table
및 이름과 색
의 페어로부터 완성되는 배열에 의해,loadSystemColors
를 호출합니다. loadSystemColors
의 마지막 인수는,SystemColor
내의 필드의 값을 사용할지 어떨지를 나타냅니다. 이 메소드는,loadSystemColors
의 마지막 인수로서 isNativeLookAndFeel()
의 값을 건네줍니다.
table
- 치가 추가되는 UIDefaults
객체
NullPointerException
- table
가 null
의 경우SystemColor
,
getDefaults()
,
loadSystemColors(javax.swing.UIDefaults, java.lang.String[], boolean)
protected void loadSystemColors(UIDefaults table, String [] systemColors, boolean useNative)
systemColors
내에 이름과 색
의 페어가 들어가 있는 table
를 생성합니다. systemColors
의 형식의 자세한 것은,initSystemColorDefaults(UIDefaults)
를 참조해 주세요.
systemColors
내의 이름과 색
의 페어 마다,table
에 엔트리가 추가됩니다. 엔트리 키는,이름과 색
의 페어의 이름
부분이 됩니다.
엔트리의 값은,이름과 색
의 페어의 색
부분에 대응합니다. 엔트리의 값은, 다음의 어느 쪽인가의 방법으로 계산됩니다. 어느 쪽의 방법에서도, 값은 항상 ColorUIResource
입니다.
useNative
가 false
의 경우,색
은,Color.decode
로 String
를 Color
로 변환하는 것에 의해 작성됩니다. decode
로 String
로부터 Color
에의 변환을 실행할 수 없는 (NumberFormatException
가 throw 된다) 경우, 흑의 ColorUIResource
가 사용됩니다.
useNative
가 true
의 경우,color
는,이름과 색
의 페어의 이름
부분으로 지정된 이름을 가지는,SystemColor
내의 필드의 값이 됩니다. 필드가 유효하지 않은 경우, 흑의 ColorUIResource
가 사용됩니다.
table
- 치가 추가되는 UIDefaults
객체systemColors
- 이름과 색
의 페어로부터 완성되는 배열 (initSystemColorDefaults(UIDefaults)
에 기술되고 있는 대로)useNative
- 색을 SystemColor
와 Color.decode
의 어느 쪽으로부터 취득할까
NullPointerException
- systemColors
가 null
의 경우,systemColors
가 빈 상태(empty)이 아니고 table
가 null
의 경우,이름과 색
의 페어에 null
의 이름이 포함되는 경우, 또는 useNative
가 false
로,이름과 색
의 페어에 null
의 색
이 포함되는 경우
ArrayIndexOutOfBoundsException
- useNative
가 false
로 systemColors.length
가 홀수의 경우initSystemColorDefaults(javax.swing.UIDefaults)
,
SystemColor
,
Color.decode(String)
protected void initComponentDefaults(UIDefaults table)
table
를 생성합니다.
table
- 치가 추가되는 UIDefaults
NullPointerException
- table
가 null
의 경우protected ActionMap getAudioActionMap()
ActionMap
를 돌려줍니다.
이 ActionMap
에는, 청각 신호를 렌더링 하는 기능을 집어 넣은 Actions
가 포함됩니다. 이러한 청각 신호는, 최종 사용자가 알아 두면(자) 편리한 사용자 및 시스템 액티버티 (다이알로그 박스의 표시등)에 맵 됩니다.
적절한 때에,ComponentUI
는 ActionMap
로부터 Action
를 취득해,playSound
에 건네줍니다.
이 메소드는, 우선 키로서 AuditoryCues.actionMap
를 사용해, 디폴트로부터 ActionMap
를 검색합니다.
값이 null 이외
의 경우, 그 값이 돌려주어집니다. 디폴트의 AuditoryCues.actionMap
의 값이 null
로, 디폴트의 AuditoryCues.cueList
의 값이 null 이외
인 경우,ActionMapUIResource
가 작성됩니다. 값의 생성은,AuditoryCues.cueList
배열의 각 요소를 반복해,createAudioAction()
를 호출해 각 요소의 Action
를 작성하는 것에 의해 행해집니다. 결과적으로 얻을 수 있는 Action
는, 배열 요소를 키로서 이용하는 것으로써,ActionMapUIResource
에 배치됩니다. 예를 들어,AuditoryCues.cueList
배열이 단일의 요소의 audioKey
를 포함한 경우,ActionMapUIResource
가 작성되어actionMap.put(cueList[0], createAudioAction(cueList[0]))
에 의해 생성됩니다.
디폴트의 AuditoryCues.actionMap
의 값이 null
로, 디폴트의 AuditoryCues.cueList
의 값이 null
인 경우, 빈 상태(empty)의 ActionMapUIResource
가 작성됩니다.
Action
를 포함한 ActionMap
ClassCastException
- 디폴트의 AuditoryCues.actionMap
의 값이 ActionMap
가 아닌지, 디폴트의 AuditoryCues.cueList
의 값이 Object[]
가 아닌 경우createAudioAction(java.lang.Object)
,
playSound(Action)
protected Action createAudioAction(Object key)
Action
를 작성해, 돌려줍니다.
key
의 값이 null 이외
의 경우, 디폴트의 값과 키 key
를 사용해 Action
가 작성됩니다. 값은,Action
상에서 actionPerformed
가 불려 갔을 때에 로드 되는 사운드 자원을 식별합니다. 사운드 자원은,getClass(). getResourceAsStream()
에 의해 byte[]
에 로드 됩니다.
key
- 오디오 액션을 식별하는 키
Action
. key
가 null
의 경우는 null
playSound(Action)
protected void playSound(Action audioAction)
audioAction
상에서 actionPerformed
를 호출해, 사운드를 재생합니다. actionPerformed
메소드는,AuditoryCues.playList
의 디폴트 값가 audioAction
의 이름과 동등의 String
엔트리를 포함한 null 이외
의 Object[]
인 경우에 불려 갑니다.
audioAction
- 시스템, 또는 발생중의 사용자 액티버티에 관련하는 오디오의 draw 방법을 알고 있는 Action. null
치는 무시된다
ClassCastException
- audioAction
가 null 이외
로, 디폴트의 AuditoryCues.playList
의 값이 Object[]
가 아닌 경우
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.