[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Property Sheet value updates a Figure

When you're not sure how to do something, the first thing you should do is
check to see how the GEF examples do the same thing.  This is pretty common
in most of our examples.

Look at StickyNoteEditPart in the logic example or ClassEditPart in the
EDiagram example.  Basically, you give the existing figure the new text, not
create a new figure.

"Jason" <jduley@xxxxxxxxxxxxxxxxx> wrote in message
news:d1ut7q$rrc$1@xxxxxxxxxxxxxxxxxxx
>
> I am trying to update a label on a figure based on a string value in a
> property sheet for that figure.  When I select the figure and change its
> label property, the EditPart for this Figure properly calls the
> propertyChanged event which in turn calls refreshVisuals.  In
> refreshVisuals, I am not sure how to update the label in this Figure.  I
> have tried the following:
>
> //get the new value
> String mainLabel = getCastedModel().getMainLabel();
> //update the Figure ???
> setFigure(new OntologyClassFigure(new Label(mainLabel)));
>
> this does not work and is probably nowhere near being correct.  Any
> suggestions would be great.  Thanks.
> Jason