public class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, SynthUI
spinnerDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Constructor and Description | 
|---|
| SynthSpinnerUI() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected JComponent | createEditor()
              该方法由installUI调用以获取JSpinner的编辑器 
              JSpinner。 | 
| protected LayoutManager | createLayout()
              创建一个 
              LayoutManager管理该editor,nextButton和previousButton的JSpinner的儿童。 | 
| protected Component | createNextButton()
              创建一个增量按钮,即 
             | 
| protected Component | createPreviousButton()
              创建一个减量按钮,即 
             | 
| static ComponentUI | createUI(JComponent c)
              返回SynthSpinnerUI的新实例。 
             | 
| SynthContext | getContext(JComponent c)
              返回指定组件的上下文。 
             | 
| protected void | installDefaults()
              初始化 
              JSpinnerborder,foreground和background基于从默认值表中对应的“微调。*”的属性,属性。 | 
| protected void | installListeners()
              使用共享对象初始化 
              PropertyChangeListener,该对象将有趣的PropertyChangeEvents委托给受保护的方法。 | 
| void | paint(Graphics g, JComponent c)
              根据外观和外观绘制指定的组件。 
             | 
| protected void | paint(SynthContext context, Graphics g)
              绘制指定的组件。 
             | 
| void | paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
              画边框 
             | 
| void | propertyChange(PropertyChangeEvent e)
              当绑定属性更改时,此方法将被调用。 
             | 
| protected void | replaceEditor(JComponent oldEditor, JComponent newEditor)
              由 
              PropertyChangeListener调用时,JSpinner编辑器属性发生变化。 | 
| protected void | uninstallDefaults()
              将 
              JSpinner's布局管理器设置为null。 | 
| protected void | uninstallListeners()
              删除由 
              PropertyChangeListener添加的PropertyChangeListener。 | 
| void | update(Graphics g, JComponent c)
              通知此UI代理重新绘制指定的组件。 
             | 
createPropertyChangeListener, getBaseline, getBaselineResizeBehavior, installKeyboardActions, installNextButtonListeners, installPreviousButtonListeners, installUI, uninstallUIcontains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSizepublic static ComponentUI createUI(JComponent c)
c - JSpinner(未使用) 
           ComponentUI.createUI(javax.swing.JComponent) 
           protected void installListeners()
PropertyChangeListener ,该对象将感兴趣的PropertyChangeEvents委托给受保护的方法。 
            此方法由installUI 。 
protected void uninstallListeners()
PropertyChangeListener添加的PropertyChangeListener。 
            此方法由uninstallUI 。 
protected void installDefaults()
JSpinner border , foreground和background基于从默认值表中对应的“微调。*”的属性,属性。 
           JSpinners布局设置为createLayout返回的值。 
           此方法由installUI 。 
          protected void uninstallDefaults()
JSpinner's布局管理器设置为null。 
           此方法由uninstallUI 。 
          protected LayoutManager createLayout()
LayoutManager管理该editor , nextButton和previousButton的JSpinner的儿童。 
           这三个孩子必须添加一个约束来标识他们的角色:“编辑”,“下一步”和“上一个”。 
           默认布局管理器可以处理这些孩子中没有任何一个。 
          createLayout在 
            BasicSpinnerUI 
           BasicSpinnerUI.createNextButton() , 
            BasicSpinnerUI.createPreviousButton() , 
            BasicSpinnerUI.createEditor() 
           protected Component createPreviousButton()
spinner.getPreviousValue 。 
           默认情况下, previousButton是JButton 。 
           如果不需要减量按钮,则此方法应返回null 。 
          createPreviousButton在 
            BasicSpinnerUI 
           null ,或 
            null 
           BasicSpinnerUI.installUI(javax.swing.JComponent) , 
            BasicSpinnerUI.createNextButton() , 
            BasicSpinnerUI.installPreviousButtonListeners(java.awt.Component) 
           protected Component createNextButton()
spinner.getNextValue 。 
           默认情况下, nextButton是JButton 。 
           如果不需要增量按钮,则此方法应返回null 。 
          createNextButton在 
            BasicSpinnerUI 
           null ,或 
            null 
           BasicSpinnerUI.installUI(javax.swing.JComponent) , 
            BasicSpinnerUI.createPreviousButton() , 
            BasicSpinnerUI.installNextButtonListeners(java.awt.Component) 
           protected JComponent createEditor()
JSpinner 。 
           默认情况下,它只返回JSpinner.getEditor() 。 
           子类可以重写createEditor返回包含微调的编辑器或空,如果他们要处理添加编辑器的组件JSpinner在installUI覆盖。 
           通常,这个方法将被覆盖,使编辑器包含带有自定义边框的容器,因为不能假定编辑器边框可以直接设置。
 当使用JSpinner.setEditor更改纺纱编辑器时,将调用replaceEditor方法。 如果您已经覆盖了此方法,那么您也可能需要覆盖replaceEditor 。 
createEditor在 
            BasicSpinnerUI 
           BasicSpinnerUI.installUI(javax.swing.JComponent) , 
            replaceEditor(javax.swing.JComponent, javax.swing.JComponent) , 
            JSpinner.getEditor() 
           protected void replaceEditor(JComponent oldEditor, JComponent newEditor)
PropertyChangeListener当JSpinner编辑器属性更改时调用。 
           删除旧编辑器并添加新编辑器是有责任的。 
           默认情况下这个操作只是: 
             spinner.remove(oldEditor);
 spinner.add(newEditor, "Editor");  
           replaceEditor的replaceEditor应与createEditor方法createEditor 。 
          public SynthContext getContext(JComponent c)
getContext在接口 
            SynthUI 
           c - 组件请求SynthContext。 
           public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)方法。 
            通常,此方法不需要被子类覆盖。 所有Look和Feel渲染代码应该位于paint方法中。 
update在 
            ComponentUI 
           g - 用于绘画的 
            Graphics对象 
           c - 正在涂漆的组件 
           paint(SynthContext,Graphics) 
           public void paint(Graphics g, JComponent c)
 Synth Look and Feel不使用此方法。 绘画由paint(SynthContext,Graphics)处理。 
paint在 
            ComponentUI 
           g - 用于绘画的 
            Graphics对象 
           c - 正在涂漆的组件 
           paint(SynthContext,Graphics) 
           protected void paint(SynthContext context, Graphics g)
context - 正在绘制的组件的上下文 
           g - 用于绘画的 
            Graphics对象 
           update(Graphics,JComponent) 
           public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
paintBorder在接口 
            SynthUI 
           context - 组件上下文 
           g - 
            Graphics上画 
           x - X坐标 
           y - Y坐标 
           w - 边框的宽度 
           h - 边框的高度 
           public void propertyChange(PropertyChangeEvent e)
propertyChange在界面 
            PropertyChangeListener 
           e - 描述事件源和已更改的属性的PropertyChangeEvent对象。 
            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.