|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart3djava.ChartObj
com.quinncurtis.chart3djava.UserCoordinates
public class UserCoordinates
This class implements simple 2D drawing using the Java user coordinate system. All coordinates are specified in Java user coordinates.
Field Summary |
---|
Constructor Summary | |
---|---|
UserCoordinates()
Creates a new instance of UserCoordinates |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns an object that is a clone of this UserCoordinates object. |
ChartPoint3D |
convert3DPoint(ChartPoint3D pnt)
This methods sets transforms the 3D user coordinates to a 2D screen coordinate projection. |
ChartPoint3D |
convert3DPoint(double x,
double y,
double z)
This methods transforms the 3D coordinates to a 2D projection. |
ChartRectangle3D |
convert3DRectangle(ChartRectangle3D rect)
This methods transforms the 3D coordinates of a rectangle to a 2D projection. |
void |
copy(UserCoordinates source)
Copies the source UserCoordinates object. |
void |
drawFillCircle(java.awt.Graphics2D g2,
int x,
int y,
int radiusx,
int radiusy)
This method renders an ellipse, using the current fill attributes. |
void |
drawFillPath(java.awt.Graphics2D g2,
java.awt.geom.GeneralPath path)
This method renders a closed polygon, contained in the specified path, using the current fill attributes. |
void |
drawFillRectangle(java.awt.Graphics2D g2,
ChartRectangle3D rect)
This method renders a rectangle using the current fill attributes. |
void |
drawPath(java.awt.Graphics2D g2,
java.awt.geom.GeneralPath path)
This method renders a closed polygon, contained in the specified path, using the specified pen. |
void |
endXORMode(ChartView canvas)
This method ends an XOR drawing mode for the window. |
int |
errorCheck(int nerror)
Checks the scale object for common errors. |
void |
fillPath(java.awt.Graphics2D g2,
java.awt.geom.GeneralPath path)
This method renders a closed polygon, contained in the specified path, using the specified pen. |
ChartRectangle3D |
getClippingBounds()
This method returns the clipping bounds. |
ChartRectangle3D |
getClipRect()
This method returns the current clipping rectangle of the current graphics context. |
java.awt.Graphics |
getContext()
This method returns a reference to the current graphics context used by the drawing routines in this class. |
ChartAttribute |
getCurrentAttributes()
This method returns a copy of the current drawing attributes for the class. |
java.awt.Color |
getCurrentColor()
This method returns the current drawing color for the class. |
java.awt.Font |
getCurrentFont()
This method returns the current font used in the rendering of text. |
static ChartRectangle3D |
getInitialClipRect()
This method returns the intial clipping rectangle of the graphics context. |
ChartRectangle3D |
getIntersectClipRect(ChartRectangle3D cliprect)
Combines the initital clipping rectangle with the current clipping rectangle, returning the intersection. |
boolean |
getLightingEnabled()
Get the the light enabled flag. |
PolygonList |
getPolygonBuffer()
Get the current polygon buffer as a PolygonList object. |
double |
getStringAscent(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the ascent of the specified string, rendered using the current font. |
double |
getStringDescent(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the descent of the specified string, rendered using the current font. |
ChartDimension3D |
getStringDimension(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the bounding dimension of the specified string, rendered using the current font. |
double |
getStringLeading(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the ascent of the specified string, rendered using the current font. |
double |
getStringLineSpace(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the line spacing of the specified string, rendered using the current font. |
ChartRectangle3D |
getStringRect(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the bounding box of the specified string, rendered using the current font. |
double |
getStringX(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the bounding width of the specified string, rendered using the current font. |
double |
getStringY(java.awt.Graphics2D g2,
java.lang.String s)
This method returns the bounding height of the specified string, rendered using the current font. |
Transform3D |
getTheTransform3D()
Get the 3D transform object associated with this coordinate system. |
boolean |
getUse3DRoutines()
Return true if the 3D transform is NOT the identity matrix, hence 3D drawing routines used. |
ChartPoint3D |
getUserCurrentPos()
This method returns the current position, in window device coordinates, of the graphics pen. |
ChartRectangle3D |
getUserViewport()
This method returns the current drawing viewport. |
double |
getUserX1()
This method returns the lower left x-value, in window device coordinates, defining the current viewport. |
double |
getUserX2()
This method returns the upper right x-value, in window device coordinates, defining the current viewport. |
double |
getUserY1()
This method returns the lower left y-value, in window device coordinates, defining the current viewport. |
double |
getUserY2()
This method returns the upper right y-value, in window device coordinates, defining the current viewport. |
boolean |
getWireFrame()
Get the current wire frame mode (true and no polygon fills are used in drawing. |
void |
pLineAbs(java.awt.geom.GeneralPath path,
ChartPoint3D p1,
ChartPoint3D p2)
This method adds a line segment with endpoints (x1,y1)-(x2,y2) to the specified path. |
void |
pLineAbs(java.awt.geom.GeneralPath path,
double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
This method adds a line segment with endpoints (x1,y1, z1)-(x2,y2, z2) to the specified path. |
void |
pLineRel(java.awt.geom.GeneralPath path,
double x,
double y,
double z)
This method implements a relative lineto operation by adding the x, y and z values to the current drawing position, and drawing a line from the old position to the new position. |
void |
pLineToAbs(java.awt.geom.GeneralPath path,
ChartPoint3D p1)
This method implements a lineto operation by drawing a line from the current location to the specified x-, y-, and z-coordinates of the specified path. |
void |
pLineToAbs(java.awt.geom.GeneralPath path,
double x,
double y,
double z)
This method implements a lineto operation by drawing a line from the current location to the specified x-, y- and z-coordinates of the specified path. |
void |
pMoveRel(java.awt.geom.GeneralPath path,
double x,
double y,
double z)
This method implements a relative move operation by adding the x, y and z values to the current drawing position of the specified path. |
void |
pMoveToAbs(java.awt.geom.GeneralPath path,
ChartPoint3D p)
This methods sets current drawing position of the specified path to the specified x-, y-, and z-coordinates. |
void |
pMoveToAbs(java.awt.geom.GeneralPath path,
double x,
double y,
double z)
This methods sets current drawing position of the specified path to the specified x-, y- and z-coordinates. |
void |
pPolyLine(java.awt.geom.GeneralPath path,
ChartPoint3D[] p,
int numdat)
This method adds multiple line segments to the specified path. |
void |
pRectangle(java.awt.geom.GeneralPath path,
ChartRectangle3D rect)
This method adds a rectangle shape to the specified path. |
void |
pTriangle(java.awt.geom.GeneralPath path,
ChartRectangle3D rect,
int dir)
This method adds a triangle shape to the specified path. |
void |
setClippingBounds(ChartRectangle3D cliprect)
Sets the clipping bounds using the specified rectangle. |
void |
setClippingBounds(int x,
int y,
int z,
int w,
int h,
int d)
Sets the clipping bounds using the specified rectangle. |
void |
setClipRect(ChartRectangle3D rect)
Sets the current clipping rectangle in the current graphics context. |
void |
setClipRect(double x,
double y,
double z,
double w,
double h,
double d)
Sets the current clipping rectangle in the current graphics context. |
void |
setClipRectX(ChartRectangle3D cliprect)
Sets the current clipping rectangle in the current graphics context. |
void |
setContext(java.awt.Graphics2D g2)
This method initializes the current graphics context used by the drawing routines in this class. |
void |
setCurrentAttributes(ChartAttribute attrib)
Sets the current drawing attributes of the current graphics context. |
void |
setCurrentColor(java.awt.Color rgbcolor)
Sets the current drawing color of the graphics context. |
void |
setCurrentFont(java.awt.Font font)
Sets the current font used in the rendering of text. |
static void |
setInitialClipRect(ChartRectangle3D r)
This method sets the intial clipping rectangle of the graphics context. |
void |
setLightingEnabled(boolean value)
Set the the light enabled flag. |
void |
setPlaneColor(ChartPoint3D[] solid,
ChartAttribute attrib)
Sets the colors for drawing and filling a polygon. |
void |
setPolygonBuffer(PolygonList value)
Set the current polygon buffer as a PolygonList object. |
void |
setTheTransform3D(Transform3D value)
Set the 3D transform object associated with this coordinate system. |
void |
setUserViewport(ChartRectangle3D rect)
Sets the current drawing viewport using window device coordinates. |
void |
setUserViewport(double x,
double y,
double z,
double w,
double h,
double d)
Sets the current drawing viewport using window device coordinates. |
void |
setWireFrame(boolean value)
Set the current wire frame mode (true and no polygon fills are used in drawing. |
void |
startXORMode(ChartView canvas,
java.awt.Color framecolor,
int linestyle)
This method starts an XOR drawing mode for the window. |
Methods inherited from class com.quinncurtis.chart3djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserCoordinates()
Method Detail |
---|
public int errorCheck(int nerror)
errorCheck
in class ChartObj
nerror
- Current error state
public void copy(UserCoordinates source)
source
- The source UserCoordinates object.public java.lang.Object clone()
clone
in class java.lang.Object
public void setContext(java.awt.Graphics2D g2)
g2
- The graphics context.public java.awt.Graphics getContext()
public void setClippingBounds(ChartRectangle3D cliprect)
cliprect
- The clipping rectangle in window device coordinates.public void setClippingBounds(int x, int y, int z, int w, int h, int d)
x
- The x-position of the clipping rectangle in window device coordinates.y
- The y-position of the clipping rectangle in window device coordinates.z
- The z-position of the clipping rectangle in window device coordinates.w
- The width of the clipping rectangle in window device coordinates.h
- The height of the clipping rectangle in window device coordinates.d
- The depth of the clipping rectangle in window device coordinates.public ChartRectangle3D getClippingBounds()
public ChartRectangle3D getIntersectClipRect(ChartRectangle3D cliprect)
cliprect
- The clipping rectangle in window device coordinates.
public void setClipRect(ChartRectangle3D rect)
rect
- The clipping rectangle in window device coordinates.public void setClipRectX(ChartRectangle3D cliprect)
cliprect
- The clipping rectangle in window device coordinates.public void setClipRect(double x, double y, double z, double w, double h, double d)
x
- The x-coordinate of the upper left value of the clipping rectangle.y
- The y-coordinate of the upper left value of the clipping rectangle.z
- The z-coordinate of the upper left value of the clipping rectangle.w
- The width of the clipping rectangle.h
- The height of the clipping rectangle.d
- The depth of the clipping rectangle.public ChartRectangle3D getClipRect()
public void setCurrentAttributes(ChartAttribute attrib)
attrib
- A reference to an attribute object.public ChartAttribute getCurrentAttributes()
public void setCurrentColor(java.awt.Color rgbcolor)
rgbcolor
- A reference to an color object.public java.awt.Color getCurrentColor()
public void setUserViewport(double x, double y, double z, double w, double h, double d)
x
- The x-coordinate of the upper left value of the viewport.y
- The y-coordinate of the upper left value of the viewport.z
- The z-coordinate of the upper left value of the viewport.w
- The width of the viewport.h
- The height of the viewport.d
- The depth of the viewport.public void setUserViewport(ChartRectangle3D rect)
rect
- The user viewport in window device coordinates.public ChartRectangle3D getUserViewport()
public ChartPoint3D convert3DPoint(double x, double y, double z)
x
- The x-coordinate of the new drawing position.y
- The y-coordinate of the new drawing position.z
- The z-coordinate of the new drawing position.
public ChartRectangle3D convert3DRectangle(ChartRectangle3D rect)
rect
- The source ChartRectangle3D object.
public ChartPoint3D convert3DPoint(ChartPoint3D pnt)
pnt
- The sourc point object.
public void pMoveToAbs(java.awt.geom.GeneralPath path, double x, double y, double z)
path
- This path is updated with the new position.*x
- The x-coordinate of the new drawing position.y
- The y-coordinate of the new drawing position.z
- The z-coordinate of the new drawing position.public void pMoveToAbs(java.awt.geom.GeneralPath path, ChartPoint3D p)
path
- This path is updated with the new position.p
- The coordinates of the new drawing position.public void pMoveRel(java.awt.geom.GeneralPath path, double x, double y, double z)
path
- This path is updated with the new position.x
- The delta x-value added to the current x-coordinate drawing position.y
- The delta y-value added to the current y-coordinate drawing position.z
- The delta z-value added to the current z-coordinate drawing position.public void pLineToAbs(java.awt.geom.GeneralPath path, double x, double y, double z)
path
- A new line segment is added to this path.x
- The delta x-value added to the current x-coordinate drawing position.y
- The delta y-value added to the current y-coordinate drawing position.z
- The delta z-value added to the current z-coordinate drawing position.public void pLineToAbs(java.awt.geom.GeneralPath path, ChartPoint3D p1)
path
- A new line segment is added to this path.p1
- Draw a line to this point.public void pLineAbs(java.awt.geom.GeneralPath path, double x1, double y1, double z1, double x2, double y2, double z2)
path
- A new line segment is added to this path.x1
- The starting x-coordinate value of the line segment.y1
- The starting y-coordinate value of the line segment.z1
- The starting z-coordinate value of the line segment.x2
- The ending x-coordinate value of the line segment.y2
- The ending y-coordinate value of the line segment.z2
- The ending y-coordinate value of the line segment.public void pLineAbs(java.awt.geom.GeneralPath path, ChartPoint3D p1, ChartPoint3D p2)
path
- A new line segment is added to this path.p1
- The starting value of the line segment.p2
- The ending value of the line segment.public void pLineRel(java.awt.geom.GeneralPath path, double x, double y, double z)
path
- A new line segment is added to this path.x
- The delta x-value used in the relative line to operation.y
- The delta y-value used in the relative line to operation.z
- The delta z-value used in the relative line to operation.public void pRectangle(java.awt.geom.GeneralPath path, ChartRectangle3D rect)
path
- The line segments are added to this path.rect
- The rectangle added to the path.public void pTriangle(java.awt.geom.GeneralPath path, ChartRectangle3D rect, int dir)
path
- The line segments are added to this path.rect
- The triangle is added to the path.dir
- Specify VERT_DIR or HORIZ_DIR.public void pPolyLine(java.awt.geom.GeneralPath path, ChartPoint3D[] p, int numdat)
path
- The line segments are added to this path.p
- An array, size numdat, of points defining the endpoints of the line segments
that are added to the specified path.numdat
- The number of points in the array.public void drawFillPath(java.awt.Graphics2D g2, java.awt.geom.GeneralPath path)
g2
- A graphics context.path
- A closed polygon has been previously defined for this path.public void drawFillCircle(java.awt.Graphics2D g2, int x, int y, int radiusx, int radiusy)
g2
- A graphics context.x
- x-position of circle center.y
- y-position of circle center.radiusx
- The radius of the x-coordinate.radiusy
- The radius of the y-coordinate.public void drawPath(java.awt.Graphics2D g2, java.awt.geom.GeneralPath path)
g2
- A graphics context.path
- A closed polygon has been previously defined for this path.public void fillPath(java.awt.Graphics2D g2, java.awt.geom.GeneralPath path)
g2
- A graphics context.path
- A closed polygon has been previously defined for this path.public void startXORMode(ChartView canvas, java.awt.Color framecolor, int linestyle)
canvas
- The ChartView object drawing takes place in.framecolor
- The drawing color.linestyle
- The drawing linestyle.public void endXORMode(ChartView canvas)
canvas
- The ChartView object drawing takes place in.public void drawFillRectangle(java.awt.Graphics2D g2, ChartRectangle3D rect)
g2
- A graphics context.rect
- A rectangle.public double getStringX(java.awt.Graphics2D g2, java.lang.String s)
g2
- The graphics context.s
- The string used to calculate the bounding width.
public double getStringY(java.awt.Graphics2D g2, java.lang.String s)
g2
- The graphics context.s
- The string used to calculate the bounding height.
public ChartRectangle3D getStringRect(java.awt.Graphics2D g2, java.lang.String s)
g2
- The graphics context.s
- The string used to calculate the bounding height.
public double getStringAscent(java.awt.Graphics2D g2, java.lang.String s)
g2
- The graphics context.s
- The string used to calculate the descent.
public double getStringDescent(java.awt.Graphics2D g2, java.lang.String s)
g2
- The graphics context.s
- The string used to calculate the descent.
public ChartDimension3D getStringDimension(java.awt.Graphics2D g2, java.lang.String s)
g2
- A graphics context.s
- The string used to calculate the bounding width.
public double getStringLeading(java.awt.Graphics2D g2, java.lang.String s)
g2
- A graphics context. *s
- The string used to calculate the descent.
public double getStringLineSpace(java.awt.Graphics2D g2, java.lang.String s)
g2
- A graphics context. *s
- The string used to calculate the descent.
public void setCurrentFont(java.awt.Font font)
font
- A reference to the font that is to be used as the current font.public java.awt.Font getCurrentFont()
public void setPlaneColor(ChartPoint3D[] solid, ChartAttribute attrib)
solid
- An array of Point3D objects, defining the polygon.attrib
- The polygon drawing attribute.public ChartPoint3D getUserCurrentPos()
public double getUserX1()
public double getUserY1()
public double getUserX2()
public double getUserY2()
public static void setInitialClipRect(ChartRectangle3D r)
r
- sets the intial clipping rectangle of the graphics context.public static ChartRectangle3D getInitialClipRect()
public Transform3D getTheTransform3D()
public void setTheTransform3D(Transform3D value)
value
- Set the 3D transform object associated with this coordinate system.public PolygonList getPolygonBuffer()
public void setPolygonBuffer(PolygonList value)
value
- Set the current polygon buffer as a PolygonList object.public boolean getWireFrame()
public void setWireFrame(boolean value)
value
- Set the current wire frame mode (true and no polygon fills are used in drawing.public boolean getLightingEnabled()
public void setLightingEnabled(boolean value)
value
- Set the the light enabled flag.public boolean getUse3DRoutines()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |