gishur.gui2
Class ScreenAlignment
java.lang.Object
|
+--gishur.gui2.Alignment
|
+--gishur.gui2.ScreenAlignment
- public class ScreenAlignment
- extends Alignment
An Alignment
class that aligns the target object relatively to the
mouse position.
- Version:
- 1.0
- Author:
- Thomas Wolf
Methods inherited from class gishur.gui2.Alignment |
align, convertAlignmentToPercent, createCenterAlignment, createLeftTopAlignment, getReferencePoint, getReferencePoint, getX, getY, hSourceAlignment, hSourceAlignmentPercent, hTargetAlignment, hTargetAlignmentPercent, toString, vector, vSourceAlignment, vSourceAlignmentPercent, vTargetAlignment, vTargetAlignmentPercent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ScreenAlignment
public ScreenAlignment(int x,
int y,
byte h_align,
byte v_align,
byte h_t_align,
byte v_t_align)
- Constructs a new
ScreenAlignment
. The point to align to is located
relatively to the source area or line as specified via the vertical
and horizontal alignment constants. An object will be aligned at the
specified distance vector from this point.
- Parameters:
x,y
- distance vectorh_align
- horizontal alignment constant (for the source object)v_align
- vertical alignment constant (for the source object)h_t_align
- horizontal alignment constant (for the target object)v_t_align
- vertical alignment constant (for the target object)
ScreenAlignment
public ScreenAlignment(int x,
int y,
byte h_t_align,
byte v_t_align)
- Constructs a new
ScreenAlignment
. The point to align to is located
relatively to the source area or line as specified via the vertical
and horizontal alignment constants. An object will be aligned at the
specified distance vector from this point.
- Parameters:
x,y
- distance vectorh_t_align
- horizontal alignment constant (for the target object)v_t_align
- vertical alignment constant (for the target object)
align
public void align(DrawObject source,
Painter target)
- Aligns the given target-
Painter
according to this
Alignment
relatively to the given source-Painter
.
- Overrides:
align
in class Alignment
- Parameters:
source
- the source Painter
(already positioned)target
- the target Painter
to align