ElegantJCharts Java API Specification v2.0

com.elegantj.graphx
Class GraphicsEx

java.lang.Object
  |
  +--com.elegantj.graphx.GraphicsEx

public class GraphicsEx
extends java.lang.Object

GraphicsEx class provides the rendering functionality


Field Summary
protected  int deviceDPI
          Specifies the device DPI
static int DR_DEFAULT
          Specifies the constant for normal 3D rectangle
static int DR_LINE_DASH
          Specifies the constant for dash line style
static int DR_LINE_DASHDOT
          Specifies the constant for dash-dot line style
static int DR_LINE_DASHDOTDOT
          Specifies the constant for dash-dot-dot line style
static int DR_LINE_DOT
          Specifies the constant for dot line style
static int DR_LINE_LOWERED
          Specifies the constant for Lowered line style
static int DR_LINE_NONE
          Specifies the constant for Line style none
static int DR_LINE_RAISED
          Specifies the constant for Raised line style
static int DR_LINE_SOLID
          Specifies the constant for solid line style
static int DR_RAISED
          Specifies the constant for raised 3D rectangle
static int DR_SHADOW
          Specifies the constant for shadowed 3D rectangle
static int DR_SHADOW_FADE
          Specifies the constant for Fade shadow style
static int DR_SHADOW_GLOW
          Specifies the constant for Glow shadow style
static int DR_SHADOW_HARD
          Specifies the constant for Hard shadow style
static int DR_SHADOW_NONE
          Specifies the constant for shadow style None
static int DR_STYLE_FIRST
          Specifies the constant for lowest possible style value
static int DR_STYLE_LAST
          Specifies the constant for highest possible style value
static int DR_SUNK
          Specifies the constant for lowered 3D rectangle
static int DR_SURROUND
          Specifies the constant for surrounded 3D rectangle
protected  int logicalDPI
          Specifies the logical DPI
static int SHADOW_SIZE
          Specifies the constant for shadow thickness
 
Constructor Summary
GraphicsEx(java.awt.Graphics g)
          Creates the GraphicsEx with specified Graphics
GraphicsEx(java.awt.Graphics g, int logicalDPI)
          Creates the GraphicsEx with specified Graphics and logical DPI
 
Method Summary
 void clearRect(int x, int y, int width, int height)
          Clears the rectangle
 void clipRect(int x, int y, int width, int height)
          Clips the rectangle
static int ConvertMMtoPixel(int mm)
          Converts value from milimeter to pixel
static int ConvertMMtoPixel(int mm, int dpi)
          Converts value from milimeter to pixel with specified DPI ratio
static int ConvertPixeltoMM(int pixel)
          Converts value from pixel to milimeter
static int ConvertPixeltoMM(int pixel, int dpi)
          Converts value from pixel to milimeter with specified DPI ratio
 void copyArea(int x, int y, int width, int height, int dx, int dy)
          Copies the rectangle to given location
 GraphicsEx create()
          Creates the GraphicsEx object
 GraphicsEx create(int x, int y, int width, int height)
          Creates the GraphicsEx object with specified rectangle
 void dispose()
          Disposed the object
 int DPtoLP(int pixel)
          Converts the device point to logical point
 int[] DPtoLP(int[] pixel)
          Converts the device point to logical point
static int DPtoLP(int pixel, int logicalDPI)
          Converts the device point to logical point with specifed logical DPI ratio
 java.awt.Point DPtoLP(java.awt.Point pixel)
          Converts the device point to logical point
 java.awt.Point[] DPtoLP(java.awt.Point[] pixel)
          Converts the device point to logical point
