use of cbit.vcell.geometry.CSGTransformation.TransformationType in project vcell by virtualcell.
the class CSGObjectPropertiesPanel method getAddTransformationMenu.
private JMenu getAddTransformationMenu() {
if (addTransformationMenu == null) {
addTransformationMenu = new JMenu("Transformation");
TransformationType[] values = CSGTransformation.TransformationType.values();
int numTypes = values.length;
addTranformationMenuItems = new JMenuItem[numTypes];
for (int i = 0; i < numTypes; i++) {
addTranformationMenuItems[i] = new JMenuItem(values[i].name().toLowerCase());
addTranformationMenuItems[i].addActionListener(eventHandler);
addTransformationMenu.add(addTranformationMenuItems[i]);
}
}
return addTransformationMenu;
}
use of cbit.vcell.geometry.CSGTransformation.TransformationType in project vcell by virtualcell.
the class CSGObjectPropertiesPanel method getTransformMenu.
private JMenu getTransformMenu() {
if (transformMenu == null) {
transformMenu = new JMenu("Transform");
TransformationType[] values = CSGTransformation.TransformationType.values();
int numTypes = values.length;
tranformMenuItems = new JMenuItem[numTypes];
for (int i = 0; i < numTypes; i++) {
tranformMenuItems[i] = new JMenuItem(values[i].name().toLowerCase());
tranformMenuItems[i].addActionListener(eventHandler);
transformMenu.add(tranformMenuItems[i]);
}
}
return transformMenu;
}
use of cbit.vcell.geometry.CSGTransformation.TransformationType in project vcell by virtualcell.
the class CSGObjectPropertiesPanel method menuItemClicked.
private void menuItemClicked(Object source) {
boolean bGeometryChanged = false;
boolean bFoundClickedMenuItem = false;
Object objectToBeSelected = null;
if (!bFoundClickedMenuItem) {
PrimitiveType[] values = CSGPrimitive.PrimitiveType.values();
int numTypes = values.length;
for (int i = 0; i < numTypes; i++) {
if (source == addPrimitiveMenuItems[i]) {
bFoundClickedMenuItem = true;
CSGPrimitive csgPrimitive = new CSGPrimitive(csgObject.getFreeName(values[i]), values[i]);
objectToBeSelected = csgPrimitive;
bGeometryChanged = addNode(csgPrimitive);
break;
}
}
}
if (!bFoundClickedMenuItem) {
OperatorType[] values = CSGSetOperator.OperatorType.values();
int numTypes = values.length;
for (int i = 0; i < numTypes; i++) {
if (source == addSetOperatorMenuItems[i]) {
bFoundClickedMenuItem = true;
CSGSetOperator csgSetOperator = new CSGSetOperator(csgObject.getFreeName(values[i]), values[i]);
objectToBeSelected = csgSetOperator;
bGeometryChanged = addNode(csgSetOperator);
break;
}
}
}
if (!bFoundClickedMenuItem) {
TransformationType[] values = CSGTransformation.TransformationType.values();
int numTypes = values.length;
for (int i = 0; i < numTypes; i++) {
if (source == addTranformationMenuItems[i]) {
bFoundClickedMenuItem = true;
CSGTransformation csgTransformation = createNewCSGTransformation(values[i]);
objectToBeSelected = csgTransformation;
bGeometryChanged = addNode(csgTransformation);
break;
}
}
}
if (!bFoundClickedMenuItem) {
TransformationType[] values = CSGTransformation.TransformationType.values();
int numTypes = values.length;
for (int i = 0; i < numTypes; i++) {
if (source == tranformMenuItems[i]) {
bFoundClickedMenuItem = true;
CSGTransformation csgTransformation = createNewCSGTransformation(values[i]);
objectToBeSelected = csgTransformation;
bGeometryChanged = transformOrApplySetOperator(csgTransformation);
break;
}
}
}
if (!bFoundClickedMenuItem) {
OperatorType[] values = CSGSetOperator.OperatorType.values();
int numTypes = values.length;
for (int i = 0; i < numTypes; i++) {
if (source == applySetOperatorMenuItems[i]) {
bFoundClickedMenuItem = true;
CSGSetOperator csgSetOperator = new CSGSetOperator(csgObject.getFreeName(values[i]), values[i]);
objectToBeSelected = csgSetOperator;
bGeometryChanged = transformOrApplySetOperator(csgSetOperator);
break;
}
}
}
if (!bGeometryChanged) {
return;
}
updateCSGObject(objectToBeSelected);
}
Aggregations