com.steema.teechart.drawing
Class Graphics3DAWT

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.drawing.Graphics3D
          extended by com.steema.teechart.drawing.Graphics3DAWT
All Implemented Interfaces:
IGraphics3D, java.io.Serializable

public class Graphics3DAWT
extends Graphics3D

Title: Graphics3DAWT class

Description: Access to central Chart drawing elements

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.steema.teechart.drawing.IGraphics3D
IGraphics3D.PieRect
 
Field Summary
protected  int currentX
           
protected  int currentY
           
 boolean dirty
           
protected  java.awt.Graphics2D g
           
 
Fields inherited from class com.steema.teechart.drawing.Graphics3D
aspect, bounds, brush, DARKCOLORQUANTITY, DARKERCOLORQUANTITY, font, fourPoints, iPointDoubles, is3D, metafiling, monochrome, pen, smoothingMode, stringFormat, textSmooth
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
Graphics3DAWT()
           
Graphics3DAWT(IBaseChart c)
           
 
Method Summary
 void arc(int x1, int y1, int x2, int y2, double startAngle, double sweepAngle)
          Use Arc to draw an elliptically curved line with the current Pen.
 void arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
          Draws an arc in the rectangle defined by the 4 co-ordinates.
 void clipEllipse(Rectangle r)
          Creates a Elliptical Windows GDI clipping region.
 void clipPolygon(Point[] p)
          Creates a Polygonal Windows GDI clipping region.
 void clipRectangle(Rectangle r)
          Creates a rectangular Windows GDI clipping region.
 void draw(int x, int y, Image image)
          Paints the image at x,y coordinates.
 void draw(Rectangle r, Image image, boolean transparent)
          Paints the image in rectangle r.
 void drawBeziers(Point[] p)
          Draws Bezier splines for the Point array p.
protected  void drawBrushImage(Rectangle r)
           
protected  void drawString(int x, int y, java.lang.String text, ChartBrush brush)
           
 void ellipse(int x1, int y1, int x2, int y2)
          Draws an Ellipse between the 2 co-ordinates.
 void ellipseEnh(int x1, int y1, int x2, int y2)
          Internal use.
 void eraseBackground(int left, int top, int right, int bottom)
          Clears background defined for Rectangle Left, Top, Right, Bottom.
 boolean fillPieSegment(int x1, int y1, int x2, int y2, int sd, int rd, int cl)
           
 void fillRectangle(ChartBrush brush, int x, int y, int width, int height)
           
 java.awt.Shape getChartPolygon(Rectangle rect, int minZ, int maxZ)
           
 boolean getDirty()
           
 java.lang.Object getGraphics()
          Accesses Drawing Graphics
static boolean hasAlpha(Image image)
           
 void horizontalLine(int left, int right, int y)
          Draws a Horizontal Line.
 void initWindow(Aspect a, Rectangle r, int maxDepth)
           
protected  void line(ChartPen p, Point a, Point b)
           
 void line(int x0, int y0, int x1, int y1)
          Draws a Line between co-ordinates.
 void lineTo(int x, int y)
          Draws a line from the present PenPos to the new co-ordinates.
 void measureString(Dimension dimension, ChartFont f, java.lang.String text)
           
 void moveTo(int x, int y)
          Sets the value of PenPos to x and y co-ordinates before calling LineTo.
static void penPrepare(ChartPen pen, java.awt.Graphics g)
           
 void pie(int x1, int y1, int x2, int y2, double startAngle, double endAngle)
          Draws a Pie slice using StartAngle and End Angle.
 void pixel(int x, int y, int z, Color color)
          Sets the 3D pixel to Color, using Pen Width.
 void polygon(ChartBrush brush, Point[] points)
          Draws a polygon using the specified GDI brush.
 void polygon(Point[] p)
          Draws a polygon.
 void polygon(PointDouble[] points)
           
 void polyLine(Point[] p)
          Draws a series of line segments to join point array p.
 void prepareDrawImage()
           
static void prepareGradient(Gradient gradient, java.awt.Graphics2D g, Rectangle rect)
          Brush to fill rectangular area rect
 void rectangle(ChartBrush b, Rectangle r)
           
 void rectangle(Rectangle rect)
          Draws a Rectangle (Rectangle r).
 void resetState()
           
 void resetTransform()
           
 void rotateLabel(int x, int y, java.lang.String text, double rotDegree)
          Draws a rotated text String at the specified xy coordinates with the RotDegree rotation angle.
 void rotateTransform(Point p, double rotDegree)
           
 void roundRectangle(Rectangle r)
          Draws a rectangle with rounded corners of personalized curvature and size.
 void roundRectangle(Rectangle r, int roundWidth, int roundHeight)
          Draws a rectangle with rounded corners of personalized curvature and size.
