|
Re: Resizing using DelegatingLayout [message #208485 is a reply to message #208324] |
Fri, 03 February 2006 11:34 |
Eclipse User |
|
|
|
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();
}
|
|
|
Powered by
FUDForum. Page generated in 0.03105 seconds