public class JaxoGroup extends JaxoExtendedObject
SELECT_DX, SELECT_DY, SELECT_P2
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1
Constructor and Description |
---|
JaxoGroup()
Constructor: creates a new empty vector and sets the dimensions
to a default value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeSelected(int handle,
int mode)
Determines if the object can be selected (moved, edited, etc)
from the given point in a given edit mode.
|
void |
clearGroup()
Removes all JaxoObjects from the Group.
|
boolean |
containsInstanceOf(java.lang.Class clazz)
Determines whether there are instances of the given Class in this group.
|
JaxoObject |
copy()
Returns an exact copy of this JaxoGroup.
|
void |
copyFrom(JaxoGroup temp)
Sets all parameters from the given object to the current one.
|
int |
getAmp()
Returns the groupAmp property of this group object.
|
java.awt.Rectangle |
getBounds()
Returns the bounding box of this object.
|
java.awt.Font |
getFont()
Returns the groupTextFont property of this text object.
|
int |
getGrabbedHandle(int clickX,
int clickY,
JaxoHandle h)
Determines which handle the user has selected to move/resize/edit
an object.
|
int |
getLatexTextSize()
Returns the groupTeXSize property of this group object.
|
JaxoList |
getObjectList()
Returns the JaxoObjects in this group.
|
boolean |
isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one.
|
java.lang.String |
latexCommand(float scale,
java.awt.Dimension canvasDim)
The latex command of this group (obsolete because every JaxoObject
has its own latex command).
|
java.lang.String |
latexWidth()
The latex command setting the width of this group
(obsolete because every JaxoObject has its own latexWidth).
|
void |
moveBy(int deltaX,
int deltaY)
Displaces the group.
|
void |
paint(JaxoGraphics2D g2)
The method that paints the JaxoObject.
|
void |
paintHandles(JaxoGraphics2D g2,
JaxoHandle h,
int editMode)
Paints the handles of this JaxoObject that allow
to move/resize/edit it.
|
void |
paintVisualAid(JaxoGraphics2D g2)
Paints a visual aid for the user during dragging
(moving or resizing) of this JaxoObject.
|
void |
prepareEditPanel(JaxoObjectEditPanel editPanel)
Initializes the given editPanel to edit properties of this JaxoObject.
|
void |
rescaleObject(int orx,
int ory,
float scale)
Rescale this JaxoObject by the scale factor scale,
keeping the point (orx, ory) fixed.
|
void |
setAmp(int amp)
Sets the groupAmp property of this group object.
|
void |
setColor(java.awt.Color newColor)
Sets the color for all objects in this group.If newColor !
|
void |
setFont(java.awt.Font textFont)
Sets the groupTextFont property of this group.
|
void |
setFontName(java.lang.String name)
Sets the font name of this group.
|
void |
setFontSize(int size)
Sets the font size of this group.
|
void |
setFontStyle(int style)
Sets the font style of this group.
|
void |
setLatexTextSize(int teXSize)
Sets the groupTeXSize property of this group object.
|
void |
setNewScale(float scale)
Rescales the group with the given scale factor,
leaving the first point fixed.
|
void |
setObjectList(JaxoList obList)
Sets the JaxoObjects of this group.
|
void |
setState(JaxoObject o)
Restore state to the values of 'o'.
|
void |
setStrokeWidth(float newStroke)
Sets the strokeWidth property of this group object.
|
int |
size()
Returns the number of JaxoObjects in this group.
|
float |
smallestDistanceTo(int px,
int py)
Determines the smallest distance of any of the handles
of this JaxoObject from the given point.
|
copyFrom, getHeight, getPointCount, getRadius, getRelh, getRelSize, getRelw, getSize, getStroke, getStrokeWidth, getWidth, getX, getX2, getY, getY2, resetStroke, setLocation, setPreferences, setRadius, setRelativeHeight, setRelativeWidth, setRelWAndH, setStroke, setX, setX2, setY, setY2, strokeIs
addPropertyChangeListener, contains, contains, contains, contains, copyFrom, firePropertyChange, getBounds2D, getBoundsWithHandles, getColor, getGeneralPath, getLaTexLocation, getName, getPathIterator, getPathIterator, getPoints, getX, getY, intersects, intersects, isAround, isMarked, propertyChange, removePropertyChangeListener, setAsMarked, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setXPosition, setY, setYPosition
public JaxoGroup()
public final JaxoObject copy()
copy
in class JaxoObject
public final boolean isCopy(JaxoObject comp)
isCopy
in class JaxoExtendedObject
comp
- The JaxoObject to compare against.public void copyFrom(JaxoGroup temp)
temp
- The object to copy from.public void setState(JaxoObject o)
JaxoObject.copy()
.setState
in class JaxoExtendedObject
o
- the object to copy from.public final int getGrabbedHandle(int clickX, int clickY, JaxoHandle h)
getGrabbedHandle
in class JaxoExtendedObject
clickX
- The x coordinate where the mouse click has ocurred.clickY
- The y coordinate where the mouse click has ocurred.h
- A handle object.public boolean canBeSelected(int handle, int mode)
canBeSelected
in class JaxoExtendedObject
handle
- One of the static variables SELECT_* defined for
this JaxoObject.mode
- The current edit mode.public final void paintHandles(JaxoGraphics2D g2, JaxoHandle h, int editMode)
paintHandles
in class JaxoExtendedObject
g2
- The corresponding graphics context.h
- A handle object to be used for painting.editMode
- The edit mode that the handles are being painted in.public final float smallestDistanceTo(int px, int py)
smallestDistanceTo
in class JaxoExtendedObject
px
- The x coordinate of the test point.py
- The y coordinate of the test point.public final void paintVisualAid(JaxoGraphics2D g2)
paintVisualAid
in class JaxoObject
g2
- The graphics context to paint the visual aid.public final void paint(JaxoGraphics2D g2)
paint
in class JaxoObject
g2
- The graphics context where the object has to be painted.public final void moveBy(int deltaX, int deltaY)
moveBy
in class JaxoExtendedObject
deltaX
- The displacement in x directiondeltaY
- The displacement in y directionpublic final java.lang.String latexCommand(float scale, java.awt.Dimension canvasDim)
latexCommand
in class JaxoObject
scale
- A scale factor to translate Java coordinates to
LaTeX coordinates.canvasDim
- The current dimension of the canvas.public final java.lang.String latexWidth()
latexWidth
in class JaxoExtendedObject
public java.awt.Rectangle getBounds()
public final void clearGroup()
public final JaxoList getObjectList()
public final void setObjectList(JaxoList obList)
obList
- A list containing all the JaxoObjects to be set
for this grouppublic final int size()
public final void rescaleObject(int orx, int ory, float scale)
rescaleObject
in class JaxoObject
orx
- The x-coordinate of the fixed point.ory
- The y-coordinate of the fixed point.scale
- The scale parameter.public final void setNewScale(float scale)
scale
- the scale factor.public final void setStrokeWidth(float newStroke)
setStrokeWidth
in class JaxoExtendedObject
newStroke
- The strokeWidth property of this group object.public final int getAmp()
public final void setAmp(int amp)
amp
- The groupAmp property of this group object.public final int getLatexTextSize()
public final void setLatexTextSize(int teXSize)
teXSize
- The groupTeXSize property of this group object.public final java.awt.Font getFont()
public final void setFont(java.awt.Font textFont)
textFont
- The groupTextFont property of this group object.public final void setFontName(java.lang.String name)
name
- the font name to set.public final void setFontStyle(int style)
style
- the font style to set.public final void setFontSize(int size)
size
- the font size to set.public final void setColor(java.awt.Color newColor)
setColor
in class JaxoObject
newColor
- The color to be set.public final boolean containsInstanceOf(java.lang.Class clazz)
clazz
- a Class to look for.public void prepareEditPanel(JaxoObjectEditPanel editPanel)
prepareEditPanel
in class JaxoObject
editPanel
- the panel to prepare.Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.