X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2FSimulationPreview.java;h=03a0e34eb68195889fbae0f8bea689634713f2d9;hb=96b4263276150f8966a3d663c2699de3ab02e04e;hp=746433b1235cf96ba5a14c93b2efd32201b81062;hpb=58c2b670f915c217fcdde1b874606a5550f4e5c7;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/SimulationPreview.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/SimulationPreview.java index 746433b1..03a0e34e 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/SimulationPreview.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/SimulationPreview.java @@ -17,24 +17,20 @@ import net.mograsim.logic.model.model.wires.ModelWire; import net.mograsim.logic.model.model.wires.ModelWireCrossPoint; import net.mograsim.logic.model.modeladapter.CoreModelParameters; import net.mograsim.logic.model.modeladapter.LogicCoreAdapter; -import net.mograsim.preferences.Preferences; +import net.mograsim.logic.model.preferences.RenderPreferences; +import net.mograsim.plugin.preferences.EclipseRenderPreferences; public class SimulationPreview implements IThemePreview { private LogicUICanvas ui; private LogicExecuter exec; - private Preferences oldPreferences; - private Preferences currentThemePreferences; @Override @SuppressWarnings("unused") public void createControl(Composite parent, ITheme currentTheme) { - oldPreferences = Preferences.current(); - - currentThemePreferences = new EclipsePreferences(currentTheme, MograsimActivator.instance().getPreferenceStore()); - // TODO this will change the global preferences; so if another LogicUICanvas redraws, it will use the "new" colors too. - Preferences.setPreferences(currentThemePreferences); + RenderPreferences currentThemeRenderPrefs = new EclipseRenderPreferences(currentTheme, + MograsimActivator.instance().getPreferenceStore()); LogicModelModifiable model = new LogicModelModifiable(); CoreModelParameters params = new CoreModelParameters(); @@ -86,7 +82,7 @@ public class SimulationPreview implements IThemePreview rIn.clicked(0, 0); - ui = new LogicUICanvas(parent, SWT.NONE, model); + ui = new LogicUICanvas(parent, SWT.NONE, model, currentThemeRenderPrefs); ui.zoom(3.5, 10, 10); exec.startLiveExecution(); @@ -98,7 +94,5 @@ public class SimulationPreview implements IThemePreview public void dispose() { exec.stopLiveExecution(); - if (Preferences.current() == currentThemePreferences) - Preferences.setPreferences(oldPreferences); } }