I can successfully create a Polygon by open api, but since it must be a closed one, and since it is not drawn if all point are on a line, it looks bad if i set the third point some pixel apart…
Another problem is that it is hard to select it by mouse click to manipulate it.
i can draw a line in an EPC-Diagram by using the VP UI. A line is simple to select by mouse.
“Line” is shown in the Window Tile when i open the Specification.
What are the objects (IModelElement, IDiagramUiModel) in open api to create and how?
The modelType of the element ist “Freehand”, the Shapetype of the UIModel is “Freehand”.
Seems that IFreehand and IFreehandUIModel do not have appropriate api to configure a line.
How can i create them for a line and set the starting point and the end point?
We have just released a new version. Now, you can create a line with the following code:
ApplicationManager.instance().getProjectManager().getProject();
DiagramManager dm = ApplicationManager.instance().getDiagramManager();
IDiagramUIModel diagram = ApplicationManager.instance().getDiagramManager().getActiveDiagram();
IFreehand model = IModelElementFactory.instance().createFreehand();
IFreehandUIModel shape = (IFreehandUIModel) dm.createDiagramElement(diagram, model);
shape.setPoints(new Point {
new Point (0, 0);
new Point (10, 150);
new Point (0, 200)
});
shape.setBounds(100, 100, 10, 200);