static java.awt.Point DPtoLP(java.awt.Point pixel, int logicalDPI)
          Converts the device point to logical point with specifed logical DPI ratio
 java.awt.Rectangle DPtoLP(java.awt.Rectangle rect)
          Converts the device point of rectangle to logical point
 void draw3DCircle(int x, int y, int diameter)
          Draws a 3D circle with specified diameter size
 void draw3DLine(int x1, int y1, int x2, int y2, boolean raised)
          Draws a 3D line
 void draw3DRect(int x, int y, int width, int height, boolean raised)
          Draws a 3D rectangle
 void draw3DRectEx(int x, int y, int width, int height, int style)
          Draws a 3D rectangle with specified rectangle style
 void draw3DRectEx(int x, int y, int width, int height, int style, int lineStyle)
          Draws a 3D rectangle with specified rectangle style and line style
 void draw3DRectWithShadow(int x, int y, int width, int height, int lineStyle, int lineWidth, java.awt.Color lineColor, int shadowStyle, int shadowWidth, java.awt.Color shadowColor)
          Draws a 3D rectangle with specified rectangle style and line style
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Draws ab Arc
 void drawBytes(byte[] data, int offset, int length, int x, int y)
          Draws a text bytes
 void drawChars(char[] data, int offset, int length, int x, int y)
          Draws characters
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
          Draws an image
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
          Draws an image
 boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
          Draws an image
 boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)
          Draws an image
 boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
          Draws an image
 boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.ImageObserver observer)
          Draws an image
 void drawLine(int x1, int y1, int x2, int y2)
          Draws a line
 void drawLineEx(int x1, int y1, int x2, int y2, int style)
          Draws a line with specified line style
 void drawOval(int x, int y, int width, int height)
          Draws an oval
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Draws a polygon
 void drawPolygon(java.awt.Polygon p)
          Draws a polygon
 void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          Draws a sequence of connected lines
 void drawRect(int x, int y, int width, int height)
          Draws a rectangle
 void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Draws a rectangle with rounded corner
 void drawString(java.lang.String str, int x, int y)
          Draws a text
 java.awt.Dimension drawStringEx(java.lang.String str, int x, int y, int width, int height, int type)
          Draws a text with specified text style
 void fill3DRect(int x, int y, int width, int height, boolean raised)
          Fills a 3D rectangle
 void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Fills an arc
 void fillOval(int x, int y, int width, int height)
          Fills an oval
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Fills a polygon
 void fillPolygon(java.awt.Polygon p)
          Fills a polygon
 void fillRect(int x, int y, int width, int height)
          Fills a rectangle
 void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Fills a rectangle with rounded corners
 void finalize()
          Finalizes object
 java.awt.Rectangle getClipBounds()
          Returns the clipped boundary
 java.awt.Rectangle getClipRect()
          Returns the clipped rectangle
 java.awt.Color getColor()
          Returns the graphics color
 java.awt.Font getFont()
          Returns the graphics font
 java.awt.FontMetrics getFontMetrics()
          Returns the graphics font metrics
 java.awt.FontMetrics getFontMetrics(java.awt.Font f)
          Returns the graphics font metrics of specified font
 java.awt.Graphics getGraphics()
          Return Graphics Object
 boolean hitClip(int x, int y, int width, int height)
          Returns true if the specified rectangular area intersects the bounding rectangle of the current clipping area.
 boolean isPrint()
          Determines whether or not the graphics object is used for printing
 int LPtoDP(int pos)
          Converts the logical point to device point
 int[] LPtoDP(int[] pos)
          Converts the logical point to device point
static int LPtoDP(int pos, int logicalDPI)
          Converts the logical point to device point with specifed logical DPI ratio
 java.awt.Point LPtoDP(java.awt.Point pos)
          Converts the logical point to device point
 java.awt.Point[] LPtoDP(java.awt.Point[] pos)
          Converts the logical point to device point
static java.awt.Point LPtoDP(java.awt.Point pos, int logicalDPI)
          Converts the logical point to device point with specifed logical DPI ratio
 java.awt.Rectangle LPtoDP(java.awt.Rectangle rect)
          Converts the logical points of rectangle to device points
 java.awt.Color setBrighter(java.awt.Color inColor)
          Generate bright color from given color
 void setClip(int x, int y, int width, int height)
          Clips the specified rectangle
 void setColor(java.awt.Color c)
          Sets the graphics color
 void setFont(java.awt.Font font)
          Sets the graphics font
 void setPaintMode()
          Sets the painting mode
 void setXORMode(java.awt.Color c1)
          Sets the XOR mode with specified color
 java.lang.String toString()
           
 void translate(int x, int y)
          Translates graphics current rendering point with specified location
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logicalDPI

protected int logicalDPI
Specifies the logical DPI


deviceDPI

protected int deviceDPI
Specifies the device DPI


DR_DEFAULT

public static final int DR_DEFAULT
Specifies the constant for normal 3D rectangle

See Also:
Constant Field Values

DR_RAISED

public static final int DR_RAISED
Specifies the constant for raised 3D rectangle

See Also:
Constant Field Values

DR_SUNK

public static final int DR_SUNK
Specifies the constant for lowered 3D rectangle

See Also:
Constant Field Values

DR_SURROUND

public static final int DR_SURROUND
Specifies the constant for surrounded 3D rectangle

See Also:
Constant Field Values

DR_SHADOW

public static final int DR_SHADOW
Specifies the constant for shadowed 3D rectangle

See Also:
Constant Field Values

DR_STYLE_FIRST

public static final int DR_STYLE_FIRST
Specifies the constant for lowest possible style value

See Also:
Constant Field Values

DR_STYLE_LAST

public static final int DR_STYLE_LAST
Specifies the constant for highest possible style value

See Also:
Constant Field Values

SHADOW_SIZE

