|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.ui.RectangleInsets
public class RectangleInsets
Title: IJChart
Description: a chart library for the Java(tm) platform.
Represents the insets for a rectangle, specified in absolute or relative terms. This class is immutable.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static RectangleInsets |
INSETS_ONE
A useful constant representing one insets. |
static RectangleInsets |
INSETS_THREE
A useful constant representing three insets. |
static RectangleInsets |
INSETS_TWO
A useful constant representing two insets. |
static RectangleInsets |
INSETS_ZERO
A useful constant representing zero insets. |
Constructor Summary | |
---|---|
RectangleInsets(double top,
double left,
double bottom,
double right)
Creates a new instance with the specified insets (as 'absolute' units). |
|
RectangleInsets(UnitType unitType,
double top,
double left,
double bottom,
double right)
Creates a new instance. |
Method Summary | |
---|---|
double |
calculateBottomInset(double height)
Returns the bottom margin. |
double |
calculateBottomOutset(double height)
Returns the bottom margin. |
double |
calculateLeftInset(double width)
Returns the left margin. |
double |
calculateLeftOutset(double width)
Returns the left margin. |
double |
calculateRightInset(double width)
Returns the right margin. |
double |
calculateRightOutset(double width)
Returns the right margin. |
double |
calculateTopInset(double height)
Returns the top margin. |
double |
calculateTopOutset(double height)
Returns the top margin. |
java.awt.geom.Rectangle2D |
createAdjustedRectangle(java.awt.geom.Rectangle2D base,
LengthAdjustmentType horizontal,
LengthAdjustmentType vertical)
Creates an adjusted rectangle using the supplied rectangle, the insets specified by this instance, and the horizontal and vertical adjustment types. |
java.awt.geom.Rectangle2D |
createInsetRectangle(java.awt.geom.Rectangle2D base)
Creates an 'inset' rectangle. |
java.awt.geom.Rectangle2D |
createInsetRectangle(java.awt.geom.Rectangle2D base,
boolean horizontal,
boolean vertical)
Creates an 'inset' rectangle. |
java.awt.geom.Rectangle2D |
createOutsetRectangle(java.awt.geom.Rectangle2D base)
Creates an 'outset' rectangle. |
java.awt.geom.Rectangle2D |
createOutsetRectangle(java.awt.geom.Rectangle2D base,
boolean horizontal,
boolean vertical)
Creates an 'outset' rectangle. |
RectangleInsets |
ensureAtLeast(double len)
Expansion edge if the edge of this object is least than len. |
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object. |
void |
expandRect(java.awt.geom.Rectangle2D rect)
Rectangular extension of the width and height. |
void |
expandRectHeight(java.awt.geom.Rectangle2D rect)
Expansion rectangle height. |
void |
expandRectWidth(java.awt.geom.Rectangle2D rect)
Expansion rectangle width. |
double |
extendHeight(double height)
Extends the given height to allow for the insets. |
double |
extendWidth(double width)
Extends the given width to allow for the insets. |
double |
getBottom()
Returns the bottom insets. |
double |
getLeft()
Returns the left insets. |
double |
getRight()
Returns the right insets. |
double |
getTop()
Returns the top insets. |
java.awt.geom.Rectangle2D |
getTrimArea(java.awt.geom.Rectangle2D area)
Shrinks the given rectangle by the amount of these insets. |
UnitType |
getUnitType()
Returns the unit type (absolute or relative).This specifies whether the insets are measured as Java2D units or percentages. |
int |
hashCode()
Returns a hash code for the object. |
java.lang.String |
toString()
Returns a textual representation of this instance, useful for debugging purposes. |
void |
trim(java.awt.geom.Rectangle2D area)
Shrinks the given rectangle by the amount of these insets. |
double |
trimHeight(double height)
Trims the given height to allow for the insets. |
double |
trimWidth(double width)
Trims the given width to allow for the insets. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RectangleInsets INSETS_ZERO
public static final RectangleInsets INSETS_ONE
public static final RectangleInsets INSETS_TWO
public static final RectangleInsets INSETS_THREE
Constructor Detail |
---|
public RectangleInsets(double top, double left, double bottom, double right)
top
-
the top insets.left
-
the left insets.bottom
- the bottom insets.right
- the right insets.public RectangleInsets(UnitType unitType, double top, double left, double bottom, double right)
unitType
-
absolute or relative units (null not permitted).top
-
the top insets.left
-
the left insets.bottom
-
the bottom insets.right
-
the right insets.Method Detail |
---|
public UnitType getUnitType()
public double getTop()
public double getBottom()
public double getLeft()
public double getRight()
public java.awt.geom.Rectangle2D createAdjustedRectangle(java.awt.geom.Rectangle2D base, LengthAdjustmentType horizontal, LengthAdjustmentType vertical)
base
-
The base rectangle (null not permitted).horizontal
-
The horizontal adjustment type (null not permitted).vertical
-
The vertical adjustment type (null not permitted).
public java.awt.geom.Rectangle2D createInsetRectangle(java.awt.geom.Rectangle2D base)
base
-
The base rectangle (null not permitted).
public java.awt.geom.Rectangle2D createInsetRectangle(java.awt.geom.Rectangle2D base, boolean horizontal, boolean vertical)
base
-
The base rectangle (null not permitted).horizontal
-
Whether or not apply horizontal insets.vertical
-
Whether or not apply vertical insets.
public java.awt.geom.Rectangle2D createOutsetRectangle(java.awt.geom.Rectangle2D base)
base
-
The base rectangle (null not permitted).
public java.awt.geom.Rectangle2D createOutsetRectangle(java.awt.geom.Rectangle2D base, boolean horizontal, boolean vertical)
base
-
The base rectangle (null not permitted).horizontal
-
Whether or not apply horizontal insets.vertical
-
Whether or not apply vertical insets.
public double calculateTopInset(double height)
height
-
The height of the base rectangle.
public double calculateTopOutset(double height)
height
- the height of the base rectangle.
public double calculateBottomInset(double height)
height
- the height of the base rectangle.
public double calculateBottomOutset(double height)
height
- the height of the base rectangle.
public double calculateLeftInset(double width)
width
- the width of the base rectangle.
public double calculateLeftOutset(double width)
width
- the width of the base rectangle.
public double calculateRightInset(double width)
width
- the width of the base rectangle.
public double calculateRightOutset(double width)
width
- the width of the base rectangle.
public double trimWidth(double width)
width
- the width.
public double extendWidth(double width)
width
- the width.
public double trimHeight(double height)
height
- the height.
public double extendHeight(double height)
height
- the height.
public void expandRectHeight(java.awt.geom.Rectangle2D rect)
rect
- Rectangle2D
The rectangle (null not permitted).public void expandRectWidth(java.awt.geom.Rectangle2D rect)
rect
- Rectangle2D
The rectangle (null not permitted).public void expandRect(java.awt.geom.Rectangle2D rect)
rect
- Rectangle2D
The rectangle (null not permitted).public void trim(java.awt.geom.Rectangle2D area)
area
- Rectangle2D
The area (null not permitted).public java.awt.geom.Rectangle2D getTrimArea(java.awt.geom.Rectangle2D area)
area
- Rectangle2D
The area (null not permitted).
public RectangleInsets ensureAtLeast(double len)
len
- double
The length (must greater or equal than len).
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
-
the object (null permitted).
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |