Updated readability of the code.
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Fri, 3 Mar 2023 22:04:08 +0000 (00:04 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Fri, 3 Mar 2023 22:04:08 +0000 (00:04 +0200)
73 files changed:
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Circle.java
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Polygon.java
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Rectangle.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewFrame.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewUpdateTimerTask.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardFocusStack.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardHelper.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardInputHandler.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseEvent.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseInteractionController.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationUserInputTracker.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/LookAndFeel.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Page.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java
src/main/java/eu/svjatoslav/sixth/e3d/io/Connexion3D.java
src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java
src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java
src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/CameraView.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/LightSource.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayHit.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/RenderAggregator.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/ShapeCollection.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/Line.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineAppearance.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineInterpolator.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/PolygonBorderInterpolator.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/TexturedPolygon.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/ForwardOrientedTextBlock.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/TexturedRectangle.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/SubShape.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonCube.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonRectangularBox.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/CanvasCharacter.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/RenderMode.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid2D.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid3D.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeCube.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeDrawing.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeSphere.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/BorderLine.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/PolygonCoordinate.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/Slicer.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/Texture.java
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/TextureBitmap.java

index 5402fc4..6201765 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.geometry;
index c272047..f2d2603 100755 (executable)
@@ -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.geometry;
@@ -90,6 +90,7 @@ public class Point2D implements Cloneable {
 
     /**
      * Calculate length of vector.
+     *
      * @return length of vector.
      */
     public double getVectorLength() {
index 6bf2dd3..120ea32 100755 (executable)
@@ -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.geometry;
@@ -60,9 +60,10 @@ public class Point3D implements Cloneable {
 
     /**
      * Add coordinates of current point to other point. Value of current point will not be changed.
+     *
      * @return current point.
      */
-    public Point3D addTo(final Point3D ... otherPoints) {
+    public Point3D addTo(final Point3D... otherPoints) {
         for (final Point3D otherPoint : otherPoints) otherPoint.add(this);
         return this;
     }
@@ -157,12 +158,12 @@ public class Point3D implements Cloneable {
      * <p>
      * See also: <a href="https://marctenbosch.com/quaternions/">Let's remove Quaternions from every 3D Engine</a>
      *
-     * @param center   center point.
+     * @param center  center point.
      * @param angleXZ angle around XZ axis.
      * @param angleYZ angle around YZ axis.
      */
     public Point3D rotate(final Point3D center, final double angleXZ,
-                       final double angleYZ) {
+                          final double angleYZ) {
         final double s1 = sin(angleXZ);
         final double c1 = cos(angleXZ);
 
@@ -229,6 +230,7 @@ public class Point3D implements Cloneable {
 
     /**
      * Set current point coordinates to given values.
+     *
      * @param x X coordinate.
      * @param y Y coordinate.
      * @param z Z coordinate.
index 13996ee..b630ca3 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.geometry;
index 617978e..1d11e72 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.geometry;
index 3f16d26..4d94136 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * 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;
 
 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.KeyboardInputHandler;
 import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardHelper;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
 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;
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.
      */
index 7e2bf74..701ec50 100755 (executable)
@@ -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;
@@ -54,10 +54,8 @@ public class TextPointer implements Comparable<TextPointer> {
     /**
      * Checks if this pointer is between the specified pointers.
      *
-     * @param start
-     *            The start pointer.
-     * @param end
-     *            The end pointer.
+     * @param start The start pointer.
+     * @param end   The end pointer.
      * @return True if this pointer is between the specified pointers.
      */
     public boolean isBetween(final TextPointer start, final TextPointer end) {
index 48b1016..6665676 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;
index 29cf98f..0c6ef51 100755 (executable)
@@ -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;
index 088d98a..9c0681c 100755 (executable)
@@ -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;
@@ -21,12 +21,12 @@ import java.util.concurrent.ConcurrentHashMap;
  */
 public class ViewPanel extends JPanel implements ComponentListener {
     private static final long serialVersionUID = 1683277888885045387L;
-    public Color backgroundColor = Color.BLACK;
     private final HIDInputTracker HIDInputTracker = new HIDInputTracker(this);
     private final KeyboardFocusStack keyboardFocusStack;
     private final Avatar avatar = new Avatar();
     private final ShapeCollection rootShapeCollection = new ShapeCollection();
     private final Set<ViewRenderListener> viewRenderListeners = ConcurrentHashMap.newKeySet();
+    public Color backgroundColor = Color.BLACK;
     /**
      * Last time this view was updated.
      */
@@ -215,7 +215,7 @@ public class ViewPanel extends JPanel implements ComponentListener {
         int panelWidth = getWidth();
         int panelHeight = getHeight();
 
-        if (panelWidth <= 0 || panelHeight <=0){
+        if (panelWidth <= 0 || panelHeight <= 0) {
             renderingContext = null;
             return;
         }
index 30e73d2..befbd6e 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;
index cb7bac4..b86dc88 100755 (executable)
@@ -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;
index a63c33b..c08fa8e 100755 (executable)
@@ -32,10 +32,10 @@ public class HIDInputTracker implements
     private final Map<Integer, Long> pressedKeysToPressedTimeMap = new HashMap<>();
     private final List<MouseEvent> detectedMouseEvents = new ArrayList<>();
     private final List<KeyEvent> detectedKeyEvents = new ArrayList<>();
-    private int wheelMovedDirection = 0;
     private final Point2D mouseDraggedDirection = new Point2D();
-    private Point2D oldMouseCoordinatesWhenDragging;
     private final ViewPanel viewPanel;
+    private int wheelMovedDirection = 0;
+    private Point2D oldMouseCoordinatesWhenDragging;
     private Point2D currentMouseLocation;
     private boolean mouseMoved;
     private boolean mouseWithinWindow = false;
index 9a1cd6d..53202db 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.humaninput;
@@ -11,8 +11,8 @@ import java.util.Stack;
 public class KeyboardFocusStack {
 
     private final ViewPanel viewPanel;
-    private WorldNavigationUserInputTracker defaultInputHandler = new WorldNavigationUserInputTracker();
-    private Stack<KeyboardInputHandler> inputHandlers = new Stack<>();
+    private final WorldNavigationUserInputTracker defaultInputHandler = new WorldNavigationUserInputTracker();
+    private final Stack<KeyboardInputHandler> inputHandlers = new Stack<>();
     private KeyboardInputHandler currentUserInputHandler;
 
     public KeyboardFocusStack(final ViewPanel viewPanel) {
index 44b861e..1bbda5b 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.humaninput;
index 3f26cdf..ccdb962 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.humaninput;
@@ -10,7 +10,7 @@ import java.awt.event.KeyEvent;
 
 /**
  * This is the process:
- *
+ * <p>
  * 1. Component receives focus, perhaps because user clicked on it with the mouse.
  * 2. Now component will receive user key press and release events from the keyboard.
  * 3. Component loses focus. Perhaps user chose another component to interact with.
index b487d15..459d0d2 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.humaninput;
index d5f1f08..5b6d470 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.humaninput;
@@ -11,18 +11,21 @@ public interface MouseInteractionController {
 
     /**
      * Called when mouse is clicked on component.
+     *
      * @return <code>true</code> if view update is needed as a consequence of this mouse click.
      */
     boolean mouseClicked(int button);
 
     /**
      * Called when mouse gets over given component.
+     *
      * @return <code>true</code> if view update is needed as a consequence of this mouse enter.
      */
     boolean mouseEntered();
 
     /**
      * Called when mouse leaves screen area occupied by component.
+     *
      * @return <code>true</code> if view update is needed as a consequence of this mouse exit.
      */
     boolean mouseExited();
index 8a66a3e..9c8415e 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.humaninput;
index 3c20ff2..27113b0 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.textEditorComponent;
index 784cdc0..b792779 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.textEditorComponent;
index 0f60618..47c898f 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.textEditorComponent;
@@ -37,8 +37,7 @@ public class Page {
     /**
      * Returns the specified line.
      *
-     * @param row
-     *            The line number.
+     * @param row The line number.
      * @return The line.
      */
     public TextLine getLine(final int row) {
@@ -49,8 +48,7 @@ public class Page {
     /**
      * Returns the length of the specified line.
      *
-     * @param row
-     *            The line number.
+     * @param row The line number.
      * @return The length of the line.
      */
     public int getLineLength(final int row) {
@@ -115,10 +113,8 @@ public class Page {
     /**
      * Removes the specified character from the page.
      *
-     * @param row
-     *            The line number.
-     * @param col
-     *            The character number.
+     * @param row The line number.
+     * @param col The character number.
      */
     public void removeCharacter(final int row, final int col) {
         if (rows.size() <= row)
@@ -129,8 +125,7 @@ public class Page {
     /**
      * Removes the specified line from the page.
      *
-     * @param row
-     *            The line number.
+     * @param row The line number.
      */
     public void removeLine(final int row) {
         if (rows.size() <= row)
index 44b19aa..0cd379c 100755 (executable)
@@ -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.textEditorComponent;
@@ -495,7 +495,6 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner {
         if (keyCode == KeyboardHelper.PGUP) {
             cursorLocation.row -= textCanvas.getSize().row;
             repaintPage = true;
-            return;
         }
 
     }
index 40fad83..90e7306 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.io;
index b889392..9cc6dcd 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.math;
index f7f64db..85a2dda 100755 (executable)
@@ -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.math;
@@ -23,8 +23,7 @@ public class Transform implements Cloneable {
     /**
      * Creates a new transform with the specified translation.
      *
-     * @param translation
-     *            the translation
+     * @param translation the translation
      */
     public Transform(final Point3D translation) {
         this.translation = translation;
@@ -34,12 +33,9 @@ public class Transform implements Cloneable {
     /**
      * Creates a new transform with the specified translation and orientation.
      *
-     * @param translation
-     *            the translation
-     * @param angleXZ
-     *            the angle around the XZ axis
-     * @param angleYZ
-     *            the angle around the YZ axis
+     * @param translation the translation
+     * @param angleXZ     the angle around the XZ axis
+     * @param angleYZ     the angle around the YZ axis
      */
     public Transform(final Point3D translation, final double angleXZ,
                      final double angleYZ) {
@@ -51,10 +47,8 @@ public class Transform implements Cloneable {
     /**
      * Creates a new transform with the specified translation and orientation.
      *
-     * @param translation
-     *            the translation
-     * @param orientation
-     *            the orientation
+     * @param translation the translation
+     * @param orientation the orientation
      */
     public Transform(final Point3D translation, final Orientation orientation) {
         this.translation = translation;
index 6e083fc..69b3095 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.math;
@@ -53,7 +53,7 @@ public class Vertex {
      * Transforms vertex coordinate to calculate its location relative to the viewer.
      * It also calculates its location on the screen.
      *
-     * @param transforms Transforms pipeline.
+     * @param transforms    Transforms pipeline.
      * @param renderContext Rendering context.
      */
     public void calculateLocationRelativeToViewer(final TransformsStack transforms,
index e1b7269..5cc17dd 100755 (executable)
@@ -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.renderer.octree;
@@ -7,7 +7,6 @@ package eu.svjatoslav.sixth.e3d.renderer.octree;
 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
 import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Ray;
 import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
-import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
 
 /**
  * <pre>
index c4c5d9b..5cdcef4 100755 (executable)
@@ -1,8 +1,8 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
-*
+ *
  * Realtime voxel renderer (in software).
  * Uses octree for data compression.
  */
index 5670ac0..559cc6c 100755 (executable)
@@ -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.renderer.octree.raytracer;
index ce92787..c2acb88 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.renderer.octree.raytracer;
@@ -23,10 +23,10 @@ public class CameraView {
         // compute camera view coordinates as if camera is at (0,0,0) and look at (0,0,1)
         final float viewAngle = (float) .6;
         cameraCenter = new Point3D();
-        topLeft = new Point3D(0,0, SIZE).rotate(-viewAngle, -viewAngle);
-        topRight = new Point3D(0,0, SIZE).rotate(viewAngle, -viewAngle);
-        bottomLeft = new Point3D(0,0,SIZE).rotate(-viewAngle, viewAngle);
-        bottomRight = new Point3D(0,0,SIZE).rotate(viewAngle, viewAngle);
+        topLeft = new Point3D(0, 0, SIZE).rotate(-viewAngle, -viewAngle);
+        topRight = new Point3D(0, 0, SIZE).rotate(viewAngle, -viewAngle);
+        bottomLeft = new Point3D(0, 0, SIZE).rotate(-viewAngle, viewAngle);
+        bottomRight = new Point3D(0, 0, SIZE).rotate(viewAngle, viewAngle);
 
         topLeft.rotate(-avatar.getAngleXZ(), -avatar.getAngleYZ());
         topRight.rotate(-avatar.getAngleXZ(), -avatar.getAngleYZ());
index 3c963d6..c0939d7 100755 (executable)
@@ -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.renderer.octree.raytracer;
@@ -12,20 +12,18 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
  */
 public class LightSource {
 
-    /**
-     * Light source location.
-     */
-    Point3D location;
-
     /**
      * Light source color.
      */
     public Color color;
-
     /**
      * Light source brightness.
      */
     public float brightness;
+    /**
+     * Light source location.
+     */
+    Point3D location;
 
     public LightSource(final Point3D location, final Color color,
                        final float Brightness) {
index 659a989..b616f2c 100755 (executable)
@@ -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.renderer.octree.raytracer;
index b65fdf9..fa0772c 100755 (executable)
@@ -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.renderer.octree.raytracer;
index d389a82..daeb417 100755 (executable)
@@ -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.renderer.octree.raytracer;
@@ -87,9 +87,9 @@ public class RayTracer implements Runnable {
                                 cameraView.cameraCenter.y,
                                 cameraView.cameraCenter.z),
                         new Point3D(
-                        cx3 - cameraView.cameraCenter.x, cy3
-                        - cameraView.cameraCenter.y, cz3
-                        - cameraView.cameraCenter.z)
+                                cx3 - cameraView.cameraCenter.x, cy3
+                                - cameraView.cameraCenter.y, cz3
+                                - cameraView.cameraCenter.z)
                 );
                 final int c = traceRay(r);
 
@@ -140,13 +140,13 @@ public class RayTracer implements Runnable {
 
                         final Ray r1 = new Ray(
                                 new Point3D(
-                                ray.hitCellX,
-                                ray.hitCellY - (float) 1.5,
-                                ray.hitCellZ),
+                                        ray.hitCellX,
+                                        ray.hitCellY - (float) 1.5,
+                                        ray.hitCellZ),
 
                                 new Point3D((float) l.location.x - (float) ray.hitCellX, l.location.y
-                                - (ray.hitCellY - (float) 1.5), (float) l.location.z
-                                - (float) ray.hitCellZ)
+                                        - (ray.hitCellY - (float) 1.5), (float) l.location.z
+                                        - (float) ray.hitCellZ)
                         );
 
                         final int rt1 = octreeVolume.traceCell(0, 0, 0,
@@ -160,13 +160,13 @@ public class RayTracer implements Runnable {
 
                         final Ray r2 = new Ray(
                                 new Point3D(
-                                ray.hitCellX - (float) 1.5,
-                                ray.hitCellY, ray.hitCellZ),
+                                        ray.hitCellX - (float) 1.5,
+                                        ray.hitCellY, ray.hitCellZ),
 
                                 new Point3D(
-                                l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y
-                                - (float) ray.hitCellY, (float) l.location.z
-                                - (float) ray.hitCellZ)
+                                        l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y
+                                        - (float) ray.hitCellY, (float) l.location.z
+                                        - (float) ray.hitCellZ)
                         );
 
                         final int rt2 = octreeVolume.traceCell(0, 0, 0,
@@ -186,13 +186,13 @@ public class RayTracer implements Runnable {
                         }
 
                         final Ray r3 = new Ray(
-                                new Point3D (
-                                ray.hitCellX, ray.hitCellY,
-                                ray.hitCellZ - (float) 1.5),
                                 new Point3D(
-                                (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
-                                - (float) ray.hitCellY, l.location.z
-                                - (ray.hitCellZ - (float) 1.5))
+                                        ray.hitCellX, ray.hitCellY,
+                                        ray.hitCellZ - (float) 1.5),
+                                new Point3D(
+                                        (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
+                                        - (float) ray.hitCellY, l.location.z
+                                        - (ray.hitCellZ - (float) 1.5))
                         );
 
                         final int rt3 = octreeVolume.traceCell(0, 0, 0,
@@ -212,14 +212,14 @@ public class RayTracer implements Runnable {
 
                         final Ray r4 = new Ray(
                                 new Point3D(
-                                ray.hitCellX,
-                                ray.hitCellY+ (float) 1.5,
-                                ray.hitCellZ),
+                                        ray.hitCellX,
+                                        ray.hitCellY + (float) 1.5,
+                                        ray.hitCellZ),
 
                                 new Point3D(
-                                (float) l.location.x - (float) ray.hitCellX, l.location.y
-                                - (ray.hitCellY + (float) 1.5), (float) l.location.z
-                                - (float) ray.hitCellZ)
+                                        (float) l.location.x - (float) ray.hitCellX, l.location.y
+                                        - (ray.hitCellY + (float) 1.5), (float) l.location.z
+                                        - (float) ray.hitCellZ)
                         );
 
                         final int rt4 = octreeVolume.traceCell(0, 0, 0,
@@ -239,14 +239,14 @@ public class RayTracer implements Runnable {
 
                         final Ray r5 = new Ray(
                                 new Point3D(
-                                ray.hitCellX + (float) 1.5,
-                                ray.hitCellY, ray.hitCellZ),
+                                        ray.hitCellX + (float) 1.5,
+                                        ray.hitCellY, ray.hitCellZ),
 
                                 new Point3D(
-                                l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y
-                                - (float) ray.hitCellY, (float) l.location.z
-                                - (float) ray.hitCellZ)
-                            );
+                                        l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y
+                                        - (float) ray.hitCellY, (float) l.location.z
+                                        - (float) ray.hitCellZ)
+                        );
 
                         final int rt5 = octreeVolume.traceCell(0, 0, 0,
                                 octreeVolume.masterCellSize, 0, r5);
@@ -265,14 +265,14 @@ public class RayTracer implements Runnable {
 
                         final Ray r6 = new Ray(
                                 new Point3D(
-                                ray.hitCellX, ray.hitCellY,
-                                ray.hitCellZ + (float) 1.5),
+                                        ray.hitCellX, ray.hitCellY,
+                                        ray.hitCellZ + (float) 1.5),
 
                                 new Point3D(
 
-                                (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
-                                - (float) ray.hitCellY, l.location.z
-                                - (ray.hitCellZ + (float) 1.5)));
+                                        (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
+                                        - (float) ray.hitCellY, l.location.z
+                                        - (ray.hitCellZ + (float) 1.5)));
 
                         final int rt6 = octreeVolume.traceCell(0, 0, 0,
                                 octreeVolume.masterCellSize, 0, r6);
index 66ff9d3..a3bbd8b 100755 (executable)
@@ -1,8 +1,8 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
-*
+ *
  * Raytracer through voxel data that is stored in octree.
  */
 
index d93100b..4de6f25 100755 (executable)
@@ -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.
  *
  * Various 3D renderers utilizing different rendering approaches.
index 9c51f1e..a78192d 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.renderer.raster;
index dca0066..d6da472 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.renderer.raster;
@@ -13,8 +13,8 @@ import java.util.Comparator;
 
 public class RenderAggregator {
 
-    private ArrayList<AbstractCoordinateShape> shapes = new ArrayList<>();
-    private ShapesZIndexComparator comparator = new ShapesZIndexComparator();
+    private final ArrayList<AbstractCoordinateShape> shapes = new ArrayList<>();
+    private final ShapesZIndexComparator comparator = new ShapesZIndexComparator();
 
     public void paint(final RenderingContext renderBuffer) {
         shapes.sort(comparator);
index b58de06..11ab674 100755 (executable)
@@ -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.renderer.raster;
index deaf60d..464b681 100755 (executable)
@@ -1,8 +1,8 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
-*
+ *
  * <pre>
  * Realtime renderer (in software) using traditional approaches:
  *      Wireframe
index 7f0daf1..d42ac78 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.renderer.raster.shapes;
index 7909d70..61cf4d7 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.renderer.raster.shapes;
index 7f13783..3f9f084 100644 (file)
@@ -18,9 +18,9 @@ public class ForwardOrientedTexture extends AbstractCoordinateShape {
 
     /**
      * Scale of the texture object.
-     *
+     * <p>
      * Object rendered visible size on the screen depends on underlying texture size and scale.
-     *
+     * <p>
      * 0 means that object will be infinitely small.
      * 1 in recommended value to maintain sharpness of the texture as seen by the viewer.
      */
index 14e213c..6541aca 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.renderer.raster.shapes.basic;
@@ -68,7 +68,7 @@ public class GlowingPoint extends ForwardOrientedTexture {
             for (int y = 0; y < TEXTURE_RESOLUTION_PIXELS; y++) {
                 int address = texture.primaryBitmap.getAddress(x, y);
 
-                final int distanceFromCenter = (int) sqrt(pow (halfResolution - x, 2) + pow (halfResolution - y, 2));
+                final int distanceFromCenter = (int) sqrt(pow(halfResolution - x, 2) + pow(halfResolution - y, 2));
 
                 int alpha = 255 - ((270 * distanceFromCenter) / halfResolution);
                 if (alpha < 0)
index 6a4bf2d..10896ec 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.renderer.raster.shapes.basic.line;
index 0e99f35..4cf0007 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.renderer.raster.shapes.basic.line;
index 12b698c..b0428e2 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.renderer.raster.shapes.basic.line;
@@ -17,11 +17,9 @@ public class LineInterpolator {
 
         if (y1 < y2) {
             if (y >= y1)
-                if (y <= y2)
-                    return true;
+                return y <= y2;
         } else if (y >= y2)
-            if (y <= y1)
-                return true;
+            return y <= y1;
 
         return false;
     }
index 93545f0..8f028cc 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.renderer.raster.shapes.basic.solidpolygon;
@@ -43,11 +43,9 @@ public class LineInterpolator implements Comparable<LineInterpolator> {
 
         if (p1.y <= p2.y) {
             if (y >= p1.y)
-                if (y <= p2.y)
-                    return true;
+                return y <= p2.y;
         } else if (y >= p2.y)
-            if (y <= p1.y)
-                return true;
+            return y <= p1.y;
 
         return false;
     }
index 87143b5..7f59169 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.renderer.raster.shapes.basic.solidpolygon;
index 1300e3a..c0ae36f 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.renderer.raster.shapes.basic.texturedpolygon;
@@ -56,11 +56,9 @@ public class PolygonBorderInterpolator implements
 
         if (p1.y < p2.y) {
             if (y >= p1.y)
-                if (y <= p2.y)
-                    return true;
+                return y <= p2.y;
         } else if (y >= p2.y)
-            if (y <= p1.y)
-                return true;
+            return y <= p1.y;
 
         return false;
     }
index 7a6f2bf..972f6bb 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.renderer.raster.shapes.basic.texturedpolygon;
index 30e92bc..20a68c1 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.renderer.raster.shapes.composite;
index e605823..7af3eab 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.renderer.raster.shapes.composite;
index 776c41d..919a87e 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.renderer.raster.shapes.composite;
index 747dd08..55c81e8 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.renderer.raster.shapes.composite.base;
@@ -117,7 +117,7 @@ public class AbstractCompositeShape extends AbstractShape {
 
     public List<SubShape> getGroup(final String groupIdentifier) {
         return originalSubShapes.stream().filter(
-                subShape -> subShape.matchesGroup(groupIdentifier))
+                        subShape -> subShape.matchesGroup(groupIdentifier))
                 .collect(Collectors.toList());
     }
 
index 9860b1c..8d279af 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.renderer.raster.shapes.composite.base;
index 6f70729..8332d93 100755 (executable)
@@ -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.renderer.raster.shapes.composite.solid;
index 21a1b79..1b23d79 100755 (executable)
@@ -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.renderer.raster.shapes.composite.solid;
index c66d5b5..b754faf 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.renderer.raster.shapes.composite.textcanvas;
index eb2f64e..ebc0f86 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.renderer.raster.shapes.composite.textcanvas;
index 7a0c5e5..854d756 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.renderer.raster.shapes.composite.textcanvas;
@@ -31,7 +31,7 @@ public class TextCanvas extends TexturedRectangle {
     public static final int FONT_CHAR_HEIGHT_TEXTURE_PIXELS = 32;
 
 
-    public static final Font FONT = CanvasCharacter.getFont((int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066));
+    public static final Font FONT = CanvasCharacter.getFont((int) (FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066));
     private static final String GROUP_TEXTURE = "texture";
     private static final String GROUP_CHARACTERS = "characters";
     private final TextPointer size;
@@ -173,8 +173,8 @@ public class TextCanvas extends TexturedRectangle {
         graphics.setColor(foreground.toAwtColor());
         graphics.drawChars(
                 new char[]{character,}, 0, 1,
-                (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS) - 0,
-                (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f));
+                (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS),
+                (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int) (FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f));
 
         getTexture().resetResampledBitmapCache();
     }
index cd4f4a2..c05f3f3 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.renderer.raster.shapes.composite.wireframe;
@@ -13,11 +13,11 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCom
 public class Grid2D extends AbstractCompositeShape {
 
     /**
-     * @param transform Grid location
-     * @param rectangle Grid dimensions
+     * @param transform      Grid location
+     * @param rectangle      Grid dimensions
      * @param xDivisionCount Division count along X axis
      * @param yDivisionCount Division count along Y axis
-     * @param appearance Grid lines appearance
+     * @param appearance     Grid lines appearance
      */
     public Grid2D(final Transform transform, final Rectangle rectangle,
                   final int xDivisionCount, final int yDivisionCount,
index d918ce9..62f42bc 100755 (executable)
@@ -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.renderer.raster.shapes.composite.wireframe;
index d91c49c..3345da6 100755 (executable)
@@ -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.renderer.raster.shapes.composite.wireframe;
index d78d729..0a9fd49 100755 (executable)
@@ -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.renderer.raster.shapes.composite.wireframe;
index 572623d..40ce99e 100755 (executable)
@@ -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.renderer.raster.shapes.composite.wireframe;
index 080bc0d..6f28c36 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.renderer.raster.slicer;
index 539892e..eca9afc 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.renderer.raster.slicer;
index 29abe41..73c9abf 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.renderer.raster.slicer;
@@ -23,7 +23,7 @@ public class Slicer {
                                  final PolygonCoordinate c2, final PolygonCoordinate c3,
                                  final TexturedPolygon originalPolygon) {
 
-        final BorderLine lines[] = new BorderLine[]{
+        final BorderLine[] lines = new BorderLine[]{
                 new BorderLine(c1, c2, 1), new BorderLine(c2, c3, 2),
                 new BorderLine(c3, c1, 3)};
 
index 6009bb8..70a6107 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.renderer.raster.texture;
@@ -113,6 +113,7 @@ public class Texture {
 
     /**
      * Returns the bitmap that should be used for rendering at the given zoom
+     *
      * @param scaleFactor The upscale factor
      * @return The bitmap
      */
@@ -133,6 +134,7 @@ public class Texture {
 
     /**
      * Returns the bitmap that should be used for rendering at the given zoom
+     *
      * @param zoomLevel The zoom level
      * @return The bitmap
      */
@@ -165,6 +167,7 @@ public class Texture {
 
     /**
      * Upscales the given bitmap by a factor of 2
+     *
      * @param originalBitmap The bitmap to upscale
      * @return The upscaled bitmap
      */
@@ -216,9 +219,10 @@ public class Texture {
 
         /**
          * Accumulates the color values of the given pixel
+         *
          * @param bitmap The bitmap
-         * @param x The x coordinate of the pixel
-         * @param y The y coordinate of the pixel
+         * @param x      The x coordinate of the pixel
+         * @param y      The y coordinate of the pixel
          */
         public void accumulate(final TextureBitmap bitmap, final int x,
                                final int y) {
@@ -251,9 +255,10 @@ public class Texture {
 
         /**
          * Stores the accumulated color values in the given bitmap
+         *
          * @param bitmap The bitmap
-         * @param x The x coordinate of the pixel
-         * @param y The y coordinate of the pixel
+         * @param x      The x coordinate of the pixel
+         * @param y      The y coordinate of the pixel
          */
         public void storeResult(final TextureBitmap bitmap, final int x,
                                 final int y) {
index fe1e304..303ab3f 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.renderer.raster.texture;
@@ -38,7 +38,7 @@ public class TextureBitmap {
      * Transfer (render) one pixel from current {@link TextureBitmap} to target raster bitmap.
      *
      * @param sourceBitmapPixelAddress Pixel address within current {@link TextureBitmap} as indicated by its offset.
-     * @param targetBitmap Bitmap of the target image where pixel should be rendered to.
+     * @param targetBitmap             Bitmap of the target image where pixel should be rendered to.
      * @param targetBitmapPixelAddress Pixel location within target image where pixel should be rendered to.
      */
     public void drawPixel(int sourceBitmapPixelAddress,