jhplot.jadraw
Class JaLoopObject
- java.lang.Object
-
- jhplot.jadraw.JaObject
-
- jhplot.jadraw.JaLoopObject
-
-
Constructor Summary
Constructors Constructor and Description JaLoopObject()
Constructor: sets the width, height, relative width and height, to a default value of JaObject.INIT_SIZE.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description JaObject
copy(JaLoopObject temp)
Returns an exact copy of this JaxoLoop.void
drawHandles(org.freehep.graphics2d.VectorGraphics g2)
Draws the handles of this loop object.void
drawVisualAid(org.freehep.graphics2d.VectorGraphics g2)
Draws a visual aid during the dragging of a loop object, which is a red cross at the center.boolean
editPanel()
Brings up the edit panel that allows to change the parameters of this object.int
getAmp()
Returns the amp property of this loop object.boolean
getArrow()
Returns the arrow property of this loop object.float
getDash()
Returns the dash property of this loop object.float
getDLSeparation()
Returns the double line property.boolean
getDoubleLine()
Returns the double line property.boolean
getFlip()
Returns the flip property of this loop object.float
getFreq()
Returns the freq property of this loop object.int
getGrabbedHandle(int clickX, int clickY, int editmode)
Determines which handle the user has selected to move/resize/edit this loop.float
getStroke()
Returns the stroke property of this loop object.boolean
isArrow()
Determines whether the arrow property of this loop object is set or not.boolean
isCopy(JaObject comp)
Returns true if all serializable variables of this JaLoopObject and those of the specified one are equal.boolean
isFlip()
Determines whether the flip property of this loop object is set or not.java.lang.String
latexWidth()
The LaTeX command that sets the width for this Loop, using the axodraw.sty package.void
rescaleObject(int orx, int ory, float scale)
Rescales this JaxoLoop by the scale factor scale, keeping the point (orx, ory) fixed.void
setAmp(int newAmp)
Sets the amp property of this loop object.void
setArrow(boolean arr)
Sets the arrow property of this loop object.void
setDash(float newDash)
Sets the dash property of this loop object.void
setDLSeparation(float dlsep)
Sets the double line property.void
setDoubleLine(boolean dline)
Sets the double line property.void
setFlip(boolean newFlip)
Sets the flip property of this loop object.void
setFreq(float newFreq)
Sets the freq property of this loop object.void
setStroke(float newStroke)
Sets the stroke property of this loop object.-
Methods inherited from class jhplot.jadraw.JaObject
copy, getBoundingBox, getColor, getGeneralPath, getHeight, getRelh, getRelHndc, getRelHuser, getRelSize, getRelw, getRelWndc, getRelWuser, getSize, getWidth, getX, getXndc, getXuser, getY, getYndc, getYuser, isMarked, isUser, jaxoDraw, latexCommand, moveBy, scalePoint, setAsMarked, setBoundingBox, setColor, setLocation, setLocation, setRelh, setRelw, setRelWAndH, setRelWH, setSize, setX, setY, updateCoor, updateNDC
-
-
-
-
Constructor Detail
-
JaLoopObject
public JaLoopObject()
Constructor: sets the width, height, relative width and height, to a default value of JaObject.INIT_SIZE.
-
-
Method Detail
-
copy
public final JaObject copy(JaLoopObject temp)
Returns an exact copy of this JaxoLoop.- Parameters:
temp
- An instance of the loop to copy to (since this is an abstract class, we have to provide an instance of a sub-class).- Returns:
- A copy of this JaxoLoop.
-
isCopy
public boolean isCopy(JaObject comp)
Returns true if all serializable variables of this JaLoopObject and those of the specified one are equal.
-
getStroke
public final float getStroke()
Returns the stroke property of this loop object.- Returns:
- The stroke property of this loop object.
-
setStroke
public final void setStroke(float newStroke)
Sets the stroke property of this loop object.- Parameters:
newStroke
- The stroke property of this loop object.
-
getDash
public final float getDash()
Returns the dash property of this loop object.- Returns:
- The dash property of this loop object.
-
setDash
public final void setDash(float newDash)
Sets the dash property of this loop object.- Parameters:
newDash
- The dash property of this loop object.
-
getFreq
public final float getFreq()
Returns the freq property of this loop object.- Returns:
- The freq property of this loop object.
-
setFreq
public final void setFreq(float newFreq)
Sets the freq property of this loop object.- Parameters:
newFreq
- The freq property of this loop object.
-
getAmp
public final int getAmp()
Returns the amp property of this loop object.- Returns:
- The amp property of this loop object.
-
setAmp
public final void setAmp(int newAmp)
Sets the amp property of this loop object.- Parameters:
newAmp
- The amp property of this loop object.
-
isArrow
public final boolean isArrow()
Determines whether the arrow property of this loop object is set or not.- Returns:
- The arrow property of this loop object.
-
getArrow
public final boolean getArrow()
Returns the arrow property of this loop object.- Returns:
- The arrow property of this loop object.
-
setArrow
public final void setArrow(boolean arr)
Sets the arrow property of this loop object.- Parameters:
arr
- The arrow property of this loop object.
-
isFlip
public final boolean isFlip()
Determines whether the flip property of this loop object is set or not.- Returns:
- The flip property of this loop object.
-
getFlip
public final boolean getFlip()
Returns the flip property of this loop object.- Returns:
- The flip property of this loop object.
-
setFlip
public final void setFlip(boolean newFlip)
Sets the flip property of this loop object.- Parameters:
newFlip
- The flip property of this loop object.
-
setDoubleLine
public final void setDoubleLine(boolean dline)
Sets the double line property.- Parameters:
dline
- The double line boolean variable.
-
getDoubleLine
public final boolean getDoubleLine()
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 property.- Parameters:
dlsep
- The double line property.
-
getDLSeparation
public final float getDLSeparation()
Returns the double line property.- Returns:
- The double line boolean variable of this object.
-
drawVisualAid
public final void drawVisualAid(org.freehep.graphics2d.VectorGraphics g2)
Draws a visual aid during the dragging of a loop object, which is a red cross at the center.- Overrides:
drawVisualAid
in classJaObject
- Parameters:
g2
- The graphics context to draw to.
-
drawHandles
public final void drawHandles(org.freehep.graphics2d.VectorGraphics g2)
Draws the handles of this loop object.- Specified by:
drawHandles
in classJaObject
- Parameters:
g2
- The current graphics context.
-
getGrabbedHandle
public final int getGrabbedHandle(int clickX, int clickY, int editmode)
Determines which handle the user has selected to move/resize/edit this loop.- Specified by:
getGrabbedHandle
in classJaObject
- Parameters:
clickX
- The x coordinate where the mouse click has ocurred.clickY
- The y coordinate where the mouse click has ocurred.editmode
- The current edit mode.- Returns:
- One of the static variables SELECT_* defined in JaObject that specifies the handle which the user has clicked.
-
rescaleObject
public final void rescaleObject(int orx, int ory, float scale)
Rescales this JaxoLoop by the scale factor scale, keeping the point (orx, ory) fixed.- Specified by:
rescaleObject
in classJaObject
- Parameters:
orx
- The x-coordinate of the fixed pointory
- The y-coordinate of the fixed pointscale
- The scale parameter
-
editPanel
public final boolean editPanel()
Brings up the edit panel that allows to change the parameters of this object.
-
latexWidth
public final java.lang.String latexWidth()
The LaTeX command that sets the width for this Loop, using the axodraw.sty package.- Specified by:
latexWidth
in classJaObject
- Returns:
- The corresponding LaTeX command.
-
-
DMelt 3.0 © DataMelt by jWork.ORG