Updated readability of the code.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / RenderingContext.java
index c5c42f6..a5f7fb7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.gui;
@@ -41,12 +41,6 @@ public class RenderingContext {
      * UI component that mouse is currently hovering over.
      */
     private MouseInteractionController objectPreviouslyUnderMouseCursor;
-
-    public void prepareForNewFrameRendering(){
-        mouseEvent = null;
-        currentObjectUnderMouseCursor = null;
-    }
-
     /**
      * Mouse click event that needs to be processed.
      * This event is processed only once per frame.
@@ -56,29 +50,11 @@ public class RenderingContext {
      * This field is set to null after the event is processed.
      */
     private MouseEvent mouseEvent;
-
-    public void setMouseEvent(MouseEvent mouseEvent) {
-        this.mouseEvent = mouseEvent;
-    }
-
-    public MouseEvent getMouseEvent() {
-        return mouseEvent;
-    }
-
     /**
      * UI component that mouse is currently hovering over.
      */
     private MouseInteractionController currentObjectUnderMouseCursor;
 
-    /**
-     * Called when given object was detected under mouse cursor, while processing {@link #mouseEvent}.
-     * Because objects are rendered back to front. The last method caller will set the top-most object, if
-     * there are multiple objects under mouse cursor.
-     */
-    public void setCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor) {
-        this.currentObjectUnderMouseCursor = currentObjectUnderMouseCursor;
-    }
-
     public RenderingContext(final int width, final int height) {
         this.width = width;
         this.height = height;
@@ -96,6 +72,28 @@ public class RenderingContext {
         graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
     }
 
+    public void prepareForNewFrameRendering() {
+        mouseEvent = null;
+        currentObjectUnderMouseCursor = null;
+    }
+
+    public MouseEvent getMouseEvent() {
+        return mouseEvent;
+    }
+
+    public void setMouseEvent(MouseEvent mouseEvent) {
+        this.mouseEvent = mouseEvent;
+    }
+
+    /**
+     * Called when given object was detected under mouse cursor, while processing {@link #mouseEvent}.
+     * Because objects are rendered back to front. The last method caller will set the top-most object, if
+     * there are multiple objects under mouse cursor.
+     */
+    public void setCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor) {
+        this.currentObjectUnderMouseCursor = currentObjectUnderMouseCursor;
+    }
+
     /**
      * @return <code>true</code> if view update is needed as a consequence of this mouse event.
      */