Draw2D v2.0

org.eclipse.draw2d.geometry
Class Insets

java.lang.Object
  |
  +--org.eclipse.draw2d.geometry.Insets
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
IFigure.NoInsets

public class Insets
extends Object
implements Cloneable, Serializable

Provides support for side space measurements for Borders

See Also:
Serialized Form

Field Summary
 int bottom
           
 int left
           
 int right
           
 int top
           
 
Constructor Summary
Insets()
          Constructs an Insets with left, top, bottom and right empty.
Insets(Insets i)
          Constructs an Insets with the initial values supplied by the input Insets.
Insets(int i)
          Constructs an Insets with all the sides set to the size given as input.
Insets(int top, int left, int bottom, int right)
          Constructs an Insets with the initial values set to the values given as input.
 
Method Summary
 Insets add(Insets insets)
          Adds the input Insets to this Insets and returns this Insets for convenience.
 boolean equals(Object o)
          Returns whether this Insets is equal to the Object input.
 Insets getAdded(Insets insets)
          Returns a new Insets containing the incremented values of this Insets and the input Insets.
 int getHeight()
          Returns the height for this Insets, which is this Inset's top and bottom values addded together.
 Insets getTransposed()
          Returns a new Insets with transposed values.
 int getWidth()
          Returns the width for this Insets which is the left value added to the right.
 boolean isEmpty()
          Returns whether this Insets has a value of zero for its top, left, right, and bottom values.
 String toString()
          Returns the description of this Insets as a String.
 Insets transpose()
          Interchanges the right-bottom and top-left spaces for this Insets and returns this Insets for convinience.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

left

public int left

top

public int top

bottom

public int bottom

right

public int right
Constructor Detail

Insets

public Insets()
Constructs an Insets with left, top, bottom and right empty.
Since:
2.0

Insets

public Insets(Insets i)
Constructs an Insets with the initial values supplied by the input Insets.
Parameters:
i - Insets supplying the initial values.
Since:
2.0

Insets

public Insets(int i)
Constructs an Insets with all the sides set to the size given as input.
Parameters:
i - Value applied to all the sides of the Insets.
Since:
2.0

Insets

public Insets(int top,
              int left,
              int bottom,
              int right)
Constructs an Insets with the initial values set to the values given as input.
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 Detail

add

public Insets add(Insets insets)
Adds the input Insets to this Insets and returns this Insets for convenience.
Since:
2.0

equals

public boolean equals(Object o)
Returns whether this Insets is equal to the Object input. The Insets are equal if their top, left, bottom, and right values are equivalent.
Overrides:
equals in class Object
Parameters:
o - Object being tested for equality.
Returns:
boolean giving the result of the equality.
Since:
2.0

getAdded

public Insets getAdded(Insets insets)
Returns a new Insets containing the incremented values of this Insets and the input Insets.
Parameters:
insets - Insets providing the increment values.
Returns:
A new Insets containing the new values.
Since:
2.0

getHeight

public int getHeight()
Returns the height for this Insets, which is this Inset's top and bottom values addded together.
Returns:
The height of this Insets.
Since:
2.0
See Also:
getWidth()

getTransposed

public Insets getTransposed()
Returns 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

getWidth

public int getWidth()
Returns the width for this Insets which is the left value added to the right.
Returns:
The width of this Insets.
Since:
2.0
See Also:
getHeight()

isEmpty

public boolean isEmpty()
Returns whether this Insets has a value of zero for its top, left, right, and bottom values.
Returns:
Returns a true if all the spaces are zero, else returns false
Since:
2.0

toString

public String toString()
Returns the description of this Insets as a String.
Overrides:
toString in class Object
Returns:
Desription.
Since:
2.0

transpose

public Insets transpose()
Interchanges the right-bottom and top-left spaces for this Insets and returns this Insets for convinience. Can be used in orientation changes.
Returns:
This Insets with the transposed sides.
Since:
2.0

Draw2D v2.0