public abstract class KahinaView<T extends KahinaObject> extends java.lang.Object implements KahinaListener
Modifier and Type | Field and Description |
---|---|
protected KahinaViewConfiguration |
config |
protected KahinaInstance<?,?,?,?> |
kahina |
protected T |
model |
protected boolean |
needsRedraw |
Constructor and Description |
---|
KahinaView(KahinaInstance<?,?,?,?> kahina) |
Modifier and Type | Method and Description |
---|---|
void |
display(KahinaObject model) |
protected void |
doDisplay()
Subclasses may override this method to take certain actions directly
after
model has changed. |
KahinaViewConfiguration |
getConfig() |
T |
getModel() |
java.lang.String |
getTitle() |
boolean |
isVisible() |
java.awt.Component |
makeEditorPanel(KahinaGUI gui) |
abstract javax.swing.JComponent |
makePanel()
Returns the panel that represents this view in the GUI.
|
boolean |
needsRedraw()
States whether this view has changed in a way that causes it to be in need of redraw.
|
void |
processEvent(KahinaEvent e) |
protected void |
processEvent(KahinaUpdateEvent e) |
protected void |
recalculate()
Override this method to define necessary operations after changes to the
model (coordinate recomputations etc.)
|
void |
requireRedraw() |
void |
setConfig(KahinaViewConfiguration config) |
void |
setTitle(java.lang.String title) |
void |
setVisible(boolean visible) |
protected KahinaViewConfiguration config
protected T extends KahinaObject model
protected final KahinaInstance<?,?,?,?> kahina
protected boolean needsRedraw
public KahinaView(KahinaInstance<?,?,?,?> kahina)
public void processEvent(KahinaEvent e)
processEvent
in interface KahinaListener
protected void processEvent(KahinaUpdateEvent e)
protected void doDisplay()
model
has changed. This default implementation does
nothing.public final void display(KahinaObject model)
public T getModel()
protected void recalculate()
public abstract javax.swing.JComponent makePanel()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
public void setConfig(KahinaViewConfiguration config)
public KahinaViewConfiguration getConfig()
public java.awt.Component makeEditorPanel(KahinaGUI gui)
public boolean isVisible()
public void setVisible(boolean visible)
public boolean needsRedraw()
public void requireRedraw()