jhplot.jadraw
Class JaLoopObject

java.lang.Object
  extended by jhplot.jadraw.JaObject
      extended by jhplot.jadraw.JaLoopObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JaFLoop, JaGlLoop, JaGLoop, JaPLoop, JaSLoop

public abstract class JaLoopObject
extends JaObject

A general loop object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jhplot.jadraw.JaObject
BB_MAX_X, BB_MAX_Y, BB_MIN_X, BB_MIN_Y, COPY, D_FORMAT, INIT_SIZE, LENGTH, MOVE, RESIZE, SELECT_BODY, SELECT_LL, SELECT_LR, SELECT_NONE, SELECT_P1, SELECT_P2, SELECT_P3, SELECT_UL, SELECT_UR
 
Constructor Summary
JaLoopObject()
          Constructor: sets the width, height, relative width and height, to a default value of JaObject.INIT_SIZE.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Specified by:
isCopy in class JaObject
Parameters:
comp - A JaLoopObject to compare with.
Returns:
True if the objects are equal, false otherwise.

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 class JaObject
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 class JaObject
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 class JaObject
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 class JaObject
Parameters:
orx - The x-coordinate of the fixed point
ory - The y-coordinate of the fixed point
scale - The scale parameter

editPanel

public final boolean editPanel()
Brings up the edit panel that allows to change the parameters of this object.

Specified by:
editPanel in class JaObject
Returns:
True if the editing actually changed the object, false if the object has not been changed.

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 class JaObject
Returns:
The corresponding LaTeX command.


jHepWork 2.8 (©) S.Chekanov