java.awt.geom

Class RectangularShape

Implemented Interfaces:
Cloneable, Shape
Known Direct Subclasses:
Arc2D, Ellipse2D, Rectangle2D, RoundRectangle2D

public abstract class RectangularShape
extends Object
implements Shape, Cloneable

RectangularShape is the base class for a number of Shape objects whose geometry is defined by a rectangular frame. This class does not directly specify any specific geometry by itself, but merely provides manipulation methods inherited by a whole category of Shape objects. The manipulation methods provided by this class can be used to query and modify the rectangular frame, which provides a reference for the subclasses to define their geometry.

Constructor Summary

RectangularShape()
This is an abstract class that cannot be instantiated directly.

Method Summary

Object
clone()
Creates a new object of the same class and with the same contents as this object.
boolean
contains(Point2D p)
Tests if a specified Point2D is inside the boundary of the Shape.
boolean
contains(Rectangle2D r)
Tests if the interior of the Shape entirely contains the specified Rectangle2D.
Rectangle
getBounds()
Returns the bounding box of the Shape.
double
getCenterX()
Returns the X coordinate of the center of the framing rectangle of the Shape in double precision.
double
getCenterY()
Returns the Y coordinate of the center of the framing rectangle of the Shape in double precision.
Rectangle2D
getFrame()
Returns the framing Rectangle2D that defines the overall shape of this object.
abstract double
getHeight()
Returns the height of the framing rectangle in double precision.
double
getMaxX()
Returns the largest X coordinate of the framing rectangle of the Shape in double precision.
double
getMaxY()
Returns the largest Y coordinate of the framing rectangle of the Shape in double precision.
double
getMinX()
Returns the smallest X coordinate of the framing rectangle of the Shape in double precision.
double
getMinY()
Returns the smallest Y coordinate of the framing rectangle of the Shape in double precision.
PathIterator
getPathIterator(AffineTransform at, double flatness)
Returns an iterator object that iterates along the Shape object's boundary and provides access to a flattened view of the outline of the Shape object's geometry.
abstract double
getWidth()
Returns the width of the framing rectangle in double precision.
abstract double
getX()
Returns the X coordinate of the upper left corner of the framing rectangle in double precision.
abstract double
getY()
Returns the Y coordinate of the upper left corner of the framing rectangle in double precision.
boolean
intersects(Rectangle2D r)
Tests if the interior of theShape intersects the interior of a specified Rectangle2D.
abstract boolean
isEmpty()
Determines whether the RectangularShape is empty.
abstract void
setFrame(double x, double y, double w, double h)
Sets the location and size of the framing rectangle of this Shape to the specified rectangular values.
void
setFrame(Point2D loc, Dimension2D size)
Sets the location and size of the framing rectangle of this Shape to the specified Point2D and Dimension2D, respectively.
void
setFrame(Rectangle2D r)
Sets the framing rectangle of this Shape to be the specified Rectangle2D.
void
setFrameFromCenter(double centerX, double centerY, double cornerX, double cornerY)
Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates.
void
setFrameFromCenter(Point2D center, Point2D corner)
Sets the framing rectangle of this Shape based on a specified center Point2D and corner Point2D.
void
setFrameFromDiagonal(double x1, double y1, double x2, double y2)
Sets the diagonal of the framing rectangle of this Shape based on the two specified coordinates.
void
setFrameFromDiagonal(Point2D p1, Point2D p2)
Sets the diagonal of the framing rectangle of this Shape based on two specified Point2D objects.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

RectangularShape

protected RectangularShape()
This is an abstract class that cannot be instantiated directly.

Method Details

clone

public Object clone()
Creates a new object of the same class and with the same contents as this object.
Overrides:
clone in interface Object
Returns:
a clone of this instance.
Since:
1.2
See Also:
Cloneable
Usages and Demos :

