org.jhotdraw.geom
Class Insets2D
- java.lang.Object
-
- org.jhotdraw.geom.Insets2D
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- Insets2D.Double, Insets2D.Float
public abstract class Insets2D extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableInsets2D.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classInsets2D.DoubleTheDoubleclass defines insets specified indoubleprecision.static classInsets2D.FloatTheFloatclass defines insets specified infloatprecision.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidadd(double top, double left, double bottom, double right)Adds the specified insets to the current insets.voidadd(Insets2D i)Adds the specified insets to the current insets.voidaddTo(java.awt.geom.Rectangle2D r)Adds the current insets to the specified Rectangle2D making the rectangle larger.java.lang.Objectclone()Creates a new object of the same class as this object.booleanequals(java.lang.Object obj)Checks whether two insets objects are equal.abstract doublegetBottom()Returns the bottom insets in double precision.abstract doublegetLeft()Returns the left insets in double precision.abstract doublegetRight()Returns the right insets in double precision.abstract doublegetTop()Returns the top insets in double precision.inthashCode()Returns the hash code for this Insets2DDouble.abstract voidset(double top, double left, double bottom, double right)Sets the insets.voidset(Insets2D i)Sets the insets.voidsubtract(double top, double left, double bottom, double right)Subtracts the specified insets from the current insets.voidsubtract(Insets2D i)Subtracts the specified insets from the current insets.voidsubtractTo(java.awt.geom.Rectangle2D r)Subtracts the current insets to the specified Rectangle2D making the rectangle smaller.java.lang.StringtoString()Returns a string representation of thisInsetsobject.
-
-
-
Method Detail
-
getTop
public abstract double getTop()
Returns the top insets in double precision.- Returns:
- the top insets of this
Insets2D.
-
getLeft
public abstract double getLeft()
Returns the left insets in double precision.- Returns:
- the left insets of this
Insets2D.
-
getBottom
public abstract double getBottom()
Returns the bottom insets in double precision.- Returns:
- the bottom insets of this
Insets2D.
-
getRight
public abstract double getRight()
Returns the right insets in double precision.- Returns:
- the right insets of this
Insets2D.
-
set
public abstract void set(double top, double left, double bottom, double right)Sets the insets.- Parameters:
top- The top insets.left- The left insets.bottom- The bottom insets.right- The right insets.
-
set
public void set(Insets2D i)
Sets the insets.- Parameters:
i- The new insets.
-
add
public void add(double top, double left, double bottom, double right)Adds the specified insets to the current insets.- Parameters:
top- The top insets.left- The left insets.bottom- The bottom insets.right- The right insets.
-
add
public void add(Insets2D i)
Adds the specified insets to the current insets.- Parameters:
i- The insets to be added.
-
addTo
public void addTo(java.awt.geom.Rectangle2D r)
Adds the current insets to the specified Rectangle2D making the rectangle larger.- Parameters:
r- The Rectangle2D.
-
subtract
public void subtract(double top, double left, double bottom, double right)Subtracts the specified insets from the current insets.- Parameters:
top- The top insets.left- The left insets.bottom- The bottom insets.right- The right insets.
-
subtract
public void subtract(Insets2D i)
Subtracts the specified insets from the current insets.- Parameters:
i- The insets to be subtracted.
-
subtractTo
public void subtractTo(java.awt.geom.Rectangle2D r)
Subtracts the current insets to the specified Rectangle2D making the rectangle smaller.- Parameters:
r- The Rectangle2D.
-
equals
public boolean equals(java.lang.Object obj)
Checks whether two insets objects are equal. Two instances ofInsets2DDoubleare equal if the four integer values of the fieldstop,left,bottom, andrightare all equal.- Overrides:
equalsin classjava.lang.Object- Returns:
trueif the two insets are equal; otherwisefalse.- Since:
- JDK1.1
-
hashCode
public int hashCode()
Returns the hash code for this Insets2DDouble.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this Insets2DDouble.
-
clone
public java.lang.Object clone()
Creates a new object of the same class as this object.- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of thisInsetsobject. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
Insetsobject.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG