Class JaxoParticleObject
java.lang.Object
net.sf.jaxodraw.object.JaxoObject
net.sf.jaxodraw.object.JaxoExtendedObject
net.sf.jaxodraw.object.JaxoParticleObject
- All Implemented Interfaces:
Shape, PropertyChangeListener, Serializable, Cloneable, EventListener
- Direct Known Subclasses:
Jaxo3PointObject, JaxoLineObject, JaxoLoopObject
The mother of all particle objects (arcs, lines and loops).
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatDefault dash for ghost objects.static final floatDefault frequency for gluon objects.static final floatDefault frequency for photon objects.static final floatDefault dash for scalar objects.Fields inherited from class JaxoExtendedObject
SELECT_DX, SELECT_DY, SELECT_P2Fields inherited from class JaxoObject
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract JaxoArrow.CoordinatesReturns the coordinates of the arrow of the current object.final booleanarrowPositionIs(float comp) Compares the arrowPosition of this JaxoParticleObject to the given float, taking into account a 0.1% error margin.copy()Returns an exact copy of the given JaxoObject.voidcopyFrom(JaxoParticleObject temp) Sets all parameters from the given object to the current one.final booleandashIs(float comp) Compares the dash of this JaxoParticleObject to the given float, taking into account a 0.1% error margin.final booleandlSepIs(float comp) Compares the dlSeparation of this JaxoParticleObject to the given float, taking into account a 0.1% error margin.final intgetAmp()Returns the amp property of this particle object.final JaxoArrowgetArrow()Returns the arrow of this particle object.final floatReturns the arrowPosition property of this particle object.final floatgetDash()Returns the dash property of this particle object.final floatReturns the double line separation of this object.final intReturns the wiggles property of this particle object.booleanisCopy(JaxoObject comp) Determines if this JaxoObject is a copy of the specified one.final booleanReturns the double line property.final booleanisFlip()Returns the flip property of this particle object.final booleanDetermines whether the arrow property of this particle object is set or not.protected voidPaints an arrow on this object.final voidsetAmp(int newAmp) Sets the amp property of this particle object.final voidSets the dash property of this particle object.final voidsetArrowPosition(float newArrowPosition) Sets the arrowPosition property of this particle object.final voidsetDash(float newDash) Sets the dash property of this particle object.final voidsetDLSeparation(float dlsep) Sets the double line separation property.final voidsetDoubleLine(boolean dline) Sets the double line property.final voidsetFlip(boolean newFlip) Sets the flip property of this particle object.final voidsetPaintArrow(boolean arr) Sets the arrow property of this particle object.voidApplies default values to this JaxoObject.voidRestore state to the values of 'o'.final voidsetWiggles(int newWiggles) Sets the wiggles property of this particle object.Methods inherited from class JaxoExtendedObject
canBeSelected, copyFrom, getGrabbedHandle, getHeight, getPointCount, getRadius, getRelh, getRelSize, getRelw, getSize, getStroke, getStrokeWidth, getWidth, getX, getX2, getY, getY2, latexWidth, moveBy, paintHandles, resetStroke, setLocation, setRadius, setRelativeHeight, setRelativeWidth, setRelWAndH, setStroke, setStrokeWidth, setX, setX2, setY, setY2, smallestDistanceTo, strokeIsMethods inherited from class JaxoObject
addPropertyChangeListener, contains, contains, contains, contains, copyFrom, firePropertyChange, getBounds2D, getBoundsWithHandles, getColor, getGeneralPath, getLaTexLocation, getName, getPathIterator, getPathIterator, getPoints, getX, getY, intersects, intersects, isAround, isMarked, latexCommand, paint, paintVisualAid, prepareEditPanel, propertyChange, removePropertyChangeListener, rescaleObject, setAsMarked, setColor, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setXPosition, setY, setYPosition
-
Field Details
-
PHOTON_FREQ
public static final float PHOTON_FREQDefault frequency for photon objects.- See Also:
-
GLUON_FREQ
public static final float GLUON_FREQDefault frequency for gluon objects.- See Also:
-
SCALAR_DASH
public static final float SCALAR_DASHDefault dash for scalar objects.- See Also:
-
GHOST_DASH
public static final float GHOST_DASHDefault dash for ghost objects.- See Also:
-
-
Constructor Details
-
JaxoParticleObject
public JaxoParticleObject()Constructor. Adds a default arrow as a PropertyChangeListener.
-
-
Method Details
-
copy
Returns an exact copy of the given JaxoObject. This implementation uses Object.clone(), so the only thing to do in subclasses is to recursively clone mutable object properties.- Overrides:
copyin classJaxoObject- Returns:
- The copy of the given JaxoObject.
-
getWiggles
public final int getWiggles()Returns the wiggles property of this particle object.- Returns:
- The wiggles property of this particle object.
-
setWiggles
public final void setWiggles(int newWiggles) Sets the wiggles property of this particle object.- Parameters:
newWiggles- The wiggles property of this particle object.
-
getDash
public final float getDash()Returns the dash property of this particle object.- Returns:
- The dash property of this particle object.
-
setDash
public final void setDash(float newDash) Sets the dash property of this particle object.- Parameters:
newDash- The dash property of this particle object.
-
getAmp
public final int getAmp()Returns the amp property of this particle object.- Returns:
- The amp property of this particle object.
-
setAmp
public final void setAmp(int newAmp) Sets the amp property of this particle object.- Parameters:
newAmp- The amp property of this particle object.
-
isPaintArrow
public final boolean isPaintArrow()Determines whether the arrow property of this particle object is set or not.- Returns:
- The arrow property of this particle object.
-
setPaintArrow
public final void setPaintArrow(boolean arr) Sets the arrow property of this particle object.- Parameters:
arr- The arrow property of this particle object.
-
isFlip
public final boolean isFlip()Returns the flip property of this particle object.- Returns:
- The flip property of this particle object.
-
setFlip
public final void setFlip(boolean newFlip) Sets the flip property of this particle object.- Parameters:
newFlip- The flip property of this particle object.
-
getArrowPosition
public final float getArrowPosition()Returns the arrowPosition property of this particle object.- Returns:
- The arrowPosition property of this particle object.
-
setArrowPosition
public final void setArrowPosition(float newArrowPosition) Sets the arrowPosition property of this particle object. Throws IllegalArgumentException if the parameter is not between 0 and 1.- Parameters:
newArrowPosition- The new arrowPosition property measured as a float number between 0 and 1.
-
setDoubleLine
public final void setDoubleLine(boolean dline) Sets the double line property.- Parameters:
dline- The double line boolean variable.
-
isDoubleLine
public final boolean isDoubleLine()Returns the double line property.- Returns:
- The double line boolean variable of this object.
-
setDLSeparation
public final void setDLSeparation(float dlsep) Sets the double line separation property.- Parameters:
dlsep- The double line separation to be set.
-
getDLSeparation
public final float getDLSeparation()Returns the double line separation of this object.- Returns:
- The double line separation.
-
getArrow
Returns the arrow of this particle object.- Returns:
- The arrow of this particle object.
-
setArrow
Sets the dash property of this particle object.- Parameters:
newArrow- The arrow of this particle object.
-
isCopy
Determines if this JaxoObject is a copy of the specified one.- Overrides:
isCopyin classJaxoExtendedObject- Parameters:
comp- The JaxoObject to compare against.- Returns:
- True if the JaxoObjects are identical.
-
copyFrom
Sets all parameters from the given object to the current one.- Parameters:
temp- The object to copy from.
-
setState
Restore state to the values of 'o'. The object 'o' must be an object of the same "type" obtained byJaxoObject.copy().- Overrides:
setStatein classJaxoExtendedObject- Parameters:
o- the object to copy from.
-
setPreferences
public void setPreferences()Applies default values to this JaxoObject. All fields except location points are initialized with values taken from thepreferences.- Overrides:
setPreferencesin classJaxoExtendedObject
-
dashIs
public final boolean dashIs(float comp) Compares the dash of this JaxoParticleObject to the given float, taking into account a 0.1% error margin.- Parameters:
comp- The float to compare to.- Returns:
- True, if the dash matches within 0.1%.
-
dlSepIs
public final boolean dlSepIs(float comp) Compares the dlSeparation of this JaxoParticleObject to the given float, taking into account a 0.1% error margin.- Parameters:
comp- The float to compare to.- Returns:
- True, if the dlSeparation matches within 0.1%.
-
arrowPositionIs
public final boolean arrowPositionIs(float comp) Compares the arrowPosition of this JaxoParticleObject to the given float, taking into account a 0.1% error margin.- Parameters:
comp- The float to compare to.- Returns:
- True, if the arrowPosition matches within 0.1%.
-
paintArrow
Paints an arrow on this object.- Parameters:
g2- The graphics context.
-
arrowCoordinates
Returns the coordinates of the arrow of the current object.- Returns:
- The coordinates of the arrow of the current object.
-