ilog.views
Class IlvGraphicUtil

java.lang.Object
  extended by ilog.views.IlvGraphicUtil

public class IlvGraphicUtil
extends Object

Utility class for drawings.


Field Summary
static float AUTO_SMOOTHNESS
          Smoothness value for splines.
static float COMPATIBLE_SMOOTHNESS
          Smoothness value for splines for backward compatibility.
 
Method Summary
static Shape AddClip(Graphics g, Shape shape)
          Adds a clipping Shape to the current clip on the given Graphics.
static void BezierBoundingBox(IlvRect bbox, IlvPoint[] pts, int length, boolean ghosting, float smoothness, float lineWidth, int lineJoin, int endCap, IlvTransformer t)
          Computes the bounding rectangle of a Bezier spline.
static void BezierBoundingBox(IlvRect bbox, IlvPoint[] pts, int length, float 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, float smoothness, float 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, float 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, float smoothness, float lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t, boolean pointsTransformed)
          Draws a Bezier spline.
static void DrawBezier(Graphics g, IlvPoint[] pts, int length, float 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, float 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, float smoothness, float lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t)
          Draws a closed Bezier spline.
static void DrawClosedBezier(Graphics g, IlvPoint[] pts, int length, float 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, float lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t)
          Draws a polyline.
static void DrawPolyline(Graphics g, IlvPoint[] pts, int length, float 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 FillBezier(Graphics g, IlvPoint[] pts, int length, boolean ghosting, float 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 IlvPoint[] GetAutoSmoothSpline(IlvPoint[] originalpoints, int length, boolean ghosting, IlvPoint[] bezierpoints, int[] flags, int[] resultingLength)
          Returns an array of IlvPoints for a smooth spline from an array of IlvPoints 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, float smoothness, boolean ghosting, IlvPoint[] bezierpoints)
          Returns an array of IlvPoints for a smooth spline from an array of IlvPoints of user control points.
static IlvPoint GetSmoothSplineBendFromHandle(int handleIndex, IlvPoint handlePoint, IlvPoint[] bendpoints, int length, float 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, float 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, float smoothness, boolean ghosting, IlvPoint[] handlepoints)
          Returns an array of IlvPoints for a smooth spline that can be used as selection handle points on the spline.
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, float smoothness, float lineWidth, int lineJoin, int endCap, IlvTransformer t)
          Performs a hit test on a Bezier spline.
static boolean PointInBezier(IlvPoint point, IlvPoint[] pts, int length, float 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, float smoothness, float 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, float 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, float 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 ILOG JViews 5.5 you should use PointInPolygon(IlvPoint,IlvPoint[],int,IlvTransformer) 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, float 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, float 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 void StopAntiAliasing(Graphics g)
          Unsets the antialiasing hint on the Graphics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPATIBLE_SMOOTHNESS

public static final float COMPATIBLE_SMOOTHNESS
Smoothness value for splines for backward compatibility. With this smoothness value, a spline looks exactly as in JViews 3.0. That is, the spline with more than two bends (4 control points) will not look smooth.

Since:
JViews 3.5
See Also:
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer,boolean), DrawClosedBezier(Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer), FillBezier(Graphics,IlvPoint[],int,boolean,float,IlvTransformer), Constant Field Values

AUTO_SMOOTHNESS

public static final float AUTO_SMOOTHNESS
Smoothness value for splines. With this smoothness value, a spline looks smooth, but the sharpness of the bend curves is automatically adjusted.

Since:
JViews 8.1
See Also:
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer,boolean), DrawClosedBezier(Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer), FillBezier(Graphics,IlvPoint[],int,boolean,float,IlvTransformer), Constant Field Values
Method Detail

DrawPolyline

public static void DrawPolyline(Graphics g,
                                IlvPoint[] pts,
                                int length,
                                float lineWidth,
                                int lineJoin,
                                int endCap,
                                float[] lineStyle,
                                IlvTransformer t)
Draws a polyline.

Parameters:
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.
See Also:
PolylineBBox(IlvPoint[],int,float,int,int,IlvTransformer), PointInPolyline(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

DrawPolyline

public static void DrawPolyline(Graphics g,
                                IlvPoint[] pts,
                                int length,
                                float lineWidth,
                                int lineJoin,
                                int endCap,
                                float[] lineStyle,
                                IlvTransformer t,
                                boolean pointsTransformed)
Draws a polyline.

Parameters:
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.
Since:
JViews 6.0
See Also:
PolylineBBox(IlvPoint[],int,float,int,int,IlvTransformer), PointInPolyline(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

isPrinting

public static boolean isPrinting(Graphics g)
Returns 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.

Since:
JViews 5.5

PointInPolyline

public static boolean PointInPolyline(IlvPoint point,
                                      IlvPoint[] pts,
                                      int length,
                                      float lineWidth,
                                      int lineJoin,
                                      int endCap,
                                      IlvTransformer t)
Performs a hit test on a polyline.

Parameters:
point - The point to test
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 draw the polyline.
Returns:
true if the point is on the polyline, false otherwise.
See Also:
DrawPolyline(Graphics,IlvPoint[],int,float,int,int,float[],IlvTransformer), PolylineBBox(IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

PolylineBBox

public static IlvRect PolylineBBox(IlvPoint[] pts,
                                   int length,
                                   float lineWidth,
                                   int lineJoin,
                                   int endCap,
                                   IlvTransformer t)
Computes the bounding rectangle of a polyline.

Parameters:
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.
See Also:
DrawPolyline(Graphics,IlvPoint[],int,float,int,int,float[],IlvTransformer), PointInPolyline(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

DrawBezier

public static void DrawBezier(Graphics g,
                              IlvPoint[] pts,
                              int length,
                              boolean ghosting,
                              float smoothness,
                              float lineWidth,
                              int lineJoin,
                              int endCap,
                              float[] lineStyle,
                              IlvTransformer t,
                              boolean pointsTransformed)
Draws a Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
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.
pointsTransformed - May be set to true if the points in pts are already transformed by the transformer.
Since:
JViews 3.5
See Also:
BezierBoundingBox(IlvRect,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), PointInBezier(IlvPoint,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), IlvStroke, IlvMakeSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

DrawBezier

public static void DrawBezier(Graphics g,
                              IlvPoint[] pts,
                              int length,
                              float lineWidth,
                              int lineJoin,
                              int endCap,
                              float[] lineStyle,
                              IlvTransformer t)
Draws a Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
See Also:
BezierBoundingBox(IlvRect,IlvPoint[],int,float,int,int,IlvTransformer), PointInBezier(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

DrawBezier

public static void DrawBezier(Graphics g,
                              IlvPoint[] pts,
                              int length,
                              float lineWidth,
                              int lineJoin,
                              int endCap,
                              float[] lineStyle,
                              IlvTransformer t,
                              boolean pointsTransformed)
Draws a Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
See Also:
BezierBoundingBox(IlvRect,IlvPoint[],int,float,int,int,IlvTransformer), PointInBezier(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

BezierBoundingBox

public static void BezierBoundingBox(IlvRect bbox,
                                     IlvPoint[] pts,
                                     int length,
                                     boolean ghosting,
                                     float smoothness,
                                     float lineWidth,
                                     int lineJoin,
                                     int endCap,
                                     IlvTransformer t)
Computes the bounding rectangle of a Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
Since:
JViews 3.5
See Also:
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer,boolean), PointInBezier(IlvPoint,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), IlvStroke, IlvMakeSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

BezierBoundingBox

public static void BezierBoundingBox(IlvRect bbox,
                                     IlvPoint[] pts,
                                     int length,
                                     float lineWidth,
                                     int lineJoin,
                                     int endCap,
                                     IlvTransformer t)
Computes the bounding rectangle of a Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
See Also:
DrawBezier(java.awt.Graphics,IlvPoint[],int,float,int,int,float[],IlvTransformer), PointInBezier(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

PointInBezier

public static boolean PointInBezier(IlvPoint point,
                                    IlvPoint[] pts,
                                    int length,
                                    boolean ghosting,
                                    float smoothness,
                                    float lineWidth,
                                    int lineJoin,
                                    int endCap,
                                    IlvTransformer t)
Performs a hit test on a Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
Returns:
true if the point is on the Bezier spline, false otherwise.
Since:
JViews 3.5
See Also:
DrawBezier(java.awt.Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer,boolean), BezierBoundingBox(IlvRect,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), IlvStroke, IlvMakeSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

PointInBezier

public static boolean PointInBezier(IlvPoint point,
                                    IlvPoint[] pts,
                                    int length,
                                    float lineWidth,
                                    int lineJoin,
                                    int endCap,
                                    IlvTransformer t)
Performs a hit test on a Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
Returns:
true if the point is on the Bezier spline, false otherwise.
See Also:
DrawBezier(java.awt.Graphics,IlvPoint[],int,float,int,int,float[],IlvTransformer), BezierBoundingBox(IlvRect,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

DrawClosedBezier

public static void DrawClosedBezier(Graphics g,
                                    IlvPoint[] pts,
                                    int length,
                                    boolean ghosting,
                                    float smoothness,
                                    float lineWidth,
                                    int lineJoin,
                                    int endCap,
                                    float[] lineStyle,
                                    IlvTransformer t)
Draws a closed Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
Since:
JViews 3.5
See Also:
ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), PointInClosedBezier(IlvPoint,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), IlvStroke, IlvMakeClosedSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

DrawClosedBezier

public static void DrawClosedBezier(Graphics g,
                                    IlvPoint[] pts,
                                    int length,
                                    float lineWidth,
                                    int lineJoin,
                                    int endCap,
                                    float[] lineStyle,
                                    IlvTransformer t)
Draws a closed Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
See Also:
ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,float,int,int,IlvTransformer), PointInClosedBezier(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

ClosedBezierBoundingBox

public static void ClosedBezierBoundingBox(IlvRect bbox,
                                           IlvPoint[] pts,
                                           int length,
                                           boolean ghosting,
                                           float smoothness,
                                           float lineWidth,
                                           int lineJoin,
                                           int endCap,
                                           IlvTransformer t)
Computes the bounding rectangle of a closed Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
Since:
JViews 3.5
See Also:
DrawClosedBezier(Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer), PointInClosedBezier(IlvPoint,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), IlvStroke, IlvMakeClosedSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

ClosedBezierBoundingBox

public static void ClosedBezierBoundingBox(IlvRect bbox,
                                           IlvPoint[] pts,
                                           int length,
                                           float lineWidth,
                                           int lineJoin,
                                           int endCap,
                                           IlvTransformer t)
Computes the bounding rectangle of a closed Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
See Also:
DrawClosedBezier(Graphics,IlvPoint[],int,float,int,int,float[],IlvTransformer), PointInClosedBezier(IlvPoint,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

PointInClosedBezier

public static boolean PointInClosedBezier(IlvPoint point,
                                          IlvPoint[] pts,
                                          int length,
                                          boolean ghosting,
                                          float smoothness,
                                          float lineWidth,
                                          int lineJoin,
                                          int endCap,
                                          IlvTransformer t)
Performs a hit test on a closed Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
Returns:
true if the point is on the Bezier spline, false otherwise.
Since:
JViews 3.5
See Also:
DrawClosedBezier(Graphics,IlvPoint[],int,boolean,float,float,int,int,float[],IlvTransformer), ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,boolean,float,float,int,int,IlvTransformer), IlvStroke, IlvMakeClosedSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

PointInClosedBezier

public static boolean PointInClosedBezier(IlvPoint point,
                                          IlvPoint[] pts,
                                          int length,
                                          float lineWidth,
                                          int lineJoin,
                                          int endCap,
                                          IlvTransformer t)
Performs a hit test on a closed Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
Returns:
true if the point is on the Bezier spline, false otherwise.
See Also:
DrawClosedBezier(Graphics,IlvPoint[],int,float,int,int,float[],IlvTransformer), ClosedBezierBoundingBox(IlvRect,IlvPoint[],int,float,int,int,IlvTransformer), IlvStroke

FillBezier

public static void FillBezier(Graphics g,
                              IlvPoint[] pts,
                              int length,
                              boolean ghosting,
                              float smoothness,
                              IlvTransformer t)
Draws a filled Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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.
Since:
JViews 3.5
See Also:
PointInFilledBezier(IlvPoint,IlvPoint[],int,boolean,float,IlvTransformer), IlvMakeFilledSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

FillBezier

public static void FillBezier(Graphics g,
                              IlvPoint[] pts,
                              int length,
                              IlvTransformer t)
Draws a filled Bezier spline of up to 4 control points. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
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.
See Also:
PointInFilledBezier(IlvPoint,IlvPoint[],int,IlvTransformer)

PointInFilledBezier

public static boolean PointInFilledBezier(IlvPoint point,
                                          IlvPoint[] pts,
                                          int length,
                                          boolean ghosting,
                                          float smoothness,
                                          IlvTransformer t)
Performs a hit test on a filled Bezier spline. This works with any number of control points, by fitting Bezier splines smoothly together.

Parameters:
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).
t - The transformer used to draw the spline.
Returns:
true if the point is on the Bezier spline, false otherwise.
Since:
JViews 3.5
See Also:
FillBezier(Graphics,IlvPoint[],int,boolean,float,IlvTransformer), IlvMakeFilledSplineInteractor.drawGhost(java.awt.Graphics), COMPATIBLE_SMOOTHNESS

PointInFilledBezier

public 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. A spline with more than 4 control points will not look smooth but bend abruptly at each fourth control point.

Parameters:
point - The point to test
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.
Returns:
true if the point is on the Bezier spline, false otherwise.
See Also:
FillBezier(Graphics,IlvPoint[],int,IlvTransformer)

GetSmoothSpline

public static IlvPoint[] GetSmoothSpline(IlvPoint[] originalpoints,
                                         int length,
                                         float smoothness,
                                         boolean ghosting,
                                         IlvPoint[] bezierpoints)
Returns an array of IlvPoints for a smooth spline from an array of IlvPoints 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 > 2

Parameters:
originalpoints - 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.
Since:
JViews 3.5

GetSmoothSplineHandlesFromBends

public static IlvPoint[] GetSmoothSplineHandlesFromBends(IlvPoint[] bendpoints,
                                                         int length,
                                                         float smoothness,
                                                         boolean ghosting,
                                                         IlvPoint[] handlepoints)
Returns an array of IlvPoints 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.

Parameters:
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.
Since:
JViews 8.1
See Also:
GetSmoothSpline(ilog.views.IlvPoint[], int, float, boolean), GetSmoothSplineHandleFromBend(int, ilog.views.IlvPoint[], int, float, boolean), GetSmoothSplineBendFromHandle(int, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, float, boolean)

GetSmoothSplineHandleFromBend

public static IlvPoint GetSmoothSplineHandleFromBend(int handleIndex,
                                                     IlvPoint[] bendpoints,
                                                     int length,
                                                     float smoothness,
                                                     boolean ghosting)
Returns a position on a smooth spline that can be used as selection handle points on the spline. While GetSmoothSplineHandlesFromBends(ilog.views.IlvPoint[], int, float, 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.

Parameters:
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.
Since:
JViews 8.1
See Also:
GetSmoothSpline(ilog.views.IlvPoint[], int, float, boolean), GetSmoothSplineHandlesFromBends(ilog.views.IlvPoint[], int, float, boolean, ilog.views.IlvPoint[]), GetSmoothSplineBendFromHandle(int, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, float, boolean)

GetSmoothSplineBendFromHandle

public static IlvPoint GetSmoothSplineBendFromHandle(int handleIndex,
                                                     IlvPoint handlePoint,
                                                     IlvPoint[] bendpoints,
                                                     int length,
                                                     float smoothness,
                                                     boolean ghosting)
Returns the used control point from the handle position on a smooth spline. This is the inverse operation to GetSmoothSplineHandleFromBend(int, ilog.views.IlvPoint[], int, float, boolean). The number of handle points is always the same as the number of user control points.

Parameters:
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.
Since:
JViews 8.1
See Also:
GetSmoothSpline(ilog.views.IlvPoint[], int, float, boolean), GetSmoothSplineHandlesFromBends(ilog.views.IlvPoint[], int, float, boolean, ilog.views.IlvPoint[]), GetSmoothSplineHandleFromBend(int, ilog.views.IlvPoint[], int, float, boolean)

GetAutoSmoothSpline

public static IlvPoint[] GetAutoSmoothSpline(IlvPoint[] originalpoints,
                                             int length,
                                             boolean ghosting,
                                             IlvPoint[] bezierpoints,
                                             int[] flags,
                                             int[] resultingLength)
Returns an array of IlvPoints for a smooth spline from an array of IlvPoints 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.

Parameters:
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.
Since:
JViews 8.1

FillPolygon

public static void FillPolygon(Graphics g,
                               IlvPoint[] points,
                               int length,
                               IlvTransformer t)
Draws a filled polygon.

Parameters:
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.

DrawPolygon

public static void DrawPolygon(Graphics g,
                               IlvPoint[] points,
                               int length,
                               IlvTransformer t)
Draws an outline of a polygon.

Parameters:
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.
Since:
JViews 5.5

PointInPolygon

public static boolean PointInPolygon(IlvPoint point,
                                     IlvPoint[] pts,
                                     int length,
                                     IlvTransformer t)
Deprecated. Beginning with ILOG JViews 5.5 you should use PointInPolygon(IlvPoint,IlvPoint[],int,IlvTransformer) instead.

Performs a hit test on a polygon.

Parameters:
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.
Returns:
true if the point is on the polyline, false otherwise.
See Also:
FillPolygon(Graphics, IlvPoint[],int,IlvTransformer)

PointInPolygon

public static boolean PointInPolygon(IlvPoint point,
                                     IlvPoint[] pts,
                                     int length,
                                     IlvTransformer t,
                                     boolean fill)
Performs a hit test on a polygon.

Parameters:
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.
Returns:
true if the point is on the polyline, false otherwise.
Since:
JViews 5.5
See Also:
FillPolygon(Graphics, IlvPoint[],int,IlvTransformer)

FillOutlinedPolygon

public static void FillOutlinedPolygon(Graphics g,
                                       IlvPoint[] points,
                                       int length,
                                       Color fillColor,
                                       Color outlineColor,
                                       IlvTransformer t)
Draws an outlined polygon.

Parameters:
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.

DrawString

public 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. The (x, y) position is the bottom-left corner of the string.

Parameters:
g - The graphics.
text - The string to draw.
x - The x position.
y - The y position.
antialiased - If true the text is antialiased.
See Also:
GetStringBounds(java.lang.String, java.awt.Font, boolean)

GetStringBounds

public static IlvRect GetStringBounds(String text,
                                      Font font,
                                      boolean antialiased)
Returns the bounding rectangle enclosing t