- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.OptionPaneUI
-
- javax.swing.plaf.basic.BasicOptionPaneUI
-
- javax.swing.plaf.synth.SynthOptionPaneUI
-
- All Implemented Interfaces:
-
PropertyChangeListener,EventListener,SynthConstants,SynthUI
public class SynthOptionPaneUI extends BasicOptionPaneUI implements PropertyChangeListener, SynthUI
为JOptionPane提供Synth L&F UI代表。- 从以下版本开始:
- 1.7
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
BasicOptionPaneUI.ButtonActionListener, BasicOptionPaneUI.ButtonAreaLayout, BasicOptionPaneUI.PropertyChangeHandler
-
-
Field Summary
-
Fields inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
hasCustomComponents, initialFocusComponent, inputComponent, MinimumHeight, minimumSize, MinimumWidth, optionPane, propertyChangeListener
-
Fields inherited from interface javax.swing.plaf.synth.SynthConstants
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
-
-
构造方法摘要
构造方法 Constructor 描述 SynthOptionPaneUI()
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected ContainercreateMessageArea()调用从installComponents()创建一个包含消息正文的Container。protected ContainercreateSeparator()返回一个分隔符。static ComponentUIcreateUI(JComponent x)为给定的组件创建一个新的UI对象。SynthContextgetContext(JComponent c)返回指定组件的上下文。protected booleangetSizeButtonsToSameWidth()返回true,基本的L&F希望所有的按钮具有相同的宽度。protected voidinstallComponents()注册组件。protected voidinstallDefaults()安装默认属性。protected voidinstallListeners()注册听众。voidpaint(Graphics g, JComponent c)根据外观和外观绘制指定的组件。protected voidpaint(SynthContext context, Graphics g)绘制指定的组件。voidpaintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)画边框voidpropertyChange(PropertyChangeEvent e)当绑定属性更改时,此方法将被调用。protected voiduninstallDefaults()卸载默认属性。protected voiduninstallListeners()取消注册听众。voidupdate(Graphics g, JComponent c)通知此UI代理重新绘制指定的组件。-
Methods inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
addButtonComponents, addIcon, addMessageComponents, burstStringInto, containsCustomComponents, createButtonActionListener, createButtonArea, createLayoutManager, createPropertyChangeListener, getButtons, getIcon, getIconForType, getInitialValueIndex, getMaxCharactersPerLineCount, getMessage, getMinimumOptionPaneSize, getPreferredSize, installKeyboardActions, installUI, resetInputValue, selectInitialValue, uninstallComponents, uninstallKeyboardActions, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize
-
-
-
-
方法详细信息
-
createUI
public static ComponentUI createUI(JComponent x)
为给定的组件创建一个新的UI对象。- 参数
-
x- 为其创建UI对象的组件 - 结果
- UI对象
-
installDefaults
protected void installDefaults()
安装默认属性。
-
installListeners
protected void installListeners()
注册听众。
-
uninstallDefaults
protected void uninstallDefaults()
卸载默认属性。
-
uninstallListeners
protected void uninstallListeners()
取消注册听众。
-
installComponents
protected void installComponents()
注册组件。
-
getContext
public SynthContext getContext(JComponent c)
返回指定组件的上下文。- Specified by:
-
getContext在接口SynthUI - 参数
-
c- 组件请求SynthContext。 - 结果
- SynthContext描述组件。
-
update
public void update(Graphics g, JComponent c)
通知此UI代理重新绘制指定的组件。 该方法描述了组件背景,然后调用了paint(SynthContext,Graphics)方法。通常,此方法不需要被子类覆盖。 所有Look和Feel渲染代码都应该在
paint方法中。- 重写:
-
update在ComponentUI - 参数
-
g- 用于绘画的Graphics对象 -
c- 正在涂漆的组件 - 另请参见:
-
paint(SynthContext,Graphics)
-
paint
public void paint(Graphics g, JComponent c)
根据外观和外观绘制指定的组件。Synth Look and Feel不使用此方法。 绘画由
paint(SynthContext,Graphics)处理。- 重写:
-
paint在ComponentUI - 参数
-
g- 用于绘画的Graphics对象 -
c- 正在涂漆的组件 - 另请参见:
-
paint(SynthContext,Graphics)
-
paint
protected void paint(SynthContext context, Graphics g)
绘制指定的组件。 这个实现什么都不做。- 参数
-
context- 正在绘制的组件的上下文 -
g- 用于绘画的Graphics对象 - 另请参见:
-
update(Graphics,JComponent)
-
paintBorder
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
画边框- Specified by:
-
paintBorder在接口SynthUI - 参数
-
context- 组件上下文 -
g-Graphics上画 -
x- X坐标 -
y- Y坐标 -
w- 边框的宽度 -
h- 边框的高度
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
当绑定属性更改时,此方法将被调用。- Specified by:
-
propertyChange在接口PropertyChangeListener - 参数
-
e- 描述事件源和已更改的属性的PropertyChangeEvent对象。
-
getSizeButtonsToSameWidth
protected boolean getSizeButtonsToSameWidth()
返回true,基本的L&F希望所有的按钮具有相同的宽度。- 重写:
-
getSizeButtonsToSameWidth在BasicOptionPaneUI - 结果
-
true如果所有的按钮应该有相同的宽度
-
createMessageArea
protected Container createMessageArea()
从installComponents()调用,创建一个包含消息正文的Container。 该图标是通过调用BasicOptionPaneUI.addIcon(java.awt.Container)创建的。- 重写:
-
createMessageArea在BasicOptionPaneUI - 结果
-
一个
Container
-
createSeparator
protected Container createSeparator()
返回一个分隔符。- 重写:
-
createSeparator在BasicOptionPaneUI - 结果
- 一个分隔符
-
-