public class JDFRectangle extends JDFNumList
JDFNumList.NormComparator, JDFNumList.VolumeComparatorJDFBaseDataTypes.EnumFitsValueEPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION| Constructor and Description |
|---|
JDFRectangle()
constructs a rectangle with all 4 values set to 0.0 Double
|
JDFRectangle(double llx,
double lly,
double urx,
double ury)
constructs a new JDFRectangle with the given double values
|
JDFRectangle(JDFNumList nl)
constructs a rectangle with all values set via a JDFNumberList
|
JDFRectangle(JDFRectangle rec)
constructs a rectangle with all values set via a JDFRectangle
|
JDFRectangle(JDFXYPair size)
constructs a rectangle with all values set via a JDFRectangle
|
JDFRectangle(JDFXYPair ll,
JDFXYPair ur) |
JDFRectangle(java.lang.String s)
constructs a rectangle with all values set via a String
|
JDFRectangle(java.util.Vector v)
Deprecated.
use typesafe constructors
|
| Modifier and Type | Method and Description |
|---|---|
JDFRectangle |
clone() |
static JDFRectangle |
createRectangle(java.lang.String s)
factory for JDFRectangle that silently returns null in case of illegal strings
|
double |
getArea() |
JDFRectangle |
getBoundingRect(JDFRectangle r)
get the common (intersected area) of this with r
|
JDFXYPair |
getCenter() |
double |
getHeight()
getHeight - returns the height of the rectangle, the difference between upper right y value and lower left y value as an absolute value
|
JDFRectangle |
getInterSection(JDFRectangle r)
get the common (intersected area) of this with r
|
JDFXYPair |
getLL() |
double |
getLlx()
getLlx - returns the lower left x coordinate
|
double |
getLly()
getLly - returns the lower left y coordinate
|
JDFXYPair |
getSize() |
JDFXYPair |
getUR() |
double |
getUrx()
getUrx - returns the upper right x coordinate
|
double |
getUry()
getUry - returns the upper right y coordinate
|
double |
getWidth()
getWidth - returns the width of the rectangle, the difference between upper right x value and lower left x value as an absolute value
|
boolean |
isGreater(JDFRectangle r)
isGreater - equality operator >
|
boolean |
isGreaterOrEqual(JDFRectangle r)
isGreaterOrEqual - equality operator >=
|
boolean |
isInside(JDFXYPair p)
isInside - true it the point is inside this
|
boolean |
isLess(JDFRectangle r)
isLess - equality operator <
|
boolean |
isLessOrEqual(JDFRectangle r)
isLessOrEqual - equality operator <=
|
boolean |
isValid()
isValid - true if the size of the vector is 4 and all instances are Double types
|
JDFRectangle |
normalize()
ensures the right points e.g after a rotation
|
JDFRectangle |
scale(JDFXYPair scaleFactor) |
JDFRectangle |
setCenter(JDFXYPair c) |
void |
setLlx(double x)
setLlx - sets the lower left x coordinate
|
void |
setLlxMm(double mmX)
setLlXMm - sets the lower left x coordinate in millimeter
|
void |
setLly(double y)
setLly - sets the lower left y coordinate
|
void |
setLlyMm(double mmY)
setLlyMm - sets the lower left y coordinate in millimeter
|
void |
setUrx(double x)
setUrx - sets the upper right x coordinate
|
void |
setUrxMm(double mmX)
setUrxMm - sets the upper right x coordinate in millimeter
|
void |
setUry(double y)
setUry - sets the upper right y coordinate
|
void |
setUryMm(double mmY)
setUryMm - sets the upper right y coordinate in millimeter
|
void |
shift(double tx,
double ty)
shifts this by the amount specified
|
void |
shift(JDFXYPair shift)
shifts this by the amount specified
|
abs, contains, containsAll, copyNumList, doubleAt, elementAt, equals, getDouble, getDoubleList, getDoubleVector, getIntArray, getString, getString, hashCode, intAt, isValidString, matches, max, min, norm, removeElementAt, replaceElementAt, scale, scale, scaleFromCM, scaleFromCM, scaleFromMM, scaleFromMM, scaleToCM, scaleToCM, scaleToMM, scaleToMM, set, setString, setX, shift, sort, subtract, toString, unify, volumeadd, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, forEach, get, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSizepublic JDFRectangle()
@Deprecated
public JDFRectangle(java.util.Vector v)
throws java.util.zip.DataFormatException
v - the given Vector with MAX_RECTANGLE_DIMENSION objects of type Doublejava.util.zip.DataFormatException - - if the Vector has not a valid formatpublic JDFRectangle(java.lang.String s)
throws java.util.zip.DataFormatException
s - the given String, blank separated numbersjava.util.zip.DataFormatException - - if the String has not a valid formatpublic JDFRectangle(JDFRectangle rec)
rec - the given rectanglepublic JDFRectangle(JDFXYPair size)
rec - the given rectanglepublic JDFRectangle(JDFNumList nl) throws java.util.zip.DataFormatException
nl - the given number listjava.util.zip.DataFormatException - - if the JDFNumberList has not a valid formatpublic JDFRectangle(double llx,
double lly,
double urx,
double ury)
llx - lower left x coordinatelly - lower left y coordinateurx - lower left x coordinateury - lower left y coordinatepublic JDFRectangle clone()
clone in class JDFNumListJDFNumList.clone()public static JDFRectangle createRectangle(java.lang.String s)
s - the string to parsepublic boolean isValid()
throws java.util.zip.DataFormatException
isValid in class JDFNumListjava.util.zip.DataFormatException - - if the Vector has not a valid formatpublic double getLlx()
public void setLlx(double x)
x - the lower left x coordinatepublic void setLlxMm(double mmX)
mmX - the lower left x coordinate in millimeterpublic double getLly()
public void setLly(double y)
y - the lower left y coordinatepublic void setLlyMm(double mmY)
mmY - the lower left y coordinate in millimeterpublic double getUrx()
public void setUrx(double x)
x - the upper right x coordinatepublic void setUrxMm(double mmX)
mmX - the upper right x coordinate in millimeterpublic double getUry()
public void setUry(double y)
y - the upper right y coordinatepublic void setUryMm(double mmY)
mmY - the upper right y coordinate in millimeterpublic double getWidth()
public double getHeight()
public boolean isGreater(JDFRectangle r)
r - the JDFRectangle object to compare tothis > rpublic JDFRectangle getInterSection(JDFRectangle r)
r - the new rect, null if r=nullpublic JDFRectangle getBoundingRect(JDFRectangle r)
r - the new rect, null if r=nullpublic void shift(double tx,
double ty)
tx - shift in x directionty - shift in y directionpublic JDFRectangle normalize()
public JDFXYPair getCenter()
public JDFRectangle setCenter(JDFXYPair c)
c - public JDFRectangle scale(JDFXYPair scaleFactor)
scaleFactor - public void shift(JDFXYPair shift)
shift - in x and y directionpublic boolean isGreaterOrEqual(JDFRectangle r)
r - the JDFRectangle object to compare tothis >= rpublic boolean isInside(JDFXYPair p)
p - the pount to checkthis < rpublic boolean isLess(JDFRectangle r)
r - the JDFRectangle object to compare tothis < rpublic boolean isLessOrEqual(JDFRectangle r)
r - the JDFRectangle object to compare tothis <= rpublic JDFXYPair getLL()
public JDFXYPair getUR()
public JDFXYPair getSize()
public double getArea()