public static final int SHADOW_SIZE
Specifies the constant for shadow thickness

See Also:
Constant Field Values

DR_LINE_NONE

public static final int DR_LINE_NONE
Specifies the constant for Line style none

See Also:
Constant Field Values

DR_LINE_SOLID

public static final int DR_LINE_SOLID
Specifies the constant for solid line style

See Also:
Constant Field Values

DR_LINE_DASH

public static final int DR_LINE_DASH
Specifies the constant for dash line style

See Also:
Constant Field Values

DR_LINE_DOT

public static final int DR_LINE_DOT
Specifies the constant for dot line style

See Also:
Constant Field Values

DR_LINE_DASHDOT

public static final int DR_LINE_DASHDOT
Specifies the constant for dash-dot line style

See Also:
Constant Field Values

DR_LINE_DASHDOTDOT

public static final int DR_LINE_DASHDOTDOT
Specifies the constant for dash-dot-dot line style

See Also:
Constant Field Values

DR_LINE_RAISED

public static final int DR_LINE_RAISED
Specifies the constant for Raised line style

See Also:
Constant Field Values

DR_LINE_LOWERED

public static final int DR_LINE_LOWERED
Specifies the constant for Lowered line style

See Also:
Constant Field Values

DR_SHADOW_NONE

public static final int DR_SHADOW_NONE
Specifies the constant for shadow style None

See Also:
Constant Field Values

DR_SHADOW_GLOW

public static final int DR_SHADOW_GLOW
Specifies the constant for Glow shadow style

See Also:
Constant Field Values

DR_SHADOW_FADE

public static final int DR_SHADOW_FADE
Specifies the constant for Fade shadow style

See Also:
Constant Field Values

DR_SHADOW_HARD

public static final int DR_SHADOW_HARD
Specifies the constant for Hard shadow style

See Also:
Constant Field Values
Constructor Detail

GraphicsEx

public GraphicsEx(java.awt.Graphics g,
                  int logicalDPI)
           throws java.lang.RuntimeException
Creates the GraphicsEx with specified Graphics and logical DPI


GraphicsEx

public GraphicsEx(java.awt.Graphics g)
           throws java.lang.RuntimeException
Creates the GraphicsEx with specified Graphics

Method Detail

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)
Clears the rectangle


clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Clips the rectangle


copyArea

public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int dx,
                     int dy)
Copies the rectangle to given location


create

public GraphicsEx create()
Creates the GraphicsEx object


create

public GraphicsEx create(int x,
                         int y,
                         int width,
                         int height)
Creates the GraphicsEx object with specified rectangle


dispose

public void dispose()
Disposed the object


draw3DRect

public void draw3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Draws a 3D rectangle


drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Draws ab Arc


drawBytes

public void drawBytes(byte[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Draws a text bytes


drawChars

public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Draws characters


drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver observer)
Draws an image


drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.image.ImageObserver observer)
Draws an image


drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver observer)
Draws an image


drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         java.awt.image.ImageObserver observer)
Draws an image


drawImage

public boolean drawImage(java.awt.Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver observer)
Draws an image


drawImage

public boolean drawImage(java.awt.Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         java.awt.image.ImageObserver observer)
Draws an image


drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Draws a line


drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Draws an oval


drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Draws a polygon


drawPolygon

public void drawPolygon(java.awt.Polygon p)
Draws a polygon


drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
Draws a sequence of connected lines


drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height)
Draws a rectangle


drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Draws a rectangle with rounded corner


drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)
Draws a text


fill3DRect

public void fill3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Fills a 3D rectangle


fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Fills an arc


fillOval

public void fillOval(int x,
                     int y,
                     int width,
                     int height)
Fills an oval


fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Fills a polygon


fillPolygon

public void fillPolygon(java.awt.Polygon p)
Fills a polygon


fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Fills a rectangle


fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Fills a rectangle with rounded corners


finalize

public void finalize()
Finalizes object

Overrides:
finalize in class java.lang.Object

getClipBounds

public java.awt.Rectangle getClipBounds()
Returns the clipped boundary


getClipRect

public java.awt.Rectangle getClipRect()
Returns the clipped rectangle


getColor

public java.awt.Color getColor()
Returns the graphics color


getFont

public java.awt.Font getFont()
Returns the graphics font


getFontMetrics

public java.awt.FontMetrics getFontMetrics()
Returns the graphics font metrics


getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font f)
Returns the graphics font metrics of specified font


setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Clips the specified rectangle


setColor

public void setColor(java.awt.Color c)
Sets the graphics color


setFont

public void setFont(java.awt.Font font)
Sets the graphics font


setPaintMode

public void setPaintMode()
Sets the painting mode


setXORMode

