JavaTM 2 Platform
Standard Ed. 6

类 java.awt.geom.Rectangle2D
的使用

使用 Rectangle2D 的软件包
java.awt 包含用于创建用户界面和绘制图形图像的所有类。 
java.awt.font 提供与字体相关的类和接口。 
java.awt.geom 提供用于在与二维几何形状相关的对象上定义和执行操作的 Java 2D 类。 
java.awt.image 提供创建和修改图像的各种类。 
java.awt.image.renderable 提供用于生成与呈现无关的图像的类和接口。 
javax.swing.plaf.basic 提供了根据基本外观构建的用户界面对象。 
javax.swing.text 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
 

java.awtRectangle2D 的使用
 

java.awtRectangle2D 的子类
 class Rectangle
          Rectangle 指定坐标空间中的一个区域,通过坐标空间中 Rectangle 对象左上方的点 (x,y)、宽度和高度可以定义这个区域。
 

返回 Rectangle2Djava.awt 中的方法
 Rectangle2D Rectangle.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
 Rectangle2D Rectangle.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 Rectangle2D TexturePaint.getAnchorRect()
          返回定位纹理图像并设置其大小的固定矩形的副本。
 Rectangle2D Polygon.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Rectangle.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Shape.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Font.getMaxCharBounds(FontRenderContext frc)
          返回最大边界定义在 FontRenderContext 中的字符的边界。
 Rectangle2D FontMetrics.getMaxCharBounds(Graphics context)
          返回指定 Graphics 上下文中具有最大边界的字符的边界。
 Rectangle2D Font.getStringBounds(char[] chars, int beginIndex, int limit, FontRenderContext frc)
          返回指定 FontRenderContext 指定字符数组的逻辑边界。
 Rectangle2D FontMetrics.getStringBounds(char[] chars, int beginIndex, int limit, Graphics context)
          返回指定 Graphics 上下文中指定字符数组的边界。
 Rectangle2D Font.getStringBounds(CharacterIterator ci, int beginIndex, int limit, FontRenderContext frc)
          返回指定 FontRenderContext 中针对指定 CharacterIterator 进行索引的字符的逻辑边界。
 Rectangle2D FontMetrics.getStringBounds(CharacterIterator ci, int beginIndex, int limit, Graphics context)
          返回用指定 Graphics 上下文中指定 CharacterIterator 进行索引的字符的边界。
 Rectangle2D Font.getStringBounds(String str, FontRenderContext frc)
          返回指定 FontRenderContext 中指定 String 的逻辑边界。
 Rectangle2D FontMetrics.getStringBounds(String str, Graphics context)
          返回指定 Graphics 上下文中指定 String 的边界。
 Rectangle2D Font.getStringBounds(String str, int beginIndex, int limit, FontRenderContext frc)
          返回指定 FontRenderContext 中指定 String 的逻辑边界。
 Rectangle2D FontMetrics.getStringBounds(String str, int beginIndex, int limit, Graphics context)
          返回指定 Graphics 上下文中指定 String 的边界。
 

参数类型为 Rectangle2Djava.awt 中的方法
 boolean Polygon.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
 boolean Shape.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
 PaintContext GradientPaint.createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
          创建并返回用来生成颜色模式的上下文。
 PaintContext LinearGradientPaint.createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform transform, RenderingHints hints)
          创建并返回用来生成颜色模式的 PaintContext
 PaintContext RadialGradientPaint.createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform transform, RenderingHints hints)
          创建并返回用来生成颜色模式的 PaintContext
 PaintContext TexturePaint.createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
          创建并返回用于生成颜色模式的上下文。
 PaintContext SystemColor.createContext(ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints)
          创建并返回用来生成纯色模式的 PaintContext
 PaintContext Color.createContext(ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints)
          创建并返回用来生成固定颜色模式的 PaintContext
 PaintContext Paint.createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
          创建并返回用来生成颜色模式的 PaintContext
 Rectangle2D Rectangle.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
 Rectangle2D Rectangle.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 boolean Polygon.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 boolean Shape.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 

