ini.trakem2.display
Class AffineTransformMode

java.lang.Object
  extended by ini.trakem2.display.AffineTransformMode
All Implemented Interfaces:
Mode

public class AffineTransformMode
extends java.lang.Object
implements Mode


Constructor Summary
AffineTransformMode(Display display)
           
 
Method Summary
 boolean apply()
           
protected  void applyAndPropagate(java.util.Set<Layer> sublist)
          Skips current layer, since its done already.
 boolean cancel()
           
 boolean canChangeLayer()
           
 boolean canPan()
           
 boolean canZoom()
           
 void centerFloater()
           
 int getFloaterX()
           
 int getFloaterY()
           
 GraphicsSource getGraphicsSource()
           
 java.awt.Rectangle getRepaintBounds()
           
 boolean isDragging()
           
 void magnificationUpdated(java.awt.Rectangle srcRect, double magnification)
           
 void mouseDragged(java.awt.event.MouseEvent me, int x_p, int y_p, int x_d, int y_d, int x_d_old, int y_d_old)
           
 void mousePressed(java.awt.event.MouseEvent me, int x_p, int y_p, double magnification)
           
 void mouseReleased(java.awt.event.MouseEvent me, int x_p, int y_p, int x_d, int y_d, int x_r, int y_r)
           
 void redoOneStep()
           
 void resetBox()
          Recalculate box and reset handles.
 void rotate(double angle, int xo, int yo)
          Rotate the objects in the current selection by the given angle, in degrees, relative to the x_o, y_o origin.
 void scale(double sx, double sy)
          Scale all selected objects and their links by by the given scales, relative to the floater position.
 void setFloater(int x, int y)
          No display bounds are checked, the floater can be placed wherever you want.
 void srcRectUpdated(java.awt.Rectangle srcRect, double magnification)
           
 void translate(double dx, double dy)
          Translate all selected objects and their links by the given differentials.
 void undoOneStep()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AffineTransformMode

public AffineTransformMode(Display display)
Method Detail

undoOneStep

public void undoOneStep()
Specified by:
undoOneStep in interface Mode

redoOneStep

public void redoOneStep()
Specified by:
redoOneStep in interface Mode

isDragging

public boolean isDragging()
Specified by:
isDragging in interface Mode

getGraphicsSource

public GraphicsSource getGraphicsSource()
Specified by:
getGraphicsSource in interface Mode

canChangeLayer

public boolean canChangeLayer()
Specified by:
canChangeLayer in interface Mode

canZoom

public boolean canZoom()
Specified by:
canZoom in interface Mode

canPan

public boolean canPan()
Specified by:
canPan in interface Mode

centerFloater

public void centerFloater()

setFloater

public void setFloater(int x,
                       int y)
No display bounds are checked, the floater can be placed wherever you want.


getFloaterX

public int getFloaterX()

getFloaterY

public int getFloaterY()

applyAndPropagate

protected void applyAndPropagate(java.util.Set<Layer> sublist)
Skips current layer, since its done already.


apply

public boolean apply()
Specified by:
apply in interface Mode

cancel

public boolean cancel()
Specified by:
cancel in interface Mode

mousePressed

public void mousePressed(java.awt.event.MouseEvent me,
                         int x_p,
                         int y_p,
                         double magnification)
Specified by:
mousePressed in interface Mode

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me,
                         int x_p,
                         int y_p,
                         int x_d,
                         int y_d,
                         int x_d_old,
                         int y_d_old)
Specified by:
mouseDragged in interface Mode

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me,
                          int x_p,
                          int y_p,
                          int x_d,
                          int y_d,
                          int x_r,
                          int y_r)
Specified by:
mouseReleased in interface Mode

resetBox

public void resetBox()
Recalculate box and reset handles.


rotate

public void rotate(double angle,
                   int xo,
                   int yo)
Rotate the objects in the current selection by the given angle, in degrees, relative to the x_o, y_o origin.


translate

public void translate(double dx,
                      double dy)
Translate all selected objects and their links by the given differentials. The floater position is unaffected; if you want to update it call centerFloater()


scale

public void scale(double sx,
                  double sy)
Scale all selected objects and their links by by the given scales, relative to the floater position. .


getRepaintBounds

public java.awt.Rectangle getRepaintBounds()
Specified by:
getRepaintBounds in interface Mode

srcRectUpdated

public void srcRectUpdated(java.awt.Rectangle srcRect,
                           double magnification)
Specified by:
srcRectUpdated in interface Mode

magnificationUpdated

public void magnificationUpdated(java.awt.Rectangle srcRect,
                                 double magnification)
Specified by:
magnificationUpdated in interface Mode