public class SpinnerComponent extends ContentComponent
eventListenerList
Constructor and Description |
---|
SpinnerComponent()
Initializes a new instance of the SpinnerComponent class.
|
Modifier and Type | Method and Description |
---|---|
void |
addSpinnerComponentListener(SpinnerComponentListener listener)
Registers an event listener.
|
Brush |
getBackground()
Gets the brush used to fill the background of the spinner.
|
Pen |
getBorder()
Gets the pen used to draw the border of the spinner.
|
Brush |
getButtonBrush()
Gets the brush of the spinner's buttons.
|
Brush |
getButtonBrushHovered()
Gets the background brush of the spinner's buttons when they are pointed with the mouse.
|
Brush |
getButtonBrushPressed()
Gets the background brush of the spinner's buttons when they are pressed.
|
java.awt.Color |
getButtonContentColor()
Gets the color of the content of the spinner's buttons.
|
Pen |
getButtonPen()
Gets the border pen of the spinner's buttons.
|
Pen |
getButtonPenHovered()
Gets the border pen of the spinner's buttons when they are pointed with the mouse.
|
Pen |
getButtonPenPressed()
Gets the border pen of the spinner's buttons when they are pressed.
|
java.awt.Font |
getFont()
Gets the font of the spinner's text.
|
float |
getLargeStep()
Gets the amount to add or subtract from the spinner value
when the page up or page down keys are pressed while the spinner has focus.
|
float |
getMaximum()
Gets the maximum value of the spinner.
|
float |
getMinimum()
Gets the minimum value of the spinner.
|
float |
getSmallStep()
Gets the amount to add or subtract from the spinner value
when the adjustment buttons are clicked or when the up or down
arrow keys are pressed while the spinner has focus.
|
java.awt.Color |
getTextColor()
Gets the color of the spinner's text.
|
float |
getValue()
Gets the value displayed in the spinner.
|
boolean |
isSpinning()
Gets a value indicating whether the spinner should revolve when
the value passes beyond the Minimum or Maximum value.
|
protected void |
loadFromJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Deserializes the component from a JsonObject.
|
protected void |
loadFromXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
ContentComponent.loadFromXml override.
|
void |
readExternal(java.io.ObjectInput in)
ContentComponent.readExternal override.
|
void |
removeSpinnerComponentListener(SpinnerComponentListener listener)
Unregisters an event listener.
|
protected void |
saveToJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Serializes the component into a JsonObject
|
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
ContentComponent.saveToXml override.
|
protected boolean |
serializeSubcomponents()
ComponentBase.serializeSubcomponents override.
|
void |
setBackground(Brush value)
Sets the brush used to fill the background of the spinner.
|
void |
setBorder(Pen value)
Sets the pen used to draw the border of the spinner.
|
void |
setButtonBrush(Brush value)
Sets the brush of the spinner's buttons.
|
void |
setButtonBrushHovered(Brush value)
Sets the background brush of the spinner's buttons when they are pointed with the mouse.
|
void |
setButtonBrushPressed(Brush value)
Sets the background brush of the spinner's buttons when they are pressed.
|
void |
setButtonContentColor(java.awt.Color value)
Sets the color of the content of the spinner's buttons.
|
void |
setButtonPen(Pen value)
Sets the border pen of the spinner's buttons.
|
void |
setButtonPenHovered(Pen value)
Sets the border pen of the spinner's buttons when they are pointed with the mouse.
|
void |
setButtonPenPressed(Pen value)
Sets the border pen of the spinner's buttons when they are pressed.
|
void |
setFont(java.awt.Font value)
Sets the font of the spinner's text.
|
void |
setIsSpinning(boolean value)
Sets a value indicating whether the spinner should revolve when
the value passes beyond the Minimum or Maximum value.
|
void |
setLargeStep(float value)
Sets the amount to add or subtract from the spinner value
when the page up or page down keys are pressed while the spinner has focus.
|
void |
setMaximum(float value)
Sets the maximum value of the spinner.
|
void |
setMinimum(float value)
Sets the minimum value of the spinner.
|
void |
setSmallStep(float value)
Sets the amount to add or subtract from the spinner value
when the adjustment buttons are clicked or when the up or down
arrow keys are pressed while the spinner has focus.
|
void |
setTextColor(java.awt.Color value)
Sets the color of the spinner's text.
|
void |
setValue(float value)
Sets the value displayed in the spinner.
|
void |
writeExternal(java.io.ObjectOutput out)
ContentComponent.writeExternal override.
|
accept, addChild, arrangeComponents, draw, getChildCount, getContent, getDesiredSize, getPadding, getThickness, setContent, setPadding
addComponentEventListener, addComponentMouseEventListener, addComponentValidationEventListener, confirmValidating, contains, createOutlinePath, find, getBounds, getCursor, getDocumentBounds, getFocusable, getGridColumn, getGridRow, getHeight, getHorizontalAlignment, getIsEnabled, getIsFocused, getIsHitTestVisible, getIsInteractive, getName, getParent, getParentHost, getVerticalAlignment, getVisible, getWidth, invalidate, invalidateLayout, onAddedToParent, onContextChanged, onGotFocus, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onLostFocus, onMouseDown, onMouseDown, onMouseMove, onMouseMove, onMouseUp, onMouseUp, onRemovedFromParent, onUnitChanged, onValidated, onValidating, onZoomChanged, raiseValidated, removeComponentEventListener, removeComponentMouseEventListener, removeComponentValidationEventListener, setBounds, setFocusable, setGridColumn, setGridRow, setHeight, setHorizontalAlignment, setIsEnabled, setIsFocused, setIsHitTestVisible, setIsInteractive, setName, setParent, setVerticalAlignment, setVisible, setWidth, toDocument, toLocal, toParent
public SpinnerComponent()
protected boolean serializeSubcomponents()
serializeSubcomponents
in class ComponentBase
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class ContentComponent
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.lang.ClassNotFoundException, java.io.IOException
readExternal
in interface java.io.Externalizable
readExternal
in class ContentComponent
java.lang.ClassNotFoundException
java.io.IOException
protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
saveToXml
in class ContentComponent
xmlElement
- An Element the component's data should be stored into.context
- An XmlPersistContext object providing contextual information about the serialization process and some helper serialization methods.protected void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context) throws javax.xml.transform.TransformerException
loadFromXml
in class ContentComponent
xmlElement
- An Element containing the component's data.context
- An XmlPersistContext object providing contextual information about the serialization process and some helper serialization methods.javax.xml.transform.TransformerException
protected void saveToJson(com.mindfusion.common.JsonObject obj, JsonPersistContext context)
saveToJson
in class ContentComponent
obj
- An JsonObject containing the SpinnerComponent datacontext
- An JsonPersistContext object providing information
about the serialization process and some helper methods.protected void loadFromJson(com.mindfusion.common.JsonObject obj, JsonPersistContext context)
loadFromJson
in class ContentComponent
obj
- An JsonObject containing the SpinnerComponent datacontext
- An JsonPersistContext object providing information
about the serialization process and some helper methods.public Brush getBackground()
public void setBackground(Brush value)
value
- An instance of the Brush class.public Pen getBorder()
public void setBorder(Pen value)
value
- An instance of the Pen class.public float getValue()
public void setValue(float value)
value
- The current spinner value.public float getMinimum()
public void setMinimum(float value)
value
- The minimum spinner value.public float getMaximum()
public void setMaximum(float value)
value
- The maximum spinner value.public float getSmallStep()
public void setSmallStep(float value)
value
- A float value representing the small step.public float getLargeStep()
public void setLargeStep(float value)
value
- A float value representing the large step.public boolean isSpinning()
public void setIsSpinning(boolean value)
value
- true to let the value revolve to the other end of the range, or false otherwise.public java.awt.Font getFont()
public void setFont(java.awt.Font value)
value
- An instance of the java.awt.Font class.public java.awt.Color getTextColor()
public void setTextColor(java.awt.Color value)
value
- An instance of the java.awt.Color class.public Brush getButtonBrush()
public void setButtonBrush(Brush value)
value
- An instance of the Brush class.public Brush getButtonBrushHovered()
public void setButtonBrushHovered(Brush value)
value
- An instance of the Brush class.public Brush getButtonBrushPressed()
public void setButtonBrushPressed(Brush value)
value
- An instance of the Brush class.public Pen getButtonPen()
public void setButtonPen(Pen value)
value
- An instance of the Pen class.public Pen getButtonPenHovered()
public void setButtonPenHovered(Pen value)
value
- An instance of the Pen class.public Pen getButtonPenPressed()
public void setButtonPenPressed(Pen value)
value
- An instance of the Pen class.public java.awt.Color getButtonContentColor()
public void setButtonContentColor(java.awt.Color value)
value
- An instance of the java.awt.Color class.public void addSpinnerComponentListener(SpinnerComponentListener listener)
listener
- An object implementing SpinnerComponentListener interface.public void removeSpinnerComponentListener(SpinnerComponentListener listener)
listener
- An object implementing SpinnerComponentListener interface.