1 18 package org.apache.batik.swing.gvt; 19 20 import java.awt.event.InputEvent ; 21 import java.awt.event.KeyEvent ; 22 import java.awt.event.MouseEvent ; 23 24 31 public abstract class AbstractResetTransformInteractor implements Interactor { 32 33 36 protected boolean finished = true; 37 38 41 public boolean endInteraction() { 42 return finished; 43 } 44 45 47 51 public void keyTyped(KeyEvent e) { 52 resetTransform(e); 53 } 54 55 58 public void keyPressed(KeyEvent e) { 59 resetTransform(e); 60 } 61 62 65 public void keyReleased(KeyEvent e) { 66 resetTransform(e); 67 } 68 69 71 74 public void mouseClicked(MouseEvent e) { 75 resetTransform(e); 76 } 77 78 81 public void mousePressed(MouseEvent e) { 82 resetTransform(e); 83 } 84 85 88 public void mouseReleased(MouseEvent e) { 89 resetTransform(e); 90 } 91 92 95 public void mouseEntered(MouseEvent e) { 96 resetTransform(e); 97 } 98 99 102 public void mouseExited(MouseEvent e) { 103 resetTransform(e); 104 } 105 106 108 115 public void mouseDragged(MouseEvent e) { 116 resetTransform(e); 117 } 118 119 123 public void mouseMoved(MouseEvent e) { 124 resetTransform(e); 125 } 126 127 130 protected void resetTransform(InputEvent e) { 131 JGVTComponent c = (JGVTComponent)e.getSource(); 132 c.resetRenderingTransform(); 133 finished = true; 134 } 135 } 136 | Popular Tags |