Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » plot » [javadoc | source]
org.jfree.chart.plot
public class: CategoryPlot [javadoc | source]
java.lang.Object
   org.jfree.chart.plot.Plot
      org.jfree.chart.plot.CategoryPlot

All Implemented Interfaces:
    PublicCloneable, ValueAxisPlot, Cloneable, RendererChangeListener, Zoomable, Serializable, AxisChangeListener, LegendItemSource, MarkerChangeListener, DatasetChangeListener

Direct Known Subclasses:
    CombinedRangeCategoryPlot, CombinedDomainCategoryPlot, CombinedCategoryPlot

A general plotting class that uses data from a CategoryDataset and renders each data item using a CategoryItemRenderer .
Field Summary
public static final  boolean DEFAULT_DOMAIN_GRIDLINES_VISIBLE    The default visibility of the grid lines plotted against the domain axis. 
public static final  boolean DEFAULT_RANGE_GRIDLINES_VISIBLE    The default visibility of the grid lines plotted against the range axis. 
public static final  Stroke DEFAULT_GRIDLINE_STROKE    The default grid line stroke. 
public static final  Paint DEFAULT_GRIDLINE_PAINT    The default grid line paint. 
public static final  Font DEFAULT_VALUE_LABEL_FONT    The default value label font. 
public static final  boolean DEFAULT_CROSSHAIR_VISIBLE    The default crosshair visibility.
    since: 1.0.5 -
 
public static final  Stroke DEFAULT_CROSSHAIR_STROKE    The default crosshair stroke.
    since: 1.0.5 -
 
public static final  Paint DEFAULT_CROSSHAIR_PAINT    The default crosshair paint.
    since: 1.0.5 -
 
protected static  ResourceBundle localizationResources    The resourceBundle for the localization. 
Fields inherited from org.jfree.chart.plot.Plot:
ZERO,  DEFAULT_INSETS,  DEFAULT_OUTLINE_STROKE,  DEFAULT_OUTLINE_PAINT,  DEFAULT_FOREGROUND_ALPHA,  DEFAULT_BACKGROUND_ALPHA,  DEFAULT_BACKGROUND_PAINT,  MINIMUM_WIDTH_TO_DRAW,  MINIMUM_HEIGHT_TO_DRAW,  DEFAULT_LEGEND_ITEM_BOX,  DEFAULT_LEGEND_ITEM_CIRCLE
Constructor:
 public 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 from org.jfree.chart.plot.CategoryPlot Summary:
