Package com.formdev.flatlaf.ui
Class FlatSpinnerUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.SpinnerUI
-
- javax.swing.plaf.basic.BasicSpinnerUI
-
- com.formdev.flatlaf.ui.FlatSpinnerUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
public class FlatSpinnerUI extends javax.swing.plaf.basic.BasicSpinnerUI implements FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate forJSpinner
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
FlatSpinnerUI.Handler
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
arrowType
private java.util.concurrent.atomic.AtomicBoolean
borderShared
protected java.awt.Color
buttonArrowColor
protected java.awt.Color
buttonBackground
protected java.awt.Color
buttonDisabledArrowColor
protected java.awt.Color
buttonDisabledSeparatorColor
protected java.awt.Color
buttonHoverArrowColor
protected java.awt.Color
buttonPressedArrowColor
protected java.awt.Color
buttonSeparatorColor
protected float
buttonSeparatorWidth
protected java.lang.String
buttonStyle
protected java.awt.Color
disabledBackground
protected java.awt.Color
disabledForeground
protected java.awt.Color
focusedBackground
private FlatSpinnerUI.Handler
handler
private static int
MAC_STEPPER_GAP
private static int
MAC_STEPPER_WIDTH
protected int
minimumWidth
private java.util.Map<java.lang.String,java.lang.Object>
oldStyleValues
protected java.awt.Insets
padding
-
Constructor Summary
Constructors Constructor Description FlatSpinnerUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addEditorFocusListener(javax.swing.JComponent editor)
protected void
applyStyle(java.lang.Object style)
protected java.lang.Object
applyStyleProperty(java.lang.String key, java.lang.Object value)
protected void
configureEditor(javax.swing.JComponent editor)
private java.awt.Component
createArrowButton(int direction, java.lang.String name)
protected javax.swing.JComponent
createEditor()
protected java.awt.LayoutManager
createLayout()
protected java.awt.Component
createNextButton()
protected java.awt.Component
createPreviousButton()
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
protected java.awt.Color
getBackground(boolean enabled)
private static javax.swing.JTextField
getEditorTextField(javax.swing.JComponent editor)
protected java.awt.Color
getForeground(boolean enabled)
private FlatSpinnerUI.Handler
getHandler()
(package private) int
getMacStyleButtonsWidth()
java.util.Map<java.lang.String,java.lang.Class<?>>
getStyleableInfos(javax.swing.JComponent c)
java.lang.Object
getStyleableValue(javax.swing.JComponent c, java.lang.String key)
protected void
installDefaults()
protected void
installListeners()
protected void
installStyle()
void
installUI(javax.swing.JComponent c)
(package private) boolean
isMacStyle()
static boolean
isPermanentFocusOwner(javax.swing.JSpinner spinner)
private void
removeEditorFocusListener(javax.swing.JComponent editor)
protected void
replaceEditor(javax.swing.JComponent oldEditor, javax.swing.JComponent newEditor)
protected void
uninstallDefaults()
protected void
uninstallListeners()
void
update(java.awt.Graphics g, javax.swing.JComponent c)
private void
updateArrowButtonsStyle()
private void
updateEditorColors()
private void
updateEditorPadding()
-
Methods inherited from class javax.swing.plaf.basic.BasicSpinnerUI
createPropertyChangeListener, getBaseline, getBaselineResizeBehavior, installKeyboardActions, installNextButtonListeners, installPreviousButtonListeners, uninstallUI
-
-
-
-
Field Detail
-
handler
private FlatSpinnerUI.Handler handler
-
minimumWidth
protected int minimumWidth
-
buttonStyle
protected java.lang.String buttonStyle
-
arrowType
protected java.lang.String arrowType
-
disabledBackground
protected java.awt.Color disabledBackground
-
disabledForeground
protected java.awt.Color disabledForeground
-
focusedBackground
protected java.awt.Color focusedBackground
-
buttonBackground
protected java.awt.Color buttonBackground
-
buttonSeparatorWidth
protected float buttonSeparatorWidth
- Since:
- 2
-
buttonSeparatorColor
protected java.awt.Color buttonSeparatorColor
- Since:
- 2
-
buttonDisabledSeparatorColor
protected java.awt.Color buttonDisabledSeparatorColor
- Since:
- 2
-
buttonArrowColor
protected java.awt.Color buttonArrowColor
-
buttonDisabledArrowColor
protected java.awt.Color buttonDisabledArrowColor
-
buttonHoverArrowColor
protected java.awt.Color buttonHoverArrowColor
-
buttonPressedArrowColor
protected java.awt.Color buttonPressedArrowColor
-
padding
protected java.awt.Insets padding
-
oldStyleValues
private java.util.Map<java.lang.String,java.lang.Object> oldStyleValues
-
borderShared
private java.util.concurrent.atomic.AtomicBoolean borderShared
-
MAC_STEPPER_WIDTH
private static final int MAC_STEPPER_WIDTH
- See Also:
- Constant Field Values
-
MAC_STEPPER_GAP
private static final int MAC_STEPPER_GAP
- See Also:
- Constant Field Values
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
getHandler
private FlatSpinnerUI.Handler getHandler()
-
installStyle
protected void installStyle()
- Since:
- 2
-
applyStyle
protected void applyStyle(java.lang.Object style)
- Since:
- 2
-
applyStyleProperty
protected java.lang.Object applyStyleProperty(java.lang.String key, java.lang.Object value)
- Since:
- 2
-
getStyleableInfos
public java.util.Map<java.lang.String,java.lang.Class<?>> getStyleableInfos(javax.swing.JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
public java.lang.Object getStyleableValue(javax.swing.JComponent c, java.lang.String key)
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
createEditor
protected javax.swing.JComponent createEditor()
- Overrides:
createEditor
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
replaceEditor
protected void replaceEditor(javax.swing.JComponent oldEditor, javax.swing.JComponent newEditor)
- Overrides:
replaceEditor
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
configureEditor
protected void configureEditor(javax.swing.JComponent editor)
- Since:
- 1.6
-
addEditorFocusListener
private void addEditorFocusListener(javax.swing.JComponent editor)
-
removeEditorFocusListener
private void removeEditorFocusListener(javax.swing.JComponent editor)
-
updateEditorPadding
private void updateEditorPadding()
-
updateEditorColors
private void updateEditorColors()
-
getEditorTextField
private static javax.swing.JTextField getEditorTextField(javax.swing.JComponent editor)
-
isPermanentFocusOwner
public static boolean isPermanentFocusOwner(javax.swing.JSpinner spinner)
- Since:
- 1.3
-
getBackground
protected java.awt.Color getBackground(boolean enabled)
-
getForeground
protected java.awt.Color getForeground(boolean enabled)
-
createLayout
protected java.awt.LayoutManager createLayout()
- Overrides:
createLayout
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
createNextButton
protected java.awt.Component createNextButton()
- Overrides:
createNextButton
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
createPreviousButton
protected java.awt.Component createPreviousButton()
- Overrides:
createPreviousButton
in classjavax.swing.plaf.basic.BasicSpinnerUI
-
createArrowButton
private java.awt.Component createArrowButton(int direction, java.lang.String name)
-
updateArrowButtonsStyle
private void updateArrowButtonsStyle()
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.ComponentUI
-
isMacStyle
boolean isMacStyle()
-
getMacStyleButtonsWidth
int getMacStyleButtonsWidth()
-
-