Class SplotMenus

java.lang.Object
cnuphys.splot.plot.SplotMenus
All Implemented Interfaces:
ActionListener, EventListener

public class SplotMenus extends Object implements ActionListener
  • Field Details

  • Constructor Details

    • SplotMenus

      public SplotMenus(PlotCanvas canvas, JMenuBar menuBar, boolean addQuit)
      Create a set of menus and items for sPlot
      Parameters:
      canvas - the plot canvas being controlled
      menuBar - the menu bar
      addQuit - if true include a quit item
    • SplotMenus

      public SplotMenus(PlotCanvas canvas, JPopupMenu popup, boolean addQuit)
      Create a set of menus and items for sPlot
      Parameters:
      canvas - the plot canvas being controlled
      popup - a popup to hold the menus
      addQuit - if true include a quit item
  • Method Details

    • makeFileMenu

      protected void makeFileMenu(Container container, boolean addQuit)
    • makeEditMenu

      protected void makeEditMenu(PlotCanvas canvas, Container container)
    • addMenuItem

      protected JMenuItem addMenuItem(String label, char accelChar, JMenu menu)
      Convenience routine for adding a menu item.
      Parameters:
      label - the menu label.
      accelChar - the accelerator character.
      menu - the menu to add the item to.
    • addMenuCheckBox

      protected JCheckBoxMenuItem addMenuCheckBox(String label, JMenu menu, boolean selected)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • getPlotCanvas

      public PlotCanvas getPlotCanvas()
      Get the underlying plot canvas
      Returns:
      the plot canvas
    • getFileMenu

      public JMenu getFileMenu()
      Get the file menu
      Returns:
      the file menu
    • getEditMenu

      public JMenu getEditMenu()
      Get the edit menu
      Returns:
      the edit menu
    • getQuitItem

      public JMenuItem getQuitItem()
      Get the quit item (might be null)
      Returns:
      the quit item
    • getPreferencesItem

      public JMenuItem getPreferencesItem()
      Get the preferences item
      Returns:
      the preferences item
    • getClearItem

      public JMenuItem getClearItem()
      Get the clear (canvas) item
      Returns:
      the clear item
    • getCurveItem

      public JMenuItem getCurveItem()
      Get the curve (editor) item
      Returns:
      the curve editor item