projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restructured Snippet support:
[Mograsim.git]
/
net.mograsim.logic.model
/
src
/
net
/
mograsim
/
logic
/
model
/
model
/
components
/
GUIComponent.java
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java
index
382d7e3
..
1cf7460
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java
@@
-51,6
+51,9
@@
public abstract class GUIComponent
private final List<Runnable> redrawListeners;
private final Runnable redrawListenerForSubcomponents;
private final List<Runnable> redrawListeners;
private final Runnable redrawListenerForSubcomponents;
+
+ private HighLevelStateHandler highLevelStateHandler;
+
// creation and destruction
public GUIComponent(ViewModelModifiable model, String name)
// creation and destruction
public GUIComponent(ViewModelModifiable model, String name)
@@
-148,6
+151,14
@@
public abstract class GUIComponent
// high-level access
// high-level access
+ /**
+ * @author Daniel Kirschten
+ */
+ protected void setHighLevelStateHandler(HighLevelStateHandler highLevelStateHandler)
+ {
+ this.highLevelStateHandler = highLevelStateHandler;
+ }
+
/**
* Gets the current value of the given high-level state. <br>
* See {@link HighLevelStateHandler} for an explanation of high-level state IDs.
/**
* Gets the current value of the given high-level state. <br>
* See {@link HighLevelStateHandler} for an explanation of high-level state IDs.
@@
-157,10
+168,9
@@
public abstract class GUIComponent
*
* @author Daniel Kirschten
*/
*
* @author Daniel Kirschten
*/
- @SuppressWarnings("static-method") // this method is intended to be overridden
public Object getHighLevelState(String stateID)
{
public Object getHighLevelState(String stateID)
{
-
throw new IllegalArgumentException("No high level state with ID " +
stateID);
+
return highLevelStateHandler.getHighLevelState(
stateID);
}
/**
}
/**
@@
-172,10
+182,9
@@
public abstract class GUIComponent
*
* @author Daniel Kirschten
*/
*
* @author Daniel Kirschten
*/
- @SuppressWarnings({ "static-method", "unused" }) // this method is intended to be overridden
public void setHighLevelState(String stateID, Object newState)
{
public void setHighLevelState(String stateID, Object newState)
{
-
throw new IllegalArgumentException("No high level state with ID " + stateID
);
+
highLevelStateHandler.setHighLevelState(stateID, newState
);
}
// "graphical" operations
}
// "graphical" operations