protected  void roundRectangle(Rectangle r, int roundWidth, int roundHeight, java.awt.Graphics2D g)
           
 void setClip(java.awt.Shape region)
           
 void setDirty(boolean value)
           
 void setGraphics(java.lang.Object value)
           
 void setPen(ChartPen value)
          Determines the kind of pen used to draw Canvas lines.
 void setPixel(int x, int y, int z, Color color)
           
 void showImage()
           
protected  void sphereEnh(int x1, int y1, int x2, int y2)
          Internal use. 3D spheres
 void textOut(int x, int y, java.lang.String text)
          Displays the 2D non-rotated label at the specified X Y screen coordinates.
protected  void transparentEllipse(int x1, int y1, int x2, int y2)
           
 void unClip()
          Removes any clipping region applied to Chart Drawing.
 boolean validState()
           
 void verticalLine(int x, int top, int bottom)
          Draws a Vertical Line from (X,Top) to (X,Bottom).
 
Methods inherited from class com.steema.teechart.drawing.Graphics3D
applyBright, applyDark, arc, arc, arrow, calc3DPoint, calc3DPoint, calc3DPoint, calc3DPos, calc3DPos, calc3DPos, calc3DPos, calc3DPos, calc3DPos, calc3DPos, calcArcAngles, calcArcPoints, calcPerspective, calcRect3D, calcTrigValues, calculate2DPosition, calculate2DPosition, calculate3DPosition, calculate3DPosition, calculate3DPosition, changed, clipCube, clipRectangle, cone, cone, cone, cone, convexHull, correctRectangle, crossingLines, cube, cube, cube, cull, cull, cylinder, donut, draw, drawBeziers, drawBlur, drawBlur, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, fillRectangle, fontTextHeight, fourPointsFromRect, getAspect, getBackColor, getBrush, getChartXCenter, getChartYCenter, getColorPalette, getColorPaletteLength, getDefaultColor, getDefaultPattern, getFont, getFontHeight, getGradient, getIZoomfactor, getMetafiling, getMonochrome, getPen, getPolygon, getRectCenter, getRotationCenter, getSmoothingMode, getSupports3DText, getSupportsFullRotation, getTextAlign, getTextSmooth, getUseBuffer, getXCenter, getYCenter, horizontalLine, line, line, line, line, lineTo, lineTo, lineTo, lineTo, lineWithZ, moveTo, moveTo, moveTo, moveTo, orientRectangle, paintBevel, paintImageBevel, pie, pie, plane, plane, plane, planeFour3D, pointAtDistance, pointFromCircle, pointFromCircle, pointFromCircle, pointFromEllipse, pointFromSpiral, pointInEllipse, pointInEllipse, pointInHorizTriangle, pointInLineTolerance, pointInLineTolerance, pointInPolygon, pointInRect, pointInTriangle, polygon, polygon, polygon, polygon, polygonFourDouble, polygonRect, polyLine, projection, pyramid, pyramid, pyramidTrunc, rad2Deg, rectangle, rectangle, rectangle, rectangle, rectangleWithZ, rectangleY, rectangleZ, rectCenter, rectFromPolygon, rectFromRectZ, reset, restore, rotateLabel, rotateLabel, rotateRectangle, save, setBackColor, setBrush, setColorPalette, setFont, setGradient, setIZoomfactor, setMetafiling, setRotationCenter, setSmoothingMode, setTextAlign, setTextSmooth, setUseBuffer, setXCenter, setYCenter, sliceArray, sliceArray, sphere, sphere, sphere, sphere, sphere, textHeight, textHeight, textOut, textOut, textWidth, textWidth, transparency, transparentColor, transparentEllipse, transparentEllipse, triangle, triangle, unClipRectangle, verticalLine, zLine
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentX

protected int currentX

currentY

protected int currentY

g

protected java.awt.Graphics2D g

dirty

public boolean dirty
Constructor Detail

Graphics3DAWT

public Graphics3DAWT()

Graphics3DAWT

public Graphics3DAWT(IBaseChart c)
Method Detail

getGraphics

public java.lang.Object getGraphics()
Accesses Drawing Graphics

