public class GLineGroup extends GObject implements Iterable<GPoint>
Constructor and Description |
---|
GLineGroup()
Creates a new line group that does not contain any points.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double x,
double y)
Adds a point with the given coordinates to this line group.
|
void |
add(GPoint point)
Adds the given point to this line group.
|
void |
clear()
Removes all points from this line group.
|
boolean |
contains(double x,
double y)
Returns true if any of the line segments in this line group touch the given point.
|
GRectangle |
getBounds()
Returns a bounding rectangle that tightly contains this line group.
|
boolean |
isEmpty()
Returns true if there are no points in this line group.
|
Iterator<GPoint> |
iterator()
Returns an Iterator for examining the points in this line group.
|
protected void |
paint2d(Graphics2D g)
Paints the group of lines on the screen.
|
String |
paramString()
Returns a string indicating the parameters of this object.
|
void |
remove(double x,
double y)
Removes the given point from this line group, if it is part of the line group.
|
void |
remove(GPoint point)
Removes the given point from this line group, if it is part of the line group.
|
void |
setLocation(double x,
double y)
Sets the line group's top/left corner to the given x/y pair.
|
int |
size()
Returns the number of points that have been added to the line group.
|
void |
translate(double dx,
double dy)
Shifts every point in this line group by the given amounts.
|
addActionListener, addMouseListener, addMouseMotionListener, areMouseListenersEnabled, clone, colorName, colorName, colorNameFriendly, contains, createTransformedGraphics, fireActionEvent, fireActionEvent, fireMouseListeners, getBottomY, getCenterLocation, getCenterX, getCenterY, getColor, getComponent, getHeight, getLineWidth, getLocation, getMatrix, getObjectColor, getParent, getRightX, getSize, getWidth, getX, getY, intersects, isAntiAliasing, isVisible, move, movePolar, paint, pause, removeActionListener, removeMouseListener, removeMouseMotionListener, repaint, rotate, scale, scale, sendBackward, sendForward, sendToBack, sendToFront, setAntiAliasing, setBottomY, setCenterLocation, setCenterLocation, setCenterX, setCenterY, setColor, setLineWidth, setLocation, setParent, setRightX, setVisible, setX, setY, start, start, toString, updateEnabledList
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public GLineGroup()
public void add(double x, double y)
public void add(GPoint point)
point
- the point to addpublic void clear()
public boolean contains(double x, double y)
public GRectangle getBounds()
public boolean isEmpty()
public Iterator<GPoint> iterator()
protected void paint2d(Graphics2D g)
public String paramString()
paramString
in class GObject
public void remove(double x, double y)
public void remove(GPoint point)
public void setLocation(double x, double y)
setLocation
in class GObject
x
- The new x-coordinate for the objecty
- The new y-coordinate for the objectpublic int size()
public void translate(double dx, double dy)