Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Resizing using DelegatingLayout
Resizing using DelegatingLayout [message #208324] Tue, 31 January 2006 14:59 Go to next message
vigan is currently offline viganFriend
Messages: 6
Registered: July 2009
Junior Member
Hi
I don't know how to move and resize my figure using DelegatingLayout.
Will I writer a DelegatingLayoutEditPolicy as a editpolicy?
I have to use Delegating Layout, since I want to resize my labels
attached to a polylineconnection.
thanks in advance.
Ivo
Re: Resizing using DelegatingLayout [message #208485 is a reply to message #208324] Fri, 03 February 2006 11:34 Go to previous message
Eclipse UserFriend
Originally posted by: kknd.yahoo.com

You can refer the XYLayoutEditPolicy to construct the
DelegatingLayoutEditPolicy

public class DelegatingLocatorImpl implements DelegatingLocator{
private Rectangle rect = null;

public DelegatingLocatorImpl(Rectangle rect){
this.rect = rect;
}
public Rectangle getConstraint(){
return rect;
}

public void relocate(IFigure target){
target.setBounds(rect);
}
}

public interface DelegatingLocator extends Locator{
public Rectangle getConstraint();
}

Inside your editpart's refreshVisuals(){
DelegatingLocator locator = new DelegatingLocatorImpl(new Rectangle());
setLayoutConstraint(locator,this);
}

Inside the DelegatingLayoutEditPolicy
public Rectangle getConstraintsFor(){
return ((DelegaingLocator)constraint).getConstraint();
}
Previous Topic:Migrating Drag and Drop to 3.1
Next Topic:Undo/Redo
Goto Forum:
  


Current Time: Thu Dec 08 17:39:20 GMT 2022

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

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

Back to the top