Class Group
- java.lang.Object
-
- edu.rit.draw.item.DrawingItem
-
- edu.rit.draw.item.Group
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public class Group extends DrawingItem implements java.io.Externalizable
Class Group provides a DrawingItem that consists of a group of other DrawingItems. To add drawing items to a group, call the group's append() and prepend() methods.The group can be scaled as a unit by calling the xScale() and yScale() methods. The group can be sheared as a unit by calling the xShear() and yShear() methods. The group can be rotated as a unit by calling the rotationAngle() method; the group is always rotated around its center point. The order in which these transforms are applied is first scaling, then shearing, then rotation.
The group's "bounding box" is the smallest rectangle that encloses all the contained drawing items' bounding boxes, after applying the scale, shear, and rotation transforms if any. The nw(), n(), ne(), w(), c(), e(), sw(), s(), and se() methods refer to points on the group's bounding box. The setter versions of these methods translate the group so the designated point on the group's bounding box coincides with the point specified as the argument. The getter versions of these methods return the designated point on the group's bounding box.
The group's "original bounding box" is the smallest rectangle that encloses all the contained drawing items' bounding boxes, before applying the scale, shear, and rotation transforms if any. The orig_nw(), orig_n(), orig_ne(), orig_w(), orig_c(), orig_e(), orig_sw(), orig_s(), and orig_se() methods refer to points on the group's original bounding box. The setter versions of these methods translate the group so the designated point on the group's original bounding box coincides with the point specified as the argument. The getter versions of these methods return the designated point on the group's original bounding box.
The transform() method takes a point, applies the group's scaling, shearing, rotation, and translation transforms to the point, and returns the transformed point. You can use this method, for example, to find out where a point defined before applying transforms to the group would end up after applying transforms to the group.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleNORMAL_ROTATION_ANGLEThe normal rotation angle (0).static doubleNORMAL_X_SCALEThe normal X scale factor (1).static doubleNORMAL_X_SHEARThe normal X shear factor (0).static doubleNORMAL_Y_SCALEThe normal Y scale factor (1).static doubleNORMAL_Y_SHEARThe normal Y shear factor (0).
-
Constructor Summary
Constructors Constructor and Description Group()Construct a new empty group.Group(Group theGroup)Construct a new group that contains the same drawing items, has the same transforms, and is at the same location, as the given group.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Groupadd()Add this group to the end of the default drawing's sequence of drawing items.Groupadd(Drawing theDrawing)Add this group to the end of the given drawing's sequence of drawing items.GroupaddFirst()Add this group to the beginning of the default drawing's sequence of drawing items.GroupaddFirst(Drawing theDrawing)Add this group to the beginning of the given drawing's sequence of drawing items.Groupappend(DrawingItem theItem)Add the given drawing item to the end of this group's list of drawing items.Groupc(double x, double y)Set the center point of this group's bounding box.Groupc(Point thePoint)Set the center point of this group's bounding box.Groupclear()Clear this group.Pointcontent_c()Returns the center point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_e()Returns the east center point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_n()Returns the north center point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_ne()Returns the northeast corner point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_nw()Returns the northwest corner point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_s()Returns the south center point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_se()Returns the southeast corner point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_sw()Returns the southwest corner point of this group's original bounding box, without applying the group's transformations if any.Pointcontent_w()Returns the west center point of this group's original bounding box, without applying the group's transformations if any.static doubledefaultRotationAngle()Returns the default rotation angle.static voiddefaultRotationAngle(double theAngle)Set the default rotation angle.static doubledefaultXScale()Returns the default X scale factor.static voiddefaultXScale(double theXScale)Set the default X scale factor.static doubledefaultXShear()Returns the default X shear factor.static voiddefaultXShear(double theXShear)Set the default X shear factor.static doubledefaultYScale()Returns the default Y scale factor.static voiddefaultYScale(double theYScale)Set the default Y scale factor.static doubledefaultYShear()Returns the default Y shear factor.static voiddefaultYShear(double theYShear)Set the default Y shear factor.voiddraw(java.awt.Graphics2D g2d)Draw this drawing item in the given graphics context.Groupe(double x, double y)Set the east middle point of this group's bounding box.Groupe(Point thePoint)Set the east middle point of this group's bounding box.doubleheight()Returns the height of this group's bounding box.Groupn(double x, double y)Set the north middle point of this group's bounding box.Groupn(Point thePoint)Set the north middle point of this group's bounding box.Groupne(double x, double y)Set the northeast corner point of this group's bounding box.Groupne(Point thePoint)Set the northeast corner point of this group's bounding box.Pointnw()Returns the northwest corner point of this group's bounding box.Groupnw(double x, double y)Set the northwest corner point of this group's bounding box.Groupnw(Point thePoint)Set the northwest corner point of this group's bounding box.Pointorig_c()Returns the center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_c(double x, double y)Set the center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_c(Point thePoint)Set the center point of this group's original bounding box, after applying the group's transformations if any.Pointorig_e()Returns the east center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_e(double x, double y)Set the east center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_e(Point thePoint)Set the east center point of this group's original bounding box, after applying the group's transformations if any.Pointorig_n()Returns the north center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_n(double x, double y)Set the north center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_n(Point thePoint)Set the north center point of this group's original bounding box, after applying the group's transformations if any.Pointorig_ne()Returns the northeast corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_ne(double x, double y)Set the northeast corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_ne(Point thePoint)Set the northeast corner point of this group's original bounding box, after applying the group's transformations if any.Pointorig_nw()Returns the northwest corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_nw(double x, double y)Set the northwest corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_nw(Point thePoint)Set the northwest corner point of this group's original bounding box, after applying the group's transformations if any.Pointorig_s()Returns the south center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_s(double x, double y)Set the south center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_s(Point thePoint)Set the south center point of this group's original bounding box, after applying the group's transformations if any.Pointorig_se()Returns the southeast corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_se(double x, double y)Set the southeast corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_se(Point thePoint)Set the southeast corner point of this group's original bounding box, after applying the group's transformations if any.Pointorig_sw()Returns the southwest corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_sw(double x, double y)Set the southwest corner point of this group's original bounding box, after applying the group's transformations if any.Grouporig_sw(Point thePoint)Set the southwest corner point of this group's original bounding box, after applying the group's transformations if any.Pointorig_w()Returns the west center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_w(double x, double y)Set the west center point of this group's original bounding box, after applying the group's transformations if any.Grouporig_w(Point thePoint)Set the west center point of this group's original bounding box, after applying the group's transformations if any.Groupprepend(DrawingItem theItem)Add the given drawing item to the beginning of this group's list of drawing items.voidreadExternal(java.io.ObjectInput in)Read this group from the given object input stream.doublerotationAngle()Returns this group's rotation angle.GrouprotationAngle(double theAngle)Set this group's rotation angle.Groups(double x, double y)Set the south middle point of this group's bounding box.Groups(Point thePoint)Set the south middle point of this group's bounding box.Groupse(double x, double y)Set the southeast corner point of this group's bounding box.Groupse(Point thePoint)Set the southeast corner point of this group's bounding box.Sizesize()Returns the size of this group's bounding box.Groupsw(double x, double y)Set the southwest corner point of this group's bounding box.Groupsw(Point thePoint)Set the southwest corner point of this group's bounding box.Pointtransform(Point thePoint)Transform the given point by applying this group's scaling, shearing, rotation, and translation transforms.Groupw(double x, double y)Set the west middle point of this group's bounding box.Groupw(Point thePoint)Set the west middle point of this group's bounding box.doublewidth()Returns the width of this group's bounding box.voidwriteExternal(java.io.ObjectOutput out)Write this group to the given object output stream.doublexScale()Returns this group's X scale factor.GroupxScale(double theXScale)Set this group's X scale factor.doublexShear()Returns this group's X shear factor.GroupxShear(double theXShear)Set this group's X shear factor.doubleyScale()Returns this group's Y scale factor.GroupyScale(double theYScale)Set this group's Y scale factor.doubleyShear()Returns this group's Y shear factor.GroupyShear(double theYShear)Set this group's Y shear factor.-
Methods inherited from class edu.rit.draw.item.DrawingItem
boundingBox, c, e, n, ne, s, se, sw, w
-
-
-
-
Field Detail
-
NORMAL_X_SCALE
public static final double NORMAL_X_SCALE
The normal X scale factor (1).- See Also:
- Constant Field Values
-
NORMAL_Y_SCALE
public static final double NORMAL_Y_SCALE
The normal Y scale factor (1).- See Also:
- Constant Field Values
-
NORMAL_X_SHEAR
public static final double NORMAL_X_SHEAR
The normal X shear factor (0).- See Also:
- Constant Field Values
-
NORMAL_Y_SHEAR
public static final double NORMAL_Y_SHEAR
The normal Y shear factor (0).- See Also:
- Constant Field Values
-
NORMAL_ROTATION_ANGLE
public static final double NORMAL_ROTATION_ANGLE
The normal rotation angle (0).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Group
public Group()
Construct a new empty group. The group's northwest corner is located at (0,0).
-
Group
public Group(Group theGroup)
Construct a new group that contains the same drawing items, has the same transforms, and is at the same location, as the given group.- Parameters:
theGroup- Group.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theGroup is null.
-
-
Method Detail
-
defaultXScale
public static double defaultXScale()
Returns the default X scale factor.- Returns:
- Default X scale factor.
-
defaultXScale
public static void defaultXScale(double theXScale)
Set the default X scale factor. Before calling this method the first time, the default X scale factor is 1.- Parameters:
theXScale- Default X scale factor.
-
defaultYScale
public static double defaultYScale()
Returns the default Y scale factor.- Returns:
- Default Y scale factor.
-
defaultYScale
public static void defaultYScale(double theYScale)
Set the default Y scale factor. Before calling this method the first time, the default Y scale factor is 1.- Parameters:
theYScale- Default Y scale factor.
-
defaultXShear
public static double defaultXShear()
Returns the default X shear factor.- Returns:
- Default X shear factor.
-
defaultXShear
public static void defaultXShear(double theXShear)
Set the default X shear factor. Before calling this method the first time, the default X shear factor is 0.- Parameters:
theXShear- Default X shear factor.
-
defaultYShear
public static double defaultYShear()
Returns the default Y shear factor.- Returns:
- Default Y shear factor.
-
defaultYShear
public static void defaultYShear(double theYShear)
Set the default Y shear factor. Before calling this method the first time, the default Y shear factor is 0.- Parameters:
theYShear- Default Y shear factor.
-
defaultRotationAngle
public static double defaultRotationAngle()
Returns the default rotation angle.- Returns:
- Default rotation angle.
-
defaultRotationAngle
public static void defaultRotationAngle(double theAngle)
Set the default rotation angle. Before calling this method the first time, the default rotation angle is 0.- Parameters:
theAngle- Default rotation angle.
-
xScale
public double xScale()
Returns this group's X scale factor.- Returns:
- X scale factor.
-
xScale
public Group xScale(double theXScale)
Set this group's X scale factor.- Parameters:
theXScale- X scale factor.- Returns:
- This group.
-
yScale
public double yScale()
Returns this group's Y scale factor.- Returns:
- Y scale factor.
-
yScale
public Group yScale(double theYScale)
Set this group's Y scale factor.- Parameters:
theYScale- Y scale factor.- Returns:
- This group.
-
xShear
public double xShear()
Returns this group's X shear factor.- Returns:
- X shear factor.
-
xShear
public Group xShear(double theXShear)
Set this group's X shear factor.- Parameters:
theXShear- X shear factor.- Returns:
- This group.
-
yShear
public double yShear()
Returns this group's Y shear factor.- Returns:
- Y shear factor.
-
yShear
public Group yShear(double theYShear)
Set this group's Y shear factor.- Parameters:
theYShear- Y shear factor.- Returns:
- This group.
-
rotationAngle
public double rotationAngle()
Returns this group's rotation angle.- Returns:
- Rotation angle.
-
rotationAngle
public Group rotationAngle(double theAngle)
Set this group's rotation angle.- Parameters:
theAngle- Rotation angle.- Returns:
- This group.
-
clear
public Group clear()
Clear this group. All drawing items in this group are removed.- Returns:
- This group.
-
append
public Group append(DrawingItem theItem)
Add the given drawing item to the end of this group's list of drawing items.- Parameters:
theItem- Drawing item.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theItem is null.
-
prepend
public Group prepend(DrawingItem theItem)
Add the given drawing item to the beginning of this group's list of drawing items.- Parameters:
theItem- Drawing item.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theItem is null.
-
size
public Size size()
Returns the size of this group's bounding box.- Overrides:
sizein classDrawingItem- Returns:
- Size.
-
width
public double width()
Returns the width of this group's bounding box.- Specified by:
widthin classDrawingItem- Returns:
- Width.
-
height
public double height()
Returns the height of this group's bounding box.- Specified by:
heightin classDrawingItem- Returns:
- Height.
-
nw
public Point nw()
Returns the northwest corner point of this group's bounding box.- Specified by:
nwin classDrawingItem- Returns:
- Northwest corner point.
-
nw
public Group nw(double x, double y)
Set the northwest corner point of this group's bounding box.- Parameters:
x- X coordinate of northwest corner point.y- Y coordinate of northwest corner point.- Returns:
- This group.
-
nw
public Group nw(Point thePoint)
Set the northwest corner point of this group's bounding box.- Parameters:
thePoint- Northwest corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
n
public Group n(double x, double y)
Set the north middle point of this group's bounding box.- Parameters:
x- X coordinate of north middle point.y- Y coordinate of north middle point.- Returns:
- This group.
-
n
public Group n(Point thePoint)
Set the north middle point of this group's bounding box.- Parameters:
thePoint- North middle point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
ne
public Group ne(double x, double y)
Set the northeast corner point of this group's bounding box.- Parameters:
x- X coordinate of northeast corner point.y- Y coordinate of northeast corner point.- Returns:
- This group.
-
ne
public Group ne(Point thePoint)
Set the northeast corner point of this group's bounding box.- Parameters:
thePoint- Northeast corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
w
public Group w(double x, double y)
Set the west middle point of this group's bounding box.- Parameters:
x- X coordinate of west middle point.y- Y coordinate of west middle point.- Returns:
- This group.
-
w
public Group w(Point thePoint)
Set the west middle point of this group's bounding box.- Parameters:
thePoint- West middle point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
c
public Group c(double x, double y)
Set the center point of this group's bounding box.- Parameters:
x- X coordinate of center point.y- Y coordinate of center point.- Returns:
- This group.
-
c
public Group c(Point thePoint)
Set the center point of this group's bounding box.- Parameters:
thePoint- Center point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
e
public Group e(double x, double y)
Set the east middle point of this group's bounding box.- Parameters:
x- X coordinate of east middle point.y- Y coordinate of east middle point.- Returns:
- This group.
-
e
public Group e(Point thePoint)
Set the east middle point of this group's bounding box.- Parameters:
thePoint- East middle point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
sw
public Group sw(double x, double y)
Set the southwest corner point of this group's bounding box.- Parameters:
x- X coordinate of southwest corner point.y- Y coordinate of southwest corner point.- Returns:
- This group.
-
sw
public Group sw(Point thePoint)
Set the southwest corner point of this group's bounding box.- Parameters:
thePoint- Southwest corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
s
public Group s(double x, double y)
Set the south middle point of this group's bounding box.- Parameters:
x- X coordinate of south middle point.y- Y coordinate of south middle point.- Returns:
- This group.
-
s
public Group s(Point thePoint)
Set the south middle point of this group's bounding box.- Parameters:
thePoint- South middle point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
se
public Group se(double x, double y)
Set the southeast corner point of this group's bounding box.- Parameters:
x- X coordinate of southeast corner point.y- Y coordinate of southeast corner point.- Returns:
- This group.
-
se
public Group se(Point thePoint)
Set the southeast corner point of this group's bounding box.- Parameters:
thePoint- Southeast corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_nw
public Point orig_nw()
Returns the northwest corner point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- Northwest corner point.
-
orig_nw
public Group orig_nw(double x, double y)
Set the northwest corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of northwest corner point.y- Y coordinate of northwest corner point.- Returns:
- This group.
-
orig_nw
public Group orig_nw(Point thePoint)
Set the northwest corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- Northwest corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_n
public Point orig_n()
Returns the north center point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- North center point.
-
orig_n
public Group orig_n(double x, double y)
Set the north center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of north center point.y- Y coordinate of north center point.- Returns:
- This group.
-
orig_n
public Group orig_n(Point thePoint)
Set the north center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- North center point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_ne
public Point orig_ne()
Returns the northeast corner point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- Northeast corner point.
-
orig_ne
public Group orig_ne(double x, double y)
Set the northeast corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of northeast corner point.y- Y coordinate of northeast corner point.- Returns:
- This group.
-
orig_ne
public Group orig_ne(Point thePoint)
Set the northeast corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- Northeast corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_w
public Point orig_w()
Returns the west center point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- West center point.
-
orig_w
public Group orig_w(double x, double y)
Set the west center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of west center point.y- Y coordinate of west center point.- Returns:
- This group.
-
orig_w
public Group orig_w(Point thePoint)
Set the west center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- West center point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_c
public Point orig_c()
Returns the center point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- Center point.
-
orig_c
public Group orig_c(double x, double y)
Set the center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of center point.y- Y coordinate of center point.- Returns:
- This group.
-
orig_c
public Group orig_c(Point thePoint)
Set the center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- Center point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_e
public Point orig_e()
Returns the east center point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- East center point.
-
orig_e
public Group orig_e(double x, double y)
Set the east center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of east center point.y- Y coordinate of east center point.- Returns:
- This group.
-
orig_e
public Group orig_e(Point thePoint)
Set the east center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- East center point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_sw
public Point orig_sw()
Returns the southwest corner point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- Southwest corner point.
-
orig_sw
public Group orig_sw(double x, double y)
Set the southwest corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of southwest corner point.y- Y coordinate of southwest corner point.- Returns:
- This group.
-
orig_sw
public Group orig_sw(Point thePoint)
Set the southwest corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- Southwest corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_s
public Point orig_s()
Returns the south center point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- South center point.
-
orig_s
public Group orig_s(double x, double y)
Set the south center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of south center point.y- Y coordinate of south center point.- Returns:
- This group.
-
orig_s
public Group orig_s(Point thePoint)
Set the south center point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- South center point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
orig_se
public Point orig_se()
Returns the southeast corner point of this group's original bounding box, after applying the group's transformations if any.- Returns:
- Southeast corner point.
-
orig_se
public Group orig_se(double x, double y)
Set the southeast corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
x- X coordinate of southeast corner point.y- Y coordinate of southeast corner point.- Returns:
- This group.
-
orig_se
public Group orig_se(Point thePoint)
Set the southeast corner point of this group's original bounding box, after applying the group's transformations if any.- Parameters:
thePoint- Southeast corner point.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if thePoint is null.
-
content_nw
public Point content_nw()
Returns the northwest corner point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- Northwest corner point.
-
content_n
public Point content_n()
Returns the north center point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- North center point.
-
content_ne
public Point content_ne()
Returns the northeast corner point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- Northeast corner point.
-
content_w
public Point content_w()
Returns the west center point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- West center point.
-
content_c
public Point content_c()
Returns the center point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- Center point.
-
content_e
public Point content_e()
Returns the east center point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- East center point.
-
content_sw
public Point content_sw()
Returns the southwest corner point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- Southwest corner point.
-
content_s
public Point content_s()
Returns the south center point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- South center point.
-
content_se
public Point content_se()
Returns the southeast corner point of this group's original bounding box, without applying the group's transformations if any.- Returns:
- Southeast corner point.
-
add
public Group add()
Add this group to the end of the default drawing's sequence of drawing items.- Overrides:
addin classDrawingItem- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if there is no default drawing.- See Also:
Drawing.defaultDrawing()
-
add
public Group add(Drawing theDrawing)
Add this group to the end of the given drawing's sequence of drawing items.- Overrides:
addin classDrawingItem- Parameters:
theDrawing- Drawing.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDrawing is null.
-
addFirst
public Group addFirst()
Add this group to the beginning of the default drawing's sequence of drawing items.- Overrides:
addFirstin classDrawingItem- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if there is no default drawing.- See Also:
Drawing.defaultDrawing()
-
addFirst
public Group addFirst(Drawing theDrawing)
Add this group to the beginning of the given drawing's sequence of drawing items.- Overrides:
addFirstin classDrawingItem- Parameters:
theDrawing- Drawing.- Returns:
- This group.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDrawing is null.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this group to the given object output stream.- Specified by:
writeExternalin interfacejava.io.Externalizable- Overrides:
writeExternalin classDrawingItem- Parameters:
out- Object output stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionRead this group from the given object input stream.- Specified by:
readExternalin interfacejava.io.Externalizable- Overrides:
readExternalin classDrawingItem- Parameters:
in- Object input stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.java.lang.ClassNotFoundException- Thrown if any class needed to deserialize this group cannot be found.
-
draw
public void draw(java.awt.Graphics2D g2d)
Draw this drawing item in the given graphics context. This method is allowed to change the graphics context's paint, stroke, and transform, and it doesn't have to change them back.- Overrides:
drawin classDrawingItem- Parameters:
g2d- 2-D graphics context.
-
-
DMelt 3.0 © DataMelt by jWork.ORG