public abstract class WAbstractChart extends FormComponent
form, INTERNAL_STATE_RECORD_PROPERTY
Constructor and Description |
---|
WAbstractChart() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPayload(com.vaadin.addon.charts.model.Series series,
Variant<Object> payload,
boolean shift)
Adds a payload to the series.
|
protected com.vaadin.addon.charts.model.style.SolidColor |
asColor(Variant.RecordVariant value) |
protected Double |
asDouble(Variant<Decimal> value) |
protected String |
asDoubleString(Decimal value) |
protected Integer |
asInt(Variant<Decimal> value) |
protected String |
asIntegerString(Decimal value) |
protected void |
clearPayloads()
Clears the payloads from internal storage.
|
protected <T extends com.vaadin.addon.charts.model.Axis> |
configureAxis(T axis,
Variant.RecordVariant def)
Configures the axis attributes.
|
protected com.vaadin.addon.charts.model.AbstractPlotOptions |
createPlotOptions(Variant.RecordVariant vPlotOptions) |
protected com.vaadin.addon.charts.Chart |
createWidget()
Called once, to create the actual Vaadin component.
|
protected com.vaadin.addon.charts.model.AxisType |
enumAxisType(EnumerationImpl enumImpl) |
protected com.vaadin.addon.charts.model.DashStyle |
enumDashStyle(EnumerationImpl enumImpl) |
protected com.vaadin.addon.charts.model.MarkerSymbolEnum |
enumMarkerSymbol(EnumerationImpl enumImpl)
Resolves the 'forms::Marker' enum value.
|
protected com.vaadin.addon.charts.model.TickPosition |
enumTickPosition(EnumerationImpl enumImpl) |
protected com.vaadin.addon.charts.model.Configuration |
getConfiguration() |
protected Variant<Object> |
getPayload(com.vaadin.addon.charts.model.Series series,
int index)
Gets the payload for an item in the given series.
|
com.vaadin.addon.charts.Chart |
getWidget()
Gets the Vaadin representation of this component.
|
void |
preventGC(Set<ValueHolder> set)
Override for all components which are actively using some record holders, not directly linked to the model.
|
protected void |
redraw()
Redraws the chart using the current configuration.
|
void |
refresh()
Redraws the chart and refreshes data source etc if they exists.
|
protected void |
registerPayloads(com.vaadin.addon.charts.model.Series series,
List<Variant<Object>> payloads)
Registers the payloads for items in the given series.
|
protected <E extends Enum<E>> |
resolveEnumeration(EnumerationImpl enumImpl,
String[] names,
E[] values) |
protected void |
restoreInternalState(Map<String,Object> state)
Restores the UI state of this component which was previously written
by
FormComponent.writeInternalState(Map) . |
void |
setChartPlotOptions(RecordHolder plotOptions)
Sets the default plot options.
|
void |
setChartSubTitle(String subTitle)
Sets the chart sub-title.
|
void |
setChartTitle(String title)
Sets the chart title.
|
protected <T extends com.vaadin.addon.charts.model.AbstractDataLabels> |
setupDataLabels(Variant.RecordVariant vDataLabels,
T labels) |
protected com.vaadin.addon.charts.model.Labels |
setupLabels(Variant.RecordVariant vDataLabels,
com.vaadin.addon.charts.model.Labels labels) |
protected void |
writeInternalState(Map<String,Object> state)
Writes the UI state of this component to the provided map.
|
addDataErrorMessage, addStyleName, attach, call, clearDataErrorMessages, createEvent, equals, getCaption, getComponentAlignment, getContextClickHandler, getCustomErrorMessage, getDataErrorMessages, getDescription, getExpandRatio, getHasChildrenAdapter, getHeight, getIcon, getModelingId, getNamespace, getStyleName, getTabIndex, getWidth, hashCode, isEnabled, isReadOnly, isVisible, localize, markAsDirty, removeStyleName, restoreState, saveState, setCaption, setComponentAlignment, setContextClickHandler, setContextMenuItems, setCustomErrorMessage, setDescription, setEnabled, setExpandRatio, setHeight, setIcon, setReadOnly, setStyleName, setTabIndex, setVisible, setWidth, toString
protected com.vaadin.addon.charts.Chart createWidget()
FormComponent
createWidget
in class FormComponent
public com.vaadin.addon.charts.Chart getWidget()
FormComponent
getWidget
in class FormComponent
protected com.vaadin.addon.charts.model.Configuration getConfiguration()
public void setChartTitle(String title)
title
- the title to setpublic void setChartSubTitle(String subTitle)
subTitle
- the sub-title to setpublic void setChartPlotOptions(RecordHolder plotOptions)
plotOptions
- the plot options to set.protected com.vaadin.addon.charts.model.style.SolidColor asColor(Variant.RecordVariant value)
protected <E extends Enum<E>> E resolveEnumeration(EnumerationImpl enumImpl, String[] names, E[] values)
protected com.vaadin.addon.charts.model.AxisType enumAxisType(EnumerationImpl enumImpl)
protected com.vaadin.addon.charts.model.TickPosition enumTickPosition(EnumerationImpl enumImpl)
protected com.vaadin.addon.charts.model.DashStyle enumDashStyle(EnumerationImpl enumImpl)
protected com.vaadin.addon.charts.model.MarkerSymbolEnum enumMarkerSymbol(EnumerationImpl enumImpl)
null
.enumImpl
- protected com.vaadin.addon.charts.model.Labels setupLabels(Variant.RecordVariant vDataLabels, com.vaadin.addon.charts.model.Labels labels)
protected <T extends com.vaadin.addon.charts.model.AbstractDataLabels> T setupDataLabels(Variant.RecordVariant vDataLabels, T labels)
protected com.vaadin.addon.charts.model.AbstractPlotOptions createPlotOptions(Variant.RecordVariant vPlotOptions)
protected <T extends com.vaadin.addon.charts.model.Axis> T configureAxis(T axis, Variant.RecordVariant def)
T
- the type of the axis.axis
- the axis to configuredef
- the axis configurationaxis
protected Variant<Object> getPayload(com.vaadin.addon.charts.model.Series series, int index)
registered
.series
- the seriesindex
- the index of the item for which to get the payloadnull
if there is no payloadregisterPayloads(Series, List)
protected void registerPayloads(com.vaadin.addon.charts.model.Series series, List<Variant<Object>> payloads)
series
- the seriespayloads
- the payloads of items in the seriesprotected void addPayload(com.vaadin.addon.charts.model.Series series, Variant<Object> payload, boolean shift)
series
- payload
- shift
- true
to remove the first payload from the listprotected void clearPayloads()
protected void redraw()
public void refresh()
public void preventGC(Set<ValueHolder> set)
FormComponent
WTabSheet
maintains a set of opened tabs. These tab records are not referenced
directly from forms::TabSheet and will therefore be garbage-collected. We however need those records to not to be GCed as the user
may ask for them simply by calling getTab(Integer).
Please note that the component definition records (e.g. forms::Button) are already GC-protected and they do not need to be added to this set.
Also, any child components currently attached to the UI are automatically protected and are not required to be registered in the set.preventGC
in class FormComponent
set
- a set of records which are to be GC-prevented, never null. The component should add any records here.
Default implementation does nothing.protected void writeInternalState(Map<String,Object> state)
FormComponent
Many UI attributes such as size, caption, etc. are not held in the records but are stored exclusively in the Vaadin components. In the records the getter/setter methods of such attributes directly delegate to the underlying component. For the purposes of the Save Document/Todo use case the state of such attributes has to be preserved.
Subclasses should override this method. The overriding method should call
super.writeInternalState(state)
to store the state form the super
class as well. The attributes should be written to the provided state
parameter. The type of the values written to the state
can only by
Java representation of LSPS types. That is java.util.Date
,
java.lang.String
, Decimal
, RecordHolder
,
ListHolder
, ... The name of the attributes stored in the map
should be unique and should not collide with the names used by any
of the superclass. It is the responsibility of the overridden method to ensure
that.
Subclasses overriding this method should also override
FormComponent.restoreInternalState(Map)
and restore the state written
by this method.
writeInternalState
in class FormComponent
state
- a map to which this method should write the component's UI state.FormComponent.restoreInternalState(Map)
,
FormComponent.saveState()
protected void restoreInternalState(Map<String,Object> state)
FormComponent
FormComponent.writeInternalState(Map)
.
Subclasses should override and call super.restoreInternalState(state);
restoreInternalState
in class FormComponent
state
- a map of attributes and their valuesFormComponent.writeInternalState(Map)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.