jhplot.jadraw
Class JaArcObject

java.lang.Object
  extended by jhplot.jadraw.JaObject
      extended by jhplot.jadraw.JaArcObject
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JaFArc, JaGArc, JaGlArc, JaPArc, JaSArc

public abstract class JaArcObject
extends JaObject

The mother of all arc objects.

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
JaArcObject()
          Constructor: sets the width, height, relative width and height, to a default value of JaObject.INIT_SIZE.
 
Method Summary
 void drawHandles(org.freehep.graphics2d.VectorGraphics g2)
          Draws the handles of this JaxoArc.
 void drawVisualAid(org.freehep.graphics2d.VectorGraphics g2)
          Draws a visual aid during the dragging of an arc object.
 boolean editPanel()
          Brings up the edit panel that allows to change the parameters of this object.
 int getAmp()
          Returns the amp property of this arc object.
 double[] getArcParameters()
           
 boolean getArrow()
          Returns the arrow property of this arc object.
 float getDash()
          Returns the dash property of this arc object.
 float getDLSeparation()
          Returns the double line separation of this object.
 boolean getDoubleLine()
          Returns the double line property.
 boolean getEnd()
          Returns the end property of this line object.
 boolean getFlip()
          Returns the flip property of this arc object.
 float getFreq()
          Returns the freq property of this arc object.
 int getGrabbedHandle(int clickX, int clickY, int editmode)
          Determines which handle the user has selected to move/resize/edit this arc.
 int getStangle()
          Returns the stangle property of this arc object.
 float getStroke()
          Returns the stroke property of this arc object.
 int getX1()
          Returns the x coordinate of the first click point of this arc.
 int getX2()
          Returns the x coordinate of the second click point of this arc.
 int getY1()
          Returns the y coordinate of the first click point of this arc.
 int getY2()
          Returns the y coordinate of the second click point of this arc.
 boolean isArrow()
          Determines whether the arrow property of this arc object is set or not.
 boolean isEnd()
          Determines whether the end property of this line object is set or not.
 boolean isFlip()
          Determines whether the flip property of this arc object is set or not.
 boolean isResizing()
          Returns the resizing property of this arc.
 String latexWidth()
          The LaTeX command that sets the width for this Arc, using the axodraw.sty package.
 void moveBy(int deltaX, int deltaY)
          Shifts the elements of the vector containing the three click points of this arc.
 void rescaleObject(int orx, int ory, float scale)
          Rescales this JaArcObject by the scale factor scale.
 void setAmp(int newAmp)
          Sets the amp property of this arc object.
 void setArcPts(int sx1, int sy1, int sx2, int sy2, int sx3, int sy3)
          Sets the points of this arc.
 void setArrow(boolean arr)
          Sets the arrow property of this arc object.
 void setDash(float newDash)
          Sets the dash property of this arc object.
 void setDLSeparation(float dlsep)
          Sets the double line separation property.
 void setDoubleLine(boolean dline)
          Sets the double line property.
 void setEnd(boolean mid)
          Sets the end property of this line object.
 void setFlip(boolean newFlip)
          Sets the flip property of this arc object.
 void setFreq(float newFreq)
          Sets the freq property of this arc object.
 void setIsResizing(boolean ir)
          Sets the resizing property of this arc.
 void setStangle(int newStangle)
          Sets the stangle property of this arc object.
 void setStroke(float newStroke)
          Sets the stroke property of this arc object.
 void setX1(int newx1)
          Sets the x coordinate of the first click point of this arc.
 void setX2(int newx2)
          Sets the x coordinate of the second click point of this arc.
 void setY1(int newy1)
          Sets the y coordinate of the first click point of this arc.
 void setY2(int newy2)
          Sets the y coordinate of the second click point of this arc.
 
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, isCopy, isMarked, isUser, jaxoDraw, latexCommand, 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

JaArcObject

public JaArcObject()
Constructor: sets the width, height, relative width and height, to a default value of JaObject.INIT_SIZE.

Method Detail

setIsResizing

public final void setIsResizing(boolean ir)
Sets the resizing property of this arc.

Parameters:
ir - True if this arc id being resized.

isResizing

public final boolean isResizing()
Returns the resizing property of this arc.

Returns:
True if this arc id being resized.

setX1

public final void setX1(int newx1)
Sets the x coordinate of the first click point of this arc.

Parameters:
newx1 - The x coordinate of the first click point of this arc.

getX1

public final int getX1()
Returns the x coordinate of the first click point of this arc.

Returns:
The x coordinate of the first click point of this arc.

setX2

public final void setX2(int newx2)
Sets the x coordinate of the second click point of this arc.

Parameters:
newx2 - The x coordinate of the second click point of this arc.

getX2

