X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2FViewModel.java;h=869f1a113c0edf410dd76e1f49e690b11f3d920c;hb=9c142c9ad59d2af070ebb6495b1ca48242da62d8;hp=7f9b113fd83ec836042f095623b8061181505806;hpb=e7193d1fb16edc79e9cc3d8adcfb71caecd8463b;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/ViewModel.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/ViewModel.java index 7f9b113f..869f1a11 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/ViewModel.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/ViewModel.java @@ -23,7 +23,7 @@ public class ViewModel private final Runnable redrawListenerForSubcomponents; - public ViewModel() + protected ViewModel() { components = new ArrayList<>(); componentsUnmodifiable = Collections.unmodifiableList(components); @@ -43,7 +43,7 @@ public class ViewModel * Adds the given component to the list of components and calls all componentAddedListeners. Don't call this method from application * code as it is automatically called in GUIComponent::new. */ - public void componentCreated(GUIComponent component) + protected void componentCreated(GUIComponent component) { if (components.contains(component)) throw new IllegalStateException("Don't add the same component twice!"); @@ -57,7 +57,7 @@ public class ViewModel * Removes the given component from the list of components and calls all componentRemovedListeners. Don't call this method from * application code as it is automatically called in GUIComponent::destroy. */ - public void componentDestroyed(GUIComponent component) + protected void componentDestroyed(GUIComponent component) { if (!components.contains(component)) throw new IllegalStateException("Don't remove the same component twice!"); @@ -71,7 +71,7 @@ public class ViewModel * Adds the given component to the list of components and calls all componentAddedListeners. Don't call this method from application * code as it is automatically called in GUIComponent::new. */ - public void wireCreated(GUIWire wire) + protected void wireCreated(GUIWire wire) { if (wires.contains(wire)) throw new IllegalStateException("Don't add the same wire twice!"); @@ -85,7 +85,7 @@ public class ViewModel * Removes the given component from the list of components and calls all componentRemovedListeners. Don't call this method from * application code as it is automatically called in GUIComponent::destroy. */ - public void wireDestroyed(GUIWire wire) + protected void wireDestroyed(GUIWire wire) { if (!wires.contains(wire)) throw new IllegalStateException("Don't remove the same wire twice!"); @@ -105,11 +105,6 @@ public class ViewModel return wiresUnmodifiable; } -// public void requestRedraw() -// { -// callRedrawListeners(); -// } - // @formatter:off public void addComponentAddedListener (Consumer listener) {componentAddedListeners .add (listener);} public void addComponentRemovedListener (Consumer listener) {componentRemovedListeners.add (listener);}