Package org.eclipse.draw2d.geometry
Class Insets
java.lang.Object
org.eclipse.draw2d.geometry.Insets
- All Implemented Interfaces:
- Serializable,- Cloneable
- Direct Known Subclasses:
- IFigure.NoInsets
Stores four integers for top, left, bottom, and right measurements.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionInsets()Constructs an Insets with all zeroes.Insets(int i) Constructs a new Insets with all the sides set to the speicifed value.Insets(int top, int left, int bottom, int right) Creates a new Insets with the specified top, left, bottom, and right values.Constructs a new Insets with initial values the same as the provided Insets.
- 
Method SummaryModifier and TypeMethodDescriptionAdds the values of the specified Insets to this Insets' values.booleanTest for equality.Creates an Insets representing the sum of this Insets with the specified Insets.intReturns the height for this Insets, equal totop+bottom.Creates a newInsetswith negated values.Creates a new Insets with transposed values.intgetWidth()Returns the width for this Insets, equal toleft+right.inthashCode()booleanisEmpty()Returns true if all values are 0.static InsetsCreates a new minimalInsetsusing the distances of the given arguments.toString()Transposes this object.
- 
Field Details- 
leftpublic int leftdistance from left
- 
toppublic int topdistance from top
- 
bottompublic int bottomdistance from bottom
- 
rightpublic int rightdistance from right
 
- 
- 
Constructor Details- 
Insetspublic Insets()Constructs an Insets with all zeroes.- Since:
- 2.0
 
- 
InsetsConstructs a new Insets with initial values the same as the provided Insets.- Parameters:
- i- The insets to copy.
- Since:
- 2.0
 
- 
Insetspublic Insets(int i) Constructs a new Insets with all the sides set to the speicifed value.- Parameters:
- i- Value applied to all sides of new Insets.
- Since:
- 2.0
 
- 
Insetspublic Insets(int top, int left, int bottom, int right) Creates a new Insets with the specified top, left, bottom, and right values.- Parameters:
- top- Value of the top space.
- left- Value of the left space.
- bottom- Value of the bottom space.
- right- Value of the right space.
- Since:
- 2.0
 
 
- 
- 
Method Details- 
addAdds the values of the specified Insets to this Insets' values.- Parameters:
- insets- the Insets being added
- Returns:
- thisfor convenience
- Since:
- 2.0
 
- 
equalsTest for equality. The Insets are equal if their top, left, bottom, and right values are equivalent.
- 
getAddedCreates an Insets representing the sum of this Insets with the specified Insets.- Parameters:
- insets- Insets to be added
- Returns:
- A new Insets
- Since:
- 2.0
 
- 
getHeightpublic int getHeight()Returns the height for this Insets, equal totop+bottom.- Returns:
- The sum of top + bottom
- Since:
- 2.0
- See Also:
 
- 
getTransposedCreates a new Insets with transposed values. Top and Left are transposed. Bottom and Right are transposed.- Returns:
- New Insets with the transposed values.
- Since:
- 2.0
 
- 
getNegatedCreates a newInsetswith negated values. Top, Left, Bottom and Right are multiplied by-1- Returns:
- The negate of this Insets
- Since:
- 3.13
 
- 
getWidthpublic int getWidth()Returns the width for this Insets, equal toleft+right.- Returns:
- The sum of left + right
- Since:
- 2.0
- See Also:
 
- 
hashCodepublic int hashCode()
- 
isEmptypublic boolean isEmpty()Returns true if all values are 0.- Returns:
- true if all values are 0
- Since:
- 2.0
 
- 
toString
- 
transposeTransposes this object. Top and Left are exchanged. Bottom and Right are exchanged. Can be used in orientation changes.- Returns:
- thisfor convenience
- Since:
- 2.0
 
- 
minCreates a new minimalInsetsusing the distances of the given arguments. The Top, Left, Bottom and Right computes using the minimum of the respective distances.
 
-