Returns:
Graphics2D

resetState

public void resetState()

showImage

public void showImage()

getDirty

public boolean getDirty()
Specified by:
getDirty in interface IGraphics3D
Overrides:
getDirty in class Graphics3D

setDirty

public void setDirty(boolean value)
Specified by:
setDirty in interface IGraphics3D
Overrides:
setDirty in class Graphics3D

validState

public boolean validState()
Overrides:
validState in class Graphics3D

initWindow

public void initWindow(Aspect a,
                       Rectangle r,
                       int maxDepth)
Specified by:
initWindow in interface IGraphics3D
Overrides:
initWindow in class Graphics3D

roundRectangle

protected void roundRectangle(Rectangle r,
                              int roundWidth,
                              int roundHeight,
                              java.awt.Graphics2D g)

penPrepare

public static final void penPrepare(ChartPen pen,
                                    java.awt.Graphics g)

setPen

public void setPen(ChartPen value)
Description copied from class: Graphics3D
Determines the kind of pen used to draw Canvas lines.

Specified by:
setPen in interface IGraphics3D
Overrides:
setPen in class Graphics3D
Parameters:
value - ChartPen

prepareDrawImage

public void prepareDrawImage()
Specified by:
prepareDrawImage in interface IGraphics3D
Specified by:
prepareDrawImage in class Graphics3D

setPixel

public void setPixel(int x,
                     int y,
                     int z,
                     Color color)
Specified by:
setPixel in interface IGraphics3D
Specified by:
setPixel in class Graphics3D

measureString

public void measureString(Dimension dimension,
                          ChartFont f,
                          java.lang.String text)
Specified by:
measureString in interface IGraphics3D
Specified by:
measureString in class Graphics3D

setClip

public void setClip(java.awt.Shape region)

setGraphics

public void setGraphics(java.lang.Object value)
Specified by:
setGraphics in interface IGraphics3D
Specified by:
setGraphics in class Graphics3D

prepareGradient

public static void prepareGradient(Gradient gradient,
                                   java.awt.Graphics2D g,
                                   Rectangle rect)
Brush to fill rectangular area rect

Parameters:
gradient - Gradient
g - Graphics2D
rect - Rectangle

line

protected void line(ChartPen p,
                    Point a,
                    Point b)
Specified by:
line in class Graphics3D

lineTo

public void lineTo(int x,
                   int y)
Draws a line from the present PenPos to the new co-ordinates.
The Line method has 4 overloads to facilitate the setting of the end co-ordinate using Point p or int x, int y, both with or without a z parameter.

Specified by:
lineTo in interface IGraphics3D
Specified by:
lineTo in class Graphics3D
Parameters:
x - int
y - int

line

public void line(int x0,
                 int y0,
                 int x1,
                 int y1)
Draws a Line between co-ordinates.

Specified by:
line in interface IGraphics3D
Specified by:
line in class Graphics3D
Parameters:
x0 - int
y0 - int
x1 - int
y1 - int

verticalLine

public void verticalLine(int x,
                         int top,
                         int bottom)
Draws a Vertical Line from (X,Top) to (X,Bottom).

Specified by:
verticalLine in interface IGraphics3D
Specified by:
verticalLine in class Graphics3D
Parameters:
x - int
top - int
bottom - int

horizontalLine

public void horizontalLine(int left,
                           int right,
                           int y)
Draws a Horizontal Line.

Specified by:
horizontalLine in interface IGraphics3D
Specified by:
horizontalLine in class Graphics3D
Parameters:
left - int
right - int
y - int

drawBeziers

public void drawBeziers(Point[] p)
Draws Bezier splines for the Point array p.

Specified by:
drawBeziers in interface IGraphics3D
Overrides:
drawBeziers in class Graphics3D
Parameters:
p - Point[]

roundRectangle

public void roundRectangle(Rectangle r,
                           int roundWidth,
                           int roundHeight)
Draws a rectangle with rounded corners of personalized curvature and size.

Specified by:
roundRectangle in interface IGraphics3D
Specified by:
roundRectangle in class Graphics3D
Parameters:
r - Rectangle
roundWidth - int
roundHeight - int

rectangle

public void rectangle(ChartBrush b,
                      Rectangle r)
Specified by:
rectangle in interface IGraphics3D
Specified by:
rectangle in class Graphics3D

drawBrushImage

protected void drawBrushImage(Rectangle r)

rectangle

public void rectangle(Rectangle rect)
Draws a Rectangle (Rectangle r).

