|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.MeasureUnit
public class MeasureUnit
Specifies units of measure.
Field Summary | |
---|---|
static MeasureUnit |
Document
Specifies document units (1/300 inch) as the unit of measure. |
static MeasureUnit |
Inch
Specifies inches as the unit of measure. |
static MeasureUnit |
Millimeter
Specifies millimeters as the unit of measure. |
static MeasureUnit |
Percent
Specifies percents as the unit of measure. |
static MeasureUnit |
Pixel
Specifies device pixels as the unit of measure. |
static MeasureUnit |
Point
Specifies printer's points (1/72 inch) as the unit of measure. |
static MeasureUnit |
WpfPoint
Specifies device-independent pixels (1/96 inch) as the unit of measure. |
Constructor Summary | |
---|---|
MeasureUnit(java.lang.String name,
double unitsPerInch)
Initializes a new instance of the MeasureUnit class with
the specified amount. |
|
MeasureUnit(java.lang.String name,
double unitsPerInch,
int standardDivisions)
Initializes a new instance of the MeasureUnit class with
the specified amount. |
|
MeasureUnit(java.lang.String name,
MeasureUnit baseUnit,
double scale)
Initializes a new instance of the MeasureUnit class with
the specified unit of measure as a base. |
|
MeasureUnit(java.lang.String name,
MeasureUnit baseUnit,
double scale,
int standardDivisions)
Initializes a new instance of the MeasureUnit class with
the specified unit of measure as a base. |
Method Summary | |
---|---|
double |
convert(double value,
MeasureUnit targetUnit,
DiagramView view)
Converts the specified value from this unit to the specified unit. |
java.awt.geom.Point2D |
convert(java.awt.geom.Point2D p,
MeasureUnit targetUnit,
DiagramView view)
Converts the specified point from this unit to the specified unit. |
java.awt.geom.Rectangle2D |
convert(java.awt.geom.Rectangle2D r,
MeasureUnit targetUnit,
DiagramView view)
Converts the specified rectangle from this unit to the specified unit. |
boolean |
equals(java.lang.Object obj)
Object.equals(java.lang.Object) override. |
static MeasureUnit |
fromGraphicsUnit(int unit)
Returns the measure unit corresponding to the specified graphics unit. |
static MeasureUnit |
fromId(int id)
Returns a MeasureUnit from its integer identifier. |
int |
getId()
Gets the unit identifier. |
java.lang.String |
getName()
Gets the name of the unit. |
int |
hashCode()
Object.hashCode() override. |
static boolean |
op_Equality(MeasureUnit a,
MeasureUnit b)
Compares two MeasureUnit objects for equality. |
static boolean |
op_Inequality(MeasureUnit a,
MeasureUnit b)
Compares two MeasureUnit objects for inequality. |
java.lang.String |
toString()
Object.toString() override. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final MeasureUnit Millimeter
public static final MeasureUnit Inch
public static final MeasureUnit Point
public static final MeasureUnit Pixel
public static final MeasureUnit Document
public static final MeasureUnit WpfPoint
public static final MeasureUnit Percent
Constructor Detail |
---|
public MeasureUnit(java.lang.String name, MeasureUnit baseUnit, double scale)
MeasureUnit
class with
the specified unit of measure as a base.
name
- The name of the new unit.baseUnit
- The base of the new unit.scale
- The scale of the new unit, relatively to the base.public MeasureUnit(java.lang.String name, MeasureUnit baseUnit, double scale, int standardDivisions)
MeasureUnit
class with
the specified unit of measure as a base.
name
- The name of the new unit.baseUnit
- The base of the new unit.scale
- The scale of the new unit, relatively to the base.standardDivisions
- The number of divisions of the new unit.public MeasureUnit(java.lang.String name, double unitsPerInch)
MeasureUnit
class with
the specified amount.
name
- The name of the new unit.unitsPerInch
- The amount of the new unit that is equal to one inch.public MeasureUnit(java.lang.String name, double unitsPerInch, int standardDivisions)
MeasureUnit
class with
the specified amount.
name
- The name of the new unit.unitsPerInch
- The amount of the new unit that is equal to one inch.standardDivisions
- The number of divisions of the new unit.Method Detail |
---|
public java.lang.String toString()
Object.toString()
override.
toString
in class java.lang.Object
public int hashCode()
Object.hashCode()
override.
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
Object.equals(java.lang.Object)
override.
equals
in class java.lang.Object
obj
- The object to compare with the current unit.
true
if the specified object is the same as or
is equal to the current unit; otherwise, false
.public static boolean op_Equality(MeasureUnit a, MeasureUnit b)
MeasureUnit
objects for equality.
a
- The first MeasureUnit
to compare.b
- The second MeasureUnit
to compare.
true
if the specified arguments are equal; otherwise, false
.public static boolean op_Inequality(MeasureUnit a, MeasureUnit b)
MeasureUnit
objects for inequality.
a
- The first MeasureUnit
to compare.b
- The second MeasureUnit
to compare.
true
if the specified arguments are not equal; otherwise, false
.public double convert(double value, MeasureUnit targetUnit, DiagramView view)
value
- The value to convert, expressed in the current measure unit.targetUnit
- The target measure unit.view
- A parameter that is used when converting to special units
(such as percents).
public java.awt.geom.Point2D convert(java.awt.geom.Point2D p, MeasureUnit targetUnit, DiagramView view)
p
- The point to convert, expressed in the current measure unit.targetUnit
- The target measure unit.view
- A parameter that is used when converting to special units
(such as percents).
public java.awt.geom.Rectangle2D convert(java.awt.geom.Rectangle2D r, MeasureUnit targetUnit, DiagramView view)
r
- The rectangle to convert, expressed in the current measure unit.targetUnit
- The target measure unit.view
- A parameter that is used when converting to special units
(such as percents).
public static MeasureUnit fromId(int id)
MeasureUnit
from its integer identifier.
id
- The identifier of one of the built-in measure units.
MeasureUnit
corresponding to the specified identifier.public static MeasureUnit fromGraphicsUnit(int unit)
unit
- One of the GraphicsUnit
values.
MeasureUnit
corresponding to the specified
graphics unit. If unit is World
, this method
returns null
. If unit is Display
,
this method returns Pixel
.public int getId()
This property returns -1 for custom MeasureUnit
objects.
public java.lang.String getName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |