java.awt.geom

Class RoundRectangle2D.Float

Enclosing Class:
RoundRectangle2D
Implemented Interfaces:
Cloneable, Shape

public static class RoundRectangle2D.Float
extends RoundRectangle2D

The Float class defines a rectangle with rounded corners all specified in float coordinates.

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.geom.RoundRectangle2D

RoundRectangle2D.Double, RoundRectangle2D.Float

Field Summary

float
archeight
The height of the arc that rounds off the corners.
float
arcwidth
The width of the arc that rounds off the corners.
float
height
The height of this RoundRectangle2D.
float
width
The width of this RoundRectangle2D.
float
x
The X coordinate of this RoundRectangle2D.
float
y
The Y coordinate of this RoundRectangle2D.

Constructor Summary

Float()
Constructs a new RoundRectangle2D, initialized to location (0.0, 0), size (0.0, 0.0), and corner arcs of radius 0.0.
Float(float x, float y, float w, float h, float arcw, float arch)
Constructs and initializes a RoundRectangle2D from the specified coordinates.

Method Summary

double
getArcHeight()
Returns the height of the arc that rounds off the corners.
double
getArcWidth()
Returns the width of the arc that rounds off the corners.
Rectangle2D
getBounds2D()
Returns the high precision bounding box of this RoundRectangle2D.
double
getHeight()
Returns the height of this RoundRectangle2D in double precision.
double
getWidth()
Returns the width of this RoundRectangle2D in double precision.
double
getX()
Returns the X coordinate of this RoundRectangle2D in double precision.
double
getY()
Returns the Y coordinate of this RoundRectangle2D in double precision.
boolean
isEmpty()
Determines whether or not this RoundRectangle2D is empty.
void
setRoundRect(double x, double y, double w, double h, double arcw, double arch)
Sets the location, size, and arc radii of this RoundRectangle2D to the specified double values.
void
setRoundRect(float x, float y, float w, float h, float arcw, float arch)
Sets the location, size, and arc radii of this RoundRectangle2D to the specified float values.
void
setRoundRect(RoundRectangle2D rr)
Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D.

Methods inherited from class java.awt.geom.RoundRectangle2D

contains, contains, getArcHeight, getArcWidth, getPathIterator, intersects, setFrame, setRoundRect, setRoundRect

Methods inherited from class java.awt.geom.RectangularShape

clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getHeight, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, getWidth, getX, getY, intersects, isEmpty, setFrame, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal

Methods inherited from class java.lang.Object

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

Field Details

archeight

public float archeight
The height of the arc that rounds off the corners.

arcwidth

public float arcwidth
The width of the arc that rounds off the corners.

height

public float height
The height of this RoundRectangle2D.

width

public float width
The width of this RoundRectangle2D.

x

public float x
The X coordinate of this RoundRectangle2D.

y

public float y
The Y coordinate of this RoundRectangle2D.

Constructor Details

Float

public Float()
Constructs a new RoundRectangle2D, initialized to location (0.0, 0), size (0.0, 0.0), and corner arcs of radius 0.0.
Usages and Demos :

View More Examples of Float()
   1:       case WHEEL           :
   2:       case ELLIPSE         : style.displayObject = new Ellipse2D.Float(); break;
   3:         ...
   4:       case RECTANGLE       : style.displayObject = new Rectangle2D.Float(); break;
   5:         ...
   6:       case ROUND_RECTANGLE : style.displayObject = new RoundRectangle2D.Float(); break;
   7:     }

View Full Code Here
   1:     private BasicStroke bs = new BasicStroke(20.0f);
   2:     private Arc2D arc = new Arc2D.Float();
   3:         ...
   4:     private Ellipse2D ellipse = new Ellipse2D.Float();
   5:         ...
   6:     private RoundRectangle2D roundRect = new RoundRectangle2D.Float();
   7:     private Rectangle2D rect = new Rectangle2D.Float();

View Full Code Here
   1:     
   2:     protected RectangularShape m_textBox  = new Rectangle2D.Float();
   3:     protected Font m_font = FontLib.getFont("SansSerif", Font.PLAIN, 10);
   4:         ...
   5:     
   6:     protected Point2D     m_tmpPoint = new Point2D.Float();
   7: 
   8:         ...
   9:             !(m_textBox instanceof Rectangle2D) ) {
  10:             m_textBox = new Rectangle2D.Float();
  11:         } else {

View Full Code Here
   1:       case InteractiveParticle.NONE            : style.displayObject = null; break;
   2:       case InteractiveParticle.ELLIPSE         : style.displayObject = new Ellipse2D.Float(); break;
   3:         ...
   4:       case InteractiveParticle.RECTANGLE       : style.displayObject = new Rectangle2D.Float(); break;
   5:         ...
   6:       case InteractiveParticle.ROUND_RECTANGLE : style.displayObject = new RoundRectangle2D.Float(); break;
   7:     }

