From b0dfd0f77e811e720c0910afc4f69cb350e1088f Mon Sep 17 00:00:00 2001 From: thomaswoehlke Date: Sun, 11 Oct 2020 08:49:03 +0200 Subject: [PATCH] Issue #48 Split Mandelbrot-Tab into Mandelbrot-Julia and Mandelbrot-Zoom --- .../mandelbrotzoom/MandelbrotZoomModel.java | 6 +-- .../mandelbrotzoom/MandelbrotZoomTab.java | 6 +-- ...State.java => MandelbrotZoomTabState.java} | 4 +- ...ava => MandelbrotZoomTabStateMachine.java} | 26 ++++++------ .../{canvas => ui}/PanelButtons.java | 6 +-- .../{canvas => ui}/PanelCopyright.java | 2 +- .../{canvas => ui}/PanelSubtitle.java | 2 +- .../mandelbrotzoom/ui}/RradioButtons.java | 2 +- .../kurzweil/Mandelbrot2JuliaApplication.java | 4 +- .../model/fractal/GaussianNumberPlane.java | 6 +-- ...anvas.java => Mandelbrot2JuliaCanvas.java} | 6 +-- ...r.java => Mandelbrot2JuliaController.java} | 8 ++-- ...tModel.java => Mandelbrot2JuliaModel.java} | 22 +++++----- ...lbrotTab.java => Mandelbrot2JuliaTab.java} | 24 +++++------ .../canvas/PanelCopyright.java | 2 +- .../canvas/PanelSubtitle.java | 2 +- .../canvas/RradioButtons.java | 2 +- .../model/Mandelbrot2JuliaState.java} | 4 +- .../model/Mandelbrot2JuliaStateMachine.java} | 18 ++++---- .../Mandelbrot2JuliaTuringMachine.java} | 16 ++++---- .../turing/MandelbrotTuringDirection.java} | 4 +- .../model/turing/MandelbrotTuringPhase.java} | 4 +- .../turing/MandelbrotTuringPhaseState.java | 41 +++++++++++++++++++ .../turing/MandelbrotTuringPositions.java} | 30 +++++++------- .../model/turing/Point.java | 2 +- .../model/turing/TuringPhaseState.java | 39 ------------------ .../TuringTuringPhaseStateEnumTest.java | 13 +++--- 27 files changed, 153 insertions(+), 148 deletions(-) rename single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/{state/TabState.java => MandelbrotZoomTabState.java} (75%) rename single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/{state/TabStateMachine.java => MandelbrotZoomTabStateMachine.java} (70%) rename single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/{canvas => ui}/PanelButtons.java (94%) rename single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/{canvas => ui}/PanelCopyright.java (87%) rename single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/{canvas => ui}/PanelSubtitle.java (87%) rename single-apps/insourcing/{insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas => insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui}/RradioButtons.java (83%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/{MandelbrotCanvas.java => Mandelbrot2JuliaCanvas.java} (89%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/{MandelbrotController.java => Mandelbrot2JuliaController.java} (77%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/{MandelbrotModel.java => Mandelbrot2JuliaModel.java} (72%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/{MandelbrotTab.java => Mandelbrot2JuliaTab.java} (82%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom => mandelbrot2julia}/canvas/PanelCopyright.java (87%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom => mandelbrot2julia}/canvas/PanelSubtitle.java (87%) rename single-apps/insourcing/{insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom => insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia}/canvas/RradioButtons.java (82%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom/model/state/ApplicationState.java => mandelbrot2julia/model/Mandelbrot2JuliaState.java} (72%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom/model/state/ApplicationStateMachine.java => mandelbrot2julia/model/Mandelbrot2JuliaStateMachine.java} (63%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom/model/turing/MandelbrotTuringMachine.java => mandelbrot2julia/model/turing/Mandelbrot2JuliaTuringMachine.java} (81%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom/model/turing/TuringDirection.java => mandelbrot2julia/model/turing/MandelbrotTuringDirection.java} (71%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom/model/turing/TuringPhase.java => mandelbrot2julia/model/turing/MandelbrotTuringPhase.java} (75%) create mode 100644 single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhaseState.java rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom/model/turing/TuringPositions.java => mandelbrot2julia/model/turing/MandelbrotTuringPositions.java} (65%) rename single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/{mandelbrotzoom => mandelbrot2julia}/model/turing/Point.java (95%) delete mode 100644 single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhaseState.java diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomModel.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomModel.java index 7214707f..35d48dcf 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomModel.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomModel.java @@ -4,7 +4,7 @@ import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties; import org.woehlke.computer.kurzweil.commons.model.fractal.GaussianNumberPlane; import org.woehlke.computer.kurzweil.commons.model.turing.Point; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state.TabStateMachine; +import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.MandelbrotZoomTabStateMachine; import org.woehlke.computer.kurzweil.commons.model.turing.MandelbrotTuringMachine; /** @@ -21,7 +21,7 @@ public class MandelbrotZoomModel { private volatile GaussianNumberPlane gaussianNumberPlane; private volatile MandelbrotTuringMachine mandelbrotTuringMachine; - private volatile TabStateMachine applicationStateMachine; + private volatile MandelbrotZoomTabStateMachine applicationStateMachine; private volatile ComputerKurzweilProperties properties; private volatile MandelbrotZoomTab frame; @@ -31,7 +31,7 @@ public MandelbrotZoomModel(ComputerKurzweilProperties properties, MandelbrotZoom this.frame = frame; this.gaussianNumberPlane = new GaussianNumberPlane(this); this.mandelbrotTuringMachine = new MandelbrotTuringMachine(this); - this.applicationStateMachine = new TabStateMachine(); + this.applicationStateMachine = new MandelbrotZoomTabStateMachine(); } public synchronized boolean click(Point c) { diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomTab.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomTab.java index 5e39ef00..32fec86b 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomTab.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/MandelbrotZoomTab.java @@ -1,9 +1,9 @@ package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom; import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelButtons; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelCopyright; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelSubtitle; +import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui.PanelButtons; +import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui.PanelCopyright; +import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui.PanelSubtitle; import org.woehlke.computer.kurzweil.commons.model.turing.Point; import javax.accessibility.Accessible; diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/TabState.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/MandelbrotZoomTabState.java similarity index 75% rename from single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/TabState.java rename to single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/MandelbrotZoomTabState.java index 790f964c..b69daf12 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/TabState.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/MandelbrotZoomTabState.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state; +package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model; /** * Mandelbrot Set drawn by a Turing Machine. @@ -9,7 +9,7 @@ * * Created by tw on 23.08.15. */ -public enum TabState { +public enum MandelbrotZoomTabState { MANDELBROT, JULIA_SET, MANDELBROT_ZOOM, diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/TabStateMachine.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/MandelbrotZoomTabStateMachine.java similarity index 70% rename from single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/TabStateMachine.java rename to single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/MandelbrotZoomTabStateMachine.java index a59b601f..6262e1b2 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/TabStateMachine.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/MandelbrotZoomTabStateMachine.java @@ -1,7 +1,9 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state; +package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model; -import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state.TabState.*; -import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state.TabState.JULIA_SET_ZOOM; +import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.MandelbrotZoomTabState; + +import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.MandelbrotZoomTabState.*; +import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.MandelbrotZoomTabState.JULIA_SET_ZOOM; /** * Mandelbrot Set drawn by a Turing Machine. @@ -12,16 +14,16 @@ * * Created by tw on 16.12.2019. */ -public class TabStateMachine { +public class MandelbrotZoomTabStateMachine { - private volatile TabState applicationState; + private volatile MandelbrotZoomTabState applicationState; - public TabStateMachine() { - this.applicationState = TabState.MANDELBROT; + public MandelbrotZoomTabStateMachine() { + this.applicationState = MandelbrotZoomTabState.MANDELBROT; } public void click(){ - TabState nextApplicationState = null; + MandelbrotZoomTabState nextApplicationState = null; switch (applicationState){ case MANDELBROT: nextApplicationState = JULIA_SET; @@ -40,7 +42,7 @@ public void click(){ } public void setModeSwitch() { - TabState nextApplicationState = this.applicationState; + MandelbrotZoomTabState nextApplicationState = this.applicationState; switch (applicationState){ case MANDELBROT: case JULIA_SET: @@ -56,7 +58,7 @@ public void setModeSwitch() { } public void setModeZoom() { - TabState nextApplicationState = this.applicationState; + MandelbrotZoomTabState nextApplicationState = this.applicationState; switch (applicationState){ case MANDELBROT: nextApplicationState = MANDELBROT_ZOOM; @@ -71,11 +73,11 @@ public void setModeZoom() { this.setApplicationState(nextApplicationState); } - public TabState getApplicationState() { + public MandelbrotZoomTabState getApplicationState() { return applicationState; } - public void setApplicationState(TabState applicationState) { + public void setApplicationState(MandelbrotZoomTabState applicationState) { this.applicationState = applicationState; } diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelButtons.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelButtons.java similarity index 94% rename from single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelButtons.java rename to single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelButtons.java index 7a5804ee..0c93373a 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelButtons.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelButtons.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui; import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.MandelbrotZoomModel; @@ -7,8 +7,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.RradioButtons.RADIO_BUTTONS_SWITCH; -import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.RradioButtons.RADIO_BUTTONS_ZOOM; +import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui.RradioButtons.RADIO_BUTTONS_SWITCH; +import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui.RradioButtons.RADIO_BUTTONS_ZOOM; /** diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelCopyright.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelCopyright.java similarity index 87% rename from single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelCopyright.java rename to single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelCopyright.java index 400050d3..0ff1ffac 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelCopyright.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelCopyright.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui; import javax.swing.*; import java.awt.*; diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelSubtitle.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelSubtitle.java similarity index 87% rename from single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelSubtitle.java rename to single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelSubtitle.java index 3e615288..cb448797 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelSubtitle.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/PanelSubtitle.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui; import javax.swing.*; import java.awt.*; diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/RradioButtons.java b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/RradioButtons.java similarity index 83% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/RradioButtons.java rename to single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/RradioButtons.java index 68b85fee..1ded481b 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/RradioButtons.java +++ b/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/ui/RradioButtons.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.ui; /** * Mandelbrot Set drawn by a Turing Machine. diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/Mandelbrot2JuliaApplication.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/Mandelbrot2JuliaApplication.java index a9ae938d..e574963c 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/Mandelbrot2JuliaApplication.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/Mandelbrot2JuliaApplication.java @@ -1,7 +1,7 @@ package org.woehlke.computer.kurzweil; import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties; -import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.MandelbrotTab; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.Mandelbrot2JuliaTab; import java.io.File; import java.net.URL; @@ -20,7 +20,7 @@ private Mandelbrot2JuliaApplication() { URL fileUrl = getClass().getResource(configFileName); File configFile = new File(fileUrl.getFile()); ComputerKurzweilProperties properties = ComputerKurzweilProperties.propertiesFactory(configFile); - MandelbrotTab frame = new MandelbrotTab(properties); + Mandelbrot2JuliaTab frame = new Mandelbrot2JuliaTab(properties); } /** diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/commons/model/fractal/GaussianNumberPlane.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/commons/model/fractal/GaussianNumberPlane.java index a78a11d5..2e177007 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/commons/model/fractal/GaussianNumberPlane.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/commons/model/fractal/GaussianNumberPlane.java @@ -1,7 +1,7 @@ package org.woehlke.computer.kurzweil.commons.model.fractal; -import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.MandelbrotModel; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing.Point; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.Mandelbrot2JuliaModel; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.Point; import java.util.ArrayDeque; import java.util.Deque; @@ -45,7 +45,7 @@ public class GaussianNumberPlane { //public static Logger log = Logger.getLogger(GaussianNumberPlane.class.getName()); - public GaussianNumberPlane(MandelbrotModel model) { + public GaussianNumberPlane(Mandelbrot2JuliaModel model) { this.worldDimensions = model.getWorldDimensions(); this.lattice = new int[worldDimensions.getWidth()][worldDimensions.getHeight()]; this.complexWorldDimensions = new ComplexNumber( diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotCanvas.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaCanvas.java similarity index 89% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotCanvas.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaCanvas.java index 19cbf428..1fb60744 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotCanvas.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaCanvas.java @@ -14,12 +14,12 @@ * Date: 05.02.2006 * Time: 00:51:51 */ -public class MandelbrotCanvas extends JComponent { +public class Mandelbrot2JuliaCanvas extends JComponent { - private volatile MandelbrotModel app; + private volatile Mandelbrot2JuliaModel app; private volatile Dimension preferredSize; - public MandelbrotCanvas(MandelbrotModel app) { + public Mandelbrot2JuliaCanvas(Mandelbrot2JuliaModel app) { this.app = app; int width = this.app.getWorldDimensions().getWidth(); int height = this.app.getWorldDimensions().getHeight(); diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotController.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaController.java similarity index 77% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotController.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaController.java index e871de84..db443aee 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotController.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaController.java @@ -10,16 +10,16 @@ * Date: 05.02.2006 * Time: 00:36:20 */ -public class MandelbrotController extends Thread implements Runnable { +public class Mandelbrot2JuliaController extends Thread implements Runnable { - private volatile MandelbrotModel mandelbrotModel; - private volatile MandelbrotTab frame; + private volatile Mandelbrot2JuliaModel mandelbrotModel; + private volatile Mandelbrot2JuliaTab frame; private final int THREAD_SLEEP_TIME = 1; private volatile Boolean goOn; - public MandelbrotController(MandelbrotModel model, MandelbrotTab frame) { + public Mandelbrot2JuliaController(Mandelbrot2JuliaModel model, Mandelbrot2JuliaTab frame) { this.frame = frame; this.mandelbrotModel = model; goOn = Boolean.TRUE; diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotModel.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaModel.java similarity index 72% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotModel.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaModel.java index 560b3108..c38645a1 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotModel.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaModel.java @@ -3,9 +3,9 @@ import lombok.Getter; import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties; import org.woehlke.computer.kurzweil.commons.model.fractal.GaussianNumberPlane; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing.Point; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state.ApplicationStateMachine; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing.MandelbrotTuringMachine; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.Point; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.Mandelbrot2JuliaStateMachine; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.Mandelbrot2JuliaTuringMachine; /** * Mandelbrot Set drawn by a Turing Machine. @@ -17,21 +17,21 @@ * Created by tw on 16.12.2019. */ @Getter -public class MandelbrotModel { +public class Mandelbrot2JuliaModel { private volatile GaussianNumberPlane gaussianNumberPlane; - private volatile MandelbrotTuringMachine mandelbrotTuringMachine; - private volatile ApplicationStateMachine applicationStateMachine; + private volatile Mandelbrot2JuliaTuringMachine mandelbrotTuringMachine; + private volatile Mandelbrot2JuliaStateMachine applicationStateMachine; private volatile ComputerKurzweilProperties properties; - private volatile MandelbrotTab frame; + private volatile Mandelbrot2JuliaTab frame; - public MandelbrotModel(ComputerKurzweilProperties properties, MandelbrotTab frame) { + public Mandelbrot2JuliaModel(ComputerKurzweilProperties properties, Mandelbrot2JuliaTab frame) { this.properties = properties; this.frame = frame; this.gaussianNumberPlane = new GaussianNumberPlane(this); - this.mandelbrotTuringMachine = new MandelbrotTuringMachine(this); - this.applicationStateMachine = new ApplicationStateMachine(); + this.mandelbrotTuringMachine = new Mandelbrot2JuliaTuringMachine(this); + this.applicationStateMachine = new Mandelbrot2JuliaStateMachine(); } public synchronized boolean click(Point c) { @@ -80,7 +80,7 @@ public GaussianNumberPlane getGaussianNumberPlane() { return gaussianNumberPlane; } - public MandelbrotTab getFrame() { + public Mandelbrot2JuliaTab getFrame() { return frame; } diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotTab.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaTab.java similarity index 82% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotTab.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaTab.java index 230c614d..147e11ca 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/MandelbrotTab.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/Mandelbrot2JuliaTab.java @@ -1,9 +1,9 @@ package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia; import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelCopyright; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelSubtitle; -import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing.Point; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.canvas.PanelCopyright; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.canvas.PanelSubtitle; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.Point; import javax.accessibility.Accessible; import javax.swing.*; @@ -19,25 +19,25 @@ * Date: 04.02.2006 * Time: 18:47:46 */ -public class MandelbrotTab extends JFrame implements ImageObserver, +public class Mandelbrot2JuliaTab extends JFrame implements ImageObserver, MenuContainer, Serializable, Accessible, WindowListener, MouseListener { - private volatile MandelbrotController mandelbrotController; - private volatile MandelbrotCanvas canvas; - private volatile MandelbrotModel mandelbrotModel; + private volatile Mandelbrot2JuliaController mandelbrotController; + private volatile Mandelbrot2JuliaCanvas canvas; + private volatile Mandelbrot2JuliaModel mandelbrotModel; private volatile Rectangle rectangleBounds; private volatile Dimension dimensionSize; - public MandelbrotTab(ComputerKurzweilProperties properties) { + public Mandelbrot2JuliaTab(ComputerKurzweilProperties properties) { super(properties.getMandelbrot().getView().getTitle()); - this.mandelbrotModel = new MandelbrotModel(properties,this); + this.mandelbrotModel = new Mandelbrot2JuliaModel(properties,this); BoxLayout layout = new BoxLayout(rootPane, BoxLayout.PAGE_AXIS); - this.canvas = new MandelbrotCanvas(mandelbrotModel); - this.mandelbrotController = new MandelbrotController(mandelbrotModel, this); + this.canvas = new Mandelbrot2JuliaCanvas(mandelbrotModel); + this.mandelbrotController = new Mandelbrot2JuliaController(mandelbrotModel, this); PanelSubtitle panelSubtitle = new PanelSubtitle(properties.getMandelbrot().getView().getSubtitle()); PanelCopyright panelCopyright = new PanelCopyright(properties.getAllinone().getView().getCopyright()); JSeparator separator = new JSeparator(); @@ -138,7 +138,7 @@ public void setModeZoom() { canvas.setCursor(new Cursor(Cursor.HAND_CURSOR)); } */ - public MandelbrotCanvas getCanvas() { + public Mandelbrot2JuliaCanvas getCanvas() { return canvas; } } diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelCopyright.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/PanelCopyright.java similarity index 87% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelCopyright.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/PanelCopyright.java index 400050d3..08cd6faf 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelCopyright.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/PanelCopyright.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.canvas; import javax.swing.*; import java.awt.*; diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelSubtitle.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/PanelSubtitle.java similarity index 87% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelSubtitle.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/PanelSubtitle.java index 3e615288..2937d110 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/PanelSubtitle.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/PanelSubtitle.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.canvas; import javax.swing.*; import java.awt.*; diff --git a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/RradioButtons.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/RradioButtons.java similarity index 82% rename from single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/RradioButtons.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/RradioButtons.java index 68b85fee..b88ef3f2 100644 --- a/single-apps/insourcing/insourcing-mandelbrot-zoom/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/canvas/RradioButtons.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/canvas/RradioButtons.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.canvas; /** * Mandelbrot Set drawn by a Turing Machine. diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/ApplicationState.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/Mandelbrot2JuliaState.java similarity index 72% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/ApplicationState.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/Mandelbrot2JuliaState.java index 6d0abeaa..653dfabf 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/ApplicationState.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/Mandelbrot2JuliaState.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model; /** * Mandelbrot Set drawn by a Turing Machine. @@ -9,7 +9,7 @@ * * Created by tw on 23.08.15. */ -public enum ApplicationState { +public enum Mandelbrot2JuliaState { MANDELBROT, JULIA_SET } diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/ApplicationStateMachine.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/Mandelbrot2JuliaStateMachine.java similarity index 63% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/ApplicationStateMachine.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/Mandelbrot2JuliaStateMachine.java index 76ab0921..ddf039a0 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/state/ApplicationStateMachine.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/Mandelbrot2JuliaStateMachine.java @@ -1,6 +1,6 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model; -import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.state.ApplicationState.*; +import static org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.Mandelbrot2JuliaState.*; /** * Mandelbrot Set drawn by a Turing Machine. @@ -11,16 +11,16 @@ * * Created by tw on 16.12.2019. */ -public class ApplicationStateMachine { +public class Mandelbrot2JuliaStateMachine { - private volatile ApplicationState applicationState; + private volatile Mandelbrot2JuliaState applicationState; - public ApplicationStateMachine() { - this.applicationState = ApplicationState.MANDELBROT; + public Mandelbrot2JuliaStateMachine() { + this.applicationState = Mandelbrot2JuliaState.MANDELBROT; } public void click(){ - ApplicationState nextApplicationState = null; + Mandelbrot2JuliaState nextApplicationState = null; switch (applicationState){ case MANDELBROT: nextApplicationState = JULIA_SET; @@ -44,11 +44,11 @@ public void setModeSwitch() { } */ - public ApplicationState getApplicationState() { + public Mandelbrot2JuliaState getApplicationState() { return applicationState; } - public void setApplicationState(ApplicationState applicationState) { + public void setApplicationState(Mandelbrot2JuliaState applicationState) { this.applicationState = applicationState; } diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/MandelbrotTuringMachine.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/Mandelbrot2JuliaTuringMachine.java similarity index 81% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/MandelbrotTuringMachine.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/Mandelbrot2JuliaTuringMachine.java index 3f15b4d0..8802d554 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/MandelbrotTuringMachine.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/Mandelbrot2JuliaTuringMachine.java @@ -1,6 +1,6 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing; -import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.MandelbrotModel; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.Mandelbrot2JuliaModel; import org.woehlke.computer.kurzweil.commons.model.fractal.GaussianNumberPlane; /** @@ -13,16 +13,16 @@ * Date: 28.08.13 * Time: 12:39 */ -public class MandelbrotTuringMachine { +public class Mandelbrot2JuliaTuringMachine { private volatile GaussianNumberPlane gaussianNumberPlane; - private volatile TuringPositions turingPositions; - private volatile TuringPhaseState turingPhaseState; + private volatile MandelbrotTuringPositions turingPositions; + private volatile MandelbrotTuringPhaseState turingPhaseState; - public MandelbrotTuringMachine(MandelbrotModel model) { + public Mandelbrot2JuliaTuringMachine(Mandelbrot2JuliaModel model) { this.gaussianNumberPlane = model.getGaussianNumberPlane(); - this.turingPhaseState = new TuringPhaseState(); - this.turingPositions = new TuringPositions(model.getWorldDimensions()); + this.turingPhaseState = new MandelbrotTuringPhaseState(); + this.turingPositions = new MandelbrotTuringPositions(model.getWorldDimensions()); start(); } diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringDirection.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringDirection.java similarity index 71% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringDirection.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringDirection.java index 0f67002f..1119bad3 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringDirection.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringDirection.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing; /** * Mandelbrot Set drawn by a Turing Machine. @@ -9,7 +9,7 @@ * * Created by tw on 18.08.15. */ -public enum TuringDirection { +public enum MandelbrotTuringDirection { UP, RIGHT, DOWN, diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhase.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhase.java similarity index 75% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhase.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhase.java index 9f5b5076..db6f1eb8 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhase.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhase.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing; /** * Mandelbrot Set drawn by a Turing Machine. @@ -9,7 +9,7 @@ * * Created by tw on 18.08.15. */ -public enum TuringPhase { +public enum MandelbrotTuringPhase { SEARCH_THE_SET, WALK_AROUND_THE_SET, FILL_THE_OUTSIDE_WITH_COLOR, diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhaseState.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhaseState.java new file mode 100644 index 00000000..b434f70e --- /dev/null +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPhaseState.java @@ -0,0 +1,41 @@ +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing; + +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.MandelbrotTuringPhase; + +/** + * Mandelbrot Set drawn by a Turing Machine. + * + * (C) 2006 - 2015 Thomas Woehlke. + * https://thomas-woehlke.blogspot.com/2016/01/mandelbrot-set-drawn-by-turing-machine.html + * @author Thomas Woehlke + * + * Created by tw on 16.12.2019. + */ +public class MandelbrotTuringPhaseState { + + private volatile MandelbrotTuringPhase turingTuringPhase; + + public MandelbrotTuringPhaseState() { + start(); + } + + public void start(){ + this.turingTuringPhase = MandelbrotTuringPhase.SEARCH_THE_SET; + } + + public void finishSearchTheSet(){ + turingTuringPhase = MandelbrotTuringPhase.WALK_AROUND_THE_SET; + } + + public void finishWalkAround() { + turingTuringPhase = MandelbrotTuringPhase.FILL_THE_OUTSIDE_WITH_COLOR; + } + + public void finishFillTheOutsideWithColors() { + turingTuringPhase = MandelbrotTuringPhase.FINISHED; + } + + public MandelbrotTuringPhase getTuringTuringPhase() { + return turingTuringPhase; + } +} diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPositions.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPositions.java similarity index 65% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPositions.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPositions.java index 42f62d9f..3813fed5 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPositions.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/MandelbrotTuringPositions.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing; /** * Mandelbrot Set drawn by a Turing Machine. @@ -9,17 +9,17 @@ * * Created by tw on 16.12.2019. */ -public class TuringPositions { +public class MandelbrotTuringPositions { private volatile Point turingPosition; private volatile Point worldDimensions; private volatile Point firstSetPosition; - private volatile TuringDirection turingDirection; + private volatile MandelbrotTuringDirection turingDirection; private volatile int steps; - public TuringPositions(Point worldDimensions) { + public MandelbrotTuringPositions(Point worldDimensions) { this.worldDimensions = worldDimensions; start(); } @@ -27,7 +27,7 @@ public TuringPositions(Point worldDimensions) { public void start() { this.steps = 0; this.turingPosition = new Point((worldDimensions.getX()-2),(worldDimensions.getY()/2+11)); - this.turingDirection = TuringDirection.LEFT; + this.turingDirection = MandelbrotTuringDirection.LEFT; } public synchronized void markFirstSetPosition(){ @@ -60,24 +60,24 @@ public synchronized void goForward() { } public synchronized void turnRight() { - TuringDirection newTuringDirection; + MandelbrotTuringDirection newTuringDirection; switch (this.turingDirection){ - case UP: newTuringDirection = TuringDirection.RIGHT; break; - case RIGHT: newTuringDirection = TuringDirection.DOWN; break; - case DOWN: newTuringDirection = TuringDirection.LEFT; break; - case LEFT: newTuringDirection = TuringDirection.UP; break; + case UP: newTuringDirection = MandelbrotTuringDirection.RIGHT; break; + case RIGHT: newTuringDirection = MandelbrotTuringDirection.DOWN; break; + case DOWN: newTuringDirection = MandelbrotTuringDirection.LEFT; break; + case LEFT: newTuringDirection = MandelbrotTuringDirection.UP; break; default: newTuringDirection = this.turingDirection; break; } this.turingDirection = newTuringDirection; } public synchronized void turnLeft() { - TuringDirection newTuringDirection; + MandelbrotTuringDirection newTuringDirection; switch (this.turingDirection){ - case UP: newTuringDirection = TuringDirection.LEFT; break; - case RIGHT: newTuringDirection = TuringDirection.UP; break; - case DOWN: newTuringDirection = TuringDirection.RIGHT; break; - case LEFT: newTuringDirection = TuringDirection.DOWN; break; + case UP: newTuringDirection = MandelbrotTuringDirection.LEFT; break; + case RIGHT: newTuringDirection = MandelbrotTuringDirection.UP; break; + case DOWN: newTuringDirection = MandelbrotTuringDirection.RIGHT; break; + case LEFT: newTuringDirection = MandelbrotTuringDirection.DOWN; break; default: newTuringDirection = this.turingDirection; break; } this.turingDirection = newTuringDirection; diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/Point.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/Point.java similarity index 95% rename from single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/Point.java rename to single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/Point.java index d0e90653..c87d847b 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/Point.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrot2julia/model/turing/Point.java @@ -1,4 +1,4 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing; +package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing; import java.util.Objects; diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhaseState.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhaseState.java deleted file mode 100644 index ab40b66b..00000000 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/main/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringPhaseState.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing; - -/** - * Mandelbrot Set drawn by a Turing Machine. - * - * (C) 2006 - 2015 Thomas Woehlke. - * https://thomas-woehlke.blogspot.com/2016/01/mandelbrot-set-drawn-by-turing-machine.html - * @author Thomas Woehlke - * - * Created by tw on 16.12.2019. - */ -public class TuringPhaseState { - - private volatile TuringPhase turingTuringPhase; - - public TuringPhaseState() { - start(); - } - - public void start(){ - this.turingTuringPhase = TuringPhase.SEARCH_THE_SET; - } - - public void finishSearchTheSet(){ - turingTuringPhase = TuringPhase.WALK_AROUND_THE_SET; - } - - public void finishWalkAround() { - turingTuringPhase = TuringPhase.FILL_THE_OUTSIDE_WITH_COLOR; - } - - public void finishFillTheOutsideWithColors() { - turingTuringPhase = TuringPhase.FINISHED; - } - - public TuringPhase getTuringTuringPhase() { - return turingTuringPhase; - } -} diff --git a/single-apps/insourcing/insourcing-mandelbrot2julia/src/test/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringTuringPhaseStateEnumTest.java b/single-apps/insourcing/insourcing-mandelbrot2julia/src/test/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringTuringPhaseStateEnumTest.java index f1d522b3..b92f1f8d 100644 --- a/single-apps/insourcing/insourcing-mandelbrot2julia/src/test/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringTuringPhaseStateEnumTest.java +++ b/single-apps/insourcing/insourcing-mandelbrot2julia/src/test/java/org/woehlke/computer/kurzweil/tabs/mandelbrotzoom/model/turing/TuringTuringPhaseStateEnumTest.java @@ -2,22 +2,23 @@ import org.junit.jupiter.api.Test; +import org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.MandelbrotTuringPhaseState; import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.model.turing.TuringPhase.*; +import static org.woehlke.computer.kurzweil.tabs.mandelbrot2julia.model.turing.MandelbrotTuringPhase.*; public class TuringTuringPhaseStateEnumTest { - private TuringPhaseState turingPhaseState = new TuringPhaseState(); + private MandelbrotTuringPhaseState turingPhaseState = new MandelbrotTuringPhaseState(); public static Logger log = Logger.getLogger(TuringPositionsTest.class.getName()); @Test public void startTest(){ log.info("startTest start"); - turingPhaseState = new TuringPhaseState(); + turingPhaseState = new MandelbrotTuringPhaseState(); assertEquals(turingPhaseState.getTuringTuringPhase(),SEARCH_THE_SET); turingPhaseState.start(); assertEquals(turingPhaseState.getTuringTuringPhase(),SEARCH_THE_SET); @@ -27,7 +28,7 @@ public void startTest(){ @Test public void finishGoToSetTest(){ log.info("finishGoToSetTest start"); - turingPhaseState = new TuringPhaseState(); + turingPhaseState = new MandelbrotTuringPhaseState(); turingPhaseState.start(); assertEquals(turingPhaseState.getTuringTuringPhase(),SEARCH_THE_SET); turingPhaseState.finishSearchTheSet(); @@ -38,7 +39,7 @@ public void finishGoToSetTest(){ @Test public void finishWalkAroundTest() { log.info("finishWalkAroundTest start"); - turingPhaseState = new TuringPhaseState(); + turingPhaseState = new MandelbrotTuringPhaseState(); turingPhaseState.start(); turingPhaseState.finishSearchTheSet(); assertEquals(turingPhaseState.getTuringTuringPhase(),WALK_AROUND_THE_SET); @@ -50,7 +51,7 @@ public void finishWalkAroundTest() { @Test public void finishFillTheOutsideWithColorsTest() { log.info("finishFillTheOutsideWithColorsTest start"); - turingPhaseState = new TuringPhaseState(); + turingPhaseState = new MandelbrotTuringPhaseState(); turingPhaseState.start(); turingPhaseState.finishSearchTheSet(); turingPhaseState.finishWalkAround();