Class PolarChartPanel

All Implemented Interfaces:
ActionListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Printable, Serializable, EventListener, Accessible, ChartChangeListener, ChartProgressListener, OverlayChangeListener

public class PolarChartPanel extends ChartPanel
PolarChartPanel is the top level object for using the PolarPlot. Since this class has a JPanel in the inheritance hierarchy, one uses this class to integrate the Polar plot into their application.

The main modification to ChartPanel is the popup menu. It removes ChartPanel's versions of:

  • Zoom In
  • Zoom Out
  • Auto Range
and replaces them with versions more appropriate for PolarPlot.
See Also:
  • Field Details

    • POLAR_ZOOM_IN_ACTION_COMMAND

      private static final String POLAR_ZOOM_IN_ACTION_COMMAND
      Zoom in command string.
      See Also:
    • POLAR_ZOOM_OUT_ACTION_COMMAND

      private static final String POLAR_ZOOM_OUT_ACTION_COMMAND
      Zoom out command string.
      See Also:
    • POLAR_AUTO_RANGE_ACTION_COMMAND

      private static final String POLAR_AUTO_RANGE_ACTION_COMMAND
      Auto range command string.
      See Also:
  • Constructor Details

    • PolarChartPanel

      public PolarChartPanel(JFreeChart chart)
      Constructs a JFreeChart panel.
      Parameters:
      chart - the chart.
    • PolarChartPanel

      public PolarChartPanel(JFreeChart chart, boolean useBuffer)
      Creates a new panel.
      Parameters:
      chart - the chart.
      useBuffer - buffered?
  • Method Details

    • setChart

      public void setChart(JFreeChart chart)
      Sets the chart that is displayed in the panel.
      Overrides:
      setChart in class ChartPanel
      Parameters:
      chart - The chart.
    • createPopupMenu

      protected JPopupMenu createPopupMenu(boolean properties, boolean save, boolean print, boolean zoom)
      Creates a popup menu for the panel.
      Overrides:
      createPopupMenu in class ChartPanel
      Parameters:
      properties - include a menu item for the chart property editor.
      save - include a menu item for saving the chart.
      print - include a menu item for printing the chart.
      zoom - include menu items for zooming.
      Returns:
      The popup menu.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handles action events generated by the popup menu.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class ChartPanel
      Parameters:
      event - the event.
    • checkChart

      private void checkChart(JFreeChart chart)
      Test that the chart is using an xy plot with time as the domain axis.
      Parameters:
      chart - the chart.
    • getPopupMenuItem

      private int getPopupMenuItem(JPopupMenu menu, String text)
      Returns the index of an item in a popup menu.
      Parameters:
      menu - the menu.
      text - the label.
      Returns:
      The item index.