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

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

Direct Known Subclasses:
    CategoryPlot, RingPlot, WaferMapPlot, CombinedRangeCategoryPlot, MultiplePiePlot, ThermometerPlot, CombinedDomainXYPlot, CompassPlot, CombinedRangeXYPlot, SpiderWebPlot, XYPlot, MeterPlot, FastScatterPlot, PiePlot, CombinedDomainCategoryPlot, ContourPlot, CombinedXYPlot, PiePlot3D, DialPlot, CombinedCategoryPlot, PolarPlot

The base class for all plots in JFreeChart. The org.jfree.chart.JFreeChart class delegates the drawing of axes and data to the plot. This base class provides facilities common to most plot types.
Field Summary
public static final  Number ZERO    Useful constant representing zero. 
public static final  RectangleInsets DEFAULT_INSETS    The default insets. 
public static final  Stroke DEFAULT_OUTLINE_STROKE    The default outline stroke. 
public static final  Paint DEFAULT_OUTLINE_PAINT    The default outline color. 
public static final  float DEFAULT_FOREGROUND_ALPHA    The default foreground alpha transparency. 
public static final  float DEFAULT_BACKGROUND_ALPHA    The default background alpha transparency. 
public static final  Paint DEFAULT_BACKGROUND_PAINT    The default background color. 
public static final  int MINIMUM_WIDTH_TO_DRAW    The minimum width at which the plot should be drawn. 
public static final  int MINIMUM_HEIGHT_TO_DRAW    The minimum height at which the plot should be drawn. 
public static final  Shape DEFAULT_LEGEND_ITEM_BOX    A default box shape for legend items. 
public static final  Shape DEFAULT_LEGEND_ITEM_CIRCLE    A default circle shape for legend items. 
Constructor:
 protected Plot() 
