gishur.gui2
Class MouseAlignment

java.lang.Object
  |
  +--gishur.gui2.Alignment
        |
        +--gishur.gui2.MouseAlignment

public class MouseAlignment
extends Alignment

An Alignment class that aligns the target object relatively to the mouse position.

Version:
1.0
Author:
Thomas Wolf

Fields inherited from class gishur.gui2.Alignment
BOTTOM, CENTER, LEFT, RIGHT, SOURCE, TARGET, TOP
 
Constructor Summary
MouseAlignment(int x, int y, byte h_t_align, byte v_t_align)
          Constructs a new MouseAlignment.
 
Method Summary
 void align(DrawObject source, Painter target)
          Aligns the given target-Painter according to this Alignment relatively to the given source-Painter.
 
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
 

Constructor Detail

MouseAlignment

public MouseAlignment(int x,
                      int y,
                      byte h_t_align,
                      byte v_t_align)
Constructs a new MouseAlignment. 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 vector
h_t_align - horizontal alignment constant (for the target object)
v_t_align - vertical alignment constant (for the target object)
Method Detail

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