Image is not displayed after reopen the plugin [message #1027539] |
Wed, 27 March 2013 00:39  |
Eclipse User |
|
|
|
I add an Image to the PictogramElement and it works.

Component c = GraphBTUtil.getComponentByRef(model, layout.getCRef());
org.eclipse.swt.graphics.Image im = GraphBTUtil.getComponentImageDescription(c);
try{
GraphitiUIPlugin.getDefault().getImageRegistry().put("GRAPHBT-IMAGE-"+layout.getCRef(), im);
} catch (Exception e) {
}
Image image = gaService.createImage(containerShape, "GRAPHBT-IMAGE-"+layout.getCRef());
int width = im.getBounds().width;
int height = im.getBounds().height;
layout.setHeight(height);
layout.setWidth(width);
layout.setX(x);
layout.setY(y);
rectangle.setLineWidth(1);
gaService.setLocationAndSize(image, x, y, width, height);
After I close and reopen it, the image is not displayed.

Please give me idea for the strange behavior.
Note: I also try to remove the image when the editor is closed and add the image as the editor is opened to imitate the behavior when the image firstly created. But it also didn't work.
Thanks
Emerson
Attachment: G1.JPG
(Size: 27.83KB, Downloaded 822 times)
Attachment: G2.JPG
(Size: 22.91KB, Downloaded 875 times)
|
|
|
|
|
|
Re: Image is not displayed after reopen the plugin [message #1033820 is a reply to message #1032048] |
Thu, 04 April 2013 13:24   |
Eclipse User |
|
|
|
Hi Wenz,
It still not working. It even not displaying any image since it is firstly registered.
I add this method to the ImageProvider so I can add image publicly:
public void addImage(String ref,String path) {
addImageFilePath(ref, path);
}
In the AddComponent module:
GraphBTImageProvider imP = GraphBTUtil.getImageProvider();
String path = GraphBTUtil.getImageAbsolutePath(ProjectUtil.RESOURCE_LOCATION+"/"+c.getComponentRef()+".jpg");
System.out.println("Path "+path);
imP.addImage(path, path); //register image by ID: path, and filePath: path
Image image = gaService.createImage(containerShape, path);
In the pageActivated:
try{
imP.addImage(path, path);
} catch (Exception e) {
}
PictogramElement pe = Graphiti.getLinkService().getPictogramElements(getDiagramTypeProvider().getDiagram(), l).get(0);
Image image = Graphiti.getGaCreateService().createImage(pe, path);
image.setHeight(l.getHeight());
image.setWidth(l.getWidth());
Even when it firstly added, the image is not displayed.
[Updated on: Thu, 04 April 2013 14:31] by Moderator
|
|
|
|
|
|
|
Re: Image is not displayed after reopen the plugin [message #1063127 is a reply to message #1027539] |
Wed, 12 June 2013 08:13  |
Eclipse User |
|
|
|
Hello
This is my favorite plugin of all time! The Flip Image is easy to use and it has improved the appearance of my blog by 110%! Thanks Much
I have been waiting for a plugin like Flip Image to come along! I was amazed that it was as easy to use as it is, and it has greatly improved the look of my website.
The Flip Image Plugin
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.06502 seconds