public void setXORMode(java.awt.Color c1)
Sets the XOR mode with specified color


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

translate

public void translate(int x,
                      int y)
Translates graphics current rendering point with specified location


isPrint

public boolean isPrint()
Determines whether or not the graphics object is used for printing


LPtoDP

public int LPtoDP(int pos)
Converts the logical point to device point


LPtoDP

public java.awt.Point LPtoDP(java.awt.Point pos)
Converts the logical point to device point


LPtoDP

public java.awt.Rectangle LPtoDP(java.awt.Rectangle rect)
Converts the logical points of rectangle to device points


LPtoDP

public int[] LPtoDP(int[] pos)
Converts the logical point to device point


LPtoDP

public java.awt.Point[] LPtoDP(java.awt.Point[] pos)
Converts the logical point to device point


DPtoLP

public int DPtoLP(int pixel)
Converts the device point to logical point


DPtoLP

public java.awt.Point DPtoLP(java.awt.Point pixel)
Converts the device point to logical point


DPtoLP

public java.awt.Rectangle DPtoLP(java.awt.Rectangle rect)
Converts the device point of rectangle to logical point


DPtoLP

public int[] DPtoLP(int[] pixel)
Converts the device point to logical point


DPtoLP

public java.awt.Point[] DPtoLP(java.awt.Point[] pixel)
Converts the device point to logical point


LPtoDP

public static int LPtoDP(int pos,
                         int logicalDPI)
Converts the logical point to device point with specifed logical DPI ratio


LPtoDP

public static java.awt.Point LPtoDP(java.awt.Point pos,
                                    int logicalDPI)
Converts the logical point to device point with specifed logical DPI ratio


DPtoLP

public static int DPtoLP(int pixel,
                         int logicalDPI)
Converts the device point to logical point with specifed logical DPI ratio


DPtoLP

public static java.awt.Point DPtoLP(java.awt.Point pixel,
                                    int logicalDPI)
Converts the device point to logical point with specifed logical DPI ratio


ConvertMMtoPixel

public static int ConvertMMtoPixel(int mm,
                                   int dpi)
Converts value from milimeter to pixel with specified DPI ratio


ConvertMMtoPixel

public static int ConvertMMtoPixel(int mm)
Converts value from milimeter to pixel


ConvertPixeltoMM

public static int ConvertPixeltoMM(int pixel,
                                   int dpi)
Converts value from pixel to milimeter with specified DPI ratio


ConvertPixeltoMM

public static int ConvertPixeltoMM(int pixel)
Converts value from pixel to milimeter


drawStringEx

public java.awt.Dimension drawStringEx(java.lang.String str,
                                       int x,
                                       int y,
                                       int width,
                                       int height,
                                       int type)
Draws a text with specified text style


drawLineEx

public void drawLineEx(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int style)
Draws a line with specified line style


draw3DLine

public void draw3DLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       boolean raised)
Draws a 3D line


draw3DRectEx

public void draw3DRectEx(int x,
                         int y,
                         int width,
                         int height,
                         int style)
Draws a 3D rectangle with specified rectangle style


draw3DRectEx

public void draw3DRectEx(int x,
                         int y,
                         int width,
                         int height,
                         int style,
                         int lineStyle)
Draws a 3D rectangle with specified rectangle style and line style


getGraphics

public java.awt.Graphics getGraphics()
Return Graphics Object

Returns:
Graphics Graphics object

draw3DRectWithShadow

public void draw3DRectWithShadow(int x,
                                 int y,
                                 int width,
                                 int height,
                                 int lineStyle,
                                 int lineWidth,
                                 java.awt.Color lineColor,
                                 int shadowStyle,
                                 int shadowWidth,
                                 java.awt.Color shadowColor)
Draws a 3D rectangle with specified rectangle style and line style

Parameters:
x -
y -
width -
height -
lineStyle -
lineWidth -
lineColor -
shadowStyle -
shadowWidth -
shadowColor -

draw3DCircle

public void draw3DCircle(int x,
                         int y,
                         int diameter)
Draws a 3D circle with specified diameter size

Parameters:
x -
y -
diameter -

setBrighter

public java.awt.Color setBrighter(java.awt.Color inColor)
Generate bright color from given color

Parameters:
inColor - Input color
Returns:
Color bright color then input color

hitClip

public boolean hitClip(int x,
                       int y,
                       int width,
                       int height)
Returns true if the specified rectangular area intersects the bounding rectangle of the current clipping area. The coordinates in the rectangle are relative to the coordinate system origin of this graphics context.

Parameters:
x - the x coordinate of the rectangle to test against the clip
y - the y coordinate of the rectangle to test against the clip
width - the width of the rectangle to test against the clip
height - the height of the rectangle to test against the clip

ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.