Search in sources :

Example 1 with ContainerContainerShape

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

the class GraphContainerLayoutVCellClassical method getPreferedSizeContainerContainerShape.

public Dimension getPreferedSizeContainerContainerShape(ContainerContainerShape shape, Graphics2D g) throws GraphModel.NotReadyException {
    // get size when empty
    Dimension emptySize = shape.getPreferedSizeSelf(g);
    // make larger than empty size so that children fit
    for (Shape child : shape.getChildren()) {
        if (child instanceof ReactionContainerShape) {
            emptySize.width = Math.max(emptySize.width, child.getSpaceManager().getRelPos().x + getPreferedSize(child, g).width);
            // emptySize.width += 8; // spaces between compartments
            emptySize.height = Math.max(emptySize.height, child.getSpaceManager().getRelPos().y + getPreferedSize(child, g).height);
        }
    }
    return emptySize;
}
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) ReactionContainerShape(cbit.vcell.graph.ReactionContainerShape) Dimension(java.awt.Dimension)

Example 2 with ContainerContainerShape

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

the class GraphContainerLayoutReactions method getPreferedSizeContainerContainerShape.

public Dimension getPreferedSizeContainerContainerShape(ContainerContainerShape shape, Graphics2D g) {
    // get size when empty
    Dimension emptySize = shape.getPreferedSizeSelf(g);
    // make larger than empty size so that children fit
    int widthSum = 0;
    for (Shape child : shape.getChildren()) {
        if (child instanceof ReactionContainerShape) {
            Dimension preferedSizeChild = getPreferedSize(child, g);
            emptySize.width = Math.max(emptySize.width, child.getSpaceManager().getRelPos().x + preferedSizeChild.width);
            widthSum += preferedSizeChild.width;
            // emptySize.width += 8; // spaces between compartments
            emptySize.height = Math.max(emptySize.height, child.getSpaceManager().getRelPos().y + preferedSizeChild.height);
        }
    }
    emptySize.width = Math.max(emptySize.width, widthSum);
    return emptySize;
}
Also used : SpeciesContextShape(cbit.vcell.graph.SpeciesContextShape) ReactionStepShape(cbit.vcell.graph.ReactionStepShape) RuleParticipantSignatureFullDiagramShape(cbit.vcell.graph.RuleParticipantSignatureFullDiagramShape) RuleParticipantSignatureShortDiagramShape(cbit.vcell.graph.RuleParticipantSignatureShortDiagramShape) ReactionRuleDiagramShape(cbit.vcell.graph.ReactionRuleDiagramShape) ReactionRuleFullDiagramShape(cbit.vcell.graph.ReactionRuleFullDiagramShape) ContainerContainerShape(cbit.vcell.graph.ContainerContainerShape) ReactionContainerShape(cbit.vcell.graph.ReactionContainerShape) ReactionContainerShape(cbit.vcell.graph.ReactionContainerShape) Dimension(java.awt.Dimension) Point(java.awt.Point)

Aggregations

ContainerContainerShape (cbit.vcell.graph.ContainerContainerShape)2 ReactionContainerShape (cbit.vcell.graph.ReactionContainerShape)2 ReactionStepShape (cbit.vcell.graph.ReactionStepShape)2 SpeciesContextShape (cbit.vcell.graph.SpeciesContextShape)2 Dimension (java.awt.Dimension)2 BioPaxShape (cbit.vcell.client.desktop.biomodel.pathway.shapes.BioPaxShape)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 ReactionRuleDiagramShape (cbit.vcell.graph.ReactionRuleDiagramShape)1 ReactionRuleFullDiagramShape (cbit.vcell.graph.ReactionRuleFullDiagramShape)1 RuleParticipantSignatureFullDiagramShape (cbit.vcell.graph.RuleParticipantSignatureFullDiagramShape)1 RuleParticipantSignatureShortDiagramShape (cbit.vcell.graph.RuleParticipantSignatureShortDiagramShape)1 StructureMappingStructureShape (cbit.vcell.graph.StructureMappingStructureShape)1 StructureShape (cbit.vcell.graph.StructureShape)1 SubVolumeContainerShape (cbit.vcell.graph.SubVolumeContainerShape)1 Point (java.awt.Point)1