public class IltGraphicUtil extends Object
Graphics
context.IltContains
Modifier and Type | Method and Description |
---|---|
static void |
_FillRect(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette palette)
Draws a filled rectangle with thickness 1 in a given palette.
|
static void |
DrawDiamond(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette palette,
int thickness)
Draws the border of a diamond with a given thickness.
|
static void |
DrawDiamond(Graphics g,
int x1,
int y1,
int x2,
int y2,
Ilt1DPalette palette,
int thickness)
Draws the border of a diamond with a given thickness.
|
static void |
DrawLegacyShape(Graphics g,
Shape shape,
Ilt1DPalette palette,
double thickness,
int join)
Method created to address support call 1-43367250
(performance on remote XWindows).
|
static void |
DrawLine(Graphics g,
int x1,
int y1,
int x2,
int y2,
Ilt1DPalette palette)
Draws a line of thickness 1 in a given palette.
|
static void |
DrawLine(Graphics g,
int x1,
int y1,
int x2,
int y2,
Ilt1DPalette palette,
double thickness,
int cap)
Draws a line of a given thickness in a given palette.
|
static void |
DrawPolygon(Graphics g,
IltPolygon p,
Ilt1DPalette palette,
double apart,
double thickness,
int join)
Draws a polygon with a given thickness in a given palette.
|
static void |
DrawPolygon(Graphics g,
IlvTransformer t,
IltPolygon p,
IltPalette palette,
double apart,
double thickness,
int join)
Draws a polygon with a given thickness in a given palette.
|
static void |
DrawPolyline(Graphics g,
IltPolyline p,
Ilt1DPalette palette,
double thickness,
int cap,
int join)
Draws a sequence of consecutive lines with a given thickness in a given
palette.
|
static void |
DrawRect(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette palette,
int thickness)
Draws the border of a rectangle with a given thickness.
|
static void |
DrawRect(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
IltPalette palette,
int thickness)
Draws the border of a rectangle with a given thickness.
|
static void |
DrawRect(Graphics g,
int x1,
int y1,
int x2,
int y2,
Ilt1DPalette palette,
int thickness)
Draws the border of a rectangle with a given thickness.
|
static void |
DrawReliefDiamond(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette brightPalette,
Ilt2DPalette darkPalette,
int thickness)
Draws the border of a diamond with a given thickness and relief-like:
the upper side is brighter, the down side is darker.
|
static void |
DrawReliefPolyline(Graphics g,
IltPolyline p,
Color bright,
Color dark)
Draws a sequence of consecutive lines with thickness 1.
|
static void |
DrawReliefPolyline(Graphics g,
IltPolyline p,
Ilt1DPalette brightPalette,
Ilt1DPalette darkPalette,
double thickness,
int cap,
int join)
Draws a sequence of consecutive lines with a given thickness.
|
static void |
DrawReliefRect(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette brightPalette,
Ilt2DPalette darkPalette,
int thickness)
Draws the border of a rectangle with a given thickness and relief-like:
the upper and left sides are brighter, the right and down sides are darker.
|
static void |
drawShape(Graphics g,
Shape shape,
Color foreground,
Color background,
Stroke stroke,
boolean antialiasing)
Draws a shape with the given configuration.
|
static void |
drawShape(Graphics g,
Shape shape,
Ilt1DPalette palette,
double width,
int cap,
int join,
boolean antialiasing)
Draws a shape with the given configuration.
|
static void |
DrawShape(Graphics g,
Shape shape,
IltPalette palette,
double width,
int cap,
int join,
boolean antialiasing)
Draws a shape with the given configuration.
|
static void |
EnableAlternatePolygonDrawing()
This static method sets alternate polygon drawing routines
designed to address the following performance support calls:
1-39173945
1-43418387
1-43367250
The performance problem experienced by the customers have
been identified as a JDK specific issue, the following Sun
Bugs might be related:
4835595
4488401
Once invoked, this method will force TGO to use internal
routines to draw
IltPolygon and
IltPolyline instead of delegating it to Swing
specific calls. |
static void |
FillDiamond(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette palette)
Fills a diamond.
|
static void |
FillPolygon(Graphics g,
IlvTransformer t,
IltPolygon polygon,
Ilt2DPalette palette)
Draws a filled polygon, including its border, in a given palette.
|
static void |
FillRect(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
Ilt2DPalette palette)
Draws a filled rectangle with thickness 1 in a given palette.
|
static void |
FillRect(Graphics g,
IlvTransformer t,
int x1,
int y1,
int x2,
int y2,
IltPalette palette)
Draws a filled rectangle with thickness 1 in a given palette.
|
static void |
FillShape(Graphics g,
IlvTransformer t,
Shape shape,
IltPalette palette,
boolean antialiasing)
Draws a shape with the given configuration.
|
static boolean |
IsAlternatePolygonDrawing()
This static method indicates whether the alternate polygon
drawing routines are enabled or not.
|
public static void EnableAlternatePolygonDrawing()
IltPolygon
and
IltPolyline
instead of delegating it to Swing
specific calls.public static boolean IsAlternatePolygonDrawing()
true
if alternate polygon drawing is
enabled; false
otherwise.public static void DrawLine(Graphics g, int x1, int y1, int x2, int y2, Ilt1DPalette palette)
public static void DrawLine(Graphics g, int x1, int y1, int x2, int y2, Ilt1DPalette palette, double thickness, int cap)
Restrictions: Only BasicStroke.CAP_BUTT
and
BasicStroke.CAP_SQUARE
are supported here.
public static void DrawRect(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette palette, int thickness)
(x1,y1) and (x2,y2) are two opposite corners of the rectangle. The palette is a 2D palette, not a 1D palette.
The corners are made with BasicStroke.CAP_BUTT
.
g
- Graphicst
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
x1, y1, x2, y2.x1
- X coordinate of the top left corner.y1
- Y coordinate of the top left corner.x2
- X coordinate of the bottom right corner.y2
- Y coordinate of the bottom right corner.palette
- Drawing configuration.thickness
- Border thickness.public static void FillRect(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette palette)
BasicStroke.CAP_BUTT
.g
- The Graphics.t
- The view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
x1, y1, x2, y2.x1
- X coordinate of the top left cornery1
- Y coordinate of the top left cornerx2
- X coordinate of the bottom right cornery2
- Y coordinate of the bottom right cornerpalette
- Graphic properties that indicate how the rectangle will be filled.public static void _FillRect(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette palette)
BasicStroke.CAP_BUTT
.
Draw nothing unless x1 <= x2 and y1 <= y2.g
- The Graphics.t
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
x1, y1, x2, y2.x1
- X coordinate of the top left cornery1
- Y coordinate of the top left cornerx2
- X coordinate of the bottom right cornery2
- Y coordinate of the bottom right cornerpalette
- Graphic properties that indicate how the rectangle will be filled.public static void DrawPolyline(Graphics g, IltPolyline p, Ilt1DPalette palette, double thickness, int cap, int join)
Restrictions: Only BasicStroke.CAP_BUTT
and
BasicStroke.CAP_SQUARE
are supported here.
Only BasicStroke.JOIN_MITER
and
BasicStroke.JOIN_BEVEL
are supported here.
When the thickness is > 1, acute angles don't look fine.
public static void DrawPolygon(Graphics g, IltPolygon p, Ilt1DPalette palette, double apart, double thickness, int join)
Restrictions: Only BasicStroke.JOIN_MITER
and
BasicStroke.JOIN_BEVEL
are supported here.
When the thickness is > 1, acute angles don't look fine.
g
- The graphics.p
- The polygon coordinates.palette
- The graphic properties.apart
- The distance (positive for a parallel to the right of the
polygon, negative for a parallel to the left of the polygon)thickness
- The thickness of the polygon.join
- The angle configuration, only BasicStroke.JOIN_MITER
and BasicStroke.JOIN_BEVEL
are currently supported.public static void FillPolygon(Graphics g, IlvTransformer t, IltPolygon polygon, Ilt2DPalette palette)
g
- The Graphics.t
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
the polygon.polygon
- The polygon to be filled.palette
- The configuration used to fill the polygon.public static void DrawReliefRect(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette brightPalette, Ilt2DPalette darkPalette, int thickness)
The thickness is not distributed symmetrically to both sides of the lines, but only towards the interior of the rectangle; (x1,y1) and (x2,y2) are two opposite corners of the rectangle.
The palette is a 2D palette, not a 1D palette. Both palettes should
contain the same IltPattern
.
The corners are made with BasicStroke.CAP_BUTT
.
g
- The graphics.t
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
x1, y1, x2, y2.x1
- X coordinate of the top left cornery1
- Y coordinate of the top left cornerx2
- X coordinate of the bottom right cornery2
- Y coordinate of the bottom right cornerbrightPalette
- Palette with bright colorsdarkPalette
- Palette with darker colorsthickness
- Relieft thicknesspublic static void DrawReliefPolyline(Graphics g, IltPolyline p, Color bright, Color dark)
public static void DrawReliefPolyline(Graphics g, IltPolyline p, Ilt1DPalette brightPalette, Ilt1DPalette darkPalette, double thickness, int cap, int join)
Restrictions: Only BasicStroke.CAP_BUTT
and
BasicStroke.CAP_SQUARE
are supported here.
Only BasicStroke.JOIN_MITER
and
BasicStroke.JOIN_BEVEL
are supported here.
When the thickness is > 1, acute angles don't look fine. The three
palettes should have the same line style.
public static void DrawRect(Graphics g, int x1, int y1, int x2, int y2, Ilt1DPalette palette, int thickness)
BasicStroke.JOIN_MITER
.public static void DrawReliefDiamond(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette brightPalette, Ilt2DPalette darkPalette, int thickness)
The actual (diagonal section) thickness of the four bounding lines will be thickness*0.707. The thickness is not distributed symmetrically, but only towards the interior of the diamond; (x1,y1) and (x2,y2) are two opposite corners of the bounding rectangle of the diamond. For best results, the differences x2-x1 and y2-y1 should be even integers.
The palette is a 2D palette, not a 1D palette. Both palettes should
contain the same IltPattern
.
The corners are made with BasicStroke.CAP_BUTT
.
public static void DrawDiamond(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette palette, int thickness)
BasicStroke.CAP_BUTT
.public static void DrawDiamond(Graphics g, int x1, int y1, int x2, int y2, Ilt1DPalette palette, int thickness)
BasicStroke.CAP_BUTT
.public static void FillDiamond(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, Ilt2DPalette palette)
Draws a filled diamond with thickness 1 in a given palette.
(x1,y1) and (x2,y2) are two opposite corners of the bounding rectangle
of the diamond. For best results, the differences x2-x1 and y2-y1
should be even integers. The corners are made with BasicStroke.CAP_BUTT
.
public static void FillRect(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, IltPalette palette)
BasicStroke.CAP_BUTT
.g
- The Graphics.t
- The view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
x1, y1, x2, y2.x1
- X coordinate of the top left cornery1
- Y coordinate of the top left cornerx2
- X coordinate of the bottom right cornery2
- Y coordinate of the bottom right cornerpalette
- Graphic properties that indicate how the rectangle will be filled.public static void FillShape(Graphics g, IlvTransformer t, Shape shape, IltPalette palette, boolean antialiasing)
Restrictions: Supports only 1D or 2D palettes. If a 1D palette is provided as argument, only the foreground and background colors are supported.
g
- Graphicst
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
the shape.shape
- Shape of the object being displayedpalette
- Configuration with foreground, background and strokeantialiasing
- Indicates if the shape should be displayed using anti-aliasingpublic static void DrawRect(Graphics g, IlvTransformer t, int x1, int y1, int x2, int y2, IltPalette palette, int thickness)
BasicStroke.CAP_BUTT
and
BasicStroke.JOIN_MITER
.g
- Graphicst
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to
x1, y1, x2, y2.x1
- X coordinate of the top left corner.y1
- Y coordinate of the top left corner.x2
- X coordinate of the bottom right corner.y2
- Y coordinate of the bottom right corner.palette
- Drawing configuration.thickness
- Border thickness.public static void DrawPolygon(Graphics g, IlvTransformer t, IltPolygon p, IltPalette palette, double apart, double thickness, int join)
Restrictions: Only BasicStroke.JOIN_MITER
and
BasicStroke.JOIN_BEVEL
are supported here.
When the thickness is > 1, acute angles don't look fine.
g
- The graphics.t
- the view's transformer, normally null
. Note:
It is assumed that t
has already been applied to p.p
- The polygon coordinates.palette
- The graphic properties.apart
- The distance (positive for a parallel to the right of the
polygon, negative for a parallel to the left of the polygon)thickness
- The thickness of the polygon.join
- The angle configuration, only BasicStroke.JOIN_MITER
and BasicStroke.JOIN_BEVEL
are currently supported.public static void DrawShape(Graphics g, Shape shape, IltPalette palette, double width, int cap, int join, boolean antialiasing)
Restrictions: Supports only 1D or 2D palettes. If a 2D palette is provided as argument, only the foreground color is supported.
g
- Graphicsshape
- Shape of the object being displayedpalette
- Configuration with foreground, background and strokewidth
- Outline widthcap
- The decoration applied to the ends of unclosed subpaths
and dash segmentsjoin
- The decoration applied where path segments meetantialiasing
- Indicates if anti-aliasing is on or offpublic static void drawShape(Graphics g, Shape shape, Color foreground, Color background, Stroke stroke, boolean antialiasing)
g
- Graphicsshape
- Shape of the object being displayedforeground
- Foreground of the object being displayedbackground
- Background of the object being displayedstroke
- Indicates if the shape stroke is also displayedantialiasing
- Indicates if the shape is to be displayed with anti-aliasingpublic static void drawShape(Graphics g, Shape shape, Ilt1DPalette palette, double width, int cap, int join, boolean antialiasing)
g
- Graphicsshape
- Shape of the object being displayedpalette
- Configuration with foreground, background and strokewidth
- Outline widthcap
- The decoration applied to the ends of unclosed subpaths
and dash segmentsjoin
- The decoration applied where path segments meetantialiasing
- Indicates if the shape is to be displayed with anti-aliasingpublic static void DrawLegacyShape(Graphics g, Shape shape, Ilt1DPalette palette, double thickness, int join)
g
- Graphicsshape
- Shape of the object being displayedpalette
- Configuration with foreground, background and strokethickness
- Outline widthjoin
- The decoration applied where path segments meet© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.