To change bounds for the existing com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement, use the methodĀ com.nomagic.magicdraw.openapi.uml.PresentationElementsManager.reshapeShapeElement(ShapeElement, java.awt.Rectangle):
ShapeElement element = ...;
Rectangle newBounds = new Rectangle(100,100,80,50);
SessionManager.getInstance().createSession("Test");
PresentationElementsManager.getInstance().reshapeShapeElement(element, newBounds);
SessionManager.getInstance().closeSession(); |
If shape has theĀ Autosize property set to TRUE, bounds will be reduced to the preferred size.