CategoryPlot
org.jfree.chart.plot

Class CategoryPlot

    • Field Detail

      • DEFAULT_DOMAIN_GRIDLINES_VISIBLE

        public static final boolean DEFAULT_DOMAIN_GRIDLINES_VISIBLE
        The default visibility of the grid lines plotted against the domain axis.
        See Also:
        Constant Field Values
      • DEFAULT_RANGE_GRIDLINES_VISIBLE

        public static final boolean DEFAULT_RANGE_GRIDLINES_VISIBLE
        The default visibility of the grid lines plotted against the range axis.
        See Also:
        Constant Field Values
      • DEFAULT_GRIDLINE_STROKE

        public static final Stroke DEFAULT_GRIDLINE_STROKE
        The default grid line stroke.
      • DEFAULT_GRIDLINE_PAINT

        public static final Paint DEFAULT_GRIDLINE_PAINT
        The default grid line paint.
      • DEFAULT_VALUE_LABEL_FONT

        public static final Font DEFAULT_VALUE_LABEL_FONT
        The default value label font.
      • DEFAULT_CROSSHAIR_VISIBLE

        public static final boolean DEFAULT_CROSSHAIR_VISIBLE
        The default crosshair visibility.
        See Also:
        Constant Field Values
      • DEFAULT_CROSSHAIR_STROKE

        public static final Stroke DEFAULT_CROSSHAIR_STROKE
        The default crosshair stroke.
      • DEFAULT_CROSSHAIR_PAINT

        public static final Paint DEFAULT_CROSSHAIR_PAINT
        The default crosshair paint.
    • Constructor Detail

      • CategoryPlot

        public CategoryPlot()
        Default constructor.
      • CategoryPlot

        public CategoryPlot(CategoryDataset dataset,            CategoryAxis domainAxis,            ValueAxis rangeAxis,            CategoryItemRenderer renderer)
        Creates a new plot.
        Parameters:
        dataset - the dataset (null permitted).
        domainAxis - the domain axis (null permitted).
        rangeAxis - the range axis (null permitted).
        renderer - the item renderer (null permitted).
    • Method Detail

      • getPlotType

        public String getPlotType()
        Returns a string describing the type of plot.
        Specified by:
        getPlotType in class Plot
        Returns:
        The type.
      • setOrientation

        public void setOrientation(PlotOrientation orientation)
        Sets the orientation for the plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        orientation - the orientation (null not permitted).
        See Also:
        getOrientation()
      • getAxisOffset

        public org.jfree.ui.RectangleInsets getAxisOffset()
        Returns the axis offset.
        Returns:
        The axis offset (never null).
        See Also:
        setAxisOffset(RectangleInsets)
      • setAxisOffset

        public void setAxisOffset(org.jfree.ui.RectangleInsets offset)
        Sets the axis offsets (gap between the data area and the axes) and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        offset - the offset (null not permitted).
        See Also:
        getAxisOffset()
      • getDomainAxis

        public CategoryAxis getDomainAxis()
        Returns the domain axis for the plot. If the domain axis for this plot is null, then the method will return the parent plot's domain axis (if there is a parent plot).
        Returns:
        The domain axis (null permitted).
        See Also:
        setDomainAxis(CategoryAxis)
      • setDomainAxis

        public void setDomainAxis(CategoryAxis axis)
        Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        axis - the axis (null permitted).
        See Also:
        getDomainAxis()
      • setDomainAxis

        public void setDomainAxis(int index,                 CategoryAxis axis)
        Sets a domain axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the axis index.
        axis - the axis (null permitted).
        See Also:
        getDomainAxis(int)
      • setDomainAxis

        public void setDomainAxis(int index,                 CategoryAxis axis,                 boolean notify)
        Sets a domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the axis index.
        axis - the axis (null permitted).
        notify - notify listeners?
      • getDomainAxisLocation

        public AxisLocation getDomainAxisLocation()
        Returns the domain axis location for the primary domain axis.
        Returns:
        The location (never null).
        See Also:
        getRangeAxisLocation()
      • setDomainAxisLocation

        public void setDomainAxisLocation(AxisLocation location,                         boolean notify)
        Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        location - the axis location (null not permitted).
        notify - a flag that controls whether listeners are notified.
      • getDomainAxisEdge

        public org.jfree.ui.RectangleEdge getDomainAxisEdge()
        Returns the domain axis edge. This is derived from the axis location and the plot orientation.
        Returns:
        The edge (never null).
      • getDomainAxisEdge

        public org.jfree.ui.RectangleEdge getDomainAxisEdge(int index)
        Returns the edge for a domain axis.
        Parameters:
        index - the axis index.
        Returns:
        The edge (never null).
      • getDomainAxisCount

        public int getDomainAxisCount()
        Returns the number of domain axes.
        Returns:
        The axis count.
      • clearDomainAxes

        public void clearDomainAxes()
        Clears the domain axes from the plot and sends a PlotChangeEvent to all registered listeners.
      • configureDomainAxes

        public void configureDomainAxes()
        Configures the domain axes.
      • getRangeAxis

        public ValueAxis getRangeAxis()
        Returns the range axis for the plot. If the range axis for this plot is null, then the method will return the parent plot's range axis (if there is a parent plot).
        Returns:
        The range axis (possibly null).
      • getRangeAxis

        public ValueAxis getRangeAxis(int index)
        Returns a range axis.
        Parameters:
        index - the axis index.
        Returns:
        The axis (null possible).
      • setRangeAxis

        public void setRangeAxis(ValueAxis axis)
        Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        axis - the axis (null permitted).
      • setRangeAxis

        public void setRangeAxis(int index,                ValueAxis axis)
        Sets a range axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the axis index.
        axis - the axis.
      • setRangeAxis

        public void setRangeAxis(int index,                ValueAxis axis,                boolean notify)
        Sets a range axis and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the axis index.
        axis - the axis.
        notify - notify listeners?
      • getRangeAxisLocation

        public AxisLocation getRangeAxisLocation()
        Returns the range axis location.
        Returns:
        The location (never null).
      • getRangeAxisEdge

        public org.jfree.ui.RectangleEdge getRangeAxisEdge()
        Returns the edge where the primary range axis is located.
        Returns:
        The edge (never null).
      • getRangeAxisEdge

        public org.jfree.ui.RectangleEdge getRangeAxisEdge(int index)
        Returns the edge for a range axis.
        Parameters:
        index - the axis index.
        Returns:
        The edge.
      • getRangeAxisCount

        public int getRangeAxisCount()
        Returns the number of range axes.
        Returns:
        The axis count.
      • clearRangeAxes

        public void clearRangeAxes()
        Clears the range axes from the plot and sends a PlotChangeEvent to all registered listeners.
      • configureRangeAxes

        public void configureRangeAxes()
        Configures the range axes.
      • getDataset

        public CategoryDataset getDataset(int index)
        Returns the dataset with the given index, or null if there is no dataset.
        Parameters:
        index - the dataset index (must be >= 0).
        Returns:
        The dataset (possibly null).
        See Also:
        setDataset(int, CategoryDataset)
      • setDataset

        public void setDataset(CategoryDataset dataset)
        Sets the dataset for the plot, replacing the existing dataset, if there is one. This method also calls the datasetChanged(DatasetChangeEvent) method, which adjusts the axis ranges if necessary and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        dataset - the dataset (null permitted).
        See Also:
        getDataset()
      • setDataset

        public void setDataset(int index,              CategoryDataset dataset)
        Sets a dataset for the plot and sends a change notification to all registered listeners.
        Parameters:
        index - the dataset index (must be >= 0).
        dataset - the dataset (null permitted).
        See Also:
        getDataset(int)
      • getDatasetCount

        public int getDatasetCount()
        Returns the number of datasets.
        Returns:
        The number of datasets.
      • indexOf

        public int indexOf(CategoryDataset dataset)
        Returns the index of the specified dataset, or -1 if the dataset does not belong to the plot.
        Parameters:
        dataset - the dataset (null not permitted).
        Returns:
        The index.
      • mapDatasetToDomainAxis

        public void mapDatasetToDomainAxis(int index,                          int axisIndex)
        Maps a dataset to a particular domain axis.
        Parameters:
        index - the dataset index (zero-based).
        axisIndex - the axis index (zero-based).
        See Also:
        getDomainAxisForDataset(int)
      • mapDatasetToDomainAxes

        public void mapDatasetToDomainAxes(int index,                          List axisIndices)
        Maps the specified dataset to the axes in the list. Note that the conversion of data values into Java2D space is always performed using the first axis in the list.
        Parameters:
        index - the dataset index (zero-based).
        axisIndices - the axis indices (null permitted).
      • mapDatasetToRangeAxis

        public void mapDatasetToRangeAxis(int index,                         int axisIndex)
        Maps a dataset to a particular range axis.
        Parameters:
        index - the dataset index (zero-based).
        axisIndex - the axis index (zero-based).
        See Also:
        getRangeAxisForDataset(int)
      • mapDatasetToRangeAxes

        public void mapDatasetToRangeAxes(int index,                         List axisIndices)
        Maps the specified dataset to the axes in the list. Note that the conversion of data values into Java2D space is always performed using the first axis in the list.
        Parameters:
        index - the dataset index (zero-based).
        axisIndices - the axis indices (null permitted).
      • getRendererCount

        public int getRendererCount()
        Returns the number of renderer slots for this plot.
        Returns:
        The number of renderer slots.
      • setRenderer

        public void setRenderer(CategoryItemRenderer renderer)
        Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends a change event to all registered listeners.
        Parameters:
        renderer - the renderer (null permitted.
        See Also:
        getRenderer()
      • setRenderer

        public void setRenderer(CategoryItemRenderer renderer,               boolean notify)
        Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and, if requested, sends a change event to all registered listeners.

        You can set the renderer to null, but this is not recommended because:

        • no data will be displayed;
        • the plot background will not be painted;
        Parameters:
        renderer - the renderer (null permitted).
        notify - notify listeners?
        See Also:
        getRenderer()
      • setRenderer

        public void setRenderer(int index,               CategoryItemRenderer renderer)
        Sets the renderer to use for the dataset with the specified index and sends a change event to all registered listeners. Note that each dataset should have its own renderer, you should not use one renderer for multiple datasets.
        Parameters:
        index - the index.
        renderer - the renderer (null permitted).
        See Also:
        getRenderer(int), setRenderer(int, CategoryItemRenderer, boolean)
      • setRenderer

        public void setRenderer(int index,               CategoryItemRenderer renderer,               boolean notify)
        Sets the renderer to use for the dataset with the specified index and, if requested, sends a change event to all registered listeners. Note that each dataset should have its own renderer, you should not use one renderer for multiple datasets.
        Parameters:
        index - the index.
        renderer - the renderer (null permitted).
        notify - notify listeners?
        See Also:
        getRenderer(int)
      • setRenderers

        public void setRenderers(CategoryItemRenderer[] renderers)
        Sets the renderers for this plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        renderers - the renderers.
      • getRendererForDataset

        public CategoryItemRenderer getRendererForDataset(CategoryDataset dataset)
        Returns the renderer for the specified dataset. If the dataset doesn't belong to the plot, this method will return null.
        Parameters:
        dataset - the dataset (null permitted).
        Returns:
        The renderer (possibly null).
      • getIndexOf

        public int getIndexOf(CategoryItemRenderer renderer)
        Returns the index of the specified renderer, or -1 if the renderer is not assigned to this plot.
        Parameters:
        renderer - the renderer (null permitted).
        Returns:
        The renderer index.
      • setDatasetRenderingOrder

        public void setDatasetRenderingOrder(DatasetRenderingOrder order)
        Sets the rendering order and sends a PlotChangeEvent to all registered listeners. By default, the plot renders the primary dataset last (so that the primary dataset overlays the secondary datasets). You can reverse this if you want to.
        Parameters:
        order - the rendering order (null not permitted).
        See Also:
        getDatasetRenderingOrder()
      • getColumnRenderingOrder

        public org.jfree.util.SortOrder getColumnRenderingOrder()
        Returns the order in which the columns are rendered. The default value is SortOrder.ASCENDING.
        Returns:
        The column rendering order (never null).
        See Also:
        setColumnRenderingOrder(SortOrder)
      • setColumnRenderingOrder

        public void setColumnRenderingOrder(org.jfree.util.SortOrder order)
        Sets the column order in which the items in each dataset should be rendered and sends a PlotChangeEvent to all registered listeners. Note that this affects the order in which items are drawn, NOT their position in the chart.
        Parameters:
        order - the order (null not permitted).
        See Also:
        getColumnRenderingOrder(), setRowRenderingOrder(SortOrder)
      • getRowRenderingOrder

        public org.jfree.util.SortOrder getRowRenderingOrder()
        Returns the order in which the rows should be rendered. The default value is SortOrder.ASCENDING.
        Returns:
        The order (never null).
        See Also:
        setRowRenderingOrder(SortOrder)
      • setRowRenderingOrder

        public void setRowRenderingOrder(org.jfree.util.SortOrder order)
        Sets the row order in which the items in each dataset should be rendered and sends a PlotChangeEvent to all registered listeners. Note that this affects the order in which items are drawn, NOT their position in the chart.
        Parameters:
        order - the order (null not permitted).
        See Also:
        getRowRenderingOrder(), setColumnRenderingOrder(SortOrder)
      • isDomainGridlinesVisible

        public boolean isDomainGridlinesVisible()
        Returns the flag that controls whether the domain grid-lines are visible.
        Returns:
        The true or false.
        See Also:
        setDomainGridlinesVisible(boolean)
      • setDomainGridlinesVisible

        public void setDomainGridlinesVisible(boolean visible)
        Sets the flag that controls whether or not grid-lines are drawn against the domain axis.

        If the flag value changes, a PlotChangeEvent is sent to all registered listeners.

        Parameters:
        visible - the new value of the flag.
        See Also:
        isDomainGridlinesVisible()
      • setDomainGridlinePosition

        public void setDomainGridlinePosition(CategoryAnchor position)
        Sets the position used for the domain gridlines and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        position - the position (null not permitted).
        See Also:
        getDomainGridlinePosition()
      • getDomainGridlineStroke

        public Stroke getDomainGridlineStroke()
        Returns the stroke used to draw grid-lines against the domain axis.
        Returns:
        The stroke (never null).
        See Also:
        setDomainGridlineStroke(Stroke)
      • setDomainGridlineStroke

        public void setDomainGridlineStroke(Stroke stroke)
        Sets the stroke used to draw grid-lines against the domain axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getDomainGridlineStroke()
      • getDomainGridlinePaint

        public Paint getDomainGridlinePaint()
        Returns the paint used to draw grid-lines against the domain axis.
        Returns:
        The paint (never null).
        See Also:
        setDomainGridlinePaint(Paint)
      • setDomainGridlinePaint

        public void setDomainGridlinePaint(Paint paint)
        Sets the paint used to draw the grid-lines (if any) against the domain axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getDomainGridlinePaint()
      • isRangeZeroBaselineVisible

        public boolean isRangeZeroBaselineVisible()
        Returns a flag that controls whether or not a zero baseline is displayed for the range axis.
        Returns:
        A boolean.
        See Also:
        setRangeZeroBaselineVisible(boolean)
      • setRangeZeroBaselineVisible

        public void setRangeZeroBaselineVisible(boolean visible)
        Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        visible - the flag.
        See Also:
        isRangeZeroBaselineVisible()
      • getRangeZeroBaselineStroke

        public Stroke getRangeZeroBaselineStroke()
        Returns the stroke used for the zero baseline against the range axis.
        Returns:
        The stroke (never null).
        See Also:
        setRangeZeroBaselineStroke(Stroke)
      • setRangeZeroBaselineStroke

        public void setRangeZeroBaselineStroke(Stroke stroke)
        Sets the stroke for the zero baseline for the range axis, and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getRangeZeroBaselineStroke()
      • getRangeZeroBaselinePaint

        public Paint getRangeZeroBaselinePaint()
        Returns the paint for the zero baseline (if any) plotted against the range axis.
        Returns:
        The paint (never null).
        See Also:
        setRangeZeroBaselinePaint(Paint)
      • setRangeZeroBaselinePaint

        public void setRangeZeroBaselinePaint(Paint paint)
        Sets the paint for the zero baseline plotted against the range axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getRangeZeroBaselinePaint()
      • isRangeGridlinesVisible

        public boolean isRangeGridlinesVisible()
        Returns the flag that controls whether the range grid-lines are visible.
        Returns:
        The flag.
        See Also:
        setRangeGridlinesVisible(boolean)
      • setRangeGridlinesVisible

        public void setRangeGridlinesVisible(boolean visible)
        Sets the flag that controls whether or not grid-lines are drawn against the range axis. If the flag changes value, a PlotChangeEvent is sent to all registered listeners.
        Parameters:
        visible - the new value of the flag.
        See Also:
        isRangeGridlinesVisible()
      • getRangeGridlineStroke

        public Stroke getRangeGridlineStroke()
        Returns the stroke used to draw the grid-lines against the range axis.
        Returns:
        The stroke (never null).
        See Also:
        setRangeGridlineStroke(Stroke)
      • setRangeGridlineStroke

        public void setRangeGridlineStroke(Stroke stroke)
        Sets the stroke used to draw the grid-lines against the range axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getRangeGridlineStroke()
      • getRangeGridlinePaint

        public Paint getRangeGridlinePaint()
        Returns the paint used to draw the grid-lines against the range axis.
        Returns:
        The paint (never null).
        See Also:
        setRangeGridlinePaint(Paint)
      • setRangeGridlinePaint

        public void setRangeGridlinePaint(Paint paint)
        Sets the paint used to draw the grid lines against the range axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getRangeGridlinePaint()
      • isRangeMinorGridlinesVisible

        public boolean isRangeMinorGridlinesVisible()
        Returns true if the range axis minor grid is visible, and false otherwise.
        Returns:
        A boolean.
        See Also:
        setRangeMinorGridlinesVisible(boolean)
      • setRangeMinorGridlinesVisible

        public void setRangeMinorGridlinesVisible(boolean visible)
        Sets the flag that controls whether or not the range axis minor grid lines are visible.

        If the flag value is changed, a PlotChangeEvent is sent to all registered listeners.

        Parameters:
        visible - the new value of the flag.
        See Also:
        isRangeMinorGridlinesVisible()
      • getRangeMinorGridlineStroke

        public Stroke getRangeMinorGridlineStroke()
        Returns the stroke for the minor grid lines (if any) plotted against the range axis.
        Returns:
        The stroke (never null).
        See Also:
        setRangeMinorGridlineStroke(Stroke)
      • setRangeMinorGridlineStroke

        public void setRangeMinorGridlineStroke(Stroke stroke)
        Sets the stroke for the minor grid lines plotted against the range axis, and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getRangeMinorGridlineStroke()
      • getRangeMinorGridlinePaint

        public Paint getRangeMinorGridlinePaint()
        Returns the paint for the minor grid lines (if any) plotted against the range axis.
        Returns:
        The paint (never null).
        See Also:
        setRangeMinorGridlinePaint(Paint)
      • setRangeMinorGridlinePaint

        public void setRangeMinorGridlinePaint(Paint paint)
        Sets the paint for the minor grid lines plotted against the range axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getRangeMinorGridlinePaint()
      • setFixedLegendItems

        public void setFixedLegendItems(LegendItemCollection items)
        Sets the fixed legend items for the plot. Leave this set to null if you prefer the legend items to be created automatically.
        Parameters:
        items - the legend items (null permitted).
        See Also:
        getFixedLegendItems()
      • getLegendItems

        public LegendItemCollection getLegendItems()
        Returns the legend items for the plot. By default, this method creates a legend item for each series in each of the datasets. You can change this behaviour by overriding this method.
        Specified by:
        getLegendItems in interface LegendItemSource
        Overrides:
        getLegendItems in class Plot
        Returns:
        The legend items.
      • handleClick

        public void handleClick(int x,               int y,               PlotRenderingInfo info)
        Handles a 'click' on the plot by updating the anchor value.
        Overrides:
        handleClick in class Plot
        Parameters:
        x - x-coordinate of the click (in Java2D space).
        y - y-coordinate of the click (in Java2D space).
        info - information about the plot's dimensions.
      • zoom

        public void zoom(double percent)
        Zooms (in or out) on the plot's value axis.

        If the value 0.0 is passed in as the zoom percent, the auto-range calculation for the axis is restored (which sets the range to include the minimum and maximum data values, thus displaying all the data).

        Overrides:
        zoom in class Plot
        Parameters:
        percent - the zoom amount.
      • addDomainMarker

        public void addDomainMarker(CategoryMarker marker)
        Adds a marker for display (in the foreground) against the domain axis and sends a PlotChangeEvent to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.
        Parameters:
        marker - the marker (null not permitted).
        See Also:
        removeDomainMarker(Marker)
      • addDomainMarker

        public void addDomainMarker(CategoryMarker marker,                   org.jfree.ui.Layer layer)
        Adds a marker for display against the domain axis and sends a PlotChangeEvent to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.
        Parameters:
        marker - the marker (null not permitted).
        layer - the layer (foreground or background) (null not permitted).
        See Also:
        removeDomainMarker(Marker, Layer)
      • addDomainMarker

        public void addDomainMarker(int index,                   CategoryMarker marker,                   org.jfree.ui.Layer layer)
        Adds a marker for display by a particular renderer and sends a PlotChangeEvent to all registered listeners.

        Typically a marker will be drawn by the renderer as a line perpendicular to a domain axis, however this is entirely up to the renderer.

        Parameters:
        index - the renderer index.
        marker - the marker (null not permitted).
        layer - the layer (null not permitted).
        See Also:
        removeDomainMarker(int, Marker, Layer)
      • addDomainMarker

        public void addDomainMarker(int index,                   CategoryMarker marker,                   org.jfree.ui.Layer layer,                   boolean notify)
        Adds a marker for display by a particular renderer and, if requested, sends a PlotChangeEvent to all registered listeners.

        Typically a marker will be drawn by the renderer as a line perpendicular to a domain axis, however this is entirely up to the renderer.

        Parameters:
        index - the renderer index.
        marker - the marker (null not permitted).
        layer - the layer (null not permitted).
        notify - notify listeners?
        See Also:
        removeDomainMarker(int, Marker, Layer, boolean)
      • clearDomainMarkers

        public void clearDomainMarkers()
        Clears all the domain markers for the plot and sends a PlotChangeEvent to all registered listeners.
        See Also:
        clearRangeMarkers()
      • getDomainMarkers

        public Collection getDomainMarkers(org.jfree.ui.Layer layer)
        Returns the list of domain markers (read only) for the specified layer.
        Parameters:
        layer - the layer (foreground or background).
        Returns:
        The list of domain markers.
      • getDomainMarkers

        public Collection getDomainMarkers(int index,                          org.jfree.ui.Layer layer)
        Returns a collection of domain markers for a particular renderer and layer.
        Parameters:
        index - the renderer index.
        layer - the layer.
        Returns:
        A collection of markers (possibly null).
      • clearDomainMarkers

        public void clearDomainMarkers(int index)
        Clears all the domain markers for the specified renderer.
        Parameters:
        index - the renderer index.
        See Also:
        clearRangeMarkers(int)
      • removeDomainMarker

        public boolean removeDomainMarker(Marker marker)
        Removes a marker for the domain axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        marker - the marker.
        Returns:
        A boolean indicating whether or not the marker was actually removed.
      • removeDomainMarker

        public boolean removeDomainMarker(Marker marker,                         org.jfree.ui.Layer layer)
        Removes a marker for the domain axis in the specified layer and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        marker - the marker (null not permitted).
        layer - the layer (foreground or background).
        Returns:
        A boolean indicating whether or not the marker was actually removed.
      • removeDomainMarker

        public boolean removeDomainMarker(int index,                         Marker marker,                         org.jfree.ui.Layer layer)
        Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the dataset/renderer index.
        marker - the marker.
        layer - the layer (foreground or background).
        Returns:
        A boolean indicating whether or not the marker was actually removed.
      • removeDomainMarker

        public boolean removeDomainMarker(int index,                         Marker marker,                         org.jfree.ui.Layer layer,                         boolean notify)
        Removes a marker for a specific dataset/renderer and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the dataset/renderer index.
        marker - the marker.
        layer - the layer (foreground or background).
        notify - notify listeners?
        Returns:
        A boolean indicating whether or not the marker was actually removed.
      • addRangeMarker

        public void addRangeMarker(Marker marker)
        Adds a marker for display (in the foreground) against the range axis and sends a PlotChangeEvent to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
        Parameters:
        marker - the marker (null not permitted).
        See Also:
        removeRangeMarker(Marker)
      • addRangeMarker

        public void addRangeMarker(Marker marker,                  org.jfree.ui.Layer layer)
        Adds a marker for display against the range axis and sends a PlotChangeEvent to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
        Parameters:
        marker - the marker (null not permitted).
        layer - the layer (foreground or background) (null not permitted).
        See Also:
        removeRangeMarker(Marker, Layer)
      • addRangeMarker

        public void addRangeMarker(int index,                  Marker marker,                  org.jfree.ui.Layer layer)
        Adds a marker for display by a particular renderer and sends a PlotChangeEvent to all registered listeners.

        Typically a marker will be drawn by the renderer as a line perpendicular to a range axis, however this is entirely up to the renderer.

        Parameters:
        index - the renderer index.
        marker - the marker.
        layer - the layer.
        See Also:
        removeRangeMarker(int, Marker, Layer)
      • addRangeMarker

        public void addRangeMarker(int index,                  Marker marker,                  org.jfree.ui.Layer layer,                  boolean notify)
        Adds a marker for display by a particular renderer and sends a PlotChangeEvent to all registered listeners.

        Typically a marker will be drawn by the renderer as a line perpendicular to a range axis, however this is entirely up to the renderer.

        Parameters:
        index - the renderer index.
        marker - the marker.
        layer - the layer.
        notify - notify listeners?
        See Also:
        removeRangeMarker(int, Marker, Layer, boolean)
      • clearRangeMarkers

        public void clearRangeMarkers()
        Clears all the range markers for the plot and sends a PlotChangeEvent to all registered listeners.
        See Also:
        clearDomainMarkers()
      • getRangeMarkers

        public Collection getRangeMarkers(org.jfree.ui.Layer layer)
        Returns the list of range markers (read only) for the specified layer.
        Parameters:
        layer - the layer (foreground or background).
        Returns:
        The list of range markers.
        See Also:
        getRangeMarkers(int, Layer)
      • getRangeMarkers

        public Collection getRangeMarkers(int index,                         org.jfree.ui.Layer layer)
        Returns a collection of range markers for a particular renderer and layer.
        Parameters:
        index - the renderer index.
        layer - the layer.
        Returns:
        A collection of markers (possibly null).
      • clearRangeMarkers

        public void clearRangeMarkers(int index)
        Clears all the range markers for the specified renderer.
        Parameters:
        index - the renderer index.
        See Also:
        clearDomainMarkers(int)
      • removeRangeMarker

        public boolean removeRangeMarker(Marker marker)
        Removes a marker for the range axis and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        marker - the marker.
        Returns:
        A boolean indicating whether or not the marker was actually removed.
        See Also:
        addRangeMarker(Marker)
      • removeRangeMarker

        public boolean removeRangeMarker(Marker marker,                        org.jfree.ui.Layer layer)
        Removes a marker for the range axis in the specified layer and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        marker - the marker (null not permitted).
        layer - the layer (foreground or background).
        Returns:
        A boolean indicating whether or not the marker was actually removed.
        See Also:
        addRangeMarker(Marker, Layer)
      • removeRangeMarker

        public boolean removeRangeMarker(int index,                        Marker marker,                        org.jfree.ui.Layer layer)
        Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the dataset/renderer index.
        marker - the marker.
        layer - the layer (foreground or background).
        Returns:
        A boolean indicating whether or not the marker was actually removed.
        See Also:
        addRangeMarker(int, Marker, Layer)
      • removeRangeMarker

        public boolean removeRangeMarker(int index,                        Marker marker,                        org.jfree.ui.Layer layer,                        boolean notify)
        Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the dataset/renderer index.
        marker - the marker.
        layer - the layer (foreground or background).
        notify - notify listeners.
        Returns:
        A boolean indicating whether or not the marker was actually removed.
        See Also:
        addRangeMarker(int, Marker, Layer, boolean)
      • isDomainCrosshairVisible

        public boolean isDomainCrosshairVisible()
        Returns the flag that controls whether or not the domain crosshair is displayed by the plot.
        Returns:
        A boolean.
        See Also:
        setDomainCrosshairVisible(boolean)
      • getDomainCrosshairRowKey

        public Comparable getDomainCrosshairRowKey()
        Returns the row key for the domain crosshair.
        Returns:
        The row key.
      • setDomainCrosshairRowKey

        public void setDomainCrosshairRowKey(Comparable key)
        Sets the row key for the domain crosshair and sends a {PlotChangeEvent} to all registered listeners.
        Parameters:
        key - the key.
      • setDomainCrosshairRowKey

        public void setDomainCrosshairRowKey(Comparable key,                            boolean notify)
        Sets the row key for the domain crosshair and, if requested, sends a {PlotChangeEvent} to all registered listeners.
        Parameters:
        key - the key.
        notify - notify listeners?
      • getDomainCrosshairColumnKey

        public Comparable getDomainCrosshairColumnKey()
        Returns the column key for the domain crosshair.
        Returns:
        The column key.
      • setDomainCrosshairColumnKey

        public void setDomainCrosshairColumnKey(Comparable key)
        Sets the column key for the domain crosshair and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        key - the key.
      • setDomainCrosshairColumnKey

        public void setDomainCrosshairColumnKey(Comparable key,                               boolean notify)
        Sets the column key for the domain crosshair and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        key - the key.
        notify - notify listeners?
      • getCrosshairDatasetIndex

        public int getCrosshairDatasetIndex()
        Returns the dataset index for the crosshair.
        Returns:
        The dataset index.
      • setCrosshairDatasetIndex

        public void setCrosshairDatasetIndex(int index)
        Sets the dataset index for the crosshair and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the index.
      • setCrosshairDatasetIndex

        public void setCrosshairDatasetIndex(int index,                            boolean notify)
        Sets the dataset index for the crosshair and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        index - the index.
        notify - notify listeners?
      • setDomainCrosshairPaint

        public void setDomainCrosshairPaint(Paint paint)
        Sets the paint used to draw the domain crosshair.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getDomainCrosshairPaint()
      • setDomainCrosshairStroke

        public void setDomainCrosshairStroke(Stroke stroke)
        Sets the stroke used to draw the domain crosshair, and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getDomainCrosshairStroke()
      • isRangeCrosshairVisible

        public boolean isRangeCrosshairVisible()
        Returns a flag indicating whether or not the range crosshair is visible.
        Returns:
        The flag.
        See Also:
        setRangeCrosshairVisible(boolean)
      • setRangeCrosshairVisible

        public void setRangeCrosshairVisible(boolean flag)
        Sets the flag indicating whether or not the range crosshair is visible.
        Parameters:
        flag - the new value of the flag.
        See Also:
        isRangeCrosshairVisible()
      • isRangeCrosshairLockedOnData

        public boolean isRangeCrosshairLockedOnData()
        Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
        Returns:
        The flag.
        See Also:
        setRangeCrosshairLockedOnData(boolean)
      • setRangeCrosshairLockedOnData

        public void setRangeCrosshairLockedOnData(boolean flag)
        Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values, and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        flag - the flag.
        See Also:
        isRangeCrosshairLockedOnData()
      • getRangeCrosshairValue

        public double getRangeCrosshairValue()
        Returns the range crosshair value.
        Returns:
        The value.
        See Also:
        setRangeCrosshairValue(double)
      • setRangeCrosshairValue

        public void setRangeCrosshairValue(double value)
        Sets the range crosshair value and, if the crosshair is visible, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        value - the new value.
        See Also:
        getRangeCrosshairValue()
      • setRangeCrosshairValue

        public void setRangeCrosshairValue(double value,                          boolean notify)
        Sets the range crosshair value and, if requested, sends a PlotChangeEvent to all registered listeners (but only if the crosshair is visible).
        Parameters:
        value - the new value.
        notify - a flag that controls whether or not listeners are notified.
        See Also:
        getRangeCrosshairValue()
      • setRangeCrosshairStroke

        public void setRangeCrosshairStroke(Stroke stroke)
        Sets the pen-style (Stroke) used to draw the range crosshair (if visible), and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the new crosshair stroke (null not permitted).
        See Also:
        getRangeCrosshairStroke()
      • setRangeCrosshairPaint

        public void setRangeCrosshairPaint(Paint paint)
        Sets the paint used to draw the range crosshair (if visible) and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getRangeCrosshairPaint()
      • addAnnotation

        public void addAnnotation(CategoryAnnotation annotation,                 boolean notify)
        Adds an annotation to the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        annotation - the annotation (null not permitted).
        notify - notify listeners?
      • removeAnnotation

        public boolean removeAnnotation(CategoryAnnotation annotation)
        Removes an annotation from the plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        annotation - the annotation (null not permitted).
        Returns:
        A boolean (indicates whether or not the annotation was removed).
        See Also:
        addAnnotation(CategoryAnnotation)
      • removeAnnotation

        public boolean removeAnnotation(CategoryAnnotation annotation,                       boolean notify)
        Removes an annotation from the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        annotation - the annotation (null not permitted).
        notify - notify listeners?
        Returns:
        A boolean (indicates whether or not the annotation was removed).
      • clearAnnotations

        public void clearAnnotations()
        Clears all the annotations and sends a PlotChangeEvent to all registered listeners.
      • getShadowGenerator

        public ShadowGenerator getShadowGenerator()
        Returns the shadow generator for the plot, if any.
        Returns:
        The shadow generator (possibly null).
      • setShadowGenerator

        public void setShadowGenerator(ShadowGenerator generator)
        Sets the shadow generator for the plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        generator - the generator (null permitted).
      • draw

        public void draw(Graphics2D g2,        Rectangle2D area,        Point2D anchor,        PlotState parentState,        PlotRenderingInfo state)
        Draws the plot on a Java 2D graphics device (such as the screen or a printer).

        At your option, you may supply an instance of PlotRenderingInfo. If you do, it will be populated with information about the drawing, including various plot dimensions and tooltip info.

        Specified by:
        draw in class Plot
        Parameters:
        g2 - the graphics device.
        area - the area within which the plot (including axes) should be drawn.
        anchor - the anchor point (null permitted).
        parentState - the state from the parent plot, if there is one.
        state - collects info as the chart is drawn (possibly null).
      • drawBackground

        public void drawBackground(Graphics2D g2,                  Rectangle2D area)
        Draws the plot background (the background color and/or image).

        This method will be called during the chart drawing process and is declared public so that it can be accessed by the renderers used by certain subclasses. You shouldn't need to call this method directly.

        Overrides:
        drawBackground in class Plot
        Parameters:
        g2 - the graphics device.
        area - the area within which the plot should be drawn.
      • render

        public boolean render(Graphics2D g2,             Rectangle2D dataArea,             int index,             PlotRenderingInfo info,             CategoryCrosshairState crosshairState)
        Draws a representation of a dataset within the dataArea region using the appropriate renderer.
        Parameters:
        g2 - the graphics device.
        dataArea - the region in which the data is to be drawn.
        index - the dataset and renderer index.
        info - an optional object for collection dimension information.
        crosshairState - a state object for tracking crosshair info (null permitted).
        Returns:
        A boolean that indicates whether or not real data was found.
      • getDataRange

        public Range getDataRange(ValueAxis axis)
        Returns the range of data values that will be plotted against the range axis. If the dataset is null, this method returns null.
        Specified by:
        getDataRange in interface ValueAxisPlot
        Parameters:
        axis - the axis.
        Returns:
        The data range.
      • getWeight

        public int getWeight()
        Returns the weight for this plot when it is used as a subplot within a combined plot.
        Returns:
        The weight.
        See Also:
        setWeight(int)
      • setWeight

        public void setWeight(int weight)
        Sets the weight for the plot and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        weight - the weight.
        See Also:
        getWeight()
      • setFixedDomainAxisSpace

        public void setFixedDomainAxisSpace(AxisSpace space)
        Sets the fixed domain axis space and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        space - the space (null permitted).
        See Also:
        getFixedDomainAxisSpace()
      • setFixedDomainAxisSpace

        public void setFixedDomainAxisSpace(AxisSpace space,                           boolean notify)
        Sets the fixed domain axis space and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        space - the space (null permitted).
        notify - notify listeners?
        See Also:
        getFixedDomainAxisSpace()
      • setFixedRangeAxisSpace

        public void setFixedRangeAxisSpace(AxisSpace space)
        Sets the fixed range axis space and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        space - the space (null permitted).
        See Also:
        getFixedRangeAxisSpace()
      • setFixedRangeAxisSpace

        public void setFixedRangeAxisSpace(AxisSpace space,                          boolean notify)
        Sets the fixed range axis space and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        space - the space (null permitted).
        notify - notify listeners?
        See Also:
        getFixedRangeAxisSpace()
      • getCategories

        public List getCategories()
        Returns a list of the categories in the plot's primary dataset.
        Returns:
        A list of the categories in the plot's primary dataset.
        See Also:
        getCategoriesForAxis(CategoryAxis)
      • getCategoriesForAxis

        public List getCategoriesForAxis(CategoryAxis axis)
        Returns a list of the categories that should be displayed for the specified axis.
        Parameters:
        axis - the axis (null not permitted)
        Returns:
        The categories.
      • getDrawSharedDomainAxis

        public boolean getDrawSharedDomainAxis()
        Returns the flag that controls whether or not the shared domain axis is drawn for each subplot.
        Returns:
        A boolean.
        See Also:
        setDrawSharedDomainAxis(boolean)
      • setDrawSharedDomainAxis

        public void setDrawSharedDomainAxis(boolean draw)
        Sets the flag that controls whether the shared domain axis is drawn when this plot is being used as a subplot.
        Parameters:
        draw - a boolean.
        See Also:
        getDrawSharedDomainAxis()
      • isDomainPannable

        public boolean isDomainPannable()
        Returns false always, because the plot cannot be panned along the domain axis/axes.
        Specified by:
        isDomainPannable in interface Pannable
        Returns:
        A boolean.
        See Also:
        isRangePannable()
      • setRangePannable

        public void setRangePannable(boolean pannable)
        Sets the flag that enables or disables panning of the plot along the range axes.
        Parameters:
        pannable - the new flag value.
        See Also:
        isRangePannable()
      • panDomainAxes

        public void panDomainAxes(double percent,                 PlotRenderingInfo info,                 Point2D source)
        Pans the domain axes by the specified percentage.
        Specified by:
        panDomainAxes in interface Pannable
        Parameters:
        percent - the distance to pan (as a percentage of the axis length).
        info - the plot info
        source - the source point where the pan action started.
      • panRangeAxes

        public void panRangeAxes(double percent,                PlotRenderingInfo info,                Point2D source)
        Pans the range axes by the specified percentage.
        Specified by:
        panRangeAxes in interface Pannable
        Parameters:
        percent - the distance to pan (as a percentage of the axis length).
        info - the plot info
        source - the source point where the pan action started.
      • isDomainZoomable

        public boolean isDomainZoomable()
        Returns false to indicate that the domain axes are not zoomable.
        Specified by:
        isDomainZoomable in interface Zoomable
        Returns:
        A boolean.
        See Also:
        isRangeZoomable()
      • getAnchorValue

        public double getAnchorValue()
        Returns the anchor value.
        Returns:
        The anchor value.
        See Also:
        setAnchorValue(double)
      • setAnchorValue

        public void setAnchorValue(double value)
        Sets the anchor value and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        value - the anchor value.
        See Also:
        getAnchorValue()
      • setAnchorValue

        public void setAnchorValue(double value,                  boolean notify)
        Sets the anchor value and, if requested, sends a PlotChangeEvent to all registered listeners.
        Parameters:
        value - the value.
        notify - notify listeners?
        See Also:
        getAnchorValue()
      • equals

        public boolean equals(Object obj)
        Tests the plot for equality with an arbitrary object.
        Overrides:
        equals in class Plot
        Parameters:
        obj - the object to test against (null permitted).
        Returns:
        A boolean.

SCaVis 2.2 © jWork.ORG