|
@@ -6,6 +6,8 @@ import java.awt.Graphics;
|
|
|
import java.awt.Graphics2D;
|
|
|
import java.awt.RenderingHints;
|
|
|
import java.awt.ScrollPane;
|
|
|
+import java.awt.event.MouseWheelEvent;
|
|
|
+import java.awt.event.MouseWheelListener;
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
import javax.swing.JPanel;
|
|
@@ -18,7 +20,7 @@ import classes.SubNet;
|
|
|
import ui.controller.Control;
|
|
|
import ui.model.Model;
|
|
|
|
|
|
-public class HolonCanvas extends JPanel {
|
|
|
+public class HolonCanvas extends JPanel implements MouseWheelListener {
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -56,6 +58,7 @@ public class HolonCanvas extends JPanel {
|
|
|
currentTime = previousTime;
|
|
|
totalElapsedTime = 0;
|
|
|
frameCount = 0;
|
|
|
+ this.addMouseWheelListener(this);
|
|
|
}
|
|
|
|
|
|
// Start Render and Update Threads
|
|
@@ -230,4 +233,9 @@ public class HolonCanvas extends JPanel {
|
|
|
center.width /= 2;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void mouseWheelMoved(MouseWheelEvent e) {
|
|
|
+ controller.setHolonBodyScale(model.getHolonBodyScale()+(-e.getScrollAmount()*e.getWheelRotation()));
|
|
|
+ }
|
|
|
+
|
|
|
}
|