Skip to main content



      Home
Home » Eclipse Projects » GEF » FigureCanvas exemple request
FigureCanvas exemple request [message #169592] Thu, 24 February 2005 13:28 Go to next message
Eclipse UserFriend
Originally posted by: florin_florea.hotmail.com

Could someone please post a very simple FigureCanvas example with, lets
say, a RoundedRectangle in it. I need to place the canvas in a View
(createPartControl(Composite parent)) of a plugin. I tried something but
it just does not work for me.

Thanks,

Florin
Re: FigureCanvas exemple request [message #169858 is a reply to message #169592] Sun, 27 February 2005 17:52 Go to previous message
Eclipse UserFriend
public static void main(String[] args) {
Display d = new Display();
Shell shell = new Shell(d);
shell.setLayout(new FillLayout());

FigureCanvas canvas = new FigureCanvas(shell);
RoundedRectangle rect = new RoundedRectangle();
rect.setBackgroundColor(ColorConstants.green);
rect.setCornerDimensions(new Dimension(30, 30));
canvas.setContents(rect);

shell.pack();
shell.open();
while (!shell.isDisposed())
while (!d.readAndDispatch())
d.sleep();
}


"Florin" <florin_florea@hotmail.com> wrote in message
news:cvl6cp$ohi$1@www.eclipse.org...
> Could someone please post a very simple FigureCanvas example with, lets
> say, a RoundedRectangle in it. I need to place the canvas in a View
> (createPartControl(Composite parent)) of a plugin. I tried something but
> it just does not work for me.
>
> Thanks,
>
> Florin
>
Previous Topic:Using generated Edit code for the property sheet of a custom GEF application
Next Topic:How to show my own deletion redo/undo label?
Goto Forum:
  


Current Time: Thu Jun 19 03:25:44 EDT 2025

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

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

Back to the top