Hi guys
So I’m running into an issue with displaying an IArchiMateApplicationInterfaceUIModel as an image programatically and was wondering if there is any way I’m going wrong.
Currently it simply just does not display itself as an image.
Thank you in advance! Would appreciate being pointed in the right direction. Here is my current code…
IArchiMateApplicationInterfaceUIModel technologyDiagramElement = (IArchiMateApplicationInterfaceUIModel) diagramManager.createDiagramElement(technologiesDiagram, technologyInterface);
technologyDiagramElement.setPresentationOption(IShapeUIModel.PRESENTATION_OPTION_IMAGE);
String assetsPath = Paths.get("../plugins/vp_plugin_/lib/assets").toAbsolutePath().normalize().toString();
String imagePath = assetsPath + "/" + this._technology.getSelectedItem().toString() + ".png";
technologyDiagramElement.setDisplayImagePath(imagePath);
System.out.println(technologyDiagramElement.getDisplayImagePath());
Jick
January 26, 2022, 1:05am
2
Hi Luke,
Thank you for your inquiry. I have forwarded your case to our engineers to study. When there is any news, I will let you know.
Best regards,
Jick Yeung
Jick
February 17, 2022, 8:51am
3
HI Luke,
Some changes have been made to support your need. Please update to the latest patch build first (16_3_20220220cg or newer). The following article shows you how to update:
Upon receiving a problem report or request of enhancement, we do our best to make the necessary changes. You will then be suggested to update your Visual Paradigm installation to the patch release, in which the fix or enhancement has been made. In...
Est. reading time: 1 minute
Here is the sample code for you as reference:
File imageFile = new File("...jpg");
String suggestdImagePath = projectManager.getShapeDisplayImagePath(imageFile, shape.getShapeType());
try {
projectManager.importShapeDisplayImage(suggestedImagePath, imageFile, projectManager.getProject());
} catch (Exception e){
e.printStackTrace();
{
shape.setDisplayImagePath(suggestedImagePath);
shape.resetCaption();
Best regards,
Jick Yeung