This example demonstrates some simple things about basic InterActor structures.
The example displays a couple of windows. You can click on the title bars and drag them around.
If you click on the radio buttons you should notice a few things:
Have a play and see what you think.
public class Slots extends Helper {
protected void buildGUI() {
setRoot(new IAShape(this, 800, 600, 0));
IAShape root = getRootShape();
// create a couple of small windows
IAWindow win1 = createWindow("Tester", 170, 100);
IAWindow win2 = createWindow("Other", 170, 100);
// and add them to the root shape
root.addChild(300, 30, win1);
root.addChild(300, 150, win2);
// now to create a slot :
// adding a venetian transition effect with an additional phase
IASlot slot = root.createSlot(50, 50);
IATransition trans = createVenetian(15, 500)
.addPhase(makeColor(120, 120, 120));
slot.setTransition(trans);
// and then, for the hell of it,
// setting the slots alpha value to make it partially transparent
slot.setAlpha(0.6f);
// now create the link 'radio' buttons
// this utility method allows the setting of a target slot
// and contents
IA2State tlink = create2StateLink("Tester", slot, win1);
IA2State olink = create2StateLink("Other", slot, win2);
IA2State elink = create2StateLink("Empty", slot, null);
// cluster them with each other so that they ensure only one is on
tlink.clusterWith(elink);
tlink.clusterWith(olink);
// sprinkle the buttons around, weird maybe
win2.addChild(20, 20, tlink);
win1.addChild(20, 20, olink);
root.addChild(20, 270, tlink);
root.addChild(100, 270, olink);
root.addChild(180, 270, elink);
// ensure display is uptodate
root.invalidate();
}
}