astah* API User Guide


[Editing presentations]

Editing Presentation of astah* API is supported in astah* UML and professional.

[Transaction Operation]

Transaction Operation is required when creating/modifying/deleting presentations.
Please read Transaction operation.

How to specify location of INodePresentations(such as Class, InstanceSpecifcication, UseCase, State, ER Entity, Topic and etc)

    public void setLocation(INodePresentation ps, Point2D location) {
        try {
            TransactionManager.beginTransaction();
            ps.setLocation(location);
            TransactionManager.endTransaction();
        } catch (InvalidEditingException e) {
            e.printStackTrace();
            TransactionManager.abortTransaction();
        }
    }

How to set start and end points of ILinkPresentations(such as Association, Dependency, Generalization, Realization, TemplateBinding, Include, Extension, Identifying Relationship, Non-Identifying Relationship, Subtype, Link between topics and etc)

    public void setPoints(ILinkPresentation ps, Point2D[] points) {
        try {
            TransactionManager.beginTransaction();
            ps.setPoints(points);
            TransactionManager.endTransaction();
        } catch (InvalidEditingException e) {
            e.printStackTrace();
            TransactionManager.abortTransaction();
        }
    }

How to set with of INodePresentations(such as Class, InstanceSpecifcication, UseCase, State, ER Entity, Topic and etc)

    public void setWidth(INodePresentation ps, double width) {
        try {
            TransactionManager.beginTransaction();
            ps.setWidth(width);
            TransactionManager.endTransaction();
        } catch (InvalidEditingException e) {
            e.printStackTrace();
            TransactionManager.abortTransaction();
        }
    }

How to set heights of INodePresentations(such as Class, InstanceSpecifcication, UseCase, State, ER Entity, Topic and etc)

    public void setHeight(INodePresentation ps, double height) {
        try {
            TransactionManager.beginTransaction();
            ps.setHeight(height);
            TransactionManager.endTransaction();
        } catch (InvalidEditingException e) {
            e.printStackTrace();
            TransactionManager.abortTransaction();
        }
    }

How to set label of INodePresentationss(such as Class, InstanceSpecifcication, UseCase, State, ER Entity, Topic and etc)


    public void setLabel(INodePresentation ps, String label) {
        try {
            TransactionManager.beginTransaction();
            ps.setLabel(label);
            TransactionManager.endTransaction();
        } catch (InvalidEditingException e) {
            e.printStackTrace();
            TransactionManager.abortTransaction();
        }
    }

How to set background color for INodePresentations(such as Class, InstanceSpecifcication, UseCase, State, ER Entity, Topic and etc)
–setProperty() method accepts "fill.color" key only.

    //(EX)red:color="#FF0000" green:color="#00FF00" blue:color="#0000FF" 
    public void setColor(INodePresentation ps, String color) {
        try {
            TransactionManager.beginTransaction();
            ps.setProperty("fill.color", color);
            TransactionManager.endTransaction();
        } catch (InvalidEditingException e) {
            e.printStackTrace();
            TransactionManager.abortTransaction();
        }
    }

HOME