Improved code readability. Components now aware of what mouse button was clicked.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / GuiComponent.java
index 4f63bb4..e72de54 100644 (file)
@@ -1,17 +1,14 @@
 /*
  * Sixth 3D engine. Author: Svjatoslav Agejenko. 
  * This project is released under Creative Commons Zero (CC0) license.
- *
-*
  */
-
 package eu.svjatoslav.sixth.e3d.gui;
 
 import eu.svjatoslav.sixth.e3d.geometry.Box;
 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
 import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
-import eu.svjatoslav.sixth.e3d.gui.humaninput.UserInputHandler;
-import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardHelper;
 import eu.svjatoslav.sixth.e3d.math.Transform;
 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
@@ -20,7 +17,7 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Wirefr
 import java.awt.event.KeyEvent;
 
 public class GuiComponent extends AbstractCompositeShape implements
-        UserInputHandler, MouseInteractionController {
+        KeyboardInputHandler, MouseInteractionController {
 
     private static final String GROUP_GUI_FOCUS = "gui.focus";
     public final ViewPanel viewPanel;
@@ -36,12 +33,6 @@ public class GuiComponent extends AbstractCompositeShape implements
         setDimensions(size);
     }
 
-    @Override
-    public boolean beforeRender(final ViewPanel viewPanel,
-                                final int millisecondsSinceLastFrame) {
-        return false;
-    }
-
     private WireframeBox createBorder() {
         final LineAppearance appearance = new LineAppearance(10,
                 new eu.svjatoslav.sixth.e3d.renderer.raster.Color(255, 0, 0, 100));
@@ -103,7 +94,7 @@ public class GuiComponent extends AbstractCompositeShape implements
     }
 
     @Override
-    public boolean mouseClicked() {
+    public boolean mouseClicked(int button) {
         return viewPanel.getKeyboardFocusStack().pushFocusOwner(this);
     }