Method from org.jfree.chart.plot.Plot Summary:
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.Plot Detail:
 public  void addChangeListener(PlotChangeListener listener) 
    Registers an object for notification of changes to the plot.
 public  void axisChanged(AxisChangeEvent event) 
    Receives notification of a change to one of the plot's axes.
 public Object clone() throws CloneNotSupportedException 
    Creates a clone of the plot.
 public  void datasetChanged(DatasetChangeEvent event) 
    Receives notification of a change to the plot's dataset.

    The plot reacts by passing on a plot change event to all registered listeners.

 abstract public  void draw(Graphics2D g2,
    Rectangle2D area,
    Point2D anchor,
    PlotState parentState,
    PlotRenderingInfo info)
    Draws the plot within the specified area. The anchor is a point on the chart that is specified externally (for instance, it may be the last point of the last mouse click performed by the user) - plots can use or ignore this value as they see fit.

    Subclasses need to provide an implementation of this method, obviously.
 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.

 public  void drawBackgroundImage(Graphics2D g2,
    Rectangle2D area) 
    Draws the background image (if there is one) aligned within the specified area.
 protected  void drawNoDataMessage(Graphics2D g2,
    Rectangle2D area) 
    Draws a message to state that there is no data to plot.
 public  void drawOutline(Graphics2D g2,
    Rectangle2D area) 
    Draws the plot outline. 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.
 public boolean equals(Object obj) 
    Tests this plot for equality with another object.
 protected  void fillBackground(Graphics2D g2,
    Rectangle2D area) 
    Fills the specified area with the background paint.
 protected  void fillBackground(Graphics2D g2,
    Rectangle2D area,
    PlotOrientation orientation) 
    Fills the specified area with the background paint. If the background paint is an instance of GradientPaint, the gradient will run in the direction suggested by the plot's orientation.
 protected  void fireChangeEvent() 
 public float getBackgroundAlpha() 
    Returns the alpha transparency of the plot area background.
 public Image getBackgroundImage() 
    Returns the background image that is used to fill the plot's background area.
 public int getBackgroundImageAlignment() 
    Returns the background image alignment. Alignment constants are defined in the org.jfree.ui.Align class in the JCommon class library.
 public float getBackgroundImageAlpha() 
    Returns the alpha transparency used to draw the background image. This is a value in the range 0.0f to 1.0f, where 0.0f is fully transparent and 1.0f is fully opaque.
 public Paint getBackgroundPaint() 
    Returns the background color of the plot area.
 public DatasetGroup getDatasetGroup() 
    Returns the dataset group for the plot (not currently used).
 public DrawingSupplier getDrawingSupplier() 
    Returns the drawing supplier for the plot.
 public float getForegroundAlpha() 
    Returns the alpha-transparency for the plot foreground.
 public RectangleInsets getInsets() 
    Returns the insets for the plot area.
 public LegendItemCollection getLegendItems() 
    Returns the legend items for the plot. By default, this method returns null. Subclasses should override to return a LegendItemCollection .
 public String getNoDataMessage() 
    Returns the string that is displayed when the dataset is empty or null.
 public Font getNoDataMessageFont() 
    Returns the font used to display the 'no data' message.
 public Paint getNoDataMessagePaint() 
    Returns the paint used to display the 'no data' message.
 public Paint getOutlinePaint() 
    Returns the color used to draw the outline of the plot area.
 public Stroke getOutlineStroke() 
    Returns the stroke used to outline the plot area.
 public Plot getParent() 
    Returns the parent plot (or null if this plot is not part of a combined plot).
 abstract public String getPlotType()
    Returns a short string describing the plot type.

    Note: this gets used in the chart property editing user interface, but there needs to be a better mechanism for identifying the plot type.

 protected double getRectX(double x,
    double w1,
    double w2,
    RectangleEdge edge) 
    Adjusts the supplied x-value.
 protected double getRectY(double y,
    double h1,
    double h2,
    RectangleEdge edge) 
    Adjusts the supplied y-value.
 public Plot getRootPlot() 
    Returns the root plot.
 public  void handleClick(int x,
    int y,
    PlotRenderingInfo info) 
    Handles a 'click' on the plot. Since the plot does not maintain any information about where it has been drawn, the plot rendering info is supplied as an argument so that the plot dimensions can be determined.
 public boolean isOutlineVisible() 
    Returns the flag that controls whether or not the plot outline is drawn. The default value is true. Note that for historical reasons, the plot's outline paint and stroke can take on null values, in which case the outline will not be drawn even if this flag is set to true.
 public boolean isSubplot() 
    Returns true if this plot is part of a combined plot structure (that is, #getParent() returns a non-null value), and false otherwise.
 public  void markerChanged(MarkerChangeEvent event) 
    Receives notification of a change to a marker that is assigned to the plot.
 public  void notifyListeners(PlotChangeEvent event) 
    Notifies all registered listeners that the plot has been modified.
 public  void removeChangeListener(PlotChangeListener listener) 
    Unregisters an object for notification of changes to the plot.
 public static RectangleEdge resolveDomainAxisLocation(AxisLocation location,
    PlotOrientation orientation) 
    Resolves a domain axis location for a given plot orientation.
 public static RectangleEdge resolveRangeAxisLocation(AxisLocation location,
    PlotOrientation orientation) 
    Resolves a range axis location for a given plot orientation.
 public  void setBackgroundAlpha(float alpha) 
    Sets the alpha transparency of the plot area background, and notifies registered listeners that the plot has been modified.
 public  void setBackgroundImage(Image image) 
    Sets the background image for the plot and sends a PlotChangeEvent to all registered listeners.
 public  void setBackgroundImageAlignment(int alignment) 
    Sets the alignment for the background image and sends a PlotChangeEvent to all registered listeners. Alignment options are defined by the org.jfree.ui.Align class in the JCommon class library.
 public  void setBackgroundImageAlpha(float alpha) 
    Sets the alpha transparency used when drawing the background image.
 public  void setBackgroundPaint(Paint paint) 
    Sets the background color of the plot area and sends a PlotChangeEvent to all registered listeners.
 protected  void setDatasetGroup(DatasetGroup group) 
    Sets the dataset group (not currently used).
 public  void setDrawingSupplier(DrawingSupplier supplier) 
    Sets the drawing supplier for the plot. The drawing supplier is responsible for supplying a limitless (possibly repeating) sequence of Paint, Stroke and Shape objects that the plot's renderer(s) can use to populate its (their) tables.
 public  void setForegroundAlpha(float alpha) 
    Sets the alpha-transparency for the plot and sends a PlotChangeEvent to all registered listeners.
 public  void setInsets(RectangleInsets insets) 
    Sets the insets for the plot and sends a PlotChangeEvent to all registered listeners.
 public  void setInsets(RectangleInsets insets,
    boolean notify) 
    Sets the insets for the plot and, if requested, and sends a PlotChangeEvent to all registered listeners.
 public  void setNoDataMessage(String message) 
    Sets the message that is displayed when the dataset is empty or null, and sends a PlotChangeEvent to all registered listeners.
 public  void setNoDataMessageFont(Font font) 
    Sets the font used to display the 'no data' message and sends a PlotChangeEvent to all registered listeners.
 public  void setNoDataMessagePaint(Paint paint) 
    Sets the paint used to display the 'no data' message and sends a PlotChangeEvent to all registered listeners.
 public  void setOutlinePaint(Paint paint) 
    Sets the paint used to draw the outline of the plot area and sends a PlotChangeEvent to all registered listeners. If you set this attribute to null, no outline will be drawn.
 public  void setOutlineStroke(Stroke stroke) 
    Sets the stroke used to outline the plot area and sends a PlotChangeEvent to all registered listeners. If you set this attribute to null, no outline will be drawn.
 public  void setOutlineVisible(boolean visible) 
    Sets the flag that controls whether or not the plot's outline is drawn, and sends a PlotChangeEvent to all registered listeners.
 public  void setParent(Plot parent) 
    Sets the parent plot. This method is intended for internal use, you shouldn't need to call it directly.
 public  void zoom(double percent) 
    Performs a zoom on the plot. Subclasses should override if zooming is appropriate for the type of plot.