public final class Utilities
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static com.mindfusion.common.DateTime |
advance(com.mindfusion.common.DateTime time,
int steps,
TimeUnit unit)
Advances the specified time with the specified number
of units according to the underlying resolution.
|
static void |
drawLine(java.awt.Graphics2D graphics,
Pen pen,
double x1,
double y1,
double x2,
double y2) |
static void |
drawPolygon(java.awt.Graphics2D graphics,
Pen pen,
java.awt.geom.Point2D.Double[] points) |
static void |
fillPolygon(java.awt.Graphics2D graphics,
Brush brush,
java.awt.geom.Point2D.Double[] points) |
static com.mindfusion.common.ScrollEvent |
fromAwtAdjustmentEvent(java.awt.event.AdjustmentEvent value)
Converts the specified
AdjustmentEvent object
to its ScrollEvent equivalent. |
static com.mindfusion.common.DayOfWeek |
fromJavaDayOfWeek(int value)
Converts the specified
Calendar constant to its
DayOfWeek equivalent. |
static java.lang.reflect.Constructor<? extends ItemViewer> |
getCustomItemViewerConstructor(java.lang.Class<? extends Item> itemType) |
static java.awt.geom.Rectangle2D |
inflate(java.awt.geom.Rectangle2D rect,
double margin) |
static java.awt.geom.Rectangle2D |
inflate(java.awt.geom.Rectangle2D rect,
double width,
double height) |
static java.awt.geom.Rectangle2D |
inflate(java.awt.geom.Rectangle2D rect,
double left,
double top,
double right,
double bottom) |
static java.awt.Rectangle |
inflate(java.awt.Rectangle rect,
int margin) |
static java.awt.Rectangle |
inflate(java.awt.Rectangle rect,
int width,
int height) |
static java.awt.geom.Rectangle2D |
inflateBottom(java.awt.geom.Rectangle2D rect,
double value)
Inflates the bottom side of the current rectangle with the specified amount
and returns a new
Rectangle2D object representing the result. |
static java.awt.Rectangle |
inflateBottom(java.awt.Rectangle rect,
int value)
Inflates the bottom side of the current rectangle with the specified amount
and returns a new Rectangle object representing the result.
|
static java.awt.geom.Rectangle2D |
inflateLeft(java.awt.geom.Rectangle2D rect,
double value)
Inflates the left side of the current rectangle with the specified amount
and returns a new
Rectangle2D object representing the result. |
static java.awt.Rectangle |
inflateLeft(java.awt.Rectangle rect,
int value)
Inflates the left side of the current rectangle with the specified amount
and returns a new Rectangle object representing the result.
|
static java.awt.Rectangle |
inflateRectangleMaxHalf(java.awt.Rectangle rect,
int left,
int top,
int right,
int bottom)
Inflates the specified rectangle from each side.
|
static java.awt.geom.Rectangle2D |
inflateRight(java.awt.geom.Rectangle2D rect,
double value)
Inflates the right side of the current rectangle with the specified amount
and returns a new
Rectangle2D object representing the result. |
static java.awt.Rectangle |
inflateRight(java.awt.Rectangle rect,
int value)
Inflates the right side of the current rectangle with the specified amount
and returns a new Rectangle object representing the result.
|
static java.awt.geom.Rectangle2D |
inflateTop(java.awt.geom.Rectangle2D rect,
double value)
Inflates the top side of the current rectangle with the specified amount
and returns a new
Rectangle2D object representing the result. |
static java.awt.Rectangle |
inflateTop(java.awt.Rectangle rect,
int value)
Inflates the top side of the current rectangle with the specified amount
and returns a new Rectangle object representing the result.
|
static boolean |
intersect(com.mindfusion.common.Duration a1,
com.mindfusion.common.Duration b1,
com.mindfusion.common.Duration a2,
com.mindfusion.common.Duration b2)
Checks whether the specified time intervals intersect.
|
static <T> java.util.List<T> |
itemsOfType(java.lang.Iterable<?> collection,
java.lang.reflect.Type type,
java.lang.Class<T> resultType)
Returns the subset of items from the specified collection that have the specified type.
|
static com.mindfusion.common.DateTime |
max(com.mindfusion.common.DateTime a,
com.mindfusion.common.DateTime b)
Returns the later of two dates.
|
static com.mindfusion.common.DateTime |
min(com.mindfusion.common.DateTime a,
com.mindfusion.common.DateTime b)
Returns the former of two dates.
|
static java.awt.Point |
offset(java.awt.Point point,
int dx,
int dy) |
static java.awt.geom.Rectangle2D |
offset(java.awt.geom.Rectangle2D rect,
double dx,
double dy) |
static java.awt.Rectangle |
offset(java.awt.Rectangle rect,
int dx,
int dy) |
static <T> java.util.List<T> |
ofType(java.lang.Iterable<?> collection,
java.lang.reflect.Type type,
java.lang.Class<T> resultType)
Returns the subset of items from the specified collection that have the specified type.
|
static void |
raiseArgumentOutOfRangeException(java.lang.String argName,
java.lang.String getString) |
static int |
toAwtHorizontalAlignment(com.mindfusion.common.HorizontalAlignment alignment)
Converts the specified
HorizontalAlignment value to its SwingConstants equivalent. |
static int |
toJavaDayOfWeek(com.mindfusion.common.DayOfWeek value)
Converts the specified
DayOfWeek constant to its
Calendar equivalent. |
public static final com.mindfusion.common.ScrollEvent fromAwtAdjustmentEvent(java.awt.event.AdjustmentEvent value)
AdjustmentEvent object
to its ScrollEvent equivalent.public static final int toAwtHorizontalAlignment(com.mindfusion.common.HorizontalAlignment alignment)
HorizontalAlignment value to its SwingConstants equivalent.public static java.awt.Rectangle inflateRectangleMaxHalf(java.awt.Rectangle rect,
int left,
int top,
int right,
int bottom)
public static void raiseArgumentOutOfRangeException(java.lang.String argName,
java.lang.String getString)
public static com.mindfusion.common.DateTime advance(com.mindfusion.common.DateTime time,
int steps,
TimeUnit unit)
public static com.mindfusion.common.DateTime max(com.mindfusion.common.DateTime a,
com.mindfusion.common.DateTime b)
public static com.mindfusion.common.DateTime min(com.mindfusion.common.DateTime a,
com.mindfusion.common.DateTime b)
public static int toJavaDayOfWeek(com.mindfusion.common.DayOfWeek value)
DayOfWeek constant to its
Calendar equivalent.public static com.mindfusion.common.DayOfWeek fromJavaDayOfWeek(int value)
Calendar constant to its
DayOfWeek equivalent.public static boolean intersect(com.mindfusion.common.Duration a1,
com.mindfusion.common.Duration b1,
com.mindfusion.common.Duration a2,
com.mindfusion.common.Duration b2)
public static <T> java.util.List<T> ofType(java.lang.Iterable<?> collection,
java.lang.reflect.Type type,
java.lang.Class<T> resultType)
public static <T> java.util.List<T> itemsOfType(java.lang.Iterable<?> collection,
java.lang.reflect.Type type,
java.lang.Class<T> resultType)
public static java.lang.reflect.Constructor<? extends ItemViewer> getCustomItemViewerConstructor(java.lang.Class<? extends Item> itemType)
public static java.awt.Point offset(java.awt.Point point,
int dx,
int dy)
public static java.awt.Rectangle offset(java.awt.Rectangle rect,
int dx,
int dy)
public static java.awt.geom.Rectangle2D offset(java.awt.geom.Rectangle2D rect,
double dx,
double dy)
public static java.awt.Rectangle inflate(java.awt.Rectangle rect,
int margin)
public static java.awt.Rectangle inflate(java.awt.Rectangle rect,
int width,
int height)
public static java.awt.geom.Rectangle2D inflate(java.awt.geom.Rectangle2D rect,
double margin)
public static java.awt.geom.Rectangle2D inflate(java.awt.geom.Rectangle2D rect,
double width,
double height)
public static java.awt.geom.Rectangle2D inflate(java.awt.geom.Rectangle2D rect,
double left,
double top,
double right,
double bottom)
public static java.awt.Rectangle inflateLeft(java.awt.Rectangle rect,
int value)
value - The amount to inflate the left side of this rectangle.public static java.awt.Rectangle inflateTop(java.awt.Rectangle rect,
int value)
value - The amount to inflate the top side of this rectangle.public static java.awt.Rectangle inflateRight(java.awt.Rectangle rect,
int value)
value - The amount to inflate the right side of this rectangle.public static java.awt.Rectangle inflateBottom(java.awt.Rectangle rect,
int value)
value - The amount to inflate the bottom side of this rectangle.public static java.awt.geom.Rectangle2D inflateLeft(java.awt.geom.Rectangle2D rect,
double value)
Rectangle2D object representing the result.value - The amount to inflate the left side of this rectangle.Rectangle2D object.public static java.awt.geom.Rectangle2D inflateTop(java.awt.geom.Rectangle2D rect,
double value)
Rectangle2D object representing the result.value - The amount to inflate the top side of this rectangle.Rectangle2D object.public static java.awt.geom.Rectangle2D inflateRight(java.awt.geom.Rectangle2D rect,
double value)
Rectangle2D object representing the result.value - The amount to inflate the right side of this rectangle.Rectangle2D object.public static java.awt.geom.Rectangle2D inflateBottom(java.awt.geom.Rectangle2D rect,
double value)
Rectangle2D object representing the result.value - The amount to inflate the bottom side of this rectangle.Rectangle2D object.public static void fillPolygon(java.awt.Graphics2D graphics,
Brush brush,
java.awt.geom.Point2D.Double[] points)
public static void drawPolygon(java.awt.Graphics2D graphics,
Pen pen,
java.awt.geom.Point2D.Double[] points)
public static void drawLine(java.awt.Graphics2D graphics,
Pen pen,
double x1,
double y1,
double x2,
double y2)