public class SliderComponent extends ContentComponent
Modifier and Type | Class and Description |
---|---|
static class |
SliderComponent.SliderType
Specifies the type of a slider component.
|
eventListenerList
Constructor and Description |
---|
SliderComponent()
Initializes a new instance of the SliderComponent class.
|
Modifier and Type | Method and Description |
---|---|
void |
addSliderListener(SliderListener listener)
Registers an event listener.
|
void |
addSliderRailListener(SliderRailListener listener)
Registers an event listener.
|
Brush |
getActiveBrush()
Gets the brush used to fill the portion of the rail
between StartValue and EndValue.
|
Brush |
getBackground()
Gets the brush used to fill the background of the slider.
|
Pen |
getBorder()
Gets the pen used to draw the border of the slider.
|
Brush |
getButtonBrush()
Gets the brush of the slider's buttons and thumbs.
|
Brush |
getButtonBrushHovered()
Gets the background brush of the slider's buttons when they are pointed with the mouse.
|
Brush |
getButtonBrushPressed()
Gets the background brush of the slider's buttons when they are pressed.
|
java.awt.Color |
getButtonContentColor()
Gets the color of the content of the slider's buttons.
|
Pen |
getButtonPen()
Gets the border pen of the slider's buttons and thumbs.
|
Pen |
getButtonPenHovered()
Gets the border pen of the slider's buttons when they are pointed with the mouse.
|
Pen |
getButtonPenPressed()
Gets the border pen of the slider's buttons when they are pressed.
|
CursorHint |
getCursor(java.awt.geom.Point2D point)
ComponentBase.getCursor override.
|
float |
getEndValue()
Gets the end value of the slider.
|
float |
getMaximum()
Gets the maximum value of the rail.
|
float |
getMinimum()
Gets the minimum value of the rail.
|
Brush |
getRailBrush()
Gets the background of the slider rail.
|
Pen |
getRailPen()
Gets the border pen of the slider rail.
|
float |
getStartValue()
Gets the start value of the slider.
|
SliderComponent.SliderType |
getType()
Gets the type of this slider component.
|
float |
getValue()
Gets the value of the slider.
|
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 |
removeSliderListener(SliderListener listener)
Unregisters an event listener.
|
void |
removeSliderRailListener(SliderRailListener 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 |
setActiveBrush(Brush value)
Sets the brush used to fill the portion of the rail
between StartValue and EndValue.
|
void |
setBackground(Brush value)
Sets the brush used to fill the background of the slider.
|
void |
setBorder(Pen value)
Sets the pen used to draw the border of the slider.
|
void |
setButtonBrush(Brush value)
Sets the brush of the slider's buttons and thumbs.
|
void |
setButtonBrushHovered(Brush value)
Sets the background brush of the slider's buttons when they are pointed with the mouse.
|
void |
setButtonBrushPressed(Brush value)
Sets the background brush of the slider's buttons when they are pressed.
|
void |
setButtonContentColor(java.awt.Color value)
Sets the color of the content of the slider's buttons.
|
void |
setButtonPen(Pen value)
Sets the border pen of the slider's buttons and thumbs.
|
void |
setButtonPenHovered(Pen value)
Sets the border pen of the slider's buttons when they are pointed with the mouse.
|
void |
setButtonPenPressed(Pen value)
Sets the border pen of the slider's buttons when they are pressed.
|
void |
setEndValue(float value)
Sets the end value of the slider.
|
void |
setMaximum(float value)
Sets the maximum value of the rail.
|
void |
setMinimum(float value)
Sets the minimum value of the rail.
|
void |
setRailBrush(Brush value)
Sets the background of the slider rail.
|
void |
setRailPen(Pen value)
Sets the border pen of the slider rail.
|
void |
setStartValue(float value)
Sets the start value of the slider.
|
void |
setType(SliderComponent.SliderType value)
Sets the type of this slider component.
|
void |
setValue(float value)
Sets the value of the slider.
|
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, 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 SliderComponent()
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 SliderComponent 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 SliderComponent datacontext
- An JsonPersistContext object providing information
about the serialization process and some helper methods.public CursorHint getCursor(java.awt.geom.Point2D point)
getCursor
in class ComponentBase
point
- A Point2D.Float instance that specifies the current mouse position, in document coordinates.public void addSliderRailListener(SliderRailListener listener)
listener
- An object implementing SliderRailListener interface.public void removeSliderRailListener(SliderRailListener listener)
listener
- An object implementing SliderRailListener interface.public void addSliderListener(SliderListener listener)
listener
- An object implementing SliderListener interface.public void removeSliderListener(SliderListener listener)
listener
- An object implementing SliderListener interface.public SliderComponent.SliderType getType()
public void setType(SliderComponent.SliderType value)
value
- A member of the SliderType enumeration.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 getMinimum()
public void setMinimum(float value)
value
- The minimum value of slider's range.public float getMaximum()
public void setMaximum(float value)
value
- The maximum value of slider's range.public float getValue()
public void setValue(float value)
value
- The current value displayed by slider.public float getStartValue()
public void setStartValue(float value)
value
- The start value of slider's current range.public float getEndValue()
public void setEndValue(float value)
value
- The end value of slider's current range.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 Brush getRailBrush()
public void setRailBrush(Brush value)
value
- An instance of the Brush class.public Pen getRailPen()
public void setRailPen(Pen value)
value
- An instance of the Pen class.public Brush getActiveBrush()
public void setActiveBrush(Brush value)
value
- An instance of the Brush class.