Kevin Trometer пре 7 година
родитељ
комит
c63bd66568
2 измењених фајлова са 9 додато и 5 уклоњено
  1. 2 2
      src/ui/view/GUI.java
  2. 7 3
      src/ui/view/MyCanvas.java

+ 2 - 2
src/ui/view/GUI.java

@@ -1285,7 +1285,7 @@ public class GUI<E> implements CategoryListener {
 				// Write new data in the PropertyTable
 				updCon.paintProperties(temp);
 				// New Tab with NodeOfNode
-				if (doubleClick() && temp instanceof CpsUpperNode) {
+				if (doubleClick() && MouseEvent.BUTTON3 != e.getButton() && temp instanceof CpsUpperNode) {
 					openNewUpperNodeTab();
 				}
 			}
@@ -1878,7 +1878,7 @@ public class GUI<E> implements CategoryListener {
 				public void mousePressed(MouseEvent e) {
 					temp = ((UpperNodeCanvas) ((JScrollPane) tabbedPane.getSelectedComponent()).getViewport()
 							.getComponent(0)).tempCps;
-					if (doubleClick() && temp instanceof CpsUpperNode) {
+					if (doubleClick()&& MouseEvent.BUTTON3 != e.getButton() && temp instanceof CpsUpperNode) {
 						openNewUpperNodeTab();
 					}
 					// updCon.refreshTableProperties(table);

+ 7 - 3
src/ui/view/MyCanvas.java

@@ -90,7 +90,9 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 	int animDuration = 500; // animation Duration
 	int animDelay = animDuration/animFPS; // animation Delay
 	int animSteps = animDuration / animDelay; // animation Steps;
-
+	long start = 0;    
+	long elapsedTime = 0;
+	
 	// contains the value of the Capacity for new created Edges
 
 	/**
@@ -168,7 +170,6 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 							repaint();
 							animDuration -= animDelay;
 							animSteps--;
-							controller.addTextToConsole("" + animDuration);
 						} else {
 							animDuration = 500;
 							animSteps = animDuration / animDelay; 
@@ -180,9 +181,12 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 							controller.addUpperNode("NodeOfNode", null);
 							controller.calculateStateForCurrentTimeStep();
 							repaint();
+							elapsedTime = System.currentTimeMillis() - start;
+							controller.addTextToConsole(elapsedTime+"");
 						}
 					}
 				});
+				start = System.currentTimeMillis();
 				animT.start();
 			}
 		});
@@ -641,7 +645,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 			tempSelected.clear();
 		}
 
-		if (doubleClick() && tempCps != null && tempCps instanceof HolonSwitch) {
+		if (doubleClick() && tempCps != null && tempCps instanceof HolonSwitch && MouseEvent.BUTTON3 != e.getButton()) {
 			((HolonSwitch) tempCps).switchState();
 		}