Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to annotation on Canvas?
How to annotation on Canvas? [message #459569] Thu, 11 August 2005 09:02 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How to annotation on Canvas? [message #459729 is a reply to message #459575] Mon, 15 August 2005 01:36 Go to previous message
Eclipse UserFriend
Originally posted by: sangmin.lee.ge.com

at now, i can't decide to use a tool or not.
but, i'd like to see the tool.
could you let me know the url?
thanks
Previous Topic:Date picker
Next Topic:Localized SWT/JFace Apps
Goto Forum:
  


Current Time: Mon Apr 19 10:35:31 GMT 2021

Powered by FUDForum. Page generated in 0.01956 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top