addAnnotation,   addAnnotation,   addDomainMarker,   addDomainMarker,   addDomainMarker,   addDomainMarker,   addRangeMarker,   addRangeMarker,   addRangeMarker,   addRangeMarker,   calculateAxisSpace,   calculateDomainAxisSpace,   calculateRangeAxisSpace,   clearAnnotations,   clearDomainAxes,   clearDomainMarkers,   clearDomainMarkers,   clearRangeAxes,   clearRangeMarkers,   clearRangeMarkers,   clone,   configureDomainAxes,   configureRangeAxes,   datasetChanged,   draw,   drawAnnotations,   drawAxes,   drawBackground,   drawDomainGridlines,   drawDomainMarkers,   drawRangeCrosshair,   drawRangeGridlines,   drawRangeLine,   drawRangeMarkers,   equals,   getAnchorValue,   getAnnotations,   getAxisOffset,   getCategories,   getCategoriesForAxis,   getColumnRenderingOrder,   getDataRange,   getDataset,   getDataset,   getDatasetCount,   getDatasetRenderingOrder,   getDomainAxis,   getDomainAxis,   getDomainAxisCount,   getDomainAxisEdge,   getDomainAxisEdge,   getDomainAxisForDataset,   getDomainAxisIndex,   getDomainAxisLocation,   getDomainAxisLocation,   getDomainGridlinePaint,   getDomainGridlinePosition,   getDomainGridlineStroke,   getDomainMarkers,   getDomainMarkers,   getDrawSharedDomainAxis,   getFixedDomainAxisSpace,   getFixedLegendItems,   getFixedRangeAxisSpace,   getIndexOf,   getLegendItems,   getOrientation,   getPlotType,   getRangeAxis,   getRangeAxis,   getRangeAxisCount,   getRangeAxisEdge,   getRangeAxisEdge,   getRangeAxisForDataset,   getRangeAxisIndex,   getRangeAxisLocation,   getRangeAxisLocation,   getRangeCrosshairPaint,   getRangeCrosshairStroke,   getRangeCrosshairValue,   getRangeGridlinePaint,   getRangeGridlineStroke,   getRangeMarkers,   getRangeMarkers,   getRenderer,   getRenderer,   getRendererForDataset,   getRowRenderingOrder,   getWeight,   handleClick,   isDomainGridlinesVisible,   isDomainZoomable,   isRangeCrosshairLockedOnData,   isRangeCrosshairVisible,   isRangeGridlinesVisible,   isRangeZoomable,   mapDatasetToDomainAxis,   mapDatasetToRangeAxis,   removeAnnotation,   removeAnnotation,   removeDomainMarker,   removeDomainMarker,   removeDomainMarker,   removeDomainMarker,   removeRangeMarker,   removeRangeMarker,   removeRangeMarker,   removeRangeMarker,   render,   rendererChanged,   setAnchorValue,   setAnchorValue,   setAxisOffset,   setColumnRenderingOrder,   setDataset,   setDataset,   setDatasetRenderingOrder,   setDomainAxes,   setDomainAxis,   setDomainAxis,   setDomainAxis,   setDomainAxisLocation,   setDomainAxisLocation,   setDomainAxisLocation,   setDomainAxisLocation,   setDomainGridlinePaint,   setDomainGridlinePosition,   setDomainGridlineStroke,   setDomainGridlinesVisible,   setDrawSharedDomainAxis,   setFixedDomainAxisSpace,   setFixedDomainAxisSpace,   setFixedLegendItems,   setFixedRangeAxisSpace,   setFixedRangeAxisSpace,   setOrientation,   setRangeAxes,   setRangeAxis,   setRangeAxis,   setRangeAxis,   setRangeAxisLocation,   setRangeAxisLocation,   setRangeAxisLocation,   setRangeAxisLocation,   setRangeCrosshairLockedOnData,   setRangeCrosshairPaint,   setRangeCrosshairStroke,   setRangeCrosshairValue,   setRangeCrosshairValue,   setRangeCrosshairVisible,   setRangeGridlinePaint,   setRangeGridlineStroke,   setRangeGridlinesVisible,   setRenderer,   setRenderer,   setRenderer,   setRenderer,   setRenderers,   setRowRenderingOrder,   setWeight,   zoom,   zoomDomainAxes,   zoomDomainAxes,   zoomDomainAxes,   zoomRangeAxes,   zoomRangeAxes,   zoomRangeAxes
Methods from org.jfree.chart.plot.Plot:
addChangeListener,   axisChanged,   clone,   datasetChanged,   draw,   drawBackground,   drawBackgroundImage,   drawNoDataMessage,   drawOutline,   equals,   fillBackground,   fillBackground,   fireChangeEvent,   getBackgroundAlpha,   getBackgroundImage,   getBackgroundImageAlignment,   getBackgroundImageAlpha,   getBackgroundPaint,   getDatasetGroup,   getDrawingSupplier,   getForegroundAlpha,   getInsets,   getLegendItems,   getNoDataMessage,   getNoDataMessageFont,   getNoDataMessagePaint,   getOutlinePaint,   getOutlineStroke,   getParent,   getPlotType,   getRectX,   getRectY,   getRootPlot,   handleClick,   isOutlineVisible,   isSubplot,   markerChanged,   notifyListeners,   removeChangeListener,   resolveDomainAxisLocation,   resolveRangeAxisLocation,   setBackgroundAlpha,   setBackgroundImage,   setBackgroundImageAlignment,   setBackgroundImageAlpha,   setBackgroundPaint,   setDatasetGroup,   setDrawingSupplier,   setForegroundAlpha,   setInsets,   setInsets,   setNoDataMessage,   setNoDataMessageFont,   setNoDataMessagePaint,   setOutlinePaint,   setOutlineStroke,   setOutlineVisible,   setParent,   zoom
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.chart.plot.CategoryPlot Detail:
 public  void addAnnotation(CategoryAnnotation annotation) 
    Adds an annotation to the plot and sends a PlotChangeEvent to all registered listeners.
 public  void addAnnotation(CategoryAnnotation annotation,
    boolean notify) 
    Adds an annotation to the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
 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.
 public  void addDomainMarker(CategoryMarker marker,
    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.
 public  void addDomainMarker(int index,
    CategoryMarker marker,
    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.

 public  void addDomainMarker(int index,
    CategoryMarker marker,
    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.

 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.
 public  void addRangeMarker(Marker marker,
    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.
 public  void addRangeMarker(int index,
    Marker marker,
    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.

 public  void addRangeMarker(int index,
    Marker marker,
    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.

 protected AxisSpace calculateAxisSpace(Graphics2D g2,
    Rectangle2D plotArea) 
    Calculates the space required for the axes.
 protected AxisSpace calculateDomainAxisSpace(Graphics2D g2,
    Rectangle2D plotArea,
    AxisSpace space) 
    Calculates the space required for the domain axis/axes.
 protected AxisSpace calculateRangeAxisSpace(Graphics2D g2,
    Rectangle2D plotArea,
    AxisSpace space) 
    Calculates the space required for the range axis/axes.
 public  void clearAnnotations() 
    Clears all the annotations and sends a PlotChangeEvent to all registered listeners.
 public  void clearDomainAxes() 
    Clears the domain axes from the plot and sends a PlotChangeEvent to all registered listeners.
 public  void clearDomainMarkers() 
    Clears all the domain markers for the plot and sends a PlotChangeEvent to all registered listeners.
 public  void clearDomainMarkers(int index) 
    Clears all the domain markers for the specified renderer.
 public  void clearRangeAxes() 
    Clears the range axes from the plot and sends a PlotChangeEvent to all registered listeners.
 public  void clearRangeMarkers() 
    Clears all the range markers for the plot and sends a PlotChangeEvent to all registered listeners.
 public  void clearRangeMarkers(int index) 
    Clears all the range markers for the specified renderer.
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the plot.
 public  void configureDomainAxes() 
    Configures the domain axes.
 public  void configureRangeAxes() 
    Configures the range axes.
 public  void datasetChanged(DatasetChangeEvent event) 
    Receives notification of a change to the plot's dataset.

    The range axis bounds will be recalculated if necessary.

 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.

 protected  void drawAnnotations(Graphics2D g2,
    Rectangle2D dataArea) 
    Draws the annotations.
 protected Map drawAxes(Graphics2D g2,
    Rectangle2D plotArea,
    Rectangle2D dataArea,
    PlotRenderingInfo plotState) 
    A utility method for drawing the plot's axes.
 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.

 protected  void drawDomainGridlines(Graphics2D g2,
    Rectangle2D dataArea) 
    Draws the gridlines for the plot.
 protected  void drawDomainMarkers(Graphics2D g2,
    Rectangle2D dataArea,
    int index,
    Layer layer) 
    Draws the domain markers (if any) for an axis and layer. This method is typically called from within the draw() method.
 protected  void drawRangeCrosshair(Graphics2D g2,
    Rectangle2D dataArea,
    PlotOrientation orientation,
    double value,
    ValueAxis axis,
    Stroke stroke,
    Paint paint) 
    Draws a range crosshair.
 protected  void drawRangeGridlines(Graphics2D g2,
    Rectangle2D dataArea,
    List ticks) 
    Draws the gridlines for the plot.
 protected  void drawRangeLine(Graphics2D g2,
    Rectangle2D dataArea,
    double value,
    Stroke stroke,
    Paint paint) 
    Utility method for drawing a line perpendicular to the range axis (used for crosshairs).
 protected  void drawRangeMarkers(Graphics2D g2,
    Rectangle2D dataArea,
    int index,
    Layer layer) 
    Draws the range markers (if any) for an axis and layer. This method is typically called from within the draw() method.
 public boolean equals(Object obj) 
    Tests the plot for equality with an arbitrary object.
 public double getAnchorValue() 
    Returns the anchor value.
 public List getAnnotations() 
    Returns the list of annotations.
 public RectangleInsets getAxisOffset() 
    Returns the axis offset.
 public List getCategories() 
    Returns a list of the categories in the plot's primary dataset.
 public List getCategoriesForAxis(CategoryAxis axis) 
    Returns a list of the categories that should be displayed for the specified axis.
 public SortOrder getColumnRenderingOrder() 
    Returns the order in which the columns are rendered. The default value is SortOrder.ASCENDING.
 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.
 public CategoryDataset getDataset() 
    Returns the primary dataset for the plot.
 public CategoryDataset getDataset(int index) 
    Returns the dataset at the given index.
 public int getDatasetCount() 
    Returns the number of datasets.
 public DatasetRenderingOrder getDatasetRenderingOrder() 
    Returns the dataset rendering order.
 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).
 public CategoryAxis getDomainAxis(int index) 
    Returns a domain axis.
 public int getDomainAxisCount() 
    Returns the number of domain axes.
 public RectangleEdge getDomainAxisEdge() 
    Returns the domain axis edge. This is derived from the axis location and the plot orientation.
 public RectangleEdge getDomainAxisEdge(int index) 
    Returns the edge for a domain axis.
 public CategoryAxis getDomainAxisForDataset(int index) 
 public int getDomainAxisIndex(CategoryAxis axis) 
    Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.
 public AxisLocation getDomainAxisLocation() 
    Returns the domain axis location for the primary domain axis.
 public AxisLocation getDomainAxisLocation(int index) 
    Returns the location for a domain axis.
 public Paint getDomainGridlinePaint() 
    Returns the paint used to draw grid-lines against the domain axis.
 public CategoryAnchor getDomainGridlinePosition() 
    Returns the position used for the domain gridlines.
 public Stroke getDomainGridlineStroke() 
    Returns the stroke used to draw grid-lines against the domain axis.
 public Collection getDomainMarkers(Layer layer) 
    Returns the list of domain markers (read only) for the specified layer.
 public Collection getDomainMarkers(int index,
    Layer layer) 
    Returns a collection of domain markers for a particular renderer and layer.
 public boolean getDrawSharedDomainAxis() 
    Returns the flag that controls whether or not the shared domain axis is drawn for each subplot.
 public AxisSpace getFixedDomainAxisSpace() 
    Returns the fixed domain axis space.
 public LegendItemCollection getFixedLegendItems() 
    Returns the fixed legend items, if any.
 public AxisSpace getFixedRangeAxisSpace() 
    Returns the fixed range axis space.
 public int getIndexOf(CategoryItemRenderer renderer) 
    Returns the index of the specified renderer, or -1 if the renderer is not assigned to this plot.
 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.
 public PlotOrientation getOrientation() 
    Returns the orientation of the plot.
 public String getPlotType() 
    Returns a string describing the type of plot.
 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).
 public ValueAxis getRangeAxis(int index) 
    Returns a range axis.
 public int getRangeAxisCount() 
    Returns the number of range axes.
 public RectangleEdge getRangeAxisEdge() 
    Returns the edge where the primary range axis is located.
 public RectangleEdge getRangeAxisEdge(int index) 
    Returns the edge for a range axis.
 public ValueAxis getRangeAxisForDataset(int index) 
 public int getRangeAxisIndex(ValueAxis axis) 
    Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.
 public AxisLocation getRangeAxisLocation() 
    Returns the range axis location.
 public AxisLocation getRangeAxisLocation(int index) 
    Returns the location for a range axis.
 public Paint getRangeCrosshairPaint() 
    Returns the paint used to draw the range crosshair.
 public Stroke getRangeCrosshairStroke() 
    Returns the pen-style (Stroke) used to draw the crosshair (if visible).
 public double getRangeCrosshairValue() 
    Returns the range crosshair value.
 public Paint getRangeGridlinePaint() 
    Returns the paint used to draw the grid-lines against the range axis.
 public Stroke getRangeGridlineStroke() 
    Returns the stroke used to draw the grid-lines against the range axis.
 public Collection getRangeMarkers(Layer layer) 
    Returns the list of range markers (read only) for the specified layer.
 public Collection getRangeMarkers(int index,
    Layer layer) 
    Returns a collection of range markers for a particular renderer and layer.
 public CategoryItemRenderer getRenderer() 
    Returns a reference to the renderer for the plot.
 public CategoryItemRenderer getRenderer(int index) 
    Returns the renderer at the given index.
 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.
 public SortOrder getRowRenderingOrder() 
    Returns the order in which the rows should be rendered. The default value is SortOrder.ASCENDING.
 public int getWeight() 
    Returns the weight for this plot when it is used as a subplot within a combined plot.
 public  void handleClick(int x,
    int y,
    PlotRenderingInfo info) 
    Handles a 'click' on the plot by updating the anchor value.
 public boolean isDomainGridlinesVisible() 
    Returns the flag that controls whether the domain grid-lines are visible.
 public boolean isDomainZoomable() 
    Returns false to indicate that the domain axes are not zoomable.
 public boolean isRangeCrosshairLockedOnData() 
    Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
 public boolean isRangeCrosshairVisible() 
    Returns a flag indicating whether or not the range crosshair is visible.
 public boolean isRangeGridlinesVisible() 
    Returns the flag that controls whether the range grid-lines are visible.
 public boolean isRangeZoomable() 
    Returns true to indicate that the range axes are zoomable.
 public  void mapDatasetToDomainAxis(int index,
    int axisIndex) 
    Maps a dataset to a particular domain axis.
 public  void mapDatasetToRangeAxis(int index,
    int axisIndex) 
    Maps a dataset to a particular range axis.
 public boolean removeAnnotation(CategoryAnnotation annotation) 
    Removes an annotation from the plot and sends a PlotChangeEvent to all registered listeners.
 public boolean removeAnnotation(CategoryAnnotation annotation,
    boolean notify) 
    Removes an annotation from the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
 public boolean removeDomainMarker(Marker marker) 
    Removes a marker for the domain axis and sends a PlotChangeEvent to all registered listeners.
 public boolean removeDomainMarker(Marker marker,
    Layer layer) 
    Removes a marker for the domain axis in the specified layer and sends a PlotChangeEvent to all registered listeners.
 public boolean removeDomainMarker(int index,