use of com.cas.sim.tis.app.control.WireNumberControl in project TeachingInSimulation by ScOrPiOzzy.
the class CircuitState method toggleTagName.
private void toggleTagName() {
for (ElecCompDef elecCompDef : compList) {
Spatial elecCompMdl = elecCompDef.getSpatial();
TagNameControl control = elecCompMdl.getControl(TagNameControl.class);
if (control == null) {
BitmapText tag = new BitmapText(tagFont);
tag.setName(elecCompDef.getProxy().getUuid());
guiNode.attachChild(tag);
control = new TagNameControl(cam, tag);
elecCompMdl.addControl(control);
}
control.setTagName(elecCompDef.getProxy().getTagName());
control.setEnabled(tagVisible);
}
for (Wire wire : wireList) {
Spatial wireMdl = wire.getSpatial();
WireNumberControl control = wireMdl.getControl(WireNumberControl.class);
if (control == null) {
BitmapText tag = new BitmapText(tagFont);
tag.setLocalScale(0.75f);
tag.setName(String.format("%s-%s", wire.getProxy().getComp1Uuid(), wire.getProxy().getComp2Uuid()));
control = new WireNumberControl(cam, guiNode, tag, wire.getProxy().getPointList());
wireMdl.addControl(control);
}
control.setNumber(wire.getProxy().getNumber());
control.setEnabled(tagVisible);
}
}
Aggregations