Palette and Editor [message #232494] |
Mon, 02 April 2007 06:29 |
Eclipse User |
|
|
|
Originally posted by: tan.janice.gmail.com
hi,
i have a palette which creates some shapes on my graphical editor.
however, i had set some constrains when the shapes a created when dragged
from the palette. such that a particular shape can only be created once.
when i open multiple editors, and have already created that shape in one
of the editors, i am not able to drag out/ create the shape on the other
editor. is this due to all editors sharing the same palette?
or am i doing it wrongly by constraining the execute() method in the
ShapeCreateCommand class?
is there a way that each instance of the editor created will have its one
palette ...?
|
|
|
Re: Palette and Editor [message #232509 is a reply to message #232494] |
Mon, 02 April 2007 11:18 |
Eclipse User |
|
|
|
Originally posted by: till.tillamma.de
Hi,
I'm not sure what you want to do, But wouldnt it be easier to create an
EditPolicy which holds the constraint and install it on the editor?
That way you wouldnt limit the palette(-tool) functionality and you
could set a limit on the shapes for each editor.
It is the way i would try to solve the problem but as i am not sure what
you are trying to do there might be a diffrent solution.
---
Till
|
|
|
Re: Palette and Editor [message #232523 is a reply to message #232494] |
Mon, 02 April 2007 17:50 |
Eclipse User |
|
|
|
Originally posted by: ""modica\".$nospam$cs.tu-berlin.de"
I'm a bit confused about what you have in your editor.
Do you mean shapes as Figures in your editor or are there Shapes (as
classes) in your model?
And where or how do you set constrains when dragging? In the model?
Cheers
Tony
janice schrieb:
> hi,
>
> i have a palette which creates some shapes on my graphical editor.
> however, i had set some constrains when the shapes a created when
> dragged from the palette. such that a particular shape can only be
> created once. when i open multiple editors, and have already created
> that shape in one of the editors, i am not able to drag out/ create the
> shape on the other editor. is this due to all editors sharing the same
> palette?
> or am i doing it wrongly by constraining the execute() method in the
> ShapeCreateCommand class?
> is there a way that each instance of the editor created will have its
> one palette ...?
|
|
|
Powered by
FUDForum. Page generated in 0.04193 seconds