参数类型为 Rectangle2Djava.awt 中的构造方法
RadialGradientPaint(Rectangle2D gradientBounds, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
          构造一个具有默认 SRGB 颜色空间的 RadialGradientPaint
TexturePaint(BufferedImage txtr, Rectangle2D anchor)
          构造 TexturePaint 对象。
 

java.awt.fontRectangle2D 的使用
 

返回 Rectangle2Djava.awt.font 中的方法
 Rectangle2D GraphicAttribute.getBounds()
          返回包括所有位的 Rectangle2D,这些位由与呈现位置相关的 GraphicAttribute 绘制。
 Rectangle2D ImageGraphicAttribute.getBounds()
          返回一个 Rectangle2D,它封装此 ImageGraphicAttribute 相对于呈现位置呈现的所有位。
 Rectangle2D ShapeGraphicAttribute.getBounds()
          返回一个 Rectangle2D,它封装此 ShapeGraphicAttribute 相对于呈现位置绘制的所有位。
 Rectangle2D TextLayout.getBounds()
          返回此 TextLayout 的边界。
 Rectangle2D GlyphMetrics.getBounds2D()
          返回该字形的边界。
abstract  Rectangle2D GlyphVector.getLogicalBounds()
          返回此 GlyphVector 的逻辑边界。
abstract  Rectangle2D GlyphVector.getVisualBounds()
          返回此 GlyphVector 的可视边界,可视边界是此 GlyphVector 轮廓的边界框。
 

参数类型为 Rectangle2Djava.awt.font 中的方法
 float[] TextLayout.getCaretInfo(TextHitInfo hit, Rectangle2D bounds)
          返回与对应于 hit 的插入符有关的信息。
 Shape TextLayout.getCaretShape(TextHitInfo hit, Rectangle2D bounds)
          返回表示指定边界内指定目标字符处插入符的 Shape
 Shape[] TextLayout.getCaretShapes(int offset, Rectangle2D bounds)
          返回对应于强插入符和弱插入符的两条路径。
 Shape[] TextLayout.getCaretShapes(int offset, Rectangle2D bounds, TextLayout.CaretPolicy policy)
          返回对应于强插入符和弱插入符的两条路径。
 Shape TextLayout.getLogicalHighlightShape(int firstEndpoint, int secondEndpoint, Rectangle2D bounds)
          返回封闭指定范围中扩展到指定 bounds 的逻辑选择范围的 Shape
 Shape TextLayout.getVisualHighlightShape(TextHitInfo firstEndpoint, TextHitInfo secondEndpoint, Rectangle2D bounds)
          返回封闭指定范围中扩展到 bounds 的可视选择范围的路径。
 TextHitInfo TextLayout.hitTestChar(float x, float y, Rectangle2D bounds)
          返回对应于指定点的 TextHitInfo
 

参数类型为 Rectangle2Djava.awt.font 中的构造方法
GlyphMetrics(boolean horizontal, float advanceX, float advanceY, Rectangle2D bounds, byte glyphType)
          构造一个 GlyphMetrics 对象。
GlyphMetrics(float advance, Rectangle2D bounds, byte glyphType)
          构造一个 GlyphMetrics 对象。
 

java.awt.geomRectangle2D 的使用
 

java.awt.geomRectangle2D 的子类
static class Rectangle2D.Double
          Double 类定义一个在 double 坐标中指定的矩形。
static class Rectangle2D.Float
          Float 类定义一个在 float 坐标中指定的矩形。
 

返回 Rectangle2Djava.awt.geom 中的方法
abstract  Rectangle2D Rectangle2D.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
 Rectangle2D Rectangle2D.Float.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
 Rectangle2D Rectangle2D.Double.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
abstract  Rectangle2D Rectangle2D.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 Rectangle2D Rectangle2D.Float.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 Rectangle2D Rectangle2D.Double.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 Rectangle2D Arc2D.getBounds2D()
          返回弧的高精度窗体矩形。
 Rectangle2D Area.getBounds2D()
          返回完全包围此 Area 的高精度边界 Rectangle2D
 Rectangle2D CubicCurve2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D CubicCurve2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Ellipse2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Ellipse2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Line2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Line2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Path2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Path2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D QuadCurve2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D QuadCurve2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D RoundRectangle2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D RoundRectangle2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Rectangle2D.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Rectangle2D.Float.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D Rectangle2D.Double.getBounds2D()
          返回一个高精度的、比 getBounds 方法更准确的 Shape 边界框。
 Rectangle2D RectangularShape.getFrame()
          返回定义此对象的总体形状的窗体 Rectangle2D
protected abstract  Rectangle2D Arc2D.makeBounds(double x, double y, double w, double h)
          构造一个适当精度的 Rectangle2D,以保存为此弧的窗体矩形计算出的参数。
protected  Rectangle2D Arc2D.Float.makeBounds(double x, double y, double w, double h)
          构造一个适当精度的 Rectangle2D,以保存为此弧的窗体矩形计算出的参数。
protected  Rectangle2D Arc2D.Double.makeBounds(double x, double y, double w, double h)
          构造一个适当精度的 Rectangle2D,以保存为此弧的窗体矩形计算出的参数。
 

参数类型为 Rectangle2Djava.awt.geom 中的方法
 void Rectangle2D.add(Rectangle2D r)
          将 Rectangle2D 对象添加到此 Rectangle2D 中。
static boolean Path2D.contains(PathIterator pi, Rectangle2D r)
          测试指定的 Rectangle2D 是否完全在指定 PathIterator 的封闭区域内。
 boolean Arc2D.contains(Rectangle2D r)
          确定弧的内部是否完全包含指定的矩形。
 boolean Area.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
 boolean CubicCurve2D.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
 boolean Line2D.contains(Rectangle2D r)
          测试此 Line2D 内部是否完全包含指定的 Rectangle2D
 boolean Path2D.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
 boolean QuadCurve2D.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
 boolean RectangularShape.contains(Rectangle2D r)
          测试 Shape 内部是否完全包含指定的 Rectangle2D
abstract  Rectangle2D Rectangle2D.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
 Rectangle2D Rectangle2D.Float.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
 Rectangle2D Rectangle2D.Double.createIntersection(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的交集。
abstract  Rectangle2D Rectangle2D.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 Rectangle2D Rectangle2D.Float.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
 Rectangle2D Rectangle2D.Double.createUnion(Rectangle2D r)
          返回一个新的 Rectangle2D 对象,它表示此 Rectangle2D 与指定 Rectangle2D 的并集。
static void Rectangle2D.intersect(Rectangle2D src1, Rectangle2D src2, Rectangle2D dest)
          将指定的一对源 Rectangle2D 对象相交,并将结果置于指定的目标 Rectangle2D 对象中。
static boolean Path2D.intersects(PathIterator pi, Rectangle2D r)
          测试指定 PathIterator 的内部是否与指定 Rectangle2D 的内部相交。
 boolean Area.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 boolean CubicCurve2D.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 boolean Line2D.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 boolean Path2D.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 boolean QuadCurve2D.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 boolean RectangularShape.intersects(Rectangle2D r)
          测试 Shape 内部是否与指定 Rectangle2D 内部相交。
 void Arc2D.setArc(Rectangle2D rect, double angSt, double angExt, int closure)
          将此弧的位置、大小、角跨越和闭合类型设置为指定值。
 void RectangularShape.setFrame(Rectangle2D r)
          将此 Shape 窗体矩形设置为指定的 Rectangle2D
 void Rectangle2D.setRect(Rectangle2D r)
          将此 Rectangle2D 设置为与指定的 Rectangle2D 相同。
 void Rectangle2D.Float.setRect(Rectangle2D r)
          将此 Rectangle2D 设置为与指定的 Rectangle2D 相同。
 void Rectangle2D.Double.setRect(Rectangle2D r)
          将此 Rectangle2D 设置为与指定的 Rectangle2D 相同。
static void Rectangle2D.union(Rectangle2D src1, Rectangle2D src2, Rectangle2D dest)
          将一对源 Rectangle2D 对象合并,并将结果置于指定的目标 Rectangle2D 对象中。
 

参数类型为 Rectangle2Djava.awt.geom 中的构造方法
Arc2D.Double(Rectangle2D ellipseBounds, double start, double extent, int type)
          构造一个新弧,并将其初始化为指定的位置、大小、角跨越和闭合类型。
Arc2D.Float(Rectangle2D ellipseBounds, float start, float extent, int type)
          构造一个新弧,并将其初始化为指定的位置、大小、角跨越和闭合类型。
 

java.awt.imageRectangle2D 的使用
 

返回 Rectangle2Djava.awt.image 中的方法
 Rectangle2D AffineTransformOp.getBounds2D(BufferedImage src)
          返回转换后的目标图像的边界框。
 Rectangle2D BufferedImageOp.getBounds2D(BufferedImage src)
          返回已过滤目标图像的边界框。
 Rectangle2D ColorConvertOp.getBounds2D(BufferedImage src)
          返回给定源的目标边界框。
 Rectangle2D ConvolveOp.getBounds2D(BufferedImage src)
          返回已过滤目标图像的边界框。
 Rectangle2D LookupOp.getBounds2D(BufferedImage src)
          返回过滤后的目标图像的边界框。
 Rectangle2D RescaleOp.getBounds2D(BufferedImage src)
          返回重缩放后的目标图像的边界框。
 Rectangle2D AffineTransformOp.getBounds2D(Raster src)
          返回转换后的目标图像的边界框。
 Rectangle2D BandCombineOp.getBounds2D(Raster src)
          返回变换后目标图像的边界框。
 Rectangle2D ColorConvertOp.getBounds2D(Raster src)
          返回给定源的目标边界框。
 Rectangle2D ConvolveOp.getBounds2D(Raster src)
          返回已过滤目标 Raster 的边界框。
 Rectangle2D LookupOp.getBounds2D(Raster src)
          返回过滤后目标 Raster 的边界框。
 Rectangle2D RasterOp.getBounds2D(Raster src)
          返回过滤后目标 Raster 的边界框。
 Rectangle2D RescaleOp.getBounds2D(Raster src)
          返回重缩放后的目标 Raster 的边界框。
 

java.awt.image.renderableRectangle2D 的使用
 

返回 Rectangle2Djava.awt.image.renderable 中的方法
 Rectangle2D ContextualRenderedImageFactory.getBounds2D(ParameterBlock paramBlock)
          返回操作的输出的边界框,该操作在与呈现无关的空间中给定的一组源上执行。
 

javax.swing.plaf.basicRectangle2D 的使用
 

javax.swing.plaf.basicRectangle2D 的子类
static class BasicTextUI.BasicCaret
           
 

javax.swing.textRectangle2D 的使用
 

javax.swing.textRectangle2D 的子类
 class DefaultCaret
          插入符的默认实现。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only