|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.swingext.Orientation
Various utilities to aid components that are aware of their
horizontal/vertical orientation. The Singleton pattern is used to
ensure that only one instance of a horizontal and one instance of a
vertical Orientation
exist.
Operations performed using length or breadth are transposed to width and height depending on whether this is a vertical or horizontal orientation.
Horizontal treats length as width, breadth as height, position as x and offset as y.
Vertical treats length as height, breadth as width, position as y and offset as x.
HORIZONTAL VERTICAL A | position = y | V +-------------+ A +-------------+ A | | | | | | <--position--> | | breadth = height | | length = = x | | | | | |height +-------------+ V +-------------+ V <-- length--> <--breadth--> = width = width
Constructor Summary | |
Orientation()
|
Method Summary | |
java.awt.Dimension |
addLength(java.awt.Dimension original,
java.awt.Component add)
Create a new Dimension from an existing
Dimension with its length increased by the length
of a Component . |
java.awt.Dimension |
addLength(java.awt.Dimension original,
java.awt.Dimension add)
Create a new Dimension from an existing
Dimension with its length increased by the length
of another Dimension . |
abstract java.awt.Dimension |
addLength(java.awt.Dimension original,
int add)
Create a new Dimension from an existing
Dimension with its length increased by a given
value. |
java.awt.Point |
addToPosition(java.awt.Point original,
java.awt.Component add)
Create a new Point from an existing
Point with its length increased by the length of a
Component . |
java.awt.Point |
addToPosition(java.awt.Point original,
java.awt.Dimension add)
Create a new Point from an existing
Point with its length increased by the length of a
Dimension . |
abstract java.awt.Point |
addToPosition(java.awt.Point original,
int add)
Create a new Point from an existing
Point with its position increased by a given
value. |
abstract int |
getBreadth(java.awt.Component comp)
Get the breadth of a Component . |
abstract int |
getBreadth(java.awt.Dimension dim)
Get the breadth of a Dimension . |
abstract java.awt.Cursor |
getCursor()
Get a cursor object pointing in the same direction as the orientation. |
abstract ArrowButton |
getEndArrowButton()
Get an arrow button pointing to the end of the orientation. |
abstract int |
getFirstUsableOffset(java.awt.Container cont)
Determines the first usable offset in a Container . |
abstract int |
getLastUsablePosition(java.awt.Container cont)
Determines the last usable position in a Container . |
abstract int |
getLength(java.awt.Component comp)
Get the length of a Component . |
abstract int |
getLength(java.awt.Dimension dim)
Get the length of a Dimension . |
abstract int |
getLengthMinusInsets(java.awt.Container cont)
Get the usable length of a Container minus its
insets . |
abstract int |
getOffset(java.awt.Point point)
Get the offset of a Point . |
abstract Orientation |
getPerpendicular()
Get an instance of an Orientation perpendicular to
this instance. |
abstract int |
getPosition(java.awt.Component comp)
Get the position of a Component . |
abstract int |
getPosition(java.awt.event.MouseEvent me)
Get the position of a MouseEvent . |
abstract int |
getPosition(java.awt.Point point)
Get the position of a Point . |
abstract ArrowButton |
getStartArrowButton()
Get an arrow button pointing to the start of the orientation. |
abstract java.awt.Point |
newPoint(int position,
int offset)
Generate a new Point object from position and offset values. |
abstract java.awt.Dimension |
setBreadth(java.awt.Dimension original,
java.awt.Dimension breadth)
Create a new Dimension from an existing
Dimension with its breadth changed to the breadth
of another given Dimension . |
abstract java.awt.Dimension |
setBreadth(java.awt.Dimension original,
int breadth)
Create a new Dimension from an existing
Dimension with its breadth changed to a given
value. |
abstract java.awt.Dimension |
setLength(java.awt.Dimension original,
java.awt.Dimension length)
Create a new Dimension from an existing
Dimension with its length changed to the length of
another given Dimension . |
abstract java.awt.Dimension |
setLength(java.awt.Dimension original,
int length)
Create a new Dimension from an existing
Dimension with its length changed to a given
value. |
abstract java.awt.Point |
setPosition(java.awt.Point original,
int position)
Create a new Point from an existing
Point with its position changed to a given value. |
java.awt.Point |
subtractFromPosition(java.awt.Point original,
java.awt.Component subtract)
Create a new Point from an existing
Point with its length decreased by the length of a
Component . |
java.awt.Point |
subtractFromPosition(java.awt.Point original,
java.awt.Dimension subtract)
Create a new Point from an existing
Point with its length decreased by the length of a
Dimension . |
java.awt.Point |
subtractFromPosition(java.awt.Point original,
int subtract)
Create a new Point from an existing
Point with its position decreased by a given
value. |
java.awt.Dimension |
subtractLength(java.awt.Dimension original,
java.awt.Component subtract)
Create a new Dimension from an existing
Dimension with its length decreased by the length
of a Component . |
java.awt.Dimension |
subtractLength(java.awt.Dimension original,
java.awt.Dimension subtract)
Create a new Dimension from an existing
Dimension with its length decreased by the length
of another Dimension . |
java.awt.Dimension |
subtractLength(java.awt.Dimension original,
int subtract)
Create a new Dimension from an existing
Dimension with its length decreased by a given
value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Orientation()
Method Detail |
public abstract Orientation getPerpendicular()
Orientation
perpendicular to
this instance.If called on a horizontal instance then a vertical instance is returned.
If called on a vertical instance then a horizontal instance is returned.
public abstract int getLength(java.awt.Dimension dim)
Dimension
.
Dimension
.public abstract int getLength(java.awt.Component comp)
Component
.
Component
.public abstract int getLengthMinusInsets(java.awt.Container cont)
Container
minus its
insets
.
Component
.public abstract int getBreadth(java.awt.Dimension dim)
Dimension
.
Dimension
.public abstract int getBreadth(java.awt.Component comp)
Component
.
Component
.public abstract int getPosition(java.awt.Point point)
Point
.
Point
.public abstract int getOffset(java.awt.Point point)
Point
.
Point
.public abstract int getLastUsablePosition(java.awt.Container cont)
Container
. This takes into account the
Insets
of the Container
.
Container
.public abstract int getFirstUsableOffset(java.awt.Container cont)
Container
. This takes into account the
Insets
of the Container
.
Container
.public abstract java.awt.Point newPoint(int position, int offset)
Point
object from position and offset values.
Point
object.public abstract int getPosition(java.awt.Component comp)
Component
.
Component
.public abstract int getPosition(java.awt.event.MouseEvent me)
MouseEvent
.
MouseEvent
.public abstract java.awt.Dimension addLength(java.awt.Dimension original, int add)
Dimension
from an existing
Dimension
with its length increased by a given
value.
Dimension
.public java.awt.Dimension addLength(java.awt.Dimension original, java.awt.Dimension add)
Dimension
from an existing
Dimension
with its length increased by the length
of another Dimension
.
Dimension
.public java.awt.Dimension addLength(java.awt.Dimension original, java.awt.Component add)
Dimension
from an existing
Dimension
with its length increased by the length
of a Component
.
Dimension
.public java.awt.Dimension subtractLength(java.awt.Dimension original, int subtract)
Dimension
from an existing
Dimension
with its length decreased by a given
value.
Dimension
.public java.awt.Dimension subtractLength(java.awt.Dimension original, java.awt.Dimension subtract)
Dimension
from an existing
Dimension
with its length decreased by the length
of another Dimension
.
Dimension
.public java.awt.Dimension subtractLength(java.awt.Dimension original, java.awt.Component subtract)
Dimension
from an existing
Dimension
with its length decreased by the length
of a Component
.
Dimension
.public abstract java.awt.Point addToPosition(java.awt.Point original, int add)
Point
from an existing
Point
with its position increased by a given
value.
Point
.public java.awt.Point addToPosition(java.awt.Point original, java.awt.Dimension add)
Point
from an existing
Point
with its length increased by the length of a
Dimension
.
Point
.public java.awt.Point addToPosition(java.awt.Point original, java.awt.Component add)
Point
from an existing
Point
with its length increased by the length of a
Component
.
Point
.public java.awt.Point subtractFromPosition(java.awt.Point original, int subtract)
Point
from an existing
Point
with its position decreased by a given
value.
Point
.public java.awt.Point subtractFromPosition(java.awt.Point original, java.awt.Dimension subtract)
Point
from an existing
Point
with its length decreased by the length of a
Dimension
.
Point
.public java.awt.Point subtractFromPosition(java.awt.Point original, java.awt.Component subtract)
Point
from an existing
Point
with its length decreased by the length of a
Component
.
Point
.public abstract java.awt.Dimension setLength(java.awt.Dimension original, int length)
Dimension
from an existing
Dimension
with its length changed to a given
value.
Dimension
.public abstract java.awt.Dimension setLength(java.awt.Dimension original, java.awt.Dimension length)
Dimension
from an existing
Dimension
with its length changed to the length of
another given Dimension
.
Dimension
.public abstract java.awt.Point setPosition(java.awt.Point original, int position)
Point
from an existing
Point
with its position changed to a given value.
Point
.public abstract java.awt.Dimension setBreadth(java.awt.Dimension original, int breadth)
Dimension
from an existing
Dimension
with its breadth changed to a given
value.
Dimension
.public abstract java.awt.Dimension setBreadth(java.awt.Dimension original, java.awt.Dimension breadth)
Dimension
from an existing
Dimension
with its breadth changed to the breadth
of another given Dimension
.
Dimension
.public abstract java.awt.Cursor getCursor()
Cursor
.public abstract ArrowButton getStartArrowButton()
ArrowButton
.public abstract ArrowButton getEndArrowButton()
ArrowButton
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20030829) | ArgoUML Project Home | ArgoUML Cookbook |