Class JaxoOptionsPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, JaxoObjectEditPanel

public class JaxoOptionsPanel extends JPanel implements JaxoObjectEditPanel
A parent class for all option panels.
Since:
2.0
See Also:
  • Constructor Details

    • JaxoOptionsPanel

      public JaxoOptionsPanel(JaxoObject ob)
      Constructor: initializes the panel.
      Parameters:
      ob - The object to be edited by this panel.
  • Method Details

    • getRotationAngleDefaults

      public static List<Integer> getRotationAngleDefaults()
      List of numbers of default rotation angles to display to the user.
      Returns:
      List
    • addChangeListener

      public void addChangeListener(ChangeListener l)
      ChangeEvents will be fired everytime the object that is being edited changes.
      Specified by:
      addChangeListener in interface JaxoObjectEditPanel
      Parameters:
      l - The listener to add.
    • removeChangeListener

      public void removeChangeListener(ChangeListener l)
      Removes a change listener.
      Parameters:
      l - The listener to remove.
    • fireStateChanged

      protected void fireStateChanged()
      Notifies all listeners of a state change.
    • setObject

      public final void setObject(JaxoObject value)
      Set the object that is being edited.
      Parameters:
      value - the object that is being edited.
    • getObject

      public final JaxoObject getObject()
      The object that is being edited.
      Returns:
      the currently edited object.
    • add3PointsPanel

      public final void add3PointsPanel(Point[] points, int gridx, int gridy)
      Adds a 3points panel at the given position.
      Specified by:
      add3PointsPanel in interface JaxoObjectEditPanel
      Parameters:
      points - The points of the arc object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • add3PointsPanel

      public final void add3PointsPanel(Point[] points, int gridx, int gridy, int gridwidth)
      Adds a 3points panel at the given position with the given width.
      Specified by:
      add3PointsPanel in interface JaxoObjectEditPanel
      Parameters:
      points - The points of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
      gridwidth - The width of the subpanel.
    • add4PointsPanel

      public final void add4PointsPanel(Point[] points, int gridx, int gridy)
      Adds a 4points panel at the given position.
      Specified by:
      add4PointsPanel in interface JaxoObjectEditPanel
      Parameters:
      points - The points of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • add4PointsPanel

      public final void add4PointsPanel(Point[] points, int gridx, int gridy, int gridwidth)
      Adds a 4points panel at the given position with the given width.
      Specified by:
      add4PointsPanel in interface JaxoObjectEditPanel
      Parameters:
      points - The points of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
      gridwidth - The width of the subpanel.
    • addPositionPanel

      public final void addPositionPanel(int x, int y, int gridx, int gridy)
      Adds a position edit panel at the given position with the given width.
      Specified by:
      addPositionPanel in interface JaxoObjectEditPanel
      Parameters:
      x - The x position of the object to be edited by this panel.
      y - The y position of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • add2PointsPanel

      public final void add2PointsPanel(Point[] points, int gridx, int gridy)
      Adds a 2PointEdit panel at the given position with the given width.
      Specified by:
      add2PointsPanel in interface JaxoObjectEditPanel
      Parameters:
      points - The points of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addXYRPanel

      public final void addXYRPanel(int x, int y, int r, int gridx, int gridy)
      Adds a XYR panel at the given position.
      Specified by:
      addXYRPanel in interface JaxoObjectEditPanel
      Parameters:
      x - The x position of the object to be edited by this panel.
      y - The r position of the object to be edited by this panel.
      r - The radius of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addCenterSizePanel

      public final void addCenterSizePanel(int x, int y, int w, int h, int gridx, int gridy)
      Adds a position/size panel at the given position.
      Specified by:
      addCenterSizePanel in interface JaxoObjectEditPanel
      Parameters:
      x - The x position of the object to be edited by this panel.
      y - The y position of the object to be edited by this panel.
      w - The width of the object to be edited by this panel.
      h - The height of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addDashPanel

      public final void addDashPanel(float dash, int gridx, int gridy)
      Adds a dash panel for an arc object at the given position.
      Specified by:
      addDashPanel in interface JaxoObjectEditPanel
      Parameters:
      dash - The dash sizie of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addStrokePanel

      public final void addStrokePanel(float width, int gridx, int gridy)
      Adds a stroke panel for an arc object at the given position.
      Specified by:
      addStrokePanel in interface JaxoObjectEditPanel
      Parameters:
      width - The the stroke width of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addReScalePanel

      public final void addReScalePanel(int gridx, int gridy)
      Adds a scale panel for an object at the given position.
      Specified by:
      addReScalePanel in interface JaxoObjectEditPanel
      Parameters:
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addWigglePanel

      public final void addWigglePanel(int amp, int wiggles, int gridx, int gridy)
      Adds a wiggle panel for an object at the given position.
      Specified by:
      addWigglePanel in interface JaxoObjectEditPanel
      Parameters:
      amp - The oamplitude of the bject to be edited by this panel.
      wiggles - The wiggles of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addWigglePanel

      public final void addWigglePanel(int amp, int gridx, int gridy)
      Adds a wiggle panel for a group at the given position.
      Specified by:
      addWigglePanel in interface JaxoObjectEditPanel
      Parameters:
      amp - The amplitude of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addSymmPanel

      public final void addSymmPanel(boolean symm, int gridx, int gridy)
      Adds a symmetry panel for a photon line at the given position.
      Specified by:
      addSymmPanel in interface JaxoObjectEditPanel
      Parameters:
      symm - The symmetry of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addStretchingPanel

      public final void addStretchingPanel(boolean noFreqStretching, int gridx, int gridy)
      Adds a stretching panel for a photon bezier at the given position.
      Specified by:
      addStretchingPanel in interface JaxoObjectEditPanel
      Parameters:
      noFreqStretching - The stretching parameter of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addRotationPanel

      public final void addRotationPanel(int angle, int gridx, int gridy)
      Adds a rotation panel for a vertex at the given position.
      Specified by:
      addRotationPanel in interface JaxoObjectEditPanel
      Parameters:
      angle - The rotation angle of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addArrowPanel

      public final void addArrowPanel(boolean arrow, boolean flip, float oldPosition, int gridx, int gridy)
      Adds an arrow panel for an object at the given position.
      Specified by:
      addArrowPanel in interface JaxoObjectEditPanel
      Parameters:
      arrow - The arrow of the object to be edited by this panel.
      flip - The flip of the arrow.
      oldPosition - The old position of the Arrow
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addArrowOptionsEditPanel

      public final void addArrowOptionsEditPanel(JaxoArrow arrow, int gridx, int gridy)
      Adds an edit panel for an arrow at the given position. If the arrow does not provide an edit panel, ie if JaxoArrow.getEditPanel() returns null, then nothing happens.
      Specified by:
      addArrowOptionsEditPanel in interface JaxoObjectEditPanel
      Parameters:
      arrow - The arrow to be edited.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addDoubleLinePanel

      public final void addDoubleLinePanel(boolean dLine, float dlSep, int gridx, int gridy)
      Adds a double line panel for an object at the given position.
      Specified by:
      addDoubleLinePanel in interface JaxoObjectEditPanel
      Parameters:
      dLine - The doubleLine of the object to be edited by this panel.
      dlSep - The double line separation of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addLineColorPanel

      public final void addLineColorPanel(Color color, int gridx, int gridy)
      Adds a line color panel at the given position.
      Specified by:
      addLineColorPanel in interface JaxoObjectEditPanel
      Parameters:
      color - The color of the object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addFillLineColorPanels

      public final void addFillLineColorPanels(Color color, Color fillColor, boolean isFilled, int fillX, int fillY, int lineX, int lineY)
      Adds a fill and a line color panel at the given positions. The line panel will be disabled (dynamically) based on the fill color/grayscale.
      Specified by:
      addFillLineColorPanels in interface JaxoObjectEditPanel
      Parameters:
      color - The color of the object to be edited by this panel.
      fillColor - The fill color of the object.
      isFilled - Whether the object is filled.
      fillX - The x position of the fill subpanel.
      fillY - The y position of the fill subpanel.
      lineX - The x position of the line subpanel.
      lineY - The y position of the line subpanel.
    • addColorPanel

      public final void addColorPanel(Color color, int type, int gridx, int gridy)
      Adds a color panel at the given position.
      Specified by:
      addColorPanel in interface JaxoObjectEditPanel
      Parameters:
      color - The color of the object to be edited by this panel.
      type - The color mode. Should be one of JaxoObjectEditPanel.TYPE_COLOR, JaxoObjectEditPanel.TYPE_LINE_COLOR or JaxoObjectEditPanel.TYPE_FILL_COLOR.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addTextPanel

      public final void addTextPanel(String text, int gridx, int gridy)
      Adds a text edit panel at the given position.
      Specified by:
      addTextPanel in interface JaxoObjectEditPanel
      Parameters:
      text - The text object to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addPSFontPanel

      public final void addPSFontPanel(Font font, int gridx, int gridy, int gridwidth)
      Adds a postscript text font edit panel at the given position.
      Specified by:
      addPSFontPanel in interface JaxoObjectEditPanel
      Parameters:
      font - The font of the text to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
      gridwidth - The width of the subpanel.
    • addLatexAlignPanel

      public final void addLatexAlignPanel(int allign, int gridx, int gridy)
      Adds a latex align edit panel at the given position.
      Specified by:
      addLatexAlignPanel in interface JaxoObjectEditPanel
      Parameters:
      allign - The align property of the text to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • addLatexFontSizePanel

      public final void addLatexFontSizePanel(int size, int gridx, int gridy)
      Adds a latex font size edit panel at the given position.
      Specified by:
      addLatexFontSizePanel in interface JaxoObjectEditPanel
      Parameters:
      size - The text size of the text to be edited by this panel.
      gridx - The x position of the subpanel.
      gridy - The y position of the subpanel.
    • show

      public final void show(Component parent, Location l)
      Display the EditPanel for the current object.
      Specified by:
      show in interface JaxoObjectEditPanel
      Parameters:
      parent - The parent component for the edit panel window
      l - The location for for the edit panel window
    • hasChanged

      public boolean hasChanged()
      Determines wether the object has been modified.
      Specified by:
      hasChanged in interface JaxoObjectEditPanel
      Returns:
      True if the object has been modified.
    • setTitleAndIcon

      public void setTitleAndIcon(String newTitle, String newIcon)
      Set title (message key) and icon (filename) that are displayed in the dialog.
      Specified by:
      setTitleAndIcon in interface JaxoObjectEditPanel
      Parameters:
      newTitle - the title.
      newIcon - the icon.
    • resetObject

      protected void resetObject()
      Reset 'object' (and GUI) to initial value.
    • showDialog

      protected final void showDialog(Component parent, Location l)
      Show a dialog for this panel. The current implementation blocks until the dialog is closed again.
      Parameters:
      parent - the parent component.
      l - the location.