Search in sources :

Example 1 with GeometryContextStructureShape

use of cbit.vcell.graph.GeometryContextStructureShape in project vcell by virtualcell.

the class GraphContainerLayoutVCellClassical method refreshLayoutChildrenGeometryContextStructureShape.

public void refreshLayoutChildrenGeometryContextStructureShape(GeometryContextStructureShape shape) {
    // calculate total height and max width of SubVolumeContainerShape
    int childHeight = 0;
    int childWidth = 0;
    for (Shape child : shape.getChildren()) {
        childHeight += child.getSpaceManager().getSize().height;
        childWidth = Math.max(childWidth, child.getSpaceManager().getSize().width);
    }
    int centerX = shape.getSpaceManager().getSize().width / 2;
    int centerY = shape.getSpaceManager().getSize().height / 2;
    int currY = Math.max(0, centerY - childHeight / 2) + shape.getLabelSize().height + 2;
    for (Shape child : shape.getChildren()) {
        child.getSpaceManager().setRelPos(centerX - child.getSpaceManager().getSize().width / 2, currY);
        currY += child.getSpaceManager().getSize().height;
        child.refreshLayoutSelf();
        refreshLayoutChildren(child);
    }
}
Also used : SubVolumeContainerShape(cbit.vcell.graph.SubVolumeContainerShape) SpeciesContextShape(cbit.vcell.graph.SpeciesContextShape) MembraneShape(cbit.vcell.graph.MembraneShape) ReactionStepShape(cbit.vcell.graph.ReactionStepShape) GeometryContextStructureShape(cbit.vcell.graph.GeometryContextStructureShape) FeatureShape(cbit.vcell.graph.FeatureShape) StructureMappingStructureShape(cbit.vcell.graph.StructureMappingStructureShape) ContainerContainerShape(cbit.vcell.graph.ContainerContainerShape) ReactionContainerShape(cbit.vcell.graph.ReactionContainerShape) GeometryContextContainerShape(cbit.vcell.graph.GeometryContextContainerShape) GeometryContextGeometryShape(cbit.vcell.graph.GeometryContextGeometryShape) StructureShape(cbit.vcell.graph.StructureShape) GeometryClassLegendShape(cbit.vcell.graph.GeometryClassLegendShape) BioPaxShape(cbit.vcell.client.desktop.biomodel.pathway.shapes.BioPaxShape) Point(java.awt.Point)

Aggregations

BioPaxShape (cbit.vcell.client.desktop.biomodel.pathway.shapes.BioPaxShape)1 ContainerContainerShape (cbit.vcell.graph.ContainerContainerShape)1 FeatureShape (cbit.vcell.graph.FeatureShape)1 GeometryClassLegendShape (cbit.vcell.graph.GeometryClassLegendShape)1 GeometryContextContainerShape (cbit.vcell.graph.GeometryContextContainerShape)1 GeometryContextGeometryShape (cbit.vcell.graph.GeometryContextGeometryShape)1 GeometryContextStructureShape (cbit.vcell.graph.GeometryContextStructureShape)1 MembraneShape (cbit.vcell.graph.MembraneShape)1 ReactionContainerShape (cbit.vcell.graph.ReactionContainerShape)1 ReactionStepShape (cbit.vcell.graph.ReactionStepShape)1 SpeciesContextShape (cbit.vcell.graph.SpeciesContextShape)1 StructureMappingStructureShape (cbit.vcell.graph.StructureMappingStructureShape)1 StructureShape (cbit.vcell.graph.StructureShape)1 SubVolumeContainerShape (cbit.vcell.graph.SubVolumeContainerShape)1 Point (java.awt.Point)1