[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Convert LayoutManagers to SWT ...

You can set layout parameters using the Control#setLayoutData(Object) method.  As to porting layout managers between AWT and SWT, that's an art more than a science.  It is possible to write custom SWT layout managers.  In fact, having done both custom AWT and custom SWT layout managers extensively, I'd have to say that it's easier to do SWT layout managers once you get used to it.  But there's no magic algorithm to switch between the two paradigms.  And unfortunately, SWT layout manager algorithms are a world appart from AWT algorithms.  I do have a class I wrote which allows you to write a somewhat generic layout manager (using only Rectangles and Point objects) which then can be used without modification as an AWT layout manager, a SwingWT layout manager, or an SWT layout manager.  (I considered adding wxWidgets support as well but unfortunately, SWT and wxWidgets both use a abstract superclass rather than a superinterface for their layout managers).  If you're interested, I'll post the class here.