How to annotation on Canvas? [message #459569] |
Thu, 11 August 2005 09:02 |
Eclipse User |
|
|
|
Originally posted by: sangmin.lee.ge.com
Hi,
I'm trying to draw a graph.
req 1. this graph's width is longer than screen.
req 2. user can insert, update and move a annotation on the graph.
so, for req 1, I put a canvas on a scrolledComposite.
for req 2, I tried to use Caret.
I have two questions. the below is my questions.
Could anyone help me? thanks.
Q1) I don't know if this dicision (to use Caret) is right or not.
Q2) in MouseDown event of Canvas, I tried to make a Caret. but it doesn't
work. the code is below.
--------------------------
Caret caret = new Caret(canvas, SWT.NONE);
caret.setLocation(e.x,e.y);
caret.setSize(10, 10);
caret.setImage(Plugin.getImageDescriptor("icons/sample.gif").createImage());
caret.setVisible(true);
|
|
|
Re: How to annotation on Canvas? [message #459575 is a reply to message #459569] |
Thu, 11 August 2005 13:32 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Sangmin" <sangmin.lee@ge.com> wrote in message
news:2856cd9f821ad8b5c3915c139d50cefd$1@www.eclipse.org...
> Hi,
>
> I'm trying to draw a graph. req 1. this graph's width is longer than
> screen.
> req 2. user can insert, update and move a annotation on the graph.
>
> so, for req 1, I put a canvas on a scrolledComposite.
> for req 2, I tried to use Caret.
> I have two questions. the below is my questions. Could anyone help me?
> thanks.
>
> Q1) I don't know if this dicision (to use Caret) is right or not.
> Q2) in MouseDown event of Canvas, I tried to make a Caret. but it doesn't
> work. the code is below.
> --------------------------
> Caret caret = new Caret(canvas, SWT.NONE);
> caret.setLocation(e.x,e.y);
> caret.setSize(10, 10);
> caret.setImage(Plugin.getImageDescriptor("icons/sample.gif").createImage());
> caret.setVisible(true);
>
Have you considered using GEF?
It has prebuilt tools to help you do the kinds of things you seem to want.
---
Sunil
|
|
|
|
Powered by
FUDForum. Page generated in 0.04057 seconds