View More Examples of clone()
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:         Shape shape = (model.isComposite(node)) ? _compositeShape : _nodeShape;
   6:         if(shape instanceof RectangularShape) {
   7:         ...
   8:             RectangularShape r = (RectangularShape)shape;
   9:         ...
  10:             shape = (Shape)(r.clone());

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.util.Arrays;
   4:         ...
   5:             Line2D line = (Line2D) shape;
   6:             result = (Shape) line.clone();    
   7:         }
   8:         ...
   9:         else if (shape instanceof RectangularShape) {
  10:         ...
  11:             RectangularShape rectangle = (RectangularShape) shape;

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5:   {
   6:     final Line2D lineClone = (Line2D) line.clone();
   7: 
   8:         ...
   9:     }
  10:     if (s instanceof RectangularShape)
  11:     {
  12:         ...
  13:       return resizeRect((RectangularShape) s, width, height);

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.AffineTransform;
   4:         ...
   5:             final Object shape = shapes[i];
   6:             if (shape instanceof RectangularShape) {
   7:         ...
   8:                 RectangularShape rect=(RectangularShape) shape;
   9:                 if (rect.isEmpty()) {
  10:         ...
  11:                     rect = (RectangularShape) rect.clone();

View Full Code Here

contains

public boolean contains(Point2D p)
Tests if a specified Point2D is inside the boundary of the Shape.
Specified by:
contains in interface Shape
Parameters:
p - the specified Point2D
Returns:
true if the Point2D is inside the Shape object's boundary; false otherwise.
Usages and Demos :

View More Examples of contains(Point2D p)
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:     public boolean contains(final Point2D point) {
  13:         return logicalShape.contains(point);

View Full Code Here

contains

public boolean contains(Rectangle2D r)
Tests if the interior of the Shape entirely contains the specified Rectangle2D.
Specified by:
contains in interface Shape
Parameters:
r - the specified Rectangle2D
Returns:
true if the Shape entirely contains the specified Rectangle2D; false otherwise.
Usages and Demos :

View More Examples of contains(Rectangle2D r)
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:     public boolean contains(final Point2D point) {
  13:         return logicalShape.contains(point);

View Full Code Here

getBounds

public Rectangle getBounds()
Returns the bounding box of the Shape.
Specified by:
getBounds in interface Shape
Returns:
a Rectangle object that bounds the Shape.

getCenterX

public double getCenterX()
Returns the X coordinate of the center of the framing rectangle of the Shape in double precision.
Returns:
the x coordinate of the framing rectangle of the Shape object's center.
Usages and Demos :

View More Examples of getCenterX()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5: 
   6:         hr = new RectangularShape[hotRegionsCount];
   7: 
   8:         ...
   9: 
  10:     public RectangularShape getScreenHotRegion(int region)
  11:     {
  12:         ...
  13:                 RectangularShape screenShape = (RectangularShape) hr[region].clone();
  14:                 Point2D.Double center = window.calculateDisplay(screenShape.getCenterX(), screenShape.getCenterY());

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:     public static Point2D getCenterPoint (Rectangle2D r) {
  12:         return new Point2D.Double(r.getCenterX(), r.getCenterY());

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:     public double getCenterX() {
  13:         return logicalShape.getCenterX();

View Full Code Here

getCenterY

public double getCenterY()
Returns the Y coordinate of the center of the framing rectangle of the Shape in double precision.
Returns:
the y coordinate of the framing rectangle of the Shape object's center.
Usages and Demos :

View More Examples of getCenterY()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5: 
   6:         hr = new RectangularShape[hotRegionsCount];
   7: 
   8:         ...
   9: 
  10:     public RectangularShape getScreenHotRegion(int region)
  11:     {
  12:         ...
  13:                 RectangularShape screenShape = (RectangularShape) hr[region].clone();
  14:                 Point2D.Double center = window.calculateDisplay(screenShape.getCenterX(), screenShape.getCenterY());

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:     public static Point2D getCenterPoint (Rectangle2D r) {
  12:         return new Point2D.Double(r.getCenterX(), r.getCenterY());

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:     public double getCenterY() {
  13:         return logicalShape.getCenterY();

View Full Code Here

getFrame

public Rectangle2D getFrame()
Returns the framing Rectangle2D that defines the overall shape of this object.
Returns:
a Rectangle2D, specified in double coordinates.
Usages and Demos :

View More Examples of getFrame()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:     public Rectangle2D getFrame() {
  13:         return logicalShape.getFrame();

View Full Code Here

getHeight

public abstract double getHeight()
Returns the height of the framing rectangle in double precision.
Returns:
the height of the framing rectangle.
Usages and Demos :

View More Examples of getHeight()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5:   public static void getFittingTransform(AffineTransform transform,
   6:       RectangularShape realBounds,
   7:         ...
   8:       RectangularShape
   9:       windowBounds) {
  10:         ...
  11:       double realWidth = realBounds.getWidth();
  12:       double realHeight = realBounds.getHeight();

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:                 b.getX(), b.getY(),
  12:                 b.getWidth(), b.getHeight());

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:         r.setRect(r.getX()-amount, r.getY()-amount,
   6:                   r.getWidth()+2*amount, r.getHeight()+2*amount);
   7:     }
   8:         ...
   9:         
  10:         if ( shape instanceof RectangularShape ) {
  11:         ...
  12:             RectangularShape r = (RectangularShape)shape;

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5: 
   6:         RectangularShape legendArea;
   7:         double availableWidth = available.getWidth();
   8:         ...
   9: 
  10:                 rowHeight = Math.max(0, legendTitle.getHeight());
  11:                 xoffset += legendTitle.getWidth();
  12:         ...
  13:                 else {
  14:                     rowHeight = Math.max(rowHeight, item.getHeight());

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:         tmp.x = logicalShape.getWidth();
  13:         tmp.y = logicalShape.getHeight();

View Full Code Here

getMaxX

public double getMaxX()
Returns the largest X coordinate of the framing rectangle of the Shape in double precision.
Returns:
the largest x coordinate of the framing rectangle of the Shape.
Usages and Demos :

View More Examples of getMaxX()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:         case SwingConstants.NORTH_EAST:
  12:             x = r.getMaxX();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:         double a2x = a2.getX(), a2y = a2.getY();
   6:         double mxx = r.getMaxX(), mxy = r.getMaxY();
   7:         double mnx = r.getMinX(), mny = r.getMinY();
   8:         ...
   9:         double a2x = l.getX2(), a2y = l.getY2();
  10:         double mxx = r.getMaxX(), mxy = r.getMaxY();
  11:         double mnx = r.getMinX(), mny = r.getMinY();
  12:         ...
  13:         
  14:         if ( shape instanceof RectangularShape ) {

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:         for (int i = 0; i < 4; i++) {
  13:             tmp.x = (i&1) == 0 ? drawnShape.getMinX() : drawnShape.getMaxX();

View Full Code Here

getMaxY

public double getMaxY()
Returns the largest Y coordinate of the framing rectangle of the Shape in double precision.
Returns:
the largest y coordinate of the framing rectangle of the Shape.
Usages and Demos :

View More Examples of getMaxY()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:             x = r.getMaxX();
  12:             y = r.getMaxY();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:         double a2x = a2.getX(), a2y = a2.getY();
   6:         double mxx = r.getMaxX(), mxy = r.getMaxY();
   7:         double mnx = r.getMinX(), mny = r.getMinY();
   8:         ...
   9:         double a2x = l.getX2(), a2y = l.getY2();
  10:         double mxx = r.getMaxX(), mxy = r.getMaxY();
  11:         double mnx = r.getMinX(), mny = r.getMinY();
  12:         ...
  13:         
  14:         if ( shape instanceof RectangularShape ) {

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:             tmp.x = (i&1) == 0 ? drawnShape.getMinX() : drawnShape.getMaxX();
  13:             tmp.y = (i&2) == 0 ? drawnShape.getMinY() : drawnShape.getMaxY();

View Full Code Here

getMinX

public double getMinX()
Returns the smallest X coordinate of the framing rectangle of the Shape in double precision.
Returns:
the smallest x coordinate of the framing rectangle of the Shape.
Usages and Demos :

View More Examples of getMinX()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:         case SwingConstants.SOUTH_WEST:
  12:             x = r.getMinX();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:         double mxx = r.getMaxX(), mxy = r.getMaxY();
   6:         double mnx = r.getMinX(), mny = r.getMinY();
   7:         
   8:         ...
   9:         double mxx = r.getMaxX(), mxy = r.getMaxY();
  10:         double mnx = r.getMinX(), mny = r.getMinY();
  11:         
  12:         ...
  13:         
  14:         if ( shape instanceof RectangularShape ) {

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:         for (int i = 0; i < 4; i++) {
  13:             tmp.x = (i&1) == 0 ? drawnShape.getMinX() : drawnShape.getMaxX();

View Full Code Here

getMinY

public double getMinY()
Returns the smallest Y coordinate of the framing rectangle of the Shape in double precision.
Returns:
the smallest y coordinate of the framing rectangle of the Shape.
Usages and Demos :

View More Examples of getMinY()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:             x = r.getCenterX();
  12:             y = r.getMinY();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:         double mxx = r.getMaxX(), mxy = r.getMaxY();
   6:         double mnx = r.getMinX(), mny = r.getMinY();
   7:         
   8:         ...
   9:         double mxx = r.getMaxX(), mxy = r.getMaxY();
  10:         double mnx = r.getMinX(), mny = r.getMinY();
  11:         
  12:         ...
  13:         
  14:         if ( shape instanceof RectangularShape ) {

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:             tmp.x = (i&1) == 0 ? drawnShape.getMinX() : drawnShape.getMaxX();
  13:             tmp.y = (i&2) == 0 ? drawnShape.getMinY() : drawnShape.getMaxY();

View Full Code Here

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Returns an iterator object that iterates along the Shape object's boundary and provides access to a flattened view of the outline of the Shape object's geometry.

Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will be returned by the iterator.

The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. An optional AffineTransform can be specified so that the coordinates returned in the iteration are transformed accordingly.

Specified by:
getPathIterator in interface Shape
Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired.
flatness - the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve
Returns:
a PathIterator object that provides access to the Shape object's flattened geometry.
Usages and Demos :

View More Examples of getPathIterator(AffineTransform at,double flatness)
   1: 
   2:     protected RectangularShape _shape;
   3: 
   4:         ...
   5:         }
   6:         o._shape=(RectangularShape)o._shape.clone();
   7:         return o;
   8:         ...
   9:     public PathIterator getPathIterator(AffineTransform at, double flatness){
  10:         return _shape.getPathIterator(at,flatness);
  11:     }

View Full Code Here

getWidth

public abstract double getWidth()
Returns the width of the framing rectangle in double precision.
Returns:
the width of the framing rectangle.
Usages and Demos :

View More Examples of getWidth()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5:   public static void getFittingTransform(AffineTransform transform,
   6:       RectangularShape realBounds,
   7:         ...
   8:       RectangularShape
   9:       windowBounds) {
  10:         ...
  11: 
  12:       double realWidth = realBounds.getWidth();

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:                 b.getX(), b.getY(),
  12:                 b.getWidth(), b.getHeight());

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:         r.setRect(r.getX()-amount, r.getY()-amount,
   6:                   r.getWidth()+2*amount, r.getHeight()+2*amount);
   7:     }
   8:         ...
   9:         
  10:         if ( shape instanceof RectangularShape ) {
  11:         ...
  12:             RectangularShape r = (RectangularShape)shape;

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5: 
   6:         RectangularShape legendArea;
   7:         ...
   8:         double availableWidth = available.getWidth();
   9:         Point2D translation;
  10:         ...
  11:                 rowHeight = Math.max(0, legendTitle.getHeight());
  12:                 xoffset += legendTitle.getWidth();

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:         adjustingLogicalSides = inverseTransform(adjustingSides);
  13:         tmp.x = logicalShape.getWidth();

View Full Code Here

getX

public abstract double getX()
Returns the X coordinate of the upper left corner of the framing rectangle in double precision.
Returns:
the x coordinate of the upper left corner of the framing rectangle.
Usages and Demos :

View More Examples of getX()
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:         Site f = (Site) i.next();
  12:         x1 = x2 = f.getX();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5: 
   6:             if (shape instanceof RectangularShape) {
   7:         ...
   8:                 RectangularShape rs = (RectangularShape) shape;
   9:         ...
  10:                 shapeRect = new QDRect((float) (rs.getX() * scaleX),

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:     public static int intersectLineRectangle(Point2D a1, Point2D a2, Rectangle2D r, Point2D[] pts) {
   6:         double a1x = a1.getX(), a1y = a1.getY();
   7:         ...
   8:         double a2x = a2.getX(), a2y = a2.getY();
   9:         double mxx = r.getMaxX(), mxy = r.getMaxY();
  10:         ...
  11:     public static void expand(Rectangle2D r, double amount) {
  12:         r.setRect(r.getX()-amount, r.getY()-amount,

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:                 XAffineTransform.inverseDeltaTransform(transform, tmp, tmp);
  13:                 double x = logicalShape.getX();

View Full Code Here

getY

public abstract double getY()
Returns the Y coordinate of the upper left corner of the framing rectangle in double precision.
Returns:
the y coordinate of the upper left corner of the framing rectangle.
Usages and Demos :

View More Examples of getY()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5:   public static void getFittingTransform(AffineTransform transform,
   6:       RectangularShape realBounds,
   7:         ...
   8:       RectangularShape
   9:       windowBounds) {
  10:         ...
  11:             -scaleWidth * realBounds.getX(),
  12:             scaleHeight * realBounds.getY());

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:         x1 = x2 = f.getX();
  12:         y1 = y2 = f.getY();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:     public static int intersectLineRectangle(Point2D a1, Point2D a2, Rectangle2D r, Point2D[] pts) {
   6:         double a1x = a1.getX(), a1y = a1.getY();
   7:         ...
   8:         double a2x = a2.getX(), a2y = a2.getY();
   9:         double mxx = r.getMaxX(), mxy = r.getMaxY();
  10:         ...
  11:     public static void expand(Rectangle2D r, double amount) {
  12:         r.setRect(r.getX()-amount, r.getY()-amount,

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:                 double x = logicalShape.getX();
  13:                 double y = logicalShape.getY();

View Full Code Here

intersects

public boolean intersects(Rectangle2D r)
Tests if the interior of theShape intersects the interior of a specified Rectangle2D.
Specified by:
intersects in interface Shape
Parameters:
r - the specified Rectangle2D
Returns:
true if the Shape and the specified Rectangle2D intersect each other; false otherwise.

isEmpty

public abstract boolean isEmpty()
Determines whether the RectangularShape is empty. When the RectangularShape is empty, it encloses no area.
Returns:
true if the RectangularShape is empty; false otherwise.
Usages and Demos :

View More Examples of isEmpty()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final RectangularShape logicalShape;
   7: 
   8:         ...
   9:     private transient RectangularShape drawnShape;
  10: 
  11:         ...
  12:     public boolean isEmpty() {
  13:         return logicalShape.isEmpty();

View Full Code Here

setFrame

public abstract void setFrame(double x,
                              double y,
                              double w,
                              double h)
Sets the location and size of the framing rectangle of this Shape to the specified rectangular values. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters:
w - the width of the specified rectangular shape
h - the height of the specified rectangular shape
See Also:
getFrame()
Usages and Demos :

View More Examples of setFrame(double x,double y,double w,double h)
   1: 
   2:     protected RectangularShape _shape;
   3: 
   4:         ...
   5:              a.setAngleExtent(param2);
   6:              a.setFrame(_ox+_x,_oy+_y-_h,_w,_h);
   7:              _shape=a;
   8:         ...
   9:         }
  10:         o._shape=(RectangularShape)o._shape.clone();
  11:         return o;
  12:         ...
  13:         }
  14:         _shape.setFrame(_ox+_x,_oy+_y-_h,_w,_h);

View Full Code Here
   1:   private void drawIt (Graphics2D _g2, Color _color, Paint _fill) {
   2:     if (! (style.displayObject instanceof RectangularShape) ) {
   3:       _g2.setColor(_color);
   4:         ...
   5:     }
   6:     RectangularShape shape = (RectangularShape) style.displayObject;
   7:     AffineTransform originalTransform = _g2.getTransform();
   8:         ...
   9:     _g2.setTransform(transform);
  10:     shape.setFrame(a1,b1,pixelOrigin[2],pixelOrigin[3]);
  11:       _g2.setPaint(_fill);

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5: 
   6:         hr = new RectangularShape[hotRegionsCount];
   7: 
   8:         ...
   9: 
  10:     public RectangularShape getScreenHotRegion(int region)
  11:     {
  12:         ...
  13: 
  14:                 screenShape.setFrame(center.x - w / 2, center.y - w / 2, w, h);

View Full Code Here
   1:   private void drawMarker (Graphics2D _g2, OnePoint _point, Color _color, Paint _fill) {
   2:     if (! (style.displayObject instanceof RectangularShape) ) {
   3:       _g2.setColor (_color);
   4:         ...
   5:     }
   6:     RectangularShape shape = (RectangularShape) style.displayObject;
   7:     AffineTransform originalTransform = _g2.getTransform();
   8:     transform.setTransform(originalTransform);
   9:     transform.rotate(-style.angle,_point.pixel[0],_point.pixel[1]);

View Full Code Here
   1: import java.awt.geom.RoundRectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.AffineTransform;
   4:         ...
   5: {
   6:     private transient RectangularShape mouseSelectedArea;
   7: 
   8:         ...
   9:         if (ox == px && oy == py) return null;
  10:         RectangularShape shape = mouseSelectedArea;
  11:         if (transform != null && !transform.isIdentity()) {
  12:         ...
  13:                         shape = (RectangularShape) shape.clone();
  14:                         shape.setFrame(xmin, ymin, xmax - xmin, ymax - ymin);

View Full Code Here

setFrame

public void setFrame(Point2D loc,
                     Dimension2D size)
Sets the location and size of the framing rectangle of this Shape to the specified Point2D and Dimension2D, respectively. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters:
loc - the specified Point2D
size - the specified Dimension2D
See Also:
getFrame()

setFrame

public void setFrame(Rectangle2D r)
Sets the framing rectangle of this Shape to be the specified Rectangle2D. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters:
r - the specified Rectangle2D
See Also:
getFrame()
Usages and Demos :

View More Examples of setFrame(Rectangle2D r)
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: 
   4:         ...
   5: public abstract class VertexStyle implements Style {
   6:     protected RectangularShape shape;
   7:     protected int size = 4;
   8:         ...
   9: 
  10:     protected VertexStyle(RectangularShape shape) {
  11:         this.shape = shape;
  12:         ...
  13:     private void setFrame(Point2D p) {
  14:         shape.setFrame(p.getX() - (getSize() / 2d),

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:     
   6:     protected RectangularShape m_textBox  = new Rectangle2D.Float();
   7:     protected Font m_font = FontLib.getFont("SansSerif", Font.PLAIN, 10);
   8:         ...
   9:         getAlignedPoint(m_tmpPoint, item, w, h, m_xAlign, m_yAlign);
  10:         m_textBox.setFrame(m_tmpPoint.getX(),m_tmpPoint.getY(),w,h);
  11:         return m_textBox;

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:     protected Font m_font = new Font("SansSerif", Font.PLAIN, 10);
   6:     protected RectangularShape m_imageBox  = new Rectangle2D.Float();
   7:     protected Point2D     m_tmpPoint = new Point2D.Double();
   8:         ...
   9:         } else {
  10:             m_imageBox.setFrame(m_tmpPoint.getX(),m_tmpPoint.getY(),w,h);
  11:         }

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public static Shape clone (Shape s) {
   6:         if (s instanceof RectangularShape) {
   7:         ...
   8:             return (RectangularShape) ((RectangularShape) s).clone();
   9: 
  10:         ...
  11:         Rectangle2D bounds = at.createTransformedShape(r).getBounds2D();
  12:         r.setFrame(bounds);

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.geom.RectangularShape;
   3: import java.awt.geom.RoundRectangle2D;
   4:         ...
   5:     
   6:     protected RectangularShape m_bbox  = new Rectangle2D.Double();
   7: 
   8:         ...
   9:         } else {
  10:             m_bbox.setFrame(m_pt.getX(), m_pt.getY(), w, h);
  11:         }
  12:         ...
  13:     public void render(Graphics2D g, VisualItem item) {
  14:         RectangularShape shape = (RectangularShape)getShape(item);

View Full Code Here

setFrameFromCenter

public void setFrameFromCenter(double centerX,
                               double centerY,
                               double cornerX,
                               double cornerY)
Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters:

setFrameFromCenter

public void setFrameFromCenter(Point2D center,
                               Point2D corner)
Sets the framing rectangle of this Shape based on a specified center Point2D and corner Point2D. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters:
center - the specified center Point2D
corner - the specified corner Point2D

setFrameFromDiagonal

public void setFrameFromDiagonal(double x1,
                                 double y1,
                                 double x2,
                                 double y2)
Sets the diagonal of the framing rectangle of this Shape based on the two specified coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters:

setFrameFromDiagonal

public void setFrameFromDiagonal(Point2D p1,
                                 Point2D p2)
Sets the diagonal of the framing rectangle of this Shape based on two specified Point2D objects. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
Parameters: