ilog.views
Class IlvUtil

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

public final class IlvUtil
extends Object

IlvUtil is a class that regroups some utilities.


Method Summary
static void BoundingBox(IlvRect bbox, float[] x, float[] y, int count)
          Computes the bounding rectangle that contains all the points
static void BoundingBox(IlvRect bbox, IlvPoint[] points, int count)
          Computes the bounding rectangle that contains all the points
static Cursor CursorFromDirection(int direction)
          Returns the AWT Cursor from an IlvConstants
static double degreesToRadians(double angle)
          Transforms the angle parameter from degrees into radians.
static float GetDeltaLine()
          Returns the size of the margin used by the method PointInLine to detect if a point is on a line.
static Frame GetFrame(Component c)
          Returns the Frame window of the component.
static int GetHeadlessScreenResolution()
          Returns the screen resolution used in headless mode.
static Image GetImageFromFile(Class baseClass, String file)
          Deprecated. Beginning with JViews 5.5 use IlvImageUtil.getImageFromFile(java.lang.Class, java.lang.String) instead.
static IlvPoint GetLineIntersection(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2, IlvPoint result)
          Returns the intersection point between two lines.
static IlvPoint GetLineIntersection(IlvPoint p1LA, IlvPoint p2LA, IlvPoint p1LB, IlvPoint p2LB, IlvPoint result)
          Returns the intersection point between two lines.
static int GetMinorVersion()
          Deprecated. Please use IlvFrameworkProduct.getMinorVersion() instead.
static int GetPatchLevel()
          Deprecated. Please use IlvFrameworkProduct.getPatchLevel() instead.
static int GetSubMinorVersion()
          Deprecated. Please use IlvFrameworkProduct.getSubMinorVersion() instead.
static int GetVersion()
          Deprecated. Please use IlvFrameworkProduct.getVersion() instead.
static boolean PointInLine(IlvPoint point, IlvPoint from, IlvPoint to)
          Returns true if the first specified point is on the line described by the two other points.
static boolean PointInLine(IlvPoint point, IlvPoint from, IlvPoint to, boolean noMarginAtExtremities)
          Returns true if the first specified point is on the line described by the two other points.
static double radiansToDegrees(double angle)
          Transforms the angle parameter from radians into degrees.
static void registerKey(String key)
          Deprecated. Beginning with JViews 6.0, runtime keys are stored in a file called "deploy.txt" inside the application jar file. This method has no effect any more. You need to use the method IlvProductUtil.registerApplication(java.lang.String) instead.
static void SetDeltaLine(float val)
          Changes the size of the margin used by the method PointInLine(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvPoint) to detect if a point is on a line.
static void SetHeadlessScreenResolution(int resolution)
          Changes the screen resolution used in headless mode as a replacement of Toolkit.getDefaultToolkit().getScreenResolution() by classes and methods that need to compute dimensions on the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

BoundingBox

public static void BoundingBox(IlvRect bbox,
                               float[] x,
                               float[] y,
                               int count)
Computes the bounding rectangle that contains all the points


BoundingBox

public static void BoundingBox(IlvRect bbox,
                               IlvPoint[] points,
                               int count)
Computes the bounding rectangle that contains all the points


GetFrame

public static Frame GetFrame(Component c)
Returns the Frame window of the component. If no Frame parent is found returns null.


GetDeltaLine

public static float GetDeltaLine()
Returns the size of the margin used by the method PointInLine to detect if a point is on a line. The default value is 3.0.


SetDeltaLine

public static void SetDeltaLine(float val)
Changes the size of the margin used by the method PointInLine(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvPoint) to detect if a point is on a line.

Parameters:
val - The new value of the margin.

GetHeadlessScreenResolution

public static int GetHeadlessScreenResolution()
Returns the screen resolution used in headless mode. This method is used as a headless replacement of Toolkit.getDefaultToolkit().getScreenResolution() by classes and methods that need to compute dimensions on the screen.

The default value is 96.

Returns:
The headless screen resolution.
Since:
JViews 8.1
See Also:
GetHeadlessScreenResolution()

SetHeadlessScreenResolution

public static void SetHeadlessScreenResolution(int resolution)
Changes the screen resolution used in headless mode as a replacement of Toolkit.getDefaultToolkit().getScreenResolution() by classes and methods that need to compute dimensions on the screen.

The default value is 96.

Parameters:
resolution - The new resolution.
Since:
JViews 8.1
See Also:
SetHeadlessScreenResolution(int)

PointInLine

public static boolean PointInLine(IlvPoint point,
                                  IlvPoint from,
                                  IlvPoint to)
Returns true if the first specified point is on the line described by the two other points. The default size of the margin used is 8.0. To modify the margin, use SetDeltaLine(float).

