Class WAxisSliderWidget
public class WAxisSliderWidget extends WPaintedWidget
WCartesianChart
.
Note: This widget currently only works with the HtmlCanvas rendering method.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WPaintedWidget
WPaintedWidget.Method
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Field Summary
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_
-
Constructor Summary
Constructors Constructor Description WAxisSliderWidget()
Creates an axis slider widget.WAxisSliderWidget(WDataSeries series)
Creates an axis slider widget.WAxisSliderWidget(WDataSeries series, WContainerWidget parent)
Creates an axis slider widget.WAxisSliderWidget(WContainerWidget parent)
Creates an axis slider widget. -
Method Summary
Modifier and Type Method Description WBrush
getBackground()
Returns the background brush.WBrush
getHandleBrush()
Returns the brush to draw the handles left and right of the selected area with.WBrush
getSelectedAreaBrush()
Returns the brush for the selected area.WPen
getSelectedSeriesPen()
Returns the pen to draw the selected part of the data series with.int
getSelectionAreaPadding(Side side)
Returns the internal margin for the selection area.WDataSeries
getSeries()
WPen
getSeriesPen()
Returns the pen to draw the data series with.boolean
isAutoLayoutEnabled()
Returns whether chart layout is computed automatically.boolean
isLabelsEnabled()
Returns whether the X axis tick labels are drawn.boolean
isYAxisZoomEnabled()
Returns whether the Y axis of the associated chart should be updated to fit the series.protected void
paintEvent(WPaintDevice paintDevice)
Paints the widget.void
remove()
Destructor.protected void
render(java.util.EnumSet<RenderFlag> flags)
Renders the widget.void
setAutoLayoutEnabled()
Configures the axis slider layout to be automatic.void
setAutoLayoutEnabled(boolean enabled)
Configures the axis slider layout to be automatic.void
setBackground(WBrush brush)
Set the background brush.void
setHandleBrush(WBrush brush)
Set the brush to draw the handles left and right of the selected area with.void
setLabelsEnabled()
Set whether to draw the X axis tick labels on the slider widget.void
setLabelsEnabled(boolean enabled)
Set whether to draw the X axis tick labels on the slider widget.void
setSelectedAreaBrush(WBrush brush)
Set the brush for the selected area.void
setSelectedSeriesPen(WPen pen)
Set the pen to draw the selected part of the data series with.void
setSelectionAreaPadding(int padding)
Sets an internal margin for the selection area.void
setSelectionAreaPadding(int padding, Side side, Side... sides)
Sets an internal margin for the selection area.void
setSelectionAreaPadding(int padding, java.util.EnumSet<Side> sides)
Sets an internal margin for the selection area.void
setSeries(WDataSeries series)
void
setSeriesPen(WPen pen)
Set the pen to draw the data series with.void
setYAxisZoomEnabled()
Set whether the Y axis of the associated chart should be updated to fit the series.void
setYAxisZoomEnabled(boolean enabled)
Set whether the Y axis of the associated chart should be updated to fit the series.Methods inherited from class eu.webtoolkit.jwt.WPaintedWidget
addArea, createDomElement, createJSBrush, createJSPainterPath, createJSPen, createJSPoint, createJSRect, createJSTransform, enableAjax, getArea, getAreas, getCreatePaintDevice, getDomChanges, getMethod, getObjJsRef, getPreferredMethod, getRepaintSlot, insertArea, layoutSizeChanged, removeArea, resize, setFormData, setPreferredMethod, update, update, update
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, blurred, callJavaScriptMember, childrenChanged, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isCanReceiveFocus, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, jsStringLiteral, jsStringLiteral, parentResized, parentResized, propagateSetVisible, refresh, removeScript, removeStyleClass, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setOffsets, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, updateSignalConnection, voidEventSignal
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, needsRerender, positionAt, positionAt, removeChild, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setObjectName, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getObjectName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WAxisSliderWidget
Creates an axis slider widget.Creates an axis slider widget that is not associated with a chart. Before it is used, a chart should be assigned with setChart(), and a series column chosen with setSeriesColumn().
-
WAxisSliderWidget
public WAxisSliderWidget()Creates an axis slider widget. -
WAxisSliderWidget
Creates an axis slider widget.Creates an axis slider widget associated with the given data series of the given chart.
-
WAxisSliderWidget
Creates an axis slider widget.
-
-
Method Details
-
remove
public void remove()Destructor.- Overrides:
remove
in classWPaintedWidget
- See Also:
WContainerWidget.removeWidget(WWidget widget)
-
setSeries
-
setSeriesPen
Set the pen to draw the data series with. -
getSeriesPen
Returns the pen to draw the data series with. -
setSelectedSeriesPen
Set the pen to draw the selected part of the data series with.If not set, this defaults to
getSeriesPen()
. -
getSelectedSeriesPen
Returns the pen to draw the selected part of the data series with. -
setHandleBrush
Set the brush to draw the handles left and right of the selected area with. -
getHandleBrush
Returns the brush to draw the handles left and right of the selected area with. -
setBackground
Set the background brush. -
getBackground
Returns the background brush. -
setSelectedAreaBrush
Set the brush for the selected area. -
getSelectedAreaBrush
Returns the brush for the selected area. -
setSelectionAreaPadding
Sets an internal margin for the selection area.This configures the area (in pixels) around the selection area that is available for the axes and labels, and the handles.
Alternatively, you can configure the chart layout to be computed automatically using
setAutoLayoutEnabled()
.- See Also:
setAutoLayoutEnabled(boolean enabled)
-
setSelectionAreaPadding
Sets an internal margin for the selection area.Calls
setSelectionAreaPadding(padding, EnumSet.of(side, sides))
-
setSelectionAreaPadding
public final void setSelectionAreaPadding(int padding)Sets an internal margin for the selection area. -
getSelectionAreaPadding
Returns the internal margin for the selection area.This is either the padding set through
setSelectionAreaPadding()
or computed usingsetAutoLayoutEnabled()
. -
setAutoLayoutEnabled
public void setAutoLayoutEnabled(boolean enabled)Configures the axis slider layout to be automatic.This configures the selection area so that the space around it is suited for the text that is rendered.
-
setAutoLayoutEnabled
public final void setAutoLayoutEnabled()Configures the axis slider layout to be automatic. -
isAutoLayoutEnabled
public boolean isAutoLayoutEnabled()Returns whether chart layout is computed automatically.- See Also:
setAutoLayoutEnabled(boolean enabled)
-
setLabelsEnabled
public void setLabelsEnabled(boolean enabled)Set whether to draw the X axis tick labels on the slider widget.Labels are enabled by default.
-
setLabelsEnabled
public final void setLabelsEnabled()Set whether to draw the X axis tick labels on the slider widget.Calls
setLabelsEnabled(true)
-
isLabelsEnabled
public boolean isLabelsEnabled()Returns whether the X axis tick labels are drawn.- See Also:
setLabelsEnabled(boolean enabled)
-
setYAxisZoomEnabled
public void setYAxisZoomEnabled(boolean enabled)Set whether the Y axis of the associated chart should be updated to fit the series.Y axis zoom is enabled by default.
-
setYAxisZoomEnabled
public final void setYAxisZoomEnabled()Set whether the Y axis of the associated chart should be updated to fit the series. -
isYAxisZoomEnabled
public boolean isYAxisZoomEnabled()Returns whether the Y axis of the associated chart should be updated to fit the series.- See Also:
setYAxisZoomEnabled(boolean enabled)
-
getSeries
-
render
Description copied from class:WWidget
Renders the widget.This function renders the widget (or an update for the widget), after this has been scheduled using
scheduleRender()
.The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.
- Overrides:
render
in classWPaintedWidget
-
paintEvent
Description copied from class:WPaintedWidget
Paints the widget.You should reimplement this method to paint the contents of the widget, using the given paintDevice.
- Specified by:
paintEvent
in classWPaintedWidget
-