View Full Code Here
   1:     protected Font m_font = new Font("SansSerif", Font.PLAIN, 10);
   2:     protected RectangularShape m_imageBox  = new Rectangle2D.Float();
   3:     protected Point2D     m_tmpPoint = new Point2D.Double();
   4:         ...
   5:                 !(m_imageBox instanceof Rectangle2D) ) {
   6:             m_imageBox = new Rectangle2D.Float();
   7:         } else {
   8:         ...
   9:             if ( !(m_imageBox instanceof RoundRectangle2D) )
  10:                 m_imageBox = new RoundRectangle2D.Float();
  11:             ((RoundRectangle2D)m_imageBox)

View Full Code Here

Float

public Float(float x,
             float y,
             float w,
             float h,
             float arcw,
             float arch)
Constructs and initializes a RoundRectangle2D from the specified coordinates.
Parameters:
w - the width to which to set the newly constructed RoundRectangle2D
h - the height to which to set the newly constructed RoundRectangle2D
arcw - the width of the arc to use to round off the corners of the newly constructed RoundRectangle2D
arch - the height of the arc to use to round off the corners of the newly constructed RoundRectangle2D
Usages and Demos :

View More Examples of Float(float x,float y,float w,float h,float arcw,float arch)
   1:   {
   2:     return new RoundRectangle2D.Float(0, 0, 100, 100, arcWidth, arcHeight);
   3:   }
   4: }

View Full Code Here
   1:     {
   2:       elementFactory.setShape(new RoundRectangle2D.Float(0, 0, 100, 100, arcWidth, arcHeight));
   3:     }
   4:     else
   5:     {

View Full Code Here
   1:             final GeometryCollection geom = new GeometryCollection();
   2:             geom.add(new RoundRectangle2D.Float(100+i, 100+i/2, 200, 200, 20, 20));
   3:             final RenderedLayer layer = new RenderedGeometries(geom);
   4:             pane.renderer.addLayer(layer);
   5:         }

View Full Code Here
   1:                          break;
   2:                 case 2 : shape = new RoundRectangle2D.Float(0.0f, 0.0f, w/5, h/4, 10.0f, 10.0f);
   3:                          break;
   4:         ...
   5:                          break;
   6:                 case 4 : shape = new QuadCurve2D.Float(0.0f,0.0f,w/10, h/2,w/5,0.0f);
   7:                          break;
   8:                 case 5 : shape = new CubicCurve2D.Float(0.0f,0.0f,w/15,h/2, w/10,h/4,w/5,0.0f);
   9:                          break;

View Full Code Here
   1:         g.setPaint(bottomGradient);
   2:         Shape shape = new RoundRectangle2D.Float(0, midHeight - ARC / 2, w, midHeight + ARC / 2 + 1, ARC, ARC);
   3:         g.fill(shape);
   4:         ...
   5:         g.setPaint(topGradient);
   6:         shape = new RoundRectangle2D.Float(0, 0, w, y2, ARC, ARC);
   7:         g.fill(shape);
   8: 
   9:         g.setPaint(null);

View Full Code Here

Method Details

getArcHeight

public double getArcHeight()
Returns the height of the arc that rounds off the corners.
Overrides:
getArcHeight in interface RoundRectangle2D
Returns:
the height of the arc that rounds off the corners of this RoundRectangle2D.

getArcWidth

public double getArcWidth()
Returns the width of the arc that rounds off the corners.
Overrides:
getArcWidth in interface RoundRectangle2D
Returns:
the width of the arc that rounds off the corners of this RoundRectangle2D.

getBounds2D

public Rectangle2D getBounds2D()
Returns the high precision bounding box of this RoundRectangle2D.
Specified by:
getBounds2D in interface Shape
Returns:
a Rectangle2D that is the bounding box of this RoundRectangle2D.

getHeight

public double getHeight()
Returns the height of this RoundRectangle2D in double precision.
Overrides:
getHeight in interface RectangularShape
Returns:
the height of this RoundRectangle2D.

getWidth

public double getWidth()
Returns the width of this RoundRectangle2D in double precision.
Overrides:
getWidth in interface RectangularShape
Returns:
the width of this RoundRectangle2D.

getX

public double getX()
Returns the X coordinate of this RoundRectangle2D in double precision.
Overrides:
getX in interface RectangularShape
Returns:
the X coordinate of this RoundRectangle2D.

getY

public double getY()
Returns the Y coordinate of this RoundRectangle2D in double precision.
Overrides:
getY in interface RectangularShape
Returns:
the Y coordinate of this RoundRectangle2D.

isEmpty

public boolean isEmpty()
Determines whether or not this RoundRectangle2D is empty.
Overrides:
isEmpty in interface RectangularShape
Returns:
true if this RoundRectangle2D is empty; false othwerwise.

setRoundRect

public void setRoundRect(double x,
                         double y,
                         double w,
                         double h,
                         double arcw,
                         double arch)
Sets the location, size, and arc radii of this RoundRectangle2D to the specified double values.
Overrides:
setRoundRect in interface RoundRectangle2D
Parameters:
w - the width to which to set this RoundRectangle2D
h - the height to which to set this RoundRectangle2D
arcw - the width to which to set the arc of this RoundRectangle2D
arch - the height to which to set the arc of this RoundRectangle2D

setRoundRect

public void setRoundRect(float x,
                         float y,
                         float w,
                         float h,
                         float arcw,
                         float arch)
Sets the location, size, and arc radii of this RoundRectangle2D to the specified float values.
Parameters:
w - the width to which to set this RoundRectangle2D
h - the height to which to set this RoundRectangle2D
arcw - the width to which to set the arc of this RoundRectangle2D
arch - the height to which to set the arc of this RoundRectangle2D

setRoundRect

public void setRoundRect(RoundRectangle2D rr)
Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D.
Overrides:
setRoundRect in interface RoundRectangle2D
Parameters:
rr - the specified RoundRectangle2D