M.mcbSend(obj);Objects are recieved by functions of the form
public void mcbReceive(ObjectType obj){...do something...}
M.mcbSend(obj);for an object of type ObjectType to send a message to all McBilliards components that implement
public void mcbReceive(ObjectType obj){...do something...}
that the manger knows about.M.addListener(this);This only needs to be done once, when the object is created.
public void mcbReceive(ObjectType obj){...do something...}
A component can implement as many mcbReceive functions as it wishes.public void mcbCleanup(){...}
when the popup is closed. Suppose your popup is a container that listens to messages and also
has a subcomponent that listens to messages. Then, it might have a mcbCleanup() function like this:
public void mcbCleanup(){
M.remove(this);
M.remove(subcomponent);
}
M.mcbCache(ObjectType.class);You might consider adding this line to the defaultCaching() line in the Manager to have it called when the manager starts.
((ObjectType)(M.mcbGet(ObjectType.class)))(replace ObjectType with a class of your choice)
M.getWord(); |
and | M.setWord(word); |
M.selectTile(T); |
or alternately | M.mcbSend(T); |
public void mcbReceive(Tile T){... word=T.getStringWord(); ...}
To get the currently selected tile call
M.getSelectedTile(); |
or equivalently | ((Tile)(M.mcbGet(Tile.class)) |
M.setParameter(z); |
or | M.setParameter(x,y); |
or | M.mcbSend(new Parameter(z); |
or | M.mcbSend(new Parameter(x,y); |
M.getZ(); |
, which is more convenient than | ((Parameter)(M.mcbGet(Parameter.class))).getZ(); |
public void mcbReceive(Parameter p){
Complex z=p.getZ();
double x=p.getX(); // which equals z.x
double y=p.getY();
... do something ...
}
((RationalTriangle)(M.mcbGet(RationalTriangle.class)))You can listen for new rational triangles with
public void mcbReceive(RationalTriangle rt){...}M.mcbSend(new HelpDocument("helpdoc.html");
public static class ColorSettings implements Serializable {...}
To bring up the settings for this object, you can call
M.mcbSend(new SettingsRequest(ColorSettings.class));Alternately, if you have an object of type ColorSettings called cs you can call
M.mcbSend(new SettingsRequest(cs.getClass()));
M.mcbRecieve(Color color);To get the current color:
M.getColor(); |
or | (Color)mcbGet(Color.class); |
M.setColor(color); |
or | M.mcbSend(color); |