codeblocks.rendering
Class BlockShapeUtil

java.lang.Object
  extended by codeblocks.rendering.BlockShapeUtil

public class BlockShapeUtil
extends java.lang.Object


Constructor Summary
BlockShapeUtil()
           
 
Method Summary
static void appendPath(java.awt.geom.GeneralPath gp1, java.awt.geom.GeneralPath gp2, boolean reversed)
          Appends path gp2 to gp1.
static void cornerShape(java.awt.geom.GeneralPath gp, float x1, float y1, float x2, float y2, float x3, float y3)
          Assumes we are at (x1,y1), the corner point is (x2,y2), and we end at (x3, y3)
static void cornerTo(java.awt.geom.GeneralPath gp, java.awt.geom.Point2D cornerPoint, java.awt.geom.Point2D nextCornerPoint, float radius)
          Draws a corner relative to the current point of the GeneralPath.
static void curveTo(java.awt.geom.GeneralPath gp, float x1, float y1, float x2, float y2, float x3, float y3)
          Draws a curve segment relative to the current point of the GeneralPath.
static java.awt.Image getBevelImage(int width, int height, java.awt.geom.Area s)
          Static method to return bufferedImage of a Beveled outline of a block
static void lineToRelative(java.awt.geom.GeneralPath gp, float x, float y)
          Draws a line segment relative to the current point of the GeneralPath.
static void printPath(java.awt.geom.GeneralPath gp)
          Prints out a GeneralPath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockShapeUtil

public BlockShapeUtil()
Method Detail

lineToRelative

public static void lineToRelative(java.awt.geom.GeneralPath gp,
                                  float x,
                                  float y)
Draws a line segment relative to the current point of the GeneralPath.


curveTo

public static void curveTo(java.awt.geom.GeneralPath gp,
                           float x1,
                           float y1,
                           float x2,
                           float y2,
                           float x3,
                           float y3)
Draws a curve segment relative to the current point of the GeneralPath. Adds a curved segment, defined by three new points, to the path by drawing a Bˇzier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bˇzier control points.


cornerTo

public static void cornerTo(java.awt.geom.GeneralPath gp,
                            java.awt.geom.Point2D cornerPoint,
                            java.awt.geom.Point2D nextCornerPoint,
                            float radius)
Draws a corner relative to the current point of the GeneralPath.

Parameters:
gp - is the general path to which the corner is being added
cornerPoint - is where the intersection of the two sides would be if there was no curve
nextCornerPoint - is the location where the corner is curving to
radius - is the radius size of the corner

cornerShape

public static void cornerShape(java.awt.geom.GeneralPath gp,
                               float x1,
                               float y1,
                               float x2,
                               float y2,
                               float x3,
                               float y3)
Assumes we are at (x1,y1), the corner point is (x2,y2), and we end at (x3, y3)


getBevelImage

public static java.awt.Image getBevelImage(int width,
                                           int height,
                                           java.awt.geom.Area s)
Static method to return bufferedImage of a Beveled outline of a block


appendPath

public static void appendPath(java.awt.geom.GeneralPath gp1,
                              java.awt.geom.GeneralPath gp2,
                              boolean reversed)
Appends path gp2 to gp1. Taken from pre-redesign code.

Parameters:
reversed - is true if the segments are added in reverse order

printPath

public static void printPath(java.awt.geom.GeneralPath gp)
Prints out a GeneralPath. Used for debugging only