Skip to main content



      Home
Home » Eclipse Projects » GEF » freeformlayer with positive coordinates only ?
freeformlayer with positive coordinates only ? [message #245650] Tue, 23 September 2008 12: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 12: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: Mon Jun 30 23:04:27 EDT 2025

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

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

Back to the top