public final int getX2()
Returns the x coordinate of the second click point of this arc.

Returns:
The x coordinate of the second click point of this arc.

setY1

public final void setY1(int newy1)
Sets the y coordinate of the first click point of this arc.

Parameters:
newy1 - The y coordinate of the first click point of this arc.

getY1

public final int getY1()
Returns the y coordinate of the first click point of this arc.

Returns:
The y coordinate of the first click point of this arc.

setY2

public final void setY2(int newy2)
Sets the y coordinate of the second click point of this arc.

Parameters:
newy2 - The y coordinate of the second click point of this arc.

getY2

public final int getY2()
Returns the y coordinate of the second click point of this arc.

Returns:
The y coordinate of the second click point of this arc.

setArcPts

public final void setArcPts(int sx1,
                            int sy1,
                            int sx2,
                            int sy2,
                            int sx3,
                            int sy3)
Sets the points of this arc.

Parameters:
sx1 - The x coordinate of the first click point of this arc.
sy1 - The y coordinate of the first click point of this arc.
sx2 - The x coordinate of the second click point of this arc.
sy2 - The y coordinate of the second click point of this arc.
sx3 - The x coordinate of the third click point of this arc.
sy3 - The y coordinate of the third click point of this arc.

getStroke

public final float getStroke()
Returns the stroke property of this arc object.

Returns:
The stroke property of this arc object.

setStroke

public final void setStroke(float newStroke)
Sets the stroke property of this arc object.

Parameters:
newStroke - The stroke property of this arc object.

getDash

public final float getDash()
Returns the dash property of this arc object.

Returns:
The dash property of this arc object.

setDash

public final void setDash(float newDash)
Sets the dash property of this arc object.

Parameters:
newDash - The dash property of this arc object.

getFreq

public final float getFreq()
Returns the freq property of this arc object.

Returns:
The freq property of this arc object.

setFreq

public final void setFreq(float newFreq)
Sets the freq property of this arc object.

Parameters:
newFreq - The freq property of this arc object.

getAmp

public final int getAmp()
Returns the amp property of this arc object.

Returns:
The amp property of this arc object.

setAmp

public final void setAmp(int newAmp)
Sets the amp property of this arc object.

Parameters:
newAmp - The amp property of this arc object.

getStangle

public final int getStangle()
Returns the stangle property of this arc object.

Returns:
The stangle property of this arc object.

setStangle

public final void setStangle(int newStangle)
Sets the stangle property of this arc object.

Parameters:
newStangle - The stangle property of this arc object.

isArrow

public final boolean isArrow()
Determines whether the arrow property of this arc object is set or not.

Returns:
The arrow property of this arc object.

getArrow

public final boolean getArrow()
Returns the arrow property of this arc object.

Returns:
The arrow property of this arc object.

setArrow

public final void setArrow(boolean arr)
Sets the arrow property of this arc object.

Parameters:
arr - The arrow property of this arc object.

isEnd

public final boolean isEnd()
Determines whether the end property of this line object is set or not.

Returns:
The end property of this line object.

getEnd

public final boolean getEnd()
Returns the end property of this line object.

Returns:
The end property of this line object.

setEnd

public final void setEnd(boolean mid)
Sets the end property of this line object.

Parameters:
mid - The end property of this line object.

isFlip

public final boolean isFlip()
Determines whether the flip property of this arc object is set or not.

Returns:
The flip property of this arc object.

getFlip

public final boolean getFlip()
Returns the flip property of this arc object.

Returns:
The flip property of this arc object.

setFlip

public final void setFlip(boolean newFlip)
Sets the flip property of this arc object.

Parameters:
newFlip - The flip property of this arc 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 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.

drawVisualAid

public final void drawVisualAid(org.freehep.graphics2d.VectorGraphics g2)
Draws a visual aid during the dragging of an arc object.

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 JaxoArc.

Specified by:
drawHandles in class JaObject
Parameters:
g2 - The corresponding graphics context.

getArcParameters

public final double[] getArcParameters()

getGrabbedHandle

public final int getGrabbedHandle(int clickX,
                                  int clickY,
                                  int editmode)
Determines which handle the user has selected to move/resize/edit this arc.

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.

moveBy

public final void moveBy(int deltaX,
                         int deltaY)
Shifts the elements of the vector containing the three click points of this arc.

Overrides:
moveBy in class JaObject
Parameters:
deltaX - The x displacement.
deltaY - The y displacement.

rescaleObject

public final void rescaleObject(int orx,
                                int ory,
                                float scale)
Rescales this JaArcObject 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 String latexWidth()
The LaTeX command that sets the width for this Arc, using the axodraw.sty package.

Specified by:
latexWidth in class JaObject
Returns:
The corresponding LaTeX command.


jHepWork 3.0 ©