public class BasicSpinnerUI extends SpinnerUI
Constructor and Description |
---|
BasicSpinnerUI() |
Modifier and Type | Method and Description |
---|---|
protected JComponent |
createEditor()
这种方法被称为installui得到的
JSpinner 编辑组件。
|
protected LayoutManager |
createLayout()
创建一个
LayoutManager 管理
editor ,
nextButton ,和JSpinner
previousButton 儿童。
|
protected Component |
createNextButton()
创建一个增量按钮,即
|
protected Component |
createPreviousButton()
创建一个递减按钮,即
|
protected PropertyChangeListener |
createPropertyChangeListener()
创建一个
PropertyChangeListener 可添加到jspinner本身。
|
static ComponentUI |
createUI(JComponent c)
返回一个新的实例basicspinnerui。
|
int |
getBaseline(JComponent c, int width, int height)
返回基线。
|
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(JComponent c)
返回一个枚举指示组件的尺寸的变化的基线。
|
protected void |
installDefaults()
初始化
JSpinner
border ,
foreground ,和
background ,基于相应的“微调性质。*”属性的缺省值表。
|
protected void |
installKeyboardActions()
安装键盘动作到jspinner。
|
protected void |
installListeners()
一个共享对象代表有趣的propertychangeevents保护方法初始化
PropertyChangeListener 。
|
protected void |
installNextButtonListeners(Component c)
安装必要的听众在下一个按钮,
c ,更新响应用户的手势
JSpinner 。
|
protected void |
installPreviousButtonListeners(Component c)
安装必要的听众前面的按钮,
c ,更新响应用户的手势
JSpinner 。
|
void |
installUI(JComponent c)
电话
installDefaults ,
installListeners ,再加
createNextButton ,
createPreviousButton 返回的部件,和
createEditor 。
|
protected void |
replaceEditor(JComponent oldEditor, JComponent newEditor)
被
PropertyChangeListener 当
JSpinner 编辑属性的变化。
|
protected void |
uninstallDefaults()
设置为空,
JSpinner's 布局管理器。
|
protected void |
uninstallListeners()
删除
PropertyChangeListener 补充installlisteners。
|
void |
uninstallUI(JComponent c)
电话
uninstallDefaults ,
uninstallListeners ,然后删除所有的纺纱的孩子。
|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
protected JSpinner spinner
installUI
方法初始化复位到零,并通过
uninstallUI
。
public static ComponentUI createUI(JComponent c)
c
- JSpinner(未使用)
ComponentUI.createUI(javax.swing.JComponent)
public void installUI(JComponent c)
installDefaults
,
installListeners
,再加
createNextButton
,
createPreviousButton
返回的部件,和
createEditor
。
installUI
方法重写,继承类
ComponentUI
c
- JSpinner
installDefaults()
,
installListeners()
,
createNextButton()
,
createPreviousButton()
,
createEditor()
public void uninstallUI(JComponent c)
uninstallDefaults
,
uninstallListeners
,然后删除所有的纺纱的孩子。
uninstallUI
方法重写,继承类
ComponentUI
c
- JSpinner(未使用)
ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
protected void installListeners()
PropertyChangeListener
。
这种方法被称为installUI
。
protected void uninstallListeners()
PropertyChangeListener
补充installlisteners。
这种方法被称为uninstallUI
。
installListeners()
protected void installDefaults()
JSpinner
border
,
foreground
,和
background
,基于相应的“微调性质。*”属性的缺省值表。的
JSpinners
布局设置为返回的值
createLayout
。这种方法被称为
installUI
。
protected void uninstallDefaults()
JSpinner's
布局管理器。这种方法被称为
uninstallUI
。
protected void installNextButtonListeners(Component c)
c
,更新响应用户的手势
JSpinner
。
c
组件安装监听器
NullPointerException
-如果
c
是空的。
createNextButton()
protected void installPreviousButtonListeners(Component c)
c
,更新响应用户的手势
JSpinner
。
c
组件安装监听器。
NullPointerException
-如果
c
是空的。
createPreviousButton()
protected LayoutManager createLayout()
LayoutManager
管理
editor
,
nextButton
,和JSpinner
previousButton
儿童。这三个孩子必须添加一个约束,确定他们的角色:“编辑”,“下一步”,和“以前”。默认的布局管理器可以处理这些孩子中的任何一个。
createNextButton()
,
createPreviousButton()
,
createEditor()
protected PropertyChangeListener createPropertyChangeListener()
PropertyChangeListener
可添加到jspinner本身。通常情况下,听众会打电话给replaceeditor当“编辑”属性的变化,由于添加编辑JSpinner是
SpinnerUI's
责任(并删除旧的)。这种方法被称为
installListeners
。
installListeners()
protected Component createPreviousButton()
spinner.getPreviousValue
返回的对象代替旋转值。默认情况下,
previousButton
是
JButton
。如果递减按钮是不需要这种方法应该返回
null
。
null
installUI(javax.swing.JComponent)
,
createNextButton()
,
installPreviousButtonListeners(java.awt.Component)
protected Component createNextButton()
spinner.getNextValue
返回的对象代替旋转值。默认情况下,
nextButton
是
JButton
。如果增值按钮不需要这个方法应该返回
null
。
null
installUI(javax.swing.JComponent)
,
createPreviousButton()
,
installNextButtonListeners(java.awt.Component)
protected JComponent createEditor()
JSpinner
编辑组件。默认情况下它只返回
JSpinner.getEditor()
。子类可以重写
createEditor
返回组件包含飞旋的编辑器或null,如果他们要处理添加编辑在
installUI
重写
JSpinner
。
通常这种方法会重写一个自定义边框容器包装的编辑,因为一个不能假设的边界可以直接编辑。
的replaceEditor
方法被调用时,纱厂编辑器改变JSpinner.setEditor
。如果你重写这个方法,那么你可能会想重写replaceEditor
以及。
installUI(javax.swing.JComponent)
,
replaceEditor(javax.swing.JComponent, javax.swing.JComponent)
,
JSpinner.getEditor()
protected void replaceEditor(JComponent oldEditor, JComponent newEditor)
PropertyChangeListener
当
JSpinner
编辑属性的变化。删除旧编辑器并添加新的一个方法是这个方法的责任。默认情况下,此操作是:
删除(oldeditor)旋转;旋转。(neweditor,添加“编辑”);
replaceEditor
的实施应与
createEditor
法协调。
protected void installKeyboardActions()
public int getBaseline(JComponent c, int width, int height)
getBaseline
方法重写,继承类
ComponentUI
c
-
JComponent
基线被要求
width
的宽度得到基线
height
-高度得到基线
null
c
NullPointerException
IllegalArgumentException
如果宽度或高度小于0
JComponent.getBaseline(int, int)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
getBaselineResizeBehavior
方法重写,继承类
ComponentUI
c
-
JComponent
返回基线调整行为
null
c
NullPointerException
JComponent.getBaseline(int, int)
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.