popMatrix();
noStroke();
- for (Cube c : model.cubes) {
- drawCube(c);
+ if (structureOn) {
+ for (Cube c : model.cubes) {
+ drawCube(c);
+ }
}
noFill();
float in = .15;
noStroke();
fill(#393939);
- // drawBox(c.x+in, c.y+in, c.z+in, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH-in*2, Cube.EDGE_HEIGHT-in*2, Cube.EDGE_WIDTH-in*2, Cube.CHANNEL_WIDTH-in);
+ drawBox(c.x+in, c.y+in, c.z+in, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH-in*2, Cube.EDGE_HEIGHT-in*2, Cube.EDGE_WIDTH-in*2, Cube.CHANNEL_WIDTH-in);
}
void drawBox(float x, float y, float z, float rx, float ry, float rz, float xd, float yd, float zd, float sw) {
}
class UIOutput extends UIWindow {
- public UIOutput(GrizzlyOutput[] grizzlies, float x, float y, float w, float h) {
+ public UIOutput(IPOutput[] outputs, float x, float y, float w, float h) {
super(lx.ui, "OUTPUT", x, y, w, h);
float yp = UIWindow.TITLE_LABEL_HEIGHT;
- final UIItemList outputs = new UIItemList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 80);
+ final UIItemList itemList = new UIItemList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 80);
List<UIItemList.Item> items = new ArrayList<UIItemList.Item>();
- for (GrizzlyOutput grizzly : grizzlies) {
- items.add(new GrizzlyScrollItem(grizzly));
- grizzly.enabled.addListener(new LXParameterListener() {
+ for (IPOutput output : outputs) {
+ items.add(new OutputItem(output));
+ output.enabled.addListener(new LXParameterListener() {
public void onParameterChanged(LXParameter parameter) {
- outputs.redraw();
+ itemList.redraw();
}
});
}
- outputs.setItems(items).addToContainer(this);
+ itemList.setItems(items).addToContainer(this);
}
- class GrizzlyScrollItem extends UIItemList.AbstractItem {
- final GrizzlyOutput output;
+ class OutputItem extends UIItemList.AbstractItem {
+ final IPOutput output;
- GrizzlyScrollItem(GrizzlyOutput output) {
+ OutputItem(IPOutput output) {
this.output = output;
}
private final MappingTool mappingTool;
- private final UIIntegerBox channelBox;
+ private final UILabel cubeLabel;
private final UIIntegerBox cubeBox;
private final UIIntegerBox stripBox;
else if (value == MAP_MODE_CHANNEL) mappingTool.mappingMode = mappingTool.MAPPING_MODE_CHANNEL;
else if (value == MAP_MODE_CUBE) mappingTool.mappingMode = mappingTool.MAPPING_MODE_SINGLE_CUBE;
}
- }.setOptions(new String[] { MAP_MODE_ALL, MAP_MODE_CHANNEL, MAP_MODE_CUBE }).addToContainer(this);
+ }.setOptions(new String[] { MAP_MODE_ALL, MAP_MODE_CUBE }).addToContainer(this);
yp += 24;
- new UILabel(4, yp+8, w-10, 20).setLabel("CHANNEL ID").addToContainer(this);
+ new UILabel(4, yp+8, w-10, 20).setLabel("CUBE ID").addToContainer(this);
yp += 24;
- (channelBox = new UIIntegerBox(4, yp, w-10, 20) {
- protected void onValueChange(int value) {
- mappingTool.setChannel(value-1);
- }
- }).setRange(1, mappingTool.numChannels()).addToContainer(this);
+ (cubeLabel = new UILabel(4, yp, w-10, 20))
+ .setAlignment(CENTER, CENTER)
+ .setLabel(model.cubes.get(0).id)
+ .setBackgroundColor(#222222)
+ .setBorderColor(#666666)
+ .addToContainer(this);
yp += 24;
- new UILabel(4, yp+8, w-10, 20).setLabel("CUBE ID").addToContainer(this);
+ new UILabel(4, yp+8, w-10, 20).setLabel("CUBE NUMBER").addToContainer(this);
yp += 24;
(cubeBox = new UIIntegerBox(4, yp, w-10, 20) {
protected void onValueChange(int value) {
}
- public void setChannelID(int value) {
- channelBox.setValue(value);
- }
-
public void setCubeID(int value) {
cubeBox.setValue(value);
+ cubeLabel.setLabel(model.getCubeByRawIndex(value).id);
}
public void setStripID(int value) {