Discussion:
[argouml-dev] Argo Figimage
Bob Tarling
2012-08-08 17:41:37 UTC
Permalink
In this case it's not a matter of whether Argo supports it but whether GEF
does.

It may be a defect in GEF. I can't say that I've ever tried this feature so
its needs testing independantly.

The code in GEF does look dodgy though. At first glance it appears to
assume that GEF (and therefore Argo) are running as an applet.

e.g.

/** Construct a new FigImage w/ the given position and URL. */
public FigImage(int x, int y, URL imageUrl) {
super(x, y, 0, 0);
_url = imageUrl;
_image = Globals.getImage(_url);
Globals.waitForImages();
setSize(_image.getWidth(this), _image.getHeight(this));
}

calls this code which refers to applets

/** Get an image from the given URL (usually a gif file). */
public static Image getImage(URL url) {
Image img = null;
if (getAppletContext() != null) {
img = getAppletContext().getImage(url);
}
if (_tracker != null && img != null)
_tracker.addImage(img, 1);
return img;
}


If you have any patch for GEF it will be gratefully accepted in that
project.

Regards

Bob


On 8 August 2012 08:08, Hai Aicheng (CM/ESW1-CN)
Hi ,
When I set the image in “FigSimpleState” through URL, it does not work.
URL viewUrl = null;
try {
viewUrl = new URL("file:///F:/test_image/test.png");
} catch (MalformedURLException e) {
*TODO*: Auto-generated catch block
LOG.error("Exception", e);
}
image = new FigImage(
getInitialX(),
getInitialY() + 2 + getNameFig().getBounds().height + 1,
69,
40 - getInitialY() + 2 + getNameFig().getBounds().height + 1,
viewUrl);
addFig(image);
but when i use the interface “FigImage(int x, int y,int w,int h,Image
img)“, it works well.
Does not argo support set image through URL??
Waitting for your response, thanks!!
Best regards / Mit freundlichen GrÌßen
*Aicheng Hai ** **海爱成*
Tel.: +86 0512 6767 7562
Fax: +86 0512 6762 1200
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=2997419

To unsubscribe from this discussion, e-mail: [dev-***@argouml.tigris.org].
To be allowed to post to the list contact the mailing list moderator, email: [***@tigris.org]
Hai Aicheng (CM/ESW1-CN)
2012-08-08 07:08:54 UTC
Permalink
Hi ,
When I set the image in “FigSimpleState” through URL, it does not work.
The way is as follows:
URL viewUrl = null;
try {
viewUrl = new URL("file:///F:/test_image/test.png");
} catch (MalformedURLException e) {
TODO: Auto-generated catch block
LOG.error("Exception", e);
}
image = new FigImage(
getInitialX(),
getInitialY() + 2 + getNameFig().getBounds().height + 1,
69,
40 - getInitialY() + 2 + getNameFig().getBounds().height + 1,
viewUrl);
addFig(image);

but when i use the interface “FigImage(int x, int y,int w,int h,Image img)“, it works well.
Does not argo support set image through URL??
Waitting for your response, thanks!!

Best regards / Mit freundlichen GrÌßen
Aicheng Hai 海爱成
Tel.: +86 0512 6767 7562
Fax: +86 0512 6762 1200

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=2997307

To unsubscribe from this discussion, e-mail: [dev-***@argouml.tigris.org].
To be allowed to post to the list contact the mailing list moderator, email: [***@tigris.org]
Loading...