Specified by:
rectangle in interface IGraphics3D
Specified by:
rectangle in class Graphics3D
Parameters:
r - Rectangle

arc

public void arc(int x1,
                int y1,
                int x2,
                int y2,
                double startAngle,
                double sweepAngle)
Use Arc to draw an elliptically curved line with the current Pen.

Specified by:
arc in interface IGraphics3D
Specified by:
arc in class Graphics3D
Parameters:
x1 - int
y1 - int
x2 - int
y2 - int
startAngle - double
sweepAngle - double

arc

public void arc(int x1,
                int y1,
                int x2,
                int y2,
                int x3,
                int y3,
                int x4,
                int y4)
Draws an arc in the rectangle defined by the 4 co-ordinates.

Specified by:
arc in class Graphics3D
Parameters:
x1 - int
y1 - int
x2 - int
y2 - int
x3 - int
y3 - int
x4 - int
y4 - int

transparentEllipse

protected void transparentEllipse(int x1,
                                  int y1,
                                  int x2,
                                  int y2)
Specified by:
transparentEllipse in class Graphics3D

ellipse

public void ellipse(int x1,
                    int y1,
                    int x2,
                    int y2)
Draws an Ellipse between the 2 co-ordinates.

Specified by:
ellipse in interface IGraphics3D
Specified by:
ellipse in class Graphics3D
Parameters:
x1 - int
y1 - int
x2 - int
y2 - int

roundRectangle

public void roundRectangle(Rectangle r)
Description copied from class: Graphics3D
Draws a rectangle with rounded corners of personalized curvature and size.

Specified by:
roundRectangle in interface IGraphics3D
Overrides:
roundRectangle in class Graphics3D
Parameters:
r - Rectangle

drawString

protected void drawString(int x,
                          int y,
                          java.lang.String text,
                          ChartBrush brush)
Specified by:
drawString in class Graphics3D

textOut

public void textOut(int x,
                    int y,
                    java.lang.String text)
Description copied from class: Graphics3D
Displays the 2D non-rotated label at the specified X Y screen coordinates.
Text is outputted to the correct internal drawing Graphics2D.
The X and Y coordinates must be valid and fit inside the Chart rectangle. It uses the current drawing Font attributes.
Writes text at the named x and y co-ordinates.

Specified by:
textOut in interface IGraphics3D
Overrides:
textOut in class Graphics3D
Parameters:
x - int
y - int
text - String

clipRectangle

public void clipRectangle(Rectangle r)
Creates a rectangular Windows GDI clipping region.
ClipRectangle creates a Windows GDI clipping region and selects it into TChart.Drawing Canvas device context handle.
Clipping regions are used to prevent a drawing escaping from desired polygon coordinates.
The UnClipRectangle method removes any clipping region applied to TChart Drawing Canvas.
You can use this method to avoid Series or custom drawing to go over the desired rectangle coordinates.
Note: Printing and creating metafiles do not accept clipping regions in logical pixels.

Specified by:
clipRectangle in interface IGraphics3D
Specified by:
clipRectangle in class Graphics3D
Parameters:
r - Rectangle

clipPolygon

public void clipPolygon(Point[] p)
Creates a Polygonal Windows GDI clipping region.
ClipPolygon creates a Windows GDI clipping region and selects it into TChart.Drawing Canvas device context handle.
Clipping regions are used to prevent a drawing escaping from desired polygon coordinates.
The UnClipRectangle method removes any clipping region applied to TChart Drawing Canvas.
You can use this method to avoid Series or custom drawing to go over the desired rectangle coordinates.
Note: Printing and creating metafiles do not accept clipping regions in logical pixels.

Specified by:
clipPolygon in interface IGraphics3D
Specified by:
clipPolygon in class Graphics3D
Parameters:
p - Point[]

unClip

public void unClip()
Removes any clipping region applied to Chart Drawing.

Specified by:
unClip in interface IGraphics3D
Specified by:
unClip in class Graphics3D

clipEllipse

public void clipEllipse(Rectangle r)
Creates a Elliptical Windows GDI clipping region.
ClipEllipse creates a Windows GDI clipping region and selects it into TChart.Drawing Canvas device context handle.
Clipping regions are used to prevent a drawing escaping from desired polygon coordinates.
The UnClipRectangle method removes any clipping region applied to TChart Drawing Canvas.
You can use this method to avoid Series or custom drawing to go over the desired rectangle coordinates.
Note: Printing and creating metafiles do not accept clipping regions in logical pixels.

