Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » setConnectionAnchor when collapsing container
setConnectionAnchor when collapsing container [message #206653] Tue, 23 September 2008 21:52 Go to next message
Eclipse UserFriend
Originally posted by: kelvinng.db.gmail.com

When I collapse a container, I want to change the anchors for the edit
parts inside of the container.

When I call setConnectionAnchor on my edit part to change it's anchor,
the link disappears!

Instead, I want it to change anchor points.

This is generally what my code looks like:

=============================================
handleNotificationEvent(Notification event) {

boolean isCollapsed = ...
if (isCollapsed) {
// someone collapsed the container
...
((Goal2EditPart)(ep)).setConnectionAnchor(new ChopboxAnchor(getFigure()));
}
}
=============================================


~Kelvin Ng
Re: setConnectionAnchor when collapsing container [message #206667 is a reply to message #206653] Tue, 23 September 2008 23:34 Go to previous message
Eclipse UserFriend
Originally posted by: kelvinng.db.gmail.com

On 2008-09-23 17:52:30 -0400, Kelvin Ng <kelvinng.db@gmail.com> said:

> When I collapse a container, I want to change the anchors for the edit
> parts inside of the container.
>
> When I call setConnectionAnchor on my edit part to change it's anchor,
> the link disappears!
>
> Instead, I want it to change anchor points.
>
> This is generally what my code looks like:
>
> =============================================
> handleNotificationEvent(Notification event) {
>
> boolean isCollapsed = ...
> if (isCollapsed) {
> // someone collapsed the container
> ...
> ((Goal2EditPart)(ep)).setConnectionAnchor(new ChopboxAnchor(getFigure()));
> }
> }
> =============================================
>
>
> ~Kelvin Ng

Sorry, I forgot to mention that I had implemented a set method for the anchor:

public void setConnectionAnchor(ConnectionAnchor newAnchor) {
anchor = newAnchor;
}

~Kelvin Ng
Previous Topic:Changing Model
Next Topic:Context Menu
Goto Forum:
  


Current Time: Tue Mar 09 07:46:40 GMT 2021

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

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

Back to the top