|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.image.graphics.ShapeUtil
public class ShapeUtil
Utility methods for generating various common Shapes for drawing figures.
Field Summary | |
---|---|
static int |
ARROW_SIZE
Default length of an arrow |
Constructor Summary | |
---|---|
ShapeUtil()
|
Method Summary | |
---|---|
static void |
addArrowLine(java.awt.geom.GeneralPath path,
java.awt.geom.Point2D.Double startPos,
java.awt.geom.Point2D.Double endPos)
Add a line with an arrow at the end to the given GeneralPath. |
static void |
main(java.lang.String[] args)
test main: usage: java GraphicsImageDisplay |
static java.awt.Shape |
makeArrow(java.awt.geom.Point2D.Double center,
java.awt.geom.Point2D.Double north)
Return a Shape object for the "arrow" symbol (a line from center to north with an arrow at north). |
static diva.util.java2d.Polygon2D |
makeArrowHead(java.awt.geom.Point2D.Double pos,
double length,
double angle,
boolean flip)
Make and return an arrow head shape at the given position. |
static java.awt.Shape |
makeCompass(java.awt.geom.Point2D.Double center,
java.awt.geom.Point2D.Double north,
java.awt.geom.Point2D.Double east)
Return a Shape object for a "compass" symbol (has two lines, from the center point, pointing north and east). |
static java.awt.Shape |
makeCross(double x,
double y,
double size)
Return a Shape object for a "cross" (x) symbol. |
static java.awt.Shape |
makeDiamond(double x,
double y,
double size)
Return a Shape object for a "diamond" symbol. |
static java.awt.Shape |
makeEllipse(double x,
double y,
double size)
Return a Shape object for an "ellipse" symbol. |
static java.awt.Shape |
makeEllipse(java.awt.geom.Point2D.Double center,
java.awt.geom.Point2D.Double north,
java.awt.geom.Point2D.Double east)
Return a Shape object for an "ellipse" symbol. |
static java.awt.Shape |
makeLine(java.awt.geom.Point2D.Double center,
java.awt.geom.Point2D.Double north,
java.awt.geom.Point2D.Double east)
Return a Shape object for the "line" symbol. |
static java.awt.Shape |
makePlus(java.awt.geom.Point2D.Double center,
java.awt.geom.Point2D.Double north,
java.awt.geom.Point2D.Double east)
Return a Shape object for a "plus" (+) symbol. |
static java.awt.Shape |
makeSquare(double x,
double y,
double size)
Return a Shape object for a "square" symbol. |
static java.awt.Shape |
makeTriangle(double x,
double y,
double size)
Return a Shape object for a "triangle" symbol. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ARROW_SIZE
Constructor Detail |
---|
public ShapeUtil()
Method Detail |
---|
public static java.awt.Shape makePlus(java.awt.geom.Point2D.Double center, java.awt.geom.Point2D.Double north, java.awt.geom.Point2D.Double east)
center
- the center point in screen coordsnorth
- the north point in screen coordseast
- the east point in screen coordspublic static java.awt.Shape makeCross(double x, double y, double size)
x
- the center X coord in screen coordsy
- the center Y coord in screen coordssize
- the radius of the symbolpublic static java.awt.Shape makeTriangle(double x, double y, double size)
x
- the center X coord in screen coordsy
- the center Y coord in screen coordssize
- the radius of the symbolpublic static java.awt.Shape makeDiamond(double x, double y, double size)
x
- the center X coord in screen coordsy
- the center Y coord in screen coordssize
- the radius of the symbolpublic static java.awt.Shape makeSquare(double x, double y, double size)
x
- the center X coord in screen coordsy
- the center Y coord in screen coordssize
- the radius of the symbolpublic static java.awt.Shape makeEllipse(double x, double y, double size)
x
- the center X coord in screen coordsy
- the center Y coord in screen coordssize
- the radius of the symbolpublic static java.awt.Shape makeEllipse(java.awt.geom.Point2D.Double center, java.awt.geom.Point2D.Double north, java.awt.geom.Point2D.Double east)
center
- the center point in screen coordsnorth
- the north point in screen coordseast
- the east point in screen coordspublic static java.awt.Shape makeCompass(java.awt.geom.Point2D.Double center, java.awt.geom.Point2D.Double north, java.awt.geom.Point2D.Double east)
center
- the center point in screen coordsnorth
- the north point in screen coordseast
- the east point in screen coordspublic static java.awt.Shape makeLine(java.awt.geom.Point2D.Double center, java.awt.geom.Point2D.Double north, java.awt.geom.Point2D.Double east)
center
- the center point in screen coordsnorth
- the north point in screen coordseast
- the east point in screen coordspublic static java.awt.Shape makeArrow(java.awt.geom.Point2D.Double center, java.awt.geom.Point2D.Double north)
center
- the center point in screen coordsnorth
- the north point in screen coordspublic static void addArrowLine(java.awt.geom.GeneralPath path, java.awt.geom.Point2D.Double startPos, java.awt.geom.Point2D.Double endPos)
path
- the line and arrow are added to the GeneralPathstartPos
- the start of the lineendPos
- the end of the line (where the arrow should be)public static diva.util.java2d.Polygon2D makeArrowHead(java.awt.geom.Point2D.Double pos, double length, double angle, boolean flip)
pos
- the position of the point of the arrow in screen coordslength
- the length of the arrowangle
- the rotation angle in radiansflip
- if true flip the arrow directionpublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |