private final Runnable redrawListenerForSubcomponents;
- public ViewModel()
+ protected ViewModel()
{
components = new ArrayList<>();
componentsUnmodifiable = Collections.unmodifiableList(components);
* 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!");
* 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!");
* 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!");
* 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!");
return wiresUnmodifiable;
}
-// public void requestRedraw()
-// {
-// callRedrawListeners();
-// }
-
// @formatter:off
public void addComponentAddedListener (Consumer<? super GUIComponent> listener) {componentAddedListeners .add (listener);}
public void addComponentRemovedListener (Consumer<? super GUIComponent> listener) {componentRemovedListeners.add (listener);}