~tapaal-contributor/tapaal/autodetect-lens-check2

« back to all changes in this revision

Viewing changes to src/pipe/gui/handler/TransitionHandler.java

merged in lp:~yrke/tapaal/evenMore-gui-cleanup doing GUI cleanup and fixing memory access check, about menu in Mac, exception in verification and reenabled quick draw

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package pipe.gui.handler;
2
2
 
3
3
import java.awt.event.MouseEvent;
4
 
import java.awt.event.MouseWheelEvent;
5
4
 
6
5
import javax.swing.JMenuItem;
7
6
import javax.swing.JPopupMenu;
8
 
import javax.swing.SwingUtilities;
9
7
 
10
 
import pipe.gui.CreateGui;
11
 
import pipe.gui.Zoomer;
12
 
import pipe.gui.Pipe.ElementType;
13
8
import pipe.gui.action.ShowHideInfoAction;
14
9
import pipe.gui.graphicElements.Transition;
15
10
 
23
18
                super(obj);
24
19
        }
25
20
 
26
 
        @Override
27
 
        public void mouseWheelMoved(MouseWheelEvent e) {
28
 
                
29
 
                if (!(CreateGui.getApp().isEditionAllowed()) || e.isControlDown() || !(myObject.isSelected())) {
30
 
                        return;
31
 
                }
32
 
 
33
 
                int rotation = 0;
34
 
                if (e.getWheelRotation() < 0) {
35
 
                        rotation = -e.getWheelRotation() * 135;
36
 
                } else {
37
 
                        rotation = e.getWheelRotation() * 45;
38
 
                }
39
 
 
40
 
                CreateGui.getCurrentTab().getUndoManager().addNewEdit(((Transition) myObject).rotate(rotation));
41
 
 
42
 
        }
43
 
 
44
21
        /**
45
22
         * Creates the popup menu that the user will see when they right click on a
46
23
         * component