* to the dragging of the mouse pointer
* @param e the event
*/
public void mouseDragged(MouseEvent e) {
VisualizationViewer vv = (VisualizationViewer)e.getSource();
MutableTransformer vt = vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW);
if(vt instanceof LensTransformer) {
vt = ((LensTransformer)vt).getDelegate();
}
Point2D p = vt.inverseTransform(e.getPoint());
boolean accepted = checkModifiers(e);
if(accepted ) {
MutableTransformer modelTransformer = vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
vv.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
if(dragOnLens) {
setViewCenter(modelTransformer, p);
setViewCenter(vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW), p);
e.consume();
vv.repaint();
} else if(dragOnEdge) {
setViewRadius(modelTransformer, p);
setViewRadius(vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW), p);
e.consume();
vv.repaint();
} else {
MutableTransformer mt = vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
Point2D iq = vt.inverseTransform(down);
iq = mt.inverseTransform(iq);
Point2D ip = vt.inverseTransform(e.getPoint());
ip = mt.inverseTransform(ip);
float dx = (float) (ip.getX()-iq.getX());
float dy = (float) (ip.getY()-iq.getY());
modelTransformer.translate(dx, dy);
down.x = e.getX();