|
|
|
Re: Add SWT button to a GEF diagram [message #241342 is a reply to message #241183] |
Thu, 07 February 2008 09:48  |
Eclipse User |
|
|
|
Originally posted by: none.ibm.com
Try this for starters. Note that SWT controls are always on top of any
other figure, including handles, feedback, etc.
ControlProxy extends Figure {
....
ControlProxy(Control control) {
this.control = control;
}
public Dimension getPreferredSize(int wHint, int hHint) {
Point p = control.computeSize(wHint, hHint);
return new Dimension(p.x, p.y);
}
public void setBounds(Rectangle rect) {
super.setBounds(rect);
rect = rect.getCopy();
translateToAbsolute(rect);
control.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.24752 seconds