use of cbit.gui.graph.GraphModel in project vcell by virtualcell.
the class VCGroupManager method collapseExistingGroups.
public void collapseExistingGroups() {
GraphModel graphModel = graphView.getGraphModel();
List<Shape> selectedShapes = graphModel.getSelectedShapes();
for (Shape selectedShape : selectedShapes) {
Shape parentShape = selectedShape.getParent();
if (parentShape != null) {
ShapeGroupUtil.collapseGroup(parentShape);
}
}
graphView.repaint();
}
use of cbit.gui.graph.GraphModel in project vcell by virtualcell.
the class VCGroupManager method disbandSelectedGroups.
public void disbandSelectedGroups() {
GraphModel graphModel = graphView.getGraphModel();
List<Shape> selectedShapes = graphModel.getSelectedShapes();
Set<Shape> groups = new HashSet<Shape>();
for (Shape selectedShape : selectedShapes) {
if (ShapeGroupUtil.isGroup(selectedShape)) {
groups.add(selectedShape);
}
// else {
// Shape parent = selectedShape.getParent();
// if(parent != null && ShapeGroupUtil.isGroup(parent)) {
// groups.add(parent);
// }
// }
}
for (Shape group : groups) {
ShapeGroupUtil.disbandGroup(graphModel, group);
}
graphView.repaint();
}
use of cbit.gui.graph.GraphModel in project vcell by virtualcell.
the class VCGroupManager method expandSelectedGroups.
public void expandSelectedGroups() {
GraphModel graphModel = graphView.getGraphModel();
List<Shape> selectedShapes = graphModel.getSelectedShapes();
for (Shape selectedShape : selectedShapes) {
ShapeGroupUtil.expandGroup(selectedShape);
}
graphView.repaint();
}
use of cbit.gui.graph.GraphModel in project vcell by virtualcell.
the class VCGroupManager method collapseAsNewGroup.
public void collapseAsNewGroup() {
GraphModel graphModel = graphView.getGraphModel();
List<Shape> selectedShapes = graphModel.getSelectedShapes();
try {
GroupShape groupShape = ShapeGroupUtil.createGroup(graphModel, groupNamer.createName(), selectedShapes);
ShapeGroupUtil.collapseGroup(groupShape);
graphView.repaint();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations