Manage View

To manage the view of Astah Instance or diagrams-view, you use the View Manager.
With the View Manager, you can customize the view to the Project View, Diagram Editor and Extra View (only through the Plug-ins).

astah screen

View Manager

You can get the View Manager with ProjectAccessor#getViewManager().

View InterfaceView

Each view manager can perform the following operations.

View Manager Target View What you can do
IProjectViewManager Project View Select Models in the Structure Tree, show properties of selected models, etc.
IDiagramViewManager Diagram Editor Open and close a specific diagram, get the currently-opened diagram, zoom, move the selected diagram to the center, etc.
IExtraViewManager Extra View Show/hide the Extra View
IIconManager - Get Icons.

Example

This is an example of opening a diagram with a specific presentation located in the center of the diagrams (Reference: AstahAccessor.java of Bookmark Plugin).

    public boolean selectPresentation(String[] classIdList) {

        try {
            ProjectAccessor projectAccessor = ProjectAccessorFactory.getProjectAccessor();
            IPresentation[] selectPresentations = getPresentation(classIdList);

            if (selectPresentations != null && selectPresentations.length > 0) {
                IDiagramViewManager dvm = projectAccessor.getViewManager().getDiagramViewManager();
                dvm.open(selectPresentations[0].getDiagram());
                dvm.showInDiagramEditor(selectPresentations[0]);
                dvm.select(selectPresentations);
            } else {
                // not exist presentation
                return false;
            }
        } catch (Exception exp) {
            exp.printStackTrace();
        }

        return true;
    }