Class WAxisSliderWidget
- java.lang.Object
-
- eu.webtoolkit.jwt.WObject
-
- eu.webtoolkit.jwt.WWidget
-
- eu.webtoolkit.jwt.WWebWidget
-
- eu.webtoolkit.jwt.WInteractWidget
-
- eu.webtoolkit.jwt.WPaintedWidget
-
- eu.webtoolkit.jwt.chart.WAxisSliderWidget
-
public class WAxisSliderWidget extends WPaintedWidget
A widget for selecting an X axis range to display on an associatedWCartesianChart.Note: This widget currently only works with the HtmlCanvas rendering method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Field Summary
-
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_, noDefault
-
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS
-
-
Constructor Summary
Constructors Constructor Description WAxisSliderWidget()Creates an axis slider widget.WAxisSliderWidget(WDataSeries series)Creates an axis slider widget.WAxisSliderWidget(WDataSeries series, WContainerWidget parentContainer)Creates an axis slider widget.WAxisSliderWidget(WContainerWidget parentContainer)Creates an axis slider widget.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WBrushgetBackground()Returns the background brush.WBrushgetHandleBrush()Returns the brush to draw the handles left and right of the selected area with.WBrushgetSelectedAreaBrush()Returns the brush for the selected area.WPengetSelectedSeriesPen()Returns the pen to draw the selected part of the data series with.intgetSelectionAreaPadding(Side side)Returns the internal margin for the selection area.WDataSeriesgetSeries()WPengetSeriesPen()Returns the pen to draw the data series with.booleanisAutoLayoutEnabled()Returns whether chart layout is computed automatically.booleanisLabelsEnabled()Returns whether the X axis tick labels are drawn.booleanisYAxisZoomEnabled()Returns whether the Y axis of the associated chart should be updated to fit the series.protected voidpaintEvent(WPaintDevice paintDevice)Paints the widget.voidremove()Destructor.protected voidrender(java.util.EnumSet<RenderFlag> flags)Renders the widget.voidsetAutoLayoutEnabled()Configures the axis slider layout to be automatic.voidsetAutoLayoutEnabled(boolean enabled)Configures the axis slider layout to be automatic.voidsetBackground(WBrush brush)Set the background brush.voidsetHandleBrush(WBrush brush)Set the brush to draw the handles left and right of the selected area with.voidsetLabelsEnabled()Set whether to draw the X axis tick labels on the slider widget.voidsetLabelsEnabled(boolean enabled)Set whether to draw the X axis tick labels on the slider widget.voidsetSelectedAreaBrush(WBrush brush)Set the brush for the selected area.voidsetSelectedSeriesPen(WPen pen)Set the pen to draw the selected part of the data series with.voidsetSelectionAreaPadding(int padding)Sets an internal margin for the selection area.voidsetSelectionAreaPadding(int padding, Side side, Side... sides)Sets an internal margin for the selection area.voidsetSelectionAreaPadding(int padding, java.util.EnumSet<Side> sides)Sets an internal margin for the selection area.voidsetSeries(WDataSeries series)voidsetSeriesPen(WPen pen)Set the pen to draw the data series with.voidsetYAxisZoomEnabled()Set whether the Y axis of the associated chart should be updated to fit the series.voidsetYAxisZoomEnabled(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, getBotResourceId, getCreatePaintDevice, getDomChanges, getMethod, getObjJsRef, getPreferredMethod, getRepaintSlot, insertArea, layoutSizeChanged, refresh, removeArea, resize, setBotResourceId, 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, beingDeleted, 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, hideToolTip, isCanReceiveFocus, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
-
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
-
Methods inherited from class eu.webtoolkit.jwt.WObject
getObjectName
-
-
-
-
Constructor Detail
-
WAxisSliderWidget
public WAxisSliderWidget(WContainerWidget parentContainer)
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
public WAxisSliderWidget(WDataSeries series, WContainerWidget parentContainer)
Creates an axis slider widget.Creates an axis slider widget associated with the given data series of the given chart.
-
WAxisSliderWidget
public WAxisSliderWidget(WDataSeries series)
Creates an axis slider widget.
-
-
Method Detail
-
remove
public void remove()
Destructor.- Overrides:
removein classWPaintedWidget- See Also:
WWidget.removeWidget(WWidget widget)
-
setSeries
public void setSeries(WDataSeries series)
-
setSeriesPen
public void setSeriesPen(WPen pen)
Set the pen to draw the data series with.
-
getSeriesPen
public WPen getSeriesPen()
Returns the pen to draw the data series with.
-
setSelectedSeriesPen
public void setSelectedSeriesPen(WPen pen)
Set the pen to draw the selected part of the data series with.If not set, this defaults to
getSeriesPen().
-
getSelectedSeriesPen
public WPen getSelectedSeriesPen()
Returns the pen to draw the selected part of the data series with.
-
setHandleBrush
public void setHandleBrush(WBrush brush)
Set the brush to draw the handles left and right of the selected area with.
-
getHandleBrush
public WBrush getHandleBrush()
Returns the brush to draw the handles left and right of the selected area with.
-
setBackground
public void setBackground(WBrush brush)
Set the background brush.
-
getBackground
public WBrush getBackground()
Returns the background brush.
-
setSelectedAreaBrush
public void setSelectedAreaBrush(WBrush brush)
Set the brush for the selected area.
-
getSelectedAreaBrush
public WBrush getSelectedAreaBrush()
Returns the brush for the selected area.
-
setSelectionAreaPadding
public void setSelectionAreaPadding(int padding, java.util.EnumSet<Side> sides)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
public final void setSelectionAreaPadding(int padding, Side side, Side... sides)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
public int getSelectionAreaPadding(Side side)
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.AxisProperty::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
public WDataSeries getSeries()
-
render
protected void render(java.util.EnumSet<RenderFlag> flags)
Description copied from class:WWidgetRenders 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:
renderin classWPaintedWidget
-
paintEvent
protected void paintEvent(WPaintDevice paintDevice)
Description copied from class:WPaintedWidgetPaints the widget.You should reimplement this method to paint the contents of the widget, using the given paintDevice.
- Specified by:
paintEventin classWPaintedWidget
-
-