Class JaxoPArc

All Implemented Interfaces:
Shape, PropertyChangeListener, Serializable, Cloneable, EventListener, JaxoSymmetricObject, JaxoWiggleObject

public class JaxoPArc extends JaxoArcObject implements JaxoWiggleObject, JaxoSymmetricObject
A photon arc.
Since:
2.0
See Also:
  • Constructor Details

    • JaxoPArc

      public JaxoPArc()
  • Method Details

    • isSymmetric

      public final boolean isSymmetric()
      Returns the symmetric property of this JaxoPArc. Determines whether the wiggles of this photon arc start and end in the same direction.
      Specified by:
      isSymmetric in interface JaxoSymmetricObject
      Returns:
      The symmetric property of this JaxoPArc.
    • setSymmetric

      public final void setSymmetric(boolean newSymm)
      Sets the symmetric property of this arc object.
      Specified by:
      setSymmetric in interface JaxoSymmetricObject
      Parameters:
      newSymm - The symmetric property of this arc object.
    • copyFrom

      public void copyFrom(JaxoPArc temp)
      Sets all parameters from the given object to the current one.
      Parameters:
      temp - The object to copy from.
    • setState

      public void setState(JaxoObject o)
      Restore state to the values of 'o'. The object 'o' must be an object of the same "type" obtained by JaxoObject.copy().
      Overrides:
      setState in class JaxoArcObject
      Parameters:
      o - the object to copy from.
    • isCopy

      public final boolean isCopy(JaxoObject comp)
      Determines if this JaxoObject is a copy of the specified one.
      Overrides:
      isCopy in class JaxoArcObject
      Parameters:
      comp - The JaxoObject to compare against.
      Returns:
      True if the JaxoObjects are identical.
    • paint

      public final void paint(JaxoGraphics2D g2)
      The method that paints the JaxoObject.
      Specified by:
      paint in class JaxoObject
      Parameters:
      g2 - The graphics context where the object has to be painted.
    • getBounds

      public Rectangle getBounds()
      Returns the bounding box of this object.
      Specified by:
      getBounds in interface Shape
      Returns:
      the bounding box of this object.
    • latexCommand

      public final String latexCommand(float scale, Dimension canvasDim)
      The LaTeX command that is necessary to draw the given JaxoObject using the axodraw.sty package.
      Specified by:
      latexCommand in class JaxoObject
      Parameters:
      scale - A scale factor to translate Java coordinates to LaTeX coordinates.
      canvasDim - The current dimension of the canvas.
      Returns:
      The corresponding axodraw LaTeX command.
    • getFrequency

      public float getFrequency()
      Gets the current frequency (number of wiggles per unit length) of this WiggleObject.
      Specified by:
      getFrequency in interface JaxoWiggleObject
      Returns:
      The frequency.
    • setWigglesFromFrequency

      public void setWigglesFromFrequency(float frequency)
      Sets the frequency to the given value and derives the number of wiggles from it.
      Specified by:
      setWigglesFromFrequency in interface JaxoWiggleObject
      Parameters:
      frequency - The frequency to set.
    • setWigglesFromFrequency

      public void setWigglesFromFrequency()
      Sets the number of wiggles from the current frequency.
      Specified by:
      setWigglesFromFrequency in interface JaxoWiggleObject
    • setFrequencyFromWiggles

      public void setFrequencyFromWiggles(int wiggles)
      Sets the number of wiggles to the given value and derives the frequency from it.
      Specified by:
      setFrequencyFromWiggles in interface JaxoWiggleObject
      Parameters:
      wiggles - The number of wiggles to set.
    • setPreferences

      public void setPreferences()
      Applies default values to this JaxoObject. All fields except location points are initialized with values taken from the preferences.
      Overrides:
      setPreferences in class JaxoParticleObject
    • prepareEditPanel

      public void prepareEditPanel(JaxoObjectEditPanel editPanel)
      Initializes the given editPanel to edit properties of this JaxoObject.
      Specified by:
      prepareEditPanel in class JaxoObject
      Parameters:
      editPanel - the panel to prepare.