Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » freeformlayer with positive coordinates only ?
freeformlayer with positive coordinates only ? [message #245650] Tue, 23 September 2008 16:01 Go to next message
Eclipse UserFriend
Originally posted by: gal.alex.agiledss.com

Hello.

In the org.eclipse.gef.examples.logic, I'm trying to constrain the node children to always be in the 'positive' part of the circuit node i.e. no
moving in the negative (vertically and horizontally). However, I'm a unsure as to how exactly to approach this. I see that the CircuitFigure class
uses a FreeFormLayer as well as a FreeformLayout. Any tips ?

Cheers,

Alex
Re: freeformlayer with positive coordinates only ? [message #245656 is a reply to message #245650] Tue, 23 September 2008 16:28 Go to previous message
Eclipse UserFriend
Originally posted by: gal.alex.agiledss.com

Alex wrote:
> Hello.
>
> In the org.eclipse.gef.examples.logic, I'm trying to constrain the node
> children to always be in the 'positive' part of the circuit node i.e. no
> moving in the negative (vertically and horizontally). However, I'm a
> unsure as to how exactly to approach this. I see that the CircuitFigure
> class uses a FreeFormLayer as well as a FreeformLayout. Any tips ?
>
> Cheers,
>
> Alex

This seems to have done the trick:

pane.setLayoutManager(new FreeformLayout() {

@Override
public void setConstraint(IFigure figure, Object newConstraint) {

Rectangle bounds = (Rectangle) newConstraint;

if (newConstraint != null) {

if (bounds.x < 0) {
bounds.x = 0;
}

if (bounds.y < 0) {
bounds.y = 0;
}
}

super.setConstraint(figure, bounds);
}
});
Previous Topic:[Announce] GEF 3.4.1 is available
Next Topic:setConnectionAnchor when collapsing container
Goto Forum:
  


Current Time: Thu Mar 28 18:23:39 GMT 2024

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

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

Back to the top