Search this API

y.geom
Class YInsets

java.lang.Object
  extended by y.geom.YInsets
All Implemented Interfaces:
java.io.Serializable

public final class YInsets
extends java.lang.Object
implements java.io.Serializable

Double-precision immutable insets representation.

See Also:
Serialized Form
 
Your browser does not support SVG content.

Field Summary
 double bottom
          The inset from the bottom.
 double left
          The inset from the left.
 double right
          The inset from the right.
 double top
          The inset from the top.
 
Constructor Summary
YInsets(double top, double left, double bottom, double right)
          Creates a new double-precision insets object with the specified insets.
YInsets(java.awt.Insets insets)
          Creates a new double-precision insets object with the specified insets.
 
Method Summary
static YInsets asYInsets(java.lang.Object data)
          Returns a YInsets insets representing the specified data.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.awt.Insets toInsets()
          Returns an integer-precision approximation of this insets object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

top

public final double top
The inset from the top.


left

public final double left
The inset from the left.


bottom

public final double bottom
The inset from the bottom.


right

public final double right
The inset from the right.

Constructor Detail

YInsets

public YInsets(double top,
               double left,
               double bottom,
               double right)
Creates a new double-precision insets object with the specified insets.

Parameters:
top - the inset from the top.
left - the inset from the left.
bottom - the inset from the bottom.
right - the inset from the right.

YInsets

public YInsets(java.awt.Insets insets)
Creates a new double-precision insets object with the specified insets.

Parameters:
insets - the top, left, bottom, and right insets.
Method Detail

toInsets

public java.awt.Insets toInsets()
Returns an integer-precision approximation of this insets object.

Returns:
an integer-precision approximation of this insets object.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

asYInsets

public static YInsets asYInsets(java.lang.Object data)
Returns a YInsets insets representing the specified data. If data is an instance of YInsets, data is returned. If data is an instance of Insets, a new YInsets instance with the appropriate values is returned. In all other cases, null is returned.

Parameters:
data - the data that has to be represented as YInsets.
Returns:
a YInsets insets representing the specified data.
See Also:
YInsets(java.awt.Insets)

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.