public abstract class SynthStyle extends Object
SynthStyle
是一套样式属性。每个
SynthUI
引用了至少一个
SynthStyle
使用
SynthStyleFactory
得出。你通常不需要直接与这类进行交互,而你将加载一个
Synth File Format file为
SynthLookAndFeel
将创造一套synthstyles。
SynthLookAndFeel
,
SynthStyleFactory
Constructor and Description |
---|
SynthStyle()
构建了一个synthstyle。
|
Modifier and Type | Method and Description |
---|---|
Object |
get(SynthContext context, Object key)
对于一个特定区域的样式属性的getter。
|
boolean |
getBoolean(SynthContext context, Object key, boolean defaultValue)
方便法得到一个特定的样式属性,其值是一个布尔值。
|
Color |
getColor(SynthContext context, ColorType type)
返回指定状态的颜色。
|
protected abstract Color |
getColorForState(SynthContext context, ColorType type)
返回指定状态的颜色。
|
Font |
getFont(SynthContext context)
返回指定状态的字体。
|
protected abstract Font |
getFontForState(SynthContext context)
返回指定状态的字体。
|
SynthGraphicsUtils |
getGraphicsUtils(SynthContext context)
返回指定上下文的
SynthGraphicUtils 。
|
Icon |
getIcon(SynthContext context, Object key)
方便的方法得到一个特定的样式属性,其值是一个图标。
|
Insets |
getInsets(SynthContext context, Insets insets)
返回用于计算尺寸信息的插图。
|
int |
getInt(SynthContext context, Object key, int defaultValue)
得到一个特定的样式属性的值是一个
Number 便利的方法。
|
SynthPainter |
getPainter(SynthContext context)
返回
SynthPainter 将用于绘画。
|
String |
getString(SynthContext context, Object key, String defaultValue)
方便法得到一个特定的样式属性,它的值是一个字符串。
|
void |
installDefaults(SynthContext context)
安装必要的状态从这种风格上的
JComponent
context 。
|
boolean |
isOpaque(SynthContext context)
如果区域是不透明的,则返回真。
|
void |
uninstallDefaults(SynthContext context)
卸载任何国家,这种风格上的
JComponent
context 安装。
|
public SynthGraphicsUtils getGraphicsUtils(SynthContext context)
SynthGraphicUtils
。
context
- synthcontext识别请求者
public Color getColor(SynthContext context, ColorType type)
JComponent
前景和背景。如果从
JComponent
的
Color
是不适当的,或不使用,这将调用
getColorForState
。子类通常应该没有覆盖,而不是覆盖
getColorForState(javax.swing.plaf.synth.SynthContext, javax.swing.plaf.synth.ColorType)
。
context
- synthcontext识别请求者
type
-颜色被请求的类型。
protected abstract Color getColorForState(SynthContext context, ColorType type)
JComponent
任何方法。
context
- synthcontext识别请求者
type
-颜色被请求的类型。
public Font getFont(SynthContext context)
JComponent
从
context
是必要的。如果没有重定向到JComponent
getFontForState(javax.swing.plaf.synth.SynthContext)
调用。
context
- synthcontext识别请求者
protected abstract Font getFontForState(SynthContext context)
JComponent
任何方法。
context
- synthcontext识别请求者
public Insets getInsets(SynthContext context, Insets insets)
context
- synthcontext识别请求者
insets
-昆虫的地方返回值。
public SynthPainter getPainter(SynthContext context)
SynthPainter
将用于绘画。这可能返回空。
context
- synthcontext识别请求者
public boolean isOpaque(SynthContext context)
context
- synthcontext识别请求者
public Object get(SynthContext context, Object key)
context
- synthcontext识别请求者
key
-性能要求。
public void installDefaults(SynthContext context)
JComponent
context
。
context
- synthcontext识别组件安装特性。
public void uninstallDefaults(SynthContext context)
JComponent
context
安装。
风格不应该依赖于这个被称为,在某些情况下,它可能永远不会被称为。
context
- synthcontext识别组件安装特性。
public int getInt(SynthContext context, Object key, int defaultValue)
Number
便利的方法。如果该值是一个
Number
,
intValue
返回,否则返回
defaultValue
。
context
- synthcontext识别请求者
key
-性能要求。
defaultValue
值如果属性没有被指定的返回,或不是一个数
public boolean getBoolean(SynthContext context, Object key, boolean defaultValue)
context
- synthcontext识别请求者
key
-性能要求。
defaultValue
值如果属性没有被指定的返回,或不是一个布尔
public Icon getIcon(SynthContext context, Object key)
context
- synthcontext识别请求者
key
-性能要求。
public String getString(SynthContext context, Object key, String defaultValue)
context
- synthcontext识别请求者
key
-性能要求。
defaultValue
值如果属性没有被指定的返回,或不是一个字符串
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.