public class IlvGraphicUtil extends Object
Modifier and Type | Field and Description |
---|---|
static double |
AUTO_SMOOTHNESS
Smoothness value for splines.
|
static double |
COMPATIBLE_SMOOTHNESS
Smoothness value for splines for backward compatibility.
|
static Font |
DEFAULT_FONT
The default font.
|
Modifier and Type | Method and Description |
---|---|
static Shape |
AddClip(Graphics g,
Shape shape)
Adds a clipping
Shape to the current clip
on the given Graphics . |
static float[] |
arrayCopyDoubleToFloat(double[] array)
Copies an array by casting double values to float values
|
static void |
BezierBoundingBox(IlvRect bbox,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Computes the bounding rectangle of a Bezier spline.
|
static void |
BezierBoundingBox(IlvRect bbox,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Computes the bounding rectangle of a Bezier spline of up to 4 control
points.
|
static void |
ClosedBezierBoundingBox(IlvRect bbox,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Computes the bounding rectangle of a closed Bezier spline.
|
static void |
ClosedBezierBoundingBox(IlvRect bbox,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Computes the bounding rectangle of a closed Bezier spline of up to
4 control points.
|
static Shape |
CreateTransformedShape(Shape shape,
IlvTransformer t)
Transforms a
Shape object. |
static void |
DrawBezier(Graphics g,
IlvPoint[] pts,
int length,
boolean ghosting,
double d,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t,
boolean pointsTransformed)
Draws a Bezier spline.
|
static void |
DrawBezier(Graphics g,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t)
Draws a Bezier spline of up to 4 control points.
|
static void |
DrawBezier(Graphics g,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t,
boolean pointsTransformed)
Draws a Bezier spline of up to 4 control points.
|
static void |
DrawClosedBezier(Graphics g,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t)
Draws a closed Bezier spline.
|
static void |
DrawClosedBezier(Graphics g,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t)
Draws a closed Bezier spline of up to 4 control points.
|
static void |
DrawImage(Graphics g,
IlvRect drawrect,
Image image,
IlvTransformer t,
ImageObserver observer,
boolean highquality)
Draws an
Image with a given IlvTransformer . |
static void |
DrawPolygon(Graphics g,
IlvPoint[] points,
int length,
IlvTransformer t)
Draws an outline of a polygon.
|
static void |
DrawPolyline(Graphics g,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t)
Draws a polyline.
|
static void |
DrawPolyline(Graphics g,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
float[] lineStyle,
IlvTransformer t,
boolean pointsTransformed)
Draws a polyline.
|
static void |
DrawRenderedImage(Graphics g,
IlvRect drawrect,
RenderedImage image,
IlvTransformer t,
boolean highquality)
Draws a
RenderedImage with a given
IlvTransformer . |
static void |
DrawString(Graphics g,
String text,
int x,
int y,
boolean antialiased)
Draws the text given by the specified string
using the current font and color of the specified graphics context.
|
static void |
DrawString(IlvGraphic obj,
Graphics g,
String text,
int x,
int y,
boolean antialiased)
Draws the text given by the specified graphic object and string using
the current font and color of the specified graphics context.
|
static void |
FillBezier(Graphics g,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
IlvTransformer t)
Draws a filled Bezier spline.
|
static void |
FillBezier(Graphics g,
IlvPoint[] pts,
int length,
IlvTransformer t)
Draws a filled Bezier spline of up to 4 control points.
|
static void |
FillOutlinedPolygon(Graphics g,
IlvPoint[] points,
int length,
Color fillColor,
Color outlineColor,
IlvTransformer t)
Draws an outlined polygon.
|
static void |
FillPolygon(Graphics g,
IlvPoint[] points,
int length,
IlvTransformer t)
Draws a filled polygon.
|
static int |
GetAlpha(Color c)
Deprecated.
since JViews 5.5 you should use
Color.getAlpha() instead |
static double |
GetArrowSize(IlvLinkImage link,
double lineWidth,
IlvTransformer t)
Returns the arrow size of a link.
|
static IlvPoint[] |
GetAutoSmoothSpline(IlvPoint[] originalpoints,
int length,
boolean ghosting,
IlvPoint[] bezierpoints,
int[] flags,
int[] resultingLength)
Returns an array of
IlvPoint s for a smooth spline from
an array of IlvPoint s of user control points. |
static float |
GetFontDescent(String text,
Font font,
boolean antialiased)
Returns the descent of the specified text when drawn
with the specified font.
|
static IlvPoint[] |
GetPolyPoints(IlvPolyPointsInterface polypoints,
IlvTransformer t)
Returns the points of a polypoint.
|
static IlvPoint[] |
GetSmoothSpline(IlvPoint[] originalpoints,
int length,
double smoothness,
boolean ghosting,
IlvPoint[] bezierpoints)
Returns an array of
IlvPoint s for a smooth spline from
an array of IlvPoint s of user control points. |
static IlvPoint |
GetSmoothSplineBendFromHandle(int handleIndex,
IlvPoint handlePoint,
IlvPoint[] bendpoints,
int length,
double smoothness,
boolean ghosting)
Returns the used control point from the handle position on a smooth spline.
|
static IlvPoint |
GetSmoothSplineHandleFromBend(int handleIndex,
IlvPoint[] bendpoints,
int length,
double smoothness,
boolean ghosting)
Returns a position on a smooth spline that can be used as selection
handle points on the spline.
|
static IlvPoint[] |
GetSmoothSplineHandlesFromBends(IlvPoint[] bendpoints,
int length,
double smoothness,
boolean ghosting,
IlvPoint[] handlepoints)
Returns an array of
IlvPoint s for a smooth spline
that can be used as selection handle points on the spline. |
static IlvRect |
GetStringBounds(IlvGraphic obj,
String text,
Font font,
boolean antialiased)
Returns the bounding rectangle enclosing text when drawn
with the specified font for specific graphic object.
|
static IlvRect |
GetStringBounds(String text,
Font font,
boolean antialiased)
Returns the bounding rectangle enclosing text when drawn
with the specified font.
|
static boolean |
IsJViews60LineStyleMode()
Returns
true if polylines and Bezier curves
with line styles are drawn in JViews 6.0 style. |
static boolean |
isPrinting(Graphics g)
Returns
true if we are currently printing. |
static Color |
MakeColor(int rgba)
Deprecated.
since JViews 5.5 you should use
new Color(rgba, true) instead. |
static Color |
MakeColor(int r,
int g,
int b,
int alpha)
Deprecated.
since JViews 5.5 you should use
new Color(r,g,b,alpha) instead. |
static boolean |
PointInBezier(IlvPoint point,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Performs a hit test on a Bezier spline.
|
static boolean |
PointInBezier(IlvPoint point,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Performs a hit test on a Bezier spline of up to 4 control points.
|
static boolean |
PointInClosedBezier(IlvPoint point,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Performs a hit test on a closed Bezier spline.
|
static boolean |
PointInClosedBezier(IlvPoint point,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Performs a hit test on a closed Bezier spline of up to 4 control points.
|
static boolean |
PointInFilledBezier(IlvPoint point,
IlvPoint[] pts,
int length,
boolean ghosting,
double smoothness,
IlvTransformer t)
Performs a hit test on a filled Bezier spline.
|
static boolean |
PointInFilledBezier(IlvPoint point,
IlvPoint[] pts,
int length,
IlvTransformer t)
Performs a hit test on a filled Bezier spline of up to 4 control points.
|
static boolean |
PointInPolygon(IlvPoint point,
IlvPoint[] pts,
int length,
IlvTransformer t)
Deprecated.
Beginning with Rogue Wave JViews 5.5 you should use
PointInPolygon(IlvPoint,IlvPoint[],int,IlvTransformer,boolean) instead. |
static boolean |
PointInPolygon(IlvPoint point,
IlvPoint[] pts,
int length,
IlvTransformer t,
boolean fill)
Performs a hit test on a polygon.
|
static boolean |
PointInPolyline(IlvPoint point,
IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Performs a hit test on a polyline.
|
static boolean |
PointInShape(IlvPoint pt,
Shape shape)
Returns
true if an IlvPoint is inside a
particular Shape object, or false otherwise. |
static IlvRect |
PolylineBBox(IlvPoint[] pts,
int length,
double lineWidth,
int lineJoin,
int endCap,
IlvTransformer t)
Computes the bounding rectangle of a polyline.
|
static IlvRect |
RectBBox(IlvRect rect,
IlvTransformer t)
Returns the bounding box of an
IlvRect transformed with the
given IlvTransformer . |
static void |
SetJViews60LineStyleMode(boolean flag)
Sets the behavior of current products to JViews 6.0 line style zooming.
|
static void |
StartAntiAliasing(Graphics g)
Sets the antialiasing hint on the
Graphics . |
static IlvGraphicVector |
startBidiChange(IlvGraphicBag bag)
Starts a session that changes either the base text direction, the locale
or the component orientation of a graphic bag.
|
static void |
StopAntiAliasing(Graphics g)
Unsets the antialiasing hint on the
Graphics . |
static void |
stopBidiChange(IlvGraphicBag bag,
IlvGraphicVector v,
boolean redraw)
Stops a session that changes either the base text direction, the locale
or the component orientation of a graphic bag.
|
public static final double COMPATIBLE_SMOOTHNESS
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer,boolean)
,
DrawClosedBezier(Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer)
,
FillBezier(Graphics,IlvPoint[],int,boolean,double,IlvTransformer)
,
Constant Field Valuespublic static final double AUTO_SMOOTHNESS
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer,boolean)
,
DrawClosedBezier(Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer)
,
FillBezier(Graphics,IlvPoint[],int,boolean,double,IlvTransformer)
,
Constant Field Valuespublic static final Font DEFAULT_FONT
public static double GetArrowSize(IlvLinkImage link, double lineWidth, IlvTransformer t)
link
- The link.lineWidth
- The effective line width of the link.t
- The transformer to draw the link.public static void DrawPolyline(Graphics g, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t)
g
- The destination Graphics
.pts
- The control points of the polyline.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the polyline.lineJoin
- The 'line join' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the polyline.PolylineBBox(IlvPoint[],int,double,int,int,IlvTransformer)
,
PointInPolyline(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void DrawPolyline(Graphics g, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t, boolean pointsTransformed)
g
- The destination Graphics
.pts
- The control points of the polyline.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the polyline.lineJoin
- The 'line join' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the polyline.pointsTransformed
- true, if the control points are already
transformed by the transformer, false otherwise.PolylineBBox(IlvPoint[],int,double,int,int,IlvTransformer)
,
PointInPolyline(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static float[] arrayCopyDoubleToFloat(double[] array)
array
- the array of double to be castedpublic static boolean isPrinting(Graphics g)
true
if we are currently printing.
The method checks the value of the printing rendering hint key on the
Graphics2D
object. The printing rendering hint is automatically
set by the IlvManager
on the Graphics2D
when you are
printing a layer.public static boolean PointInPolyline(IlvPoint point, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
point
- The point to testpts
- The control points of the polylinelength
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the polyline.lineJoin
- The 'line join' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to draw the polyline.true
if the point is on the polyline,
false
otherwise.DrawPolyline(Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
PolylineBBox(IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static IlvRect PolylineBBox(IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
pts
- The control points of the polyline.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the polyline.lineJoin
- The 'line join' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the polyline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to compute the bbox.DrawPolyline(Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
PointInPolyline(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void DrawBezier(Graphics g, IlvPoint[] pts, int length, boolean ghosting, double d, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t, boolean pointsTransformed)
g
- The destination Graphics
.pts
- The control points of the spline.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.d
- The smoothness of a multipoint spline (between 0 and 1).lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the spline.pointsTransformed
- May be set to true
if the points
in pts
are already transformed by the transformer.BezierBoundingBox(IlvRect,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
PointInBezier(IlvPoint,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
IlvStroke
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static void DrawBezier(Graphics g, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t)
g
- The destination Graphics
.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the spline.BezierBoundingBox(IlvRect,IlvPoint[],int,double,int,int,IlvTransformer)
,
PointInBezier(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void DrawBezier(Graphics g, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t, boolean pointsTransformed)
g
- The destination Graphics
.pts
- The control points of the spline.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the spline.pointsTransformed
- May be set to true
if the points
in pts
are already transformed by the transformer.BezierBoundingBox(IlvRect,IlvPoint[],int,double,int,int,IlvTransformer)
,
PointInBezier(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void BezierBoundingBox(IlvRect bbox, IlvPoint[] pts, int length, boolean ghosting, double smoothness, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
bbox
- A rectangle where the result is set.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to compute the bbox.DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer,boolean)
,
PointInBezier(IlvPoint,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
IlvStroke
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static void BezierBoundingBox(IlvRect bbox, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
bbox
- A rectangle where the result is set.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to compute the bbox.DrawBezier(java.awt.Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
PointInBezier(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static boolean PointInBezier(IlvPoint point, IlvPoint[] pts, int length, boolean ghosting, double smoothness, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
point
- The point to test.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to draw the spline.true
if the point is on the Bezier spline,
false
otherwise.DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer,boolean)
,
BezierBoundingBox(IlvRect,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
IlvStroke
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static boolean PointInBezier(IlvPoint point, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
point
- The point to testpts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to draw the spline.true
if the point is on the Bezier spline,
false
otherwise.DrawBezier(java.awt.Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
BezierBoundingBox(IlvRect,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void DrawClosedBezier(Graphics g, IlvPoint[] pts, int length, boolean ghosting, double smoothness, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t)
g
- The destination Graphics
.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the spline.ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
PointInClosedBezier(IlvPoint,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
IlvStroke
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static void DrawClosedBezier(Graphics g, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t)
g
- The destination Graphics
.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.lineStyle
- The array representing the dashing pattern.t
- The transformer used to draw the spline.ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,double,int,int,IlvTransformer)
,
PointInClosedBezier(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void ClosedBezierBoundingBox(IlvRect bbox, IlvPoint[] pts, int length, boolean ghosting, double smoothness, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
bbox
- A rectangle where the result is set.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to compute the bbox.DrawClosedBezier(Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer)
,
PointInClosedBezier(IlvPoint,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
IlvStroke
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static void ClosedBezierBoundingBox(IlvRect bbox, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
bbox
- A rectangle where the result is set.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to compute the bbox.DrawClosedBezier(Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
PointInClosedBezier(IlvPoint,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static boolean PointInClosedBezier(IlvPoint point, IlvPoint[] pts, int length, boolean ghosting, double smoothness, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
point
- The point to test.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to draw the spline.true
if the point is on the Bezier spline,
false
otherwise.DrawClosedBezier(Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer)
,
ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,boolean,double,double,int,int,IlvTransformer)
,
IlvStroke
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static boolean PointInClosedBezier(IlvPoint point, IlvPoint[] pts, int length, double lineWidth, int lineJoin, int endCap, IlvTransformer t)
point
- The point to test.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.lineWidth
- The width of the pen used to draw the spline.lineJoin
- The 'line join' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.endCap
- The 'end cap' style used to draw the spline.
The valid values are defined in the interface IlvStroke
.t
- The transformer used to draw the spline.true
if the point is on the Bezier spline,
false
otherwise.DrawClosedBezier(Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,double,int,int,IlvTransformer)
,
IlvStroke
public static void FillBezier(Graphics g, IlvPoint[] pts, int length, boolean ghosting, double smoothness, IlvTransformer t)
g
- The destination Graphics
.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).t
- The transformer used to draw the spline.PointInFilledBezier(IlvPoint,IlvPoint[],int,boolean,double,IlvTransformer)
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static void FillBezier(Graphics g, IlvPoint[] pts, int length, IlvTransformer t)
g
- The destination Graphics
.pts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.t
- The transformer used to draw the spline.PointInFilledBezier(IlvPoint,IlvPoint[],int,IlvTransformer)
public static boolean PointInFilledBezier(IlvPoint point, IlvPoint[] pts, int length, boolean ghosting, double smoothness, IlvTransformer t)
point
- The point to testpts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.smoothness
- The smoothness of a multipoint spline (between 0 and 1).t
- The transformer used to draw the spline.true
if the point is on the Bezier spline,
false
otherwise.FillBezier(Graphics,IlvPoint[],int,boolean,double,IlvTransformer)
,
IlvMakeSplineInteractor.drawGhost(java.awt.Graphics)
,
COMPATIBLE_SMOOTHNESS
public static boolean PointInFilledBezier(IlvPoint point, IlvPoint[] pts, int length, IlvTransformer t)
point
- The point to testpts
- The control points of the spline with untransformed coordinates.length
- The number of significant points in pts
.t
- The transformer used to draw the spline.true
if the point is on the Bezier spline,
false
otherwise.FillBezier(Graphics,IlvPoint[],int,IlvTransformer)
public static IlvPoint[] GetSmoothSpline(IlvPoint[] originalpoints, int length, double smoothness, boolean ghosting, IlvPoint[] bezierpoints)
IlvPoint
s for a smooth spline from
an array of IlvPoint
s of user control points.
If required space is available in the bezierpoints
array,
the method uses it.
The number of significant points in the resulting array is:
length
, if length
<= 2
length
- 2) * 3 + 1 +
(ghosting
?1:0),
if length
> 2originalpoints
- The user control points.length
- The number of significant points in
originalpoints
.smoothness
- The smoothness of a multipoint spline (between 0 and 1).ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.bezierpoints
- An array of points that is filled. If the array is
null
or not large enough, a new array of appropriate size
is allocated and returned.public static IlvPoint[] GetSmoothSplineHandlesFromBends(IlvPoint[] bendpoints, int length, double smoothness, boolean ghosting, IlvPoint[] handlepoints)
IlvPoint
s for a smooth spline
that can be used as selection handle points on the spline.
The returned points are guaranteed to be on the spline.
The number of handle points is always the same as the number of
user control points.
If required space is available in the handlepoints
array,
the method uses it.bendpoints
- The user control points.length
- The number of significant points in bendpoints
.smoothness
- The smoothness of a multipoint spline (between 0 and 1).ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized assuming that the user will add
more control points.handlepoints
- An array of points that is filled. If the array is
null
or not large enough, a new array of appropriate size
is allocated and returned.GetSmoothSpline(IlvPoint[], int, double, boolean, IlvPoint[])
,
GetSmoothSplineHandleFromBend(int, ilog.views.IlvPoint[], int, double, boolean)
,
GetSmoothSplineBendFromHandle(int, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, double, boolean)
public static IlvPoint GetSmoothSplineHandleFromBend(int handleIndex, IlvPoint[] bendpoints, int length, double smoothness, boolean ghosting)
GetSmoothSplineHandlesFromBends(ilog.views.IlvPoint[], int, double, boolean, ilog.views.IlvPoint[])
returns all handle positions,
this method returns the position of the handle with the given index.
The number of handle points is always the same as the number of
user control points.handleIndex
- The index of the handle.bendpoints
- The user control points.length
- The number of significant points in bendpoints
.smoothness
- The smoothness of a multipoint spline (between 0 and 1).ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized assuming that the user will add
more control points.GetSmoothSpline(IlvPoint[], int, double, boolean, IlvPoint[])
,
GetSmoothSplineHandlesFromBends(ilog.views.IlvPoint[], int, double, boolean, ilog.views.IlvPoint[])
,
GetSmoothSplineBendFromHandle(int, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, double, boolean)
public static IlvPoint GetSmoothSplineBendFromHandle(int handleIndex, IlvPoint handlePoint, IlvPoint[] bendpoints, int length, double smoothness, boolean ghosting)
GetSmoothSplineHandleFromBend(int, ilog.views.IlvPoint[], int, double, boolean)
.
The number of handle points is always the same as the number of
user control points.handleIndex
- The index of the handle.handlePoint
- The position of the handle on the spline.bendpoints
- The user control points.length
- The number of significant points in bendpoints
.smoothness
- The smoothness of a multipoint spline (between 0 and 1).ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized assuming that the user will add
more control points.GetSmoothSpline(IlvPoint[], int, double, boolean, IlvPoint[])
,
GetSmoothSplineHandlesFromBends(ilog.views.IlvPoint[], int, double, boolean, ilog.views.IlvPoint[])
,
GetSmoothSplineHandleFromBend(int, ilog.views.IlvPoint[], int, double, boolean)
public static IlvPoint[] GetAutoSmoothSpline(IlvPoint[] originalpoints, int length, boolean ghosting, IlvPoint[] bezierpoints, int[] flags, int[] resultingLength)
IlvPoint
s for a smooth spline from
an array of IlvPoint
s of user control points.
If required space is available in the bezierpoints
array,
the method uses it.
This method analyzes the control points to calculate an appropriate
smoothness automatically. The number of significant points in the
resulting array depends on the position of the control points.
The algorithm needs an auxiliary integer array of the size
length
. If an array flags
of size
length
is passed, this array is used as auxiliary array.originalpoints
- The user control points.length
- The number of significant points in
originalpoints
.ghosting
- true
if the line is drawn during ghosting
that happens during interactive spline creation. In this case, it is
unknown how many control points the user will add later; therefore, the
spline drawing is optimized under the assumption that the user will add
more control points.bezierpoints
- The returned array.flags
- An auxiliary array. Can be null
.resultingLength
- An array of 1, which will receive the number
of significant points in the returned array.public static void FillPolygon(Graphics g, IlvPoint[] points, int length, IlvTransformer t)
g
- The Graphics
object used to draw.points
- The control points of the polygon.length
- The number of significant
points in points
.t
- The transformer.public static void DrawPolygon(Graphics g, IlvPoint[] points, int length, IlvTransformer t)
g
- The Graphics
object used to draw.points
- The control points of the polygon.length
- The number of significant
points in points
.t
- The transformer.@Deprecated public static boolean PointInPolygon(IlvPoint point, IlvPoint[] pts, int length, IlvTransformer t)
PointInPolygon(IlvPoint,IlvPoint[],int,IlvTransformer,boolean)
instead.point
- The point to testpts
- The control points of the polylinelength
- The number of significant points in pts
.t
- The transformer used to draw the polygon.true
if the point is on the polyline,
false
otherwise.FillPolygon(Graphics, IlvPoint[],int,IlvTransformer)
public static boolean PointInPolygon(IlvPoint point, IlvPoint[] pts, int length, IlvTransformer t, boolean fill)
point
- The point to test.pts
- The control points of the polyline.length
- The number of significant points in pts
.t
- The transformer used to draw the polygon.fill
- Whether the polygon is filled or not.true
if the point is on the polyline,
false
otherwise.FillPolygon(Graphics, IlvPoint[],int,IlvTransformer)
public static void FillOutlinedPolygon(Graphics g, IlvPoint[] points, int length, Color fillColor, Color outlineColor, IlvTransformer t)
g
- The Graphics
object used to draw.points
- The control points of the polyline.length
- The number of significant
points in points
.fillColor
- The color used to fill the polygon.outlineColor
- The color used to draw the outline.t
- The transformer.public static void DrawString(Graphics g, String text, int x, int y, boolean antialiased)
g
- The graphics.text
- The string to draw.x
- The x position.y
- The y position.antialiased
- If true
the text is antialiased.GetStringBounds(java.lang.String, java.awt.Font, boolean)
public static void DrawString(IlvGraphic obj, Graphics g, String text, int x, int y, boolean antialiased)
obj
- The graphic objectg
- The graphics.text
- The string to draw.x
- The x position.y
- The y position.antialiased
- If true
the text is antialiased.GetStringBounds(java.lang.String, java.awt.Font, boolean)
public static IlvRect GetStringBounds(String text, Font font, boolean antialiased)
text
- The text.font
- The font.antialiased
- If true
,
the size of the antialiased text is computed.DrawString(java.awt.Graphics, java.lang.String, int, int, boolean)
public static IlvRect GetStringBounds(IlvGraphic obj, String text, Font font, boolean antialiased)
obj
- The graphic object.text
- The text.font
- The font.antialiased
- If true
,
the size of the antialiased text is computed.DrawString(java.awt.Graphics, java.lang.String, int, int, boolean)
public static float GetFontDescent(String text, Font font, boolean antialiased)
text
- The text.font
- The font.antialiased
- If true
,
the descent of the antialiased text is computed.DrawString(java.awt.Graphics, java.lang.String, int, int, boolean)
,
GetStringBounds(java.lang.String, java.awt.Font, boolean)
public static void StartAntiAliasing(Graphics g)
Graphics
.public static void StopAntiAliasing(Graphics g)
Graphics
.@Deprecated public static int GetAlpha(Color c)
Color.getAlpha()
insteadMakeColor(int, int, int, int)
@Deprecated public static Color MakeColor(int r, int g, int b, int alpha)
new Color(r,g,b,alpha)
instead.r
- The red component.g
- The green component.b
- The blue component.alpha
- The alpha component (in the range of 0-255).GetAlpha(java.awt.Color)
@Deprecated public static Color MakeColor(int rgba)
new Color(rgba, true)
instead.rgba
- The red, green, blue, and alpha components.GetAlpha(java.awt.Color)
public static boolean PointInShape(IlvPoint pt, Shape shape)
true
if an IlvPoint
is inside a
particular Shape
object, or false
otherwise.pt
- The point to be testedshape
- The shape to be testedpublic static IlvRect RectBBox(IlvRect rect, IlvTransformer t)
IlvRect
transformed with the
given IlvTransformer
.
The rectangle follows all transformations including rotations.
The rectangle is modified.rect
- The rectangle.t
- The transformer.public static void DrawImage(Graphics g, IlvRect drawrect, Image image, IlvTransformer t, ImageObserver observer, boolean highquality)
Image
with a given IlvTransformer
.public static void DrawRenderedImage(Graphics g, IlvRect drawrect, RenderedImage image, IlvTransformer t, boolean highquality)
RenderedImage
with a given
IlvTransformer
.public static Shape AddClip(Graphics g, Shape shape)
Shape
to the current clip
on the given Graphics
.
Returns the previous clipping shape.g
- The Graphics
on which the clip will be added.shape
- The clipping Shape
to be added.public static Shape CreateTransformedShape(Shape shape, IlvTransformer t)
Shape
object.shape
- The Shape
to be transformed.t
- The transformer.public static void SetJViews60LineStyleMode(boolean flag)
DrawPolyline(java.awt.Graphics, ilog.views.IlvPoint[], int, double, int, int, float[], ilog.views.IlvTransformer)
.DrawBezier(java.awt.Graphics, ilog.views.IlvPoint[], int, boolean, double, double, int, int, float[], ilog.views.IlvTransformer, boolean)
.DrawClosedBezier(java.awt.Graphics, ilog.views.IlvPoint[], int, boolean, double, double, int, int, float[], ilog.views.IlvTransformer)
.false
.flag
- Set to true
so polylines and Bezier curves
are drawn with JViews 6.0 line styles.DrawPolyline(Graphics,IlvPoint[],int,double,int,int,float[],IlvTransformer)
,
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer,boolean)
,
DrawClosedBezier(Graphics,IlvPoint[],int,boolean,double,double,int,int,float[],IlvTransformer)
,
IsJViews60LineStyleMode()
public static boolean IsJViews60LineStyleMode()
true
if polylines and Bezier curves
with line styles are drawn in JViews 6.0 style.
Returns false
if polylines and Bezier curves
with line styles are drawn in standard style.true
if polylines and Bezier curves
with line styles are drawn in JViews 6.0 style,
false
if they are drawn at all zoom factors.SetJViews60LineStyleMode(boolean)
public static final IlvPoint[] GetPolyPoints(IlvPolyPointsInterface polypoints, IlvTransformer t)
polypoints
- The polypoints object.t
- The transformer to draw the polypoints object.public static IlvGraphicVector startBidiChange(IlvGraphicBag bag)
IlvGraphicVector v = IlvGraphicUtil.startBidiChange(bag); try { // do the change on the bag, for instance, for base text direction: bag._baseTextDirection = baseTextDirection; // or: bag._componentOrientation = componentOrientation; // or: bag._locale = locale; } finally { IlvGraphicUtil.stopBidiChange(bag, v, redraw); }
bag
- The graphic bagpublic static void stopBidiChange(IlvGraphicBag bag, IlvGraphicVector v, boolean redraw)
bag
- The graphic bagv
- The graphic vector returned by startBidiChange(ilog.views.IlvGraphicBag)
.redraw
- Whether to redraw the entire bag at the end.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.