Class WAxisSliderWidget


  • public class WAxisSliderWidget
    extends WPaintedWidget
    A widget for selecting an X axis range to display on an associated WCartesianChart.

    Note: This widget currently only works with the HtmlCanvas rendering method.

    • 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​(WDataSeries series,
                                 WContainerWidget parentContainer)
        Creates an axis slider widget.

        Creates an axis slider widget associated with the given data series of the given chart.

    • Method Detail

      • 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)
      • 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.

        Calls setAutoLayoutEnabled(true)

      • 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)

      • 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.

        Calls setYAxisZoomEnabled(true)

      • 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)
      • render

        protected void render​(java.util.EnumSet<RenderFlag> flags)
        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 class WPaintedWidget
      • paintEvent

        protected void paintEvent​(WPaintDevice paintDevice)
        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 class WPaintedWidget