Change figure of an edit part dynamically [message #61996] |
Wed, 05 February 2003 05:58  |
Eclipse User |
|
|
|
Hi
I have an EditPart which i want to change it's figure according to some data
in the model
I tried overriding getFigure() but when calling
setLayoutConstraint(this,getFigure()) , the following exception occurs
java.lang.IllegalArgumentException: IWAG0004E Figure.setConstraint(..):
Figure is not a child
at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1236)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(Abst
ractGraphicalEditPart.java:763)
at
com.ibm.bpmworkbench.ui.ProcessGraphModeler.parts.SContainer Part.refreshVisu
als(SContainerPart.java:216)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:716
)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphica
lEditPart.java:534)
I figured out that the problem is that the Parent EditPart registers the
figure of the children parts once when creating them , so when it tries to
setConstraint() on a different Figure , it blows
What Can I do ?
|
|
|
|
|
Re: Change figure of an edit part dynamically [message #62139 is a reply to message #62115] |
Wed, 05 February 2003 10:35  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
For now you will have to implement this yourself by creating a wrapper
figure.
The wrapper Figure should be a plain figure in StackLayout with one child
that is one of your current figures. When you want to "swap the figure",
remove the wrappers child and replace it with another. The EditParts figure
will not change, since it will be the wrapper.
If your EditPart has children, you will have to move all of the childrens'
figures to the swapped figure.
"Shady Said" <sh_said@yahoo.com> wrote in message
news:b1r95v$e1d$1@rogue.oti.com...
> No , I want a completly differnt figure not the same one with different
> attributes(background color for ex.)
> This is important in the semantics of my application
>
>
> "Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
> news:b1r5k2$7fb$1@rogue.oti.com...
> > Could you just change the current figure instead of replacing it with an
> entirely new one?
> >
> > Eric
> >
> >
> > Shady Said wrote:
> > > Hi
> > > I have an EditPart which i want to change it's figure according to
some
> data
> > > in the model
> > > I tried overriding getFigure() but when calling
> > > setLayoutConstraint(this,getFigure()) , the following exception occurs
> > >
> > > java.lang.IllegalArgumentException: IWAG0004E
Figure.setConstraint(..):
> > > Figure is not a child
> > > at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1236)
> > > at
> > >
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(Abst
> > > ractGraphicalEditPart.java:763)
> > > at
> > >
>
com.ibm.bpmworkbench.ui.ProcessGraphModeler.parts.SContainer Part.refreshVisu
> > > als(SContainerPart.java:216)
> > > at
> > >
>
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:716
> > > )
> > > at
> > >
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphica
> > > lEditPart.java:534)
> > >
> > > I figured out that the problem is that the Parent EditPart registers
the
> > > figure of the children parts once when creating them , so when it
tries
> to
> > > setConstraint() on a different Figure , it blows
> > >
> > > What Can I do ?
> > >
> > >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04316 seconds