return layoutModel.getListOfLayouts();
}
}
else if (contextObject instanceof Layout) {
Layout layout = (Layout) contextObject;
SBase newElement = null;
if (elementName.equals(listOfCompartmentGlyphs)) {
newElement = layout.getListOfCompartmentGlyphs();
}
else if (elementName.equals(listOfSpeciesGlyphs)) {
newElement = layout.getListOfSpeciesGlyphs();
}
else if (elementName.equals(listOfReactionGlyphs)) {
newElement = layout.getListOfReactionGlyphs();
}
else if (elementName.equals(listOfTextGlyphs)) {
newElement = layout.getListOfTextGlyphs();
}
else if (elementName.equals(listOfAdditionalGraphicalObjects)) {
newElement = layout.getListOfAdditionalGraphicalObjects();
}
else if (elementName.equals(dimensions)) {
Dimensions dimension = new Dimensions();
layout.setDimensions(dimension);
newElement = dimension;
}
if (newElement != null) {
return newElement;
}
}
else if (contextObject instanceof GraphicalObject) {
GraphicalObject graphicalObject = (GraphicalObject) contextObject;
if (elementName.equals(boundingBox)) {
BoundingBox bbox = new BoundingBox();
graphicalObject.setBoundingBox(bbox);
return bbox;
}
if (graphicalObject instanceof ReactionGlyph)
{
ReactionGlyph reactionGlyph = (ReactionGlyph) graphicalObject;
if (elementName.equals(curve)) {
Curve curve = new Curve();
reactionGlyph.setCurve(curve);
return curve;
}
else if (elementName.equals(listOfSpeciesReferenceGlyphs))
{
ListOf<SpeciesReferenceGlyph> list = reactionGlyph.getListOfSpeciesReferenceGlyphs();
return list;
}
}
else if (graphicalObject instanceof SpeciesReferenceGlyph)
{
SpeciesReferenceGlyph speciesRefGlyph = (SpeciesReferenceGlyph) contextObject;
if (elementName.equals(curve)) {
Curve curve = new Curve();
speciesRefGlyph.setCurve(curve);
return curve;
}
}
else if (graphicalObject instanceof GeneralGlyph)
{
GeneralGlyph generalGlyph = (GeneralGlyph) graphicalObject;
if (elementName.equals(curve)) {
Curve curve = new Curve();
generalGlyph.setCurve(curve);
return curve;
}
else if (elementName.equals(listOfSubGlyphs))
{
ListOf<GraphicalObject> list = generalGlyph.getListOfSubGlyphs();
return list;
}
else if (elementName.equals(listOfReferenceGlyphs))
{
ListOf<ReferenceGlyph> list = generalGlyph.getListOfReferenceGlyphs();
return list;
}
}
else if (graphicalObject instanceof ReferenceGlyph)
{
ReferenceGlyph refGlyph = (ReferenceGlyph) contextObject;
if (elementName.equals(curve)) {
Curve curve = new Curve();
refGlyph.setCurve(curve);
return curve;
}
}
}
else if (contextObject instanceof BoundingBox)
{
BoundingBox bbox = (BoundingBox) contextObject;
if (elementName.equals(position)) {
Position position = new Position();
bbox.setPosition(position);
return position;
}
else if (elementName.equals(dimensions)) {
Dimensions dimension = new Dimensions();
bbox.setDimensions(dimension);
return dimension;
}
}
else if (contextObject instanceof Curve) {
Curve curve = (Curve) contextObject;
SBase newElement = null;
if (elementName.equals(listOfCurveSegments)) {
newElement = curve.getListOfCurveSegments();
}
if (newElement != null) {
return newElement;
}
}
else if (contextObject instanceof CurveSegment) {
CubicBezier curveSegment = (CubicBezier) contextObject;
if (elementName.equals(start)) {
Start point = new Start();
curveSegment.setStart(point);
return point;
}
else if (elementName.equals(end)) {
End point = new End();
curveSegment.setEnd(point);
return point;
}
else if (elementName.equals(basePoint1)) {
BasePoint1 point = new BasePoint1();
curveSegment.setBasePoint1(point);
return point;
}
else if (elementName.equals(basePoint2)) {
BasePoint2 point = new BasePoint2();
curveSegment.setBasePoint2(point);
return point;
}
}
else if (contextObject instanceof ListOf<?>) {
ListOf<SBase> listOf = (ListOf<SBase>) contextObject;
SBase newElement = null;
if (elementName.equals(layout)) {
newElement = new Layout();
}
else if (elementName.equals(compartmentGlyph)) {