public class VisitorDemoModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private IPaintCmd |
paintCmd
The installed IPaintCmd instance.
|
private IViewAdapter |
view
The adapter out to the view
|
Constructor and Description |
---|
VisitorDemoModel(IViewAdapter view)
Teh cosntructor for the class
|
Modifier and Type | Method and Description |
---|---|
IHost[] |
getHosts()
Get an array of the available host types, i.e.
|
private IVisitor |
loadVisitor(java.lang.String classname)
Utility method to load a visitor given its classname, without the leading "visitors.impl.".
|
void |
paint(java.awt.Graphics g)
Paint on the given Graphics object using the current IPaintCmd object in the model.
|
java.lang.Object |
run(IHost host,
java.lang.String visitorClassname)
Return the results of having the given host object execute the visitor corresponding to the given class name.
|
void |
setPaintCmd(IPaintCmd cmd)
Set the model's IPaintCmd instance to the given instance.
|
private IViewAdapter view
private IPaintCmd paintCmd
public VisitorDemoModel(IViewAdapter view)
view
- the adapter to the viewpublic IHost[] getHosts()
public java.lang.Object run(IHost host, java.lang.String visitorClassname)
host
- An IHost objectvisitorClassname
- The name of the visitor class, without the leading "visitors.impl."private IVisitor loadVisitor(java.lang.String classname)
classname
- the visitor's classnamepublic void setPaintCmd(IPaintCmd cmd)
cmd
- The new IPaintCmdpublic void paint(java.awt.Graphics g)
g
- The Graphics context on which to draw.