Package org.zkoss.chart
Class NavigationButton
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.NavigationButton
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class NavigationButton extends Optionable
A collection of options for buttons appearing in the exporting module.All the options in this class support
DynamicalAttribute
.- Author:
- jumperchen, RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description NavigationButton()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlign()
Returns alignment for the buttons.Number
getHeight()
Returns pixel height of the buttons.Color
getSymbolFill()
Returns fill color for the symbol within the button.Number
getSymbolSize()
Returns the pixel size of the symbol on the button.Color
getSymbolStroke()
Returns the color of the symbol's stroke or line.Number
getSymbolStrokeWidth()
Returns the pixel stroke width of the symbol on the button.Number
getSymbolX()
Returns the x position of the center of the symbol inside the button.Number
getSymbolY()
Returns the y position of the center of the symbol inside the button.String
getText()
Returns a text string to add to the individual button.<K,V>
Map<K,V>getTheme()
Returns a collection of attributes for the button.String
getVerticalAlign()
Returns the vertical alignment of the buttons.Number
getWidth()
Returns the pixel width of the button.Number
getY()
Returns the vertical offset of the button's position relative to itsverticalAlign
.boolean
isEnabled()
Returns whether to enable buttons.void
setAlign(String align)
Sets alignment for the buttons.void
setEnabled(boolean enabled)
Sets whether to enable buttons.void
setHeight(Number height)
Sets pixel height of the buttons.void
setSymbolFill(String color)
Sets fill color for the symbol within the button.void
setSymbolFill(Color color)
Sets fill color for the symbol within the button.void
setSymbolFill(LinearGradient color)
Sets fill color for the symbol within the button.void
setSymbolFill(RadialGradient color)
Sets fill color for the symbol within the button.void
setSymbolSize(Number symbolSize)
Sets the pixel size of the symbol on the button.void
setSymbolStroke(String color)
Sets the color of the symbol's stroke or line.void
setSymbolStroke(Color color)
Sets the color of the symbol's stroke or line.void
setSymbolStroke(LinearGradient color)
Sets the color of the symbol's stroke or line.void
setSymbolStroke(RadialGradient color)
Sets the color of the symbol's stroke or line.void
setSymbolStrokeWidth(Number symbolStrokeWidth)
Sets the pixel stroke width of the symbol on the button.void
setSymbolX(Number symbolX)
Sets the x position of the center of the symbol inside the button.void
setSymbolY(Number symbolY)
Sets the y position of the center of the symbol inside the button.void
setText(String text)
Sets a text string to add to the individual button.<K,V>
voidsetTheme(Map<K,V> theme)
Sets a collection of attributes for the button.void
setVerticalAlign(String verticalAlign)
Sets the vertical alignment of the buttons.void
setWidth(Number width)
Sets the pixel width of the button.void
setY(Number y)
Sets the vertical offset of the button's position relative to itsverticalAlign
.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getAlign
public String getAlign()
Returns alignment for the buttons.Default: right
-
setAlign
public void setAlign(String align)
Sets alignment for the buttons.
-
isEnabled
public boolean isEnabled()
Returns whether to enable buttons.Default: true
-
setEnabled
public void setEnabled(boolean enabled)
Sets whether to enable buttons.
-
getHeight
public Number getHeight()
Returns pixel height of the buttons.Default: 20
-
setHeight
public void setHeight(Number height)
Sets pixel height of the buttons.
-
getSymbolFill
public Color getSymbolFill()
Returns fill color for the symbol within the button.Default: "#E0E0E0"
-
setSymbolFill
public void setSymbolFill(Color color)
Sets fill color for the symbol within the button.
-
setSymbolFill
public void setSymbolFill(String color)
Sets fill color for the symbol within the button.
-
setSymbolFill
public void setSymbolFill(LinearGradient color)
Sets fill color for the symbol within the button.
-
setSymbolFill
public void setSymbolFill(RadialGradient color)
Sets fill color for the symbol within the button.
-
getSymbolSize
public Number getSymbolSize()
Returns the pixel size of the symbol on the button.Default: 14
-
setSymbolSize
public void setSymbolSize(Number symbolSize)
Sets the pixel size of the symbol on the button.
-
getSymbolStroke
public Color getSymbolStroke()
Returns the color of the symbol's stroke or line.Default: "#666"
-
setSymbolStroke
public void setSymbolStroke(Color color)
Sets the color of the symbol's stroke or line.
-
setSymbolStroke
public void setSymbolStroke(String color)
Sets the color of the symbol's stroke or line.
-
setSymbolStroke
public void setSymbolStroke(LinearGradient color)
Sets the color of the symbol's stroke or line.
-
setSymbolStroke
public void setSymbolStroke(RadialGradient color)
Sets the color of the symbol's stroke or line.
-
getSymbolStrokeWidth
public Number getSymbolStrokeWidth()
Returns the pixel stroke width of the symbol on the button.Default: 1
-
setSymbolStrokeWidth
public void setSymbolStrokeWidth(Number symbolStrokeWidth)
Sets the pixel stroke width of the symbol on the button.
-
getSymbolX
public Number getSymbolX()
Returns the x position of the center of the symbol inside the button.Default: 12.5
-
setSymbolX
public void setSymbolX(Number symbolX)
Sets the x position of the center of the symbol inside the button.
-
getSymbolY
public Number getSymbolY()
Returns the y position of the center of the symbol inside the button.Default: 10.5
-
setSymbolY
public void setSymbolY(Number symbolY)
Sets the y position of the center of the symbol inside the button.
-
getText
public String getText()
Returns a text string to add to the individual button.Default: null
-
setText
public void setText(String text)
Sets a text string to add to the individual button.
-
getTheme
public <K,V> Map<K,V> getTheme()
Returns a collection of attributes for the button. The object takes SVG attributes likefill
,stroke
,stroke-width
orr
, the border radius. The theme also supportsstyle
, a collection of CSS properties for the text. Equivalent attributes for the hover state are given intheme.states.hover
.- Type Parameters:
K
- type for the keyif style was set using
setTheme(Map)
, type will be the same as the type from the key of the mapif style was not set, type will be Object by default
V
- type for the valueif style was set using
setTheme(Map)
, type will be the same as the type from the key of the mapif style was not set, type will be Object by default
-
setTheme
public <K,V> void setTheme(Map<K,V> theme)
Sets a collection of attributes for the button. The object takes SVG attributes likefill
,stroke
,stroke-width
orr
, the border radius. The theme also supportsstyle
, a collection of CSS properties for the text. Equivalent attributes for the hover state are given intheme.states.hover
.This method allows complex styling like:
Map<String, Object> styles = new HashMap<String, Object>(); styles.put("fill", "#E8E8EA"); styles.put("stroke", "#6E6E78"); styles.put("stroke-width", "1"); styles.put("r", "0"); Map<String, Object> states = new HashMap<String, Object>(); Map<String, String> hover = new HashMap<String, String>(); hover.put("fill", "#F4F4F6"); hover.put("stroke", "#6E6E78"); hover.put("stroke-width", "1"); hover.put("r", "0"); states.put("hover", hover); styles.put("states", states); Map<String, String> style = new HashMap<String, String>(); style.put("color", "#4D5663"); style.put("fontSize", "12px"); style.put("fontFamily", "'Arial'"); style.put("fontWeight", "normal"); style.put("padding", "10px"); styles.put("style", style);
{ "fill": "#E8E8EA", "stroke": "#6E6E78", "stroke-width": "1", "r": "0", "states": { "hover": { "fill": "#F4F4F6", "stroke": "#6E6E78", "stroke-width": "1", "r": "0" } }, "style": { "color": "#4D5663", "fontSize": "12px", "fontFamily": "'Arial'", "fontWeight": "normal", "padding": "10px" } }
- Type Parameters:
K
- Type for the key, usually StringV
- Type for the value, usually String. For nested maps, use Object or any other type.- Parameters:
theme
- the style object
-
getVerticalAlign
public String getVerticalAlign()
Returns the vertical alignment of the buttons. Can be one of "top", "middle" or "bottom".Default: top
-
setVerticalAlign
public void setVerticalAlign(String verticalAlign)
Sets the vertical alignment of the buttons. Can be one of "top", "middle" or "bottom".
-
getWidth
public Number getWidth()
Returns the pixel width of the button.Default: 24
-
setWidth
public void setWidth(Number width)
Sets the pixel width of the button.
-
getY
public Number getY()
Returns the vertical offset of the button's position relative to itsverticalAlign
.Default: 0
-
setY
public void setY(Number y)
Sets the vertical offset of the button's position relative to itsverticalAlign
.
-
-