Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Anchors and resizing
Anchors and resizing [message #119372] Wed, 25 February 2004 07:15 Go to next message
Matt is currently offline MattFriend
Messages: 40
Registered: July 2009
Member
Hi all,

I have a number of Figures that send Points to their anchors to control
the anchors' locations. The anchors move with the Figures, but when the
Figures are re-sized, the anchor positions don't expand and contract.

I've tried updating the location Points in the Figures' paintFigure()
method, but it hasn't been working. Any thoughts?

I apologize in advance if this has been asked elsewhere, but I hadn't
found it.

Matt
Re: Anchors and resizing [message #119398 is a reply to message #119372] Wed, 25 February 2004 13:23 Go to previous messageGo to next message
Ryan Pu is currently offline Ryan PuFriend
Messages: 7
Registered: July 2009
Junior Member
Matt,

You needn't update anchor locations in your own code
if your anchor extends the AbstractConnectionAnchor.

Matt wrote on 2004-2-25 15:15:

> Hi all,
>
> I have a number of Figures that send Points to
> their anchors to control
> the anchors' locations. The anchors move with
> the Figures, but when the Figures are re-sized,
> the anchor positions don't expand and contract.
>
> I've tried updating the location Points in the
> Figures' paintFigure()
> method, but it hasn't been working. Any
> thoughts?
>
> I apologize in advance if this has been asked
> elsewhere, but I hadn't found it.
>
> Matt
Re: Anchors and resizing [message #119722 is a reply to message #119398] Fri, 27 February 2004 12:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: josephlee.163.com

implement the following code in you figure.
public void validate() {
if(isValid()) return;
//you can use getSize method to get the new location of your figure.
layoutConnectionAnchors();
super.validate();
}
hope these can give you some suggestions.
Ryan Pu wrote:

> Matt,

> You needn't update anchor locations in your own code
> if your anchor extends the AbstractConnectionAnchor.

> Matt wrote on 2004-2-25 15:15:

> > Hi all,
> >
> > I have a number of Figures that send Points to
> > their anchors to control
> > the anchors' locations. The anchors move with
> > the Figures, but when the Figures are re-sized,
> > the anchor positions don't expand and contract.
> >
> > I've tried updating the location Points in the
> > Figures' paintFigure()
> > method, but it hasn't been working. Any
> > thoughts?
> >
> > I apologize in advance if this has been asked
> > elsewhere, but I hadn't found it.
> >
> > Matt
Re: Anchors and resizing [message #119798 is a reply to message #119722] Sat, 28 February 2004 12:43 Go to previous message
Ryan Pu is currently offline Ryan PuFriend
Messages: 7
Registered: July 2009
Junior Member
You should not do like that. You needn't code in figure if
your anchor extends AbstractConnectionAnchor. Because when
figure translated or moved, Figure#fireMoved() will be
called, thus listener added by AbstractConnectionAnchor
will notify listeners of connections to update. And as a
result, the connections will call the anchor's
getReferencePoint() and getLocation() again to get a newer
location.

joseph wrote on 2004-2-27 20:19:

> implement the following code in you figure.
> public void validate() {
> if(isValid()) return;
> //you can use getSize method to get the new location of
> your figure. layoutConnectionAnchors();
> super.validate();
> }
> hope these can give you some suggestions.
> Ryan Pu wrote:
>
>> Matt,
>
>> You needn't update anchor locations in your own code
>> if your anchor extends the AbstractConnectionAnchor.
>
>> Matt wrote on 2004-2-25 15:15:
>
>> > Hi all,
>> >
>> > I have a number of Figures that send Points to
>> > their anchors to control
>> > the anchors' locations. The anchors move with
>> > the Figures, but when the Figures are re-sized,
>> > the anchor positions don't expand and contract.
>> >
>> > I've tried updating the location Points in the
>> > Figures' paintFigure()
>> > method, but it hasn't been working. Any
>> > thoughts?
>> >
>> > I apologize in advance if this has been asked
>> > elsewhere, but I hadn't found it.
>> >
>> > Matt
Previous Topic:Re: refresh the label's content
Next Topic:WorkspaceModifyOperation class missing.
Goto Forum:
  


Current Time: Fri Nov 08 22:54:42 GMT 2024

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

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

Back to the top