|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.util.DimensionUtilities
Provides utilities for manipulating
Dimension objects.
| Constructor Summary | |
DimensionUtilities()
|
|
| Method Summary | |
static Dimension |
createDimension(Dimension d)
Returns a new Dimension object
with the width and height of the given Dimension;
if the given width or height is less than zero,
it is set to zero. |
static Dimension |
createDimension(int width,
int height)
Returns a new Dimension object
with the given width and height;
if the given width or height is less than zero,
it is set to zero. |
static Dimension |
createMaximumDimension()
Returns a new Dimension object
with the maximum possible width and height. |
static Dimension |
createMinimumDimension()
Returns a new Dimension object
with zero width and height. |
static Dimension |
expand(Dimension d,
Insets insets)
Returns a new Dimension object
whose width and height are equal
to the corresponding values
in the given Dimension object,
expanded to include the given Insets. |
static Dimension |
max(Dimension d1,
Dimension d2)
Returns a new Dimension object
whose width and height are set
to the maximum corresponding values
in the given Dimension objects. |
static Dimension |
min(Dimension d1,
Dimension d2)
Returns a new Dimension object
whose width and height are set
to the minimum corresponding values
in the given Dimension objects. |
static Dimension |
shrink(Dimension d,
Insets insets)
Returns a new Dimension object
whose width and height are equal
to the corresponding values
in the given Dimension object,
shrinked to exclude the given Insets. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DimensionUtilities()
| Method Detail |
public static Dimension createDimension(int width,
int height)
Dimension object
with the given width and height;
if the given width or height is less than zero,
it is set to zero.
width - the width for the new Dimensionheight - the height for the new DimensioncreateDimension(Dimension)public static Dimension createDimension(Dimension d)
Dimension object
with the width and height of the given Dimension;
if the given width or height is less than zero,
it is set to zero.
d - the Dimension to be copied
NullPointerException - if the given Dimension is nullcreateDimension(int, int)public static Dimension createMinimumDimension()
Dimension object
with zero width and height.
createMinimumDimension()public static Dimension createMaximumDimension()
Dimension object
with the maximum possible width and height.
createMaximumDimension()
public static Dimension min(Dimension d1,
Dimension d2)
Dimension object
whose width and height are set
to the minimum corresponding values
in the given Dimension objects.
d1 - one of two Dimension objectsd2 - the other of the two Dimension objects
NullPointerException - if either of the given Dimension objects
is nullmax(Dimension, Dimension)
public static Dimension max(Dimension d1,
Dimension d2)
Dimension object
whose width and height are set
to the maximum corresponding values
in the given Dimension objects.
d1 - one of two Dimension objectsd2 - the other of the two Dimension objects
NullPointerException - if either of the given Dimension objects
is nullmin(Dimension, Dimension)
public static Dimension expand(Dimension d,
Insets insets)
Dimension object
whose width and height are equal
to the corresponding values
in the given Dimension object,
expanded to include the given Insets.
If the given Insets are negative
with respect to either the x or y direction,
the given Dimension is
neither expanded nor shrinked in that direction.
d - the Dimension to be copied and expandedinsets - the Insets to be considered
NullPointerException - if either the given Dimension object
or the given Insets object
is nullshrink(Dimension, Insets)
public static Dimension shrink(Dimension d,
Insets insets)
Dimension object
whose width and height are equal
to the corresponding values
in the given Dimension object,
shrinked to exclude the given Insets.
If the given Insets are negative
with respect to either the x or y direction,
the given Dimension is
neither expanded nor shrinked in that direction.
d - the Dimension to be copied and shrinkedinsets - the Insets to be considered
NullPointerException - if either the given Dimension object
or the given Insets object
is nullexpand(Dimension, Insets)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||