Parameters:
point - The point to test.
from - The first point of the line.
to - The second point of the line.
See Also:
GetDeltaLine(), SetDeltaLine(float)

PointInLine

public static boolean PointInLine(IlvPoint point,
                                  IlvPoint from,
                                  IlvPoint to,
                                  boolean noMarginAtExtremities)
Returns true if the first specified point is on the line described by the two other points. The default size of the margin used is 8.0.

Parameters:
point - The point to test.
from - The first point of the line.
to - The second point of the line.
noMarginAtExtremities - if true, the margin will not be used at the extremities of the line.
See Also:
GetDeltaLine(), SetDeltaLine(float)

GetLineIntersection

public static IlvPoint GetLineIntersection(IlvPoint p1LA,
                                           IlvPoint p2LA,
                                           IlvPoint p1LB,
                                           IlvPoint p2LB,
                                           IlvPoint result)
Returns the intersection point between two lines.

Parameters:
p1LA - One point on the first line.
p2LA - Another point on the first line.
p1LB - One point on the second line.
p2LB - Another point on the second line.
result - If not null, this point is used a container for the return value and is filled with the intersection point if the lines intersect. If null, a new point is allocated internally and returned, if the lines intersect.
Returns:
The unique intersection point, or null if the two lines are parallel.
Since:
JViews 5.0

GetLineIntersection

public static IlvPoint GetLineIntersection(double ax1,
                                           double ay1,
                                           double ax2,
                                           double ay2,
                                           double bx1,
                                           double by1,
                                           double bx2,
                                           double by2,
                                           IlvPoint result)
Returns the intersection point between two lines.

Parameters:
ax1 - The x coordinate of the first point on the first line.
ay1 - The y coordinate of the first point on the first line.
ax2 - The x coordinate of the second point on the first line.
ay2 - The y coordinate of the second point on the first line.
bx1 - The x coordinate of the first point on the second line.
by1 - The y coordinate of the first point on the second line.
bx2 - The x coordinate of the second point on the second line.
by2 - The y coordinate of the second point on the second line.
result - If not null, this point is used a container for the return value and is filled with the intersection point if the lines intersect. If null, a new point is allocated internally and returned, if the lines intersect.
Returns:
The unique intersection point, or null if the two lines are parallel.
Since:
JViews 5.0

CursorFromDirection

public static Cursor CursorFromDirection(int direction)
Returns the AWT Cursor from an IlvConstants


degreesToRadians

public static double degreesToRadians(double angle)
Transforms the angle parameter from degrees into radians.

This method is identical to java.lang.Math.toRadians(angle).


radiansToDegrees

public static double radiansToDegrees(double angle)
Transforms the angle parameter from radians into degrees.

This method is identical to java.lang.Math.toDegrees(angle).


GetImageFromFile

public static Image GetImageFromFile(Class baseClass,
                                     String file)
                              throws IOException
Deprecated. Beginning with JViews 5.5 use IlvImageUtil.getImageFromFile(java.lang.Class, java.lang.String) instead.

Utility method that creates an image from a file stored in a JAR file. To read the image file, the method uses the InputStream returned by the method getResourceAsStream called on the baseClass object.

Parameters:
baseClass - The Class object on which the method getResourceAsStream is called.
file - The location of the file that contains the image to be read. The location must be specified relative to the location of the baseClass class.
Throws:
IOException
Since:
JViews 3.0

registerKey

public static final void registerKey(String key)
Deprecated. Beginning with JViews 6.0, runtime keys are stored in a file called "deploy.txt" inside the application jar file. This method has no effect any more. You need to use the method IlvProductUtil.registerApplication(java.lang.String) instead.

This method allows you to register the Runtime Key that allows you to deploy an application using JViews. Note that you should have a key for each component of the JViews Component Suite. To get more information about licensing go to http://javalicense.ilog.com.

Since:
JViews 5.0

GetVersion

public static final int GetVersion()
Deprecated. Please use IlvFrameworkProduct.getVersion() instead.

Returns the ILOG JViews version number, that is, 7.

Since:
JViews 2.1

GetMinorVersion

public static final int GetMinorVersion()
Deprecated. Please use IlvFrameworkProduct.getMinorVersion() instead.

Returns the ILOG JViews minor version number, that is, 0.

Since:
JViews 2.1

GetSubMinorVersion

public static final int GetSubMinorVersion()
Deprecated. Please use IlvFrameworkProduct.getSubMinorVersion() instead.

Returns the ILOG JViews subminor version number. For instance, with ILOG JViews 5.5 the method returns 0.

Since:
JViews 2.1

GetPatchLevel

public static final int GetPatchLevel()
Deprecated. Please use IlvFrameworkProduct.getPatchLevel() instead.

Returns the ILOG JViews patch level number. If the version does not includes patches, the method returns 0.

Since:
JViews 2.1


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.