public class BasicSeparatorUI extends SeparatorUI
| Modifier and Type | Field and Description |
|---|---|
protected Color |
highlight |
protected Color |
shadow |
| Constructor and Description |
|---|
BasicSeparatorUI() |
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent c) |
Dimension |
getMaximumSize(JComponent c)
返回指定组件的最大尺寸,适合外观和感觉。
|
Dimension |
getMinimumSize(JComponent c)
返回指定组件的最小尺寸,适合外观和感觉。
|
Dimension |
getPreferredSize(JComponent c)
返回指定组件的偏好大小,适合外观和感觉。
|
protected void |
installDefaults(JSeparator s) |
protected void |
installListeners(JSeparator s) |
void |
installUI(JComponent c)
适当地配置指定的组件的外观和感觉。
|
void |
paint(Graphics g, JComponent c)
适当地涂抹指定的组件的外观和感觉。
|
protected void |
uninstallDefaults(JSeparator s) |
protected void |
uninstallListeners(JSeparator s) |
void |
uninstallUI(JComponent c)
在installUI中反转在
installUI上完成的
installUI 。
|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, updatepublic static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
ComponentUI复制
ComponentUI实例作为指定组件上的UI委托时,将调用此方法。
该方法应该完全配置组件的外观,包括以下内容:
LayoutManager上安装LayoutManager。 PropertyChangeListener上创建/安装PropertyChangeListener,以便适当地检测和响应组件属性的更改。 installUI在
ComponentUI
c - 正在安装此UI代理的组件
ComponentUI.uninstallUI(javax.swing.JComponent) ,
JComponent.setUI(javax.swing.plaf.ComponentUI) ,
JComponent.updateUI()
public void uninstallUI(JComponent c)
ComponentUI
installUI上完成的installUI 。
当该UIComponent实例作为指定组件的UI委托被删除时,将调用此方法。
该方法应该撤消在installUI中执行的installUI ,小心使JComponent实例处于干净状态(无外部侦听器,外观特定属性对象等)。
这应该包括以下内容:
uninstallUI在
ComponentUI
c - 从中删除此UI代理的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.installUI(javax.swing.JComponent) ,
JComponent.updateUI()
protected void installDefaults(JSeparator s)
protected void uninstallDefaults(JSeparator s)
protected void installListeners(JSeparator s)
protected void uninstallListeners(JSeparator s)
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update指定组件正在被绘制时的方法。
子类应该覆盖此方法,并使用指定的Graphics对象来呈现Graphics的内容。
paint在
ComponentUI
g - 要绘画的
Graphics上下文
c - 正在涂漆的部件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
public Dimension getPreferredSize(JComponent c)
ComponentUI
null ,则首选的大小将由组件的布局管理器计算(这是安装了特定布局管理器的任何组件的首选方法)。
此方法的默认实现返回null 。
getPreferredSize在
ComponentUI
c - 要查询其首选大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
JComponent.getPreferredSize() ,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMinimumSize(JComponent c)
ComponentUI
null ,则最小尺寸将由组件的布局管理器计算(这是安装了特定布局管理器的任何组件的首选方法)。
此方法的默认实现将调用getPreferredSize并返回该值。
getMinimumSize在
ComponentUI
c - 正在查询最小大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
Dimension对象或
null
JComponent.getMinimumSize() ,
LayoutManager.minimumLayoutSize(java.awt.Container) ,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
ComponentUI
null ,则最大大小将由组件的布局管理器计算(这是安装了特定布局管理器的任何组件的首选方法)。
此方法的默认实现将调用getPreferredSize并返回该值。
getMaximumSize在
ComponentUI类
c - 查询最大大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
Dimension对象或
null
JComponent.getMaximumSize() ,
LayoutManager2.maximumLayoutSize(java.awt.Container)
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.