Resizing using DelegatingLayout [message #208324] |
Tue, 31 January 2006 14:59  |
Eclipse User |
|
|
|
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  |
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.04633 seconds