Specified by:
clipEllipse in interface IGraphics3D
Specified by:
clipEllipse in class Graphics3D
Parameters:
r - Rectangle

rotateLabel

public void rotateLabel(int x,
                        int y,
                        java.lang.String text,
                        double rotDegree)
Draws a rotated text String at the specified xy coordinates with the RotDegree rotation angle.
RotDegree values must be between 0 and 360. The string is drawn on the Chart Drawing Canvas.

Specified by:
rotateLabel in interface IGraphics3D
Specified by:
rotateLabel in class Graphics3D
Parameters:
x - int
y - int
text - String
rotDegree - double

rotateTransform

public void rotateTransform(Point p,
                            double rotDegree)

resetTransform

public void resetTransform()

moveTo

public void moveTo(int x,
                   int y)
Sets the value of PenPos to x and y co-ordinates before calling LineTo.

Specified by:
moveTo in interface IGraphics3D
Specified by:
moveTo in class Graphics3D
Parameters:
x - int
y - int

pie

public void pie(int x1,
                int y1,
                int x2,
                int y2,
                double startAngle,
                double endAngle)
Draws a Pie slice using StartAngle and End Angle.

Specified by:
pie in class Graphics3D
Parameters:
x1 - int
y1 - int
x2 - int
y2 - int
startAngle - double
endAngle - double

eraseBackground

public void eraseBackground(int left,
                            int top,
                            int right,
                            int bottom)
Clears background defined for Rectangle Left, Top, Right, Bottom.

Specified by:
eraseBackground in class Graphics3D
Parameters:
left - int
top - int
right - int
bottom - int

fillRectangle

public void fillRectangle(ChartBrush brush,
                          int x,
                          int y,
                          int width,
                          int height)
Specified by:
fillRectangle in class Graphics3D

pixel

public void pixel(int x,
                  int y,
                  int z,
                  Color color)
Sets the 3D pixel to Color, using Pen Width.

Specified by:
pixel in class Graphics3D
Parameters:
x - int
y - int
z - int
color - Color

polyLine

public void polyLine(Point[] p)
Draws a series of line segments to join point array p.

Specified by:
polyLine in interface IGraphics3D
Specified by:
polyLine in class Graphics3D
Parameters:
p - Point[]

fillPieSegment

public boolean fillPieSegment(int x1,
                              int y1,
                              int x2,
                              int y2,
                              int sd,
                              int rd,
                              int cl)
Specified by:
fillPieSegment in class Graphics3D

polygon

public void polygon(ChartBrush brush,
                    Point[] points)
Draws a polygon using the specified GDI brush.

Parameters:
brush - ChartBrush
points - Point[]

polygon

public void polygon(Point[] p)
Draws a polygon.

Specified by:
polygon in interface IGraphics3D
Specified by:
polygon in class Graphics3D
Parameters:
p - Point[]

polygon

public void polygon(PointDouble[] points)
Specified by:
polygon in interface IGraphics3D
Specified by:
polygon in class Graphics3D

draw

public void draw(Rectangle r,
                 Image image,
                 boolean transparent)
Paints the image in rectangle r.
It can also be used to Print the Chart in a customized way:
Or you can use the TeeChart Draw method to render an image at any location.

Specified by:
draw in interface IGraphics3D
Specified by:
draw in class Graphics3D
Parameters:
r - Rectangle
image - Image
transparent - boolean

draw

public void draw(int x,
                 int y,
                 Image image)
Paints the image at x,y coordinates.
It can also be used to Print the Chart in a customized way:
Or you can use the TeeChart Draw method to render an image at any location

Parameters:
x - int
y - int
image - Image

hasAlpha

public static boolean hasAlpha(Image image)

getChartPolygon

public java.awt.Shape getChartPolygon(Rectangle rect,
                                      int minZ,
                                      int maxZ)

sphereEnh

protected void sphereEnh(int x1,
                         int y1,
                         int x2,
                         int y2)
Internal use. 3D spheres

Specified by:
sphereEnh in class Graphics3D
Parameters:
x1 - int
y1 - int
x2 - int
y2 - int

ellipseEnh

public void ellipseEnh(int x1,
                       int y1,
                       int x2,
                       int y2)
Internal use. Enhanced spheres

Specified by:
ellipseEnh in class Graphics3D
Parameters:
x1 - int
y1 - int
x2 - int
y2 - int