/* * Copyright (c) 2007 Declarative Engineering LLC. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Declarative Engineering LLC * verson 1 which accompanies this distribution, and is available at * http://declarativeengineering.com/legal/DE_Developer_License_v1.txt */ package com.foundation.view.swt; import org.eclipse.swt.SWT; public class RowLayout extends Layout { public static final int HORIZONTAL = SWT.HORIZONTAL; public static final int VERTICAL = SWT.VERTICAL; public static final int CENTER = SWT.CENTER; public static final int BEGINNING = SWT.BEGINNING; public static final int END = SWT.END; public static final int FILL = SWT.FILL; public int type = SWT.HORIZONTAL; public int marginWidth = 0; public int marginHeight = 0; public int spacing = 3; public boolean wrap = true; public boolean pack = true; public int alignment = SWT.BEGINNING; public boolean justify = false; public int marginLeft = 3; public int marginTop = 3; public int marginRight = 3; public int marginBottom = 3; /** * RowLayout constructor. * @param container The container that is using the layout. */ public RowLayout(IAbstractSwtContainer container) { super(container); }//RowLayout()// /** * RowLayout constructor. * @param container The container that is using the layout. */ public RowLayout(ICellContainer container) { super(container); }//RowLayout()// /* (non-Javadoc) * @see com.foundation.view.swt.Layout#createLayout(java.lang.Object) */ public org.eclipse.swt.widgets.Layout createLayout(Object rowObject) { com.foundation.view.swt.layout.RowLayout result = new com.foundation.view.swt.layout.RowLayout(); result.type = type; result.marginHeight = marginHeight; result.marginWidth = marginWidth; result.spacing = spacing; result.wrap = wrap; result.pack = pack; result.alignment = alignment; result.justify = justify; result.marginLeft = marginLeft; result.marginTop = marginTop; result.marginRight = marginRight; result.marginBottom = marginBottom; return result; }//createLayout()// /* (non-Javadoc) * @see com.foundation.view.swt.Layout#initialize() */ public void initialize() { }//initialize()// /* (non-Javadoc) * @see com.foundation.view.swt.Layout#refresh() */ public void refresh() { }//refresh()// /* (non-Javadoc) * @see com.foundation.view.swt.Layout#synchronize() */ public void synchronize() { }//synchronize()// /* (non-Javadoc) * @see com.foundation.view.swt.Layout#release() */ public void release() { }//release()// /** * Sets the layout type. * @param type The layout type. */ public void setType(int type) { this.type = type; }//setType()// /** * Sets the layout margin width. * @param marginWidth The layout margin width. */ public void setMarginWidth(int marginWidth) { this.marginWidth = marginWidth; }//setMarginWidth()// /** * Sets the layout margin height. * @param marginHeight The layout margin height. */ public void setMarginHeight(int marginHeight) { this.marginHeight = marginHeight; }//setMarginHeight()// /** * Sets the layout spacing. * @param spacing The layout spacing. */ public void setSpacing(int spacing) { this.spacing = spacing; }//setSpacing()// /** * Sets the layout wrap. * @param wrap The layout wrap. */ public void setWrap(boolean wrap) { this.wrap = wrap; }//setWrap()// /** * Sets the layout pack. * @param pack The layout pack. */ public void setPack(boolean pack) { this.pack = pack; }//setPack()// /** * Sets the layout alignment which identifies how to place the components in the axis opposite the type (direction of flow). * @param alignment The layout alignment. */ public void setAlignment(int alignment) { this.alignment = alignment; }//setAlignment()// /** * Sets the layout justify. * @param justify The layout justify. */ public void setJustify(boolean justify) { this.justify = justify; }//setJustify()// /** * Sets the layout margin top. * @param marginTop The layout margin top. */ public void setMarginTop(int marginTop) { this.marginTop = marginTop; }//setMarginTop()// /** * Sets the layout margin bottom. * @param marginBottom The layout margin bottom. */ public void setMarginBottom(int marginBottom) { this.marginBottom = marginBottom; }//setMarginBottom()// /** * Sets the layout margin right. * @param marginRight The layout margin right. */ public void setMarginRight(int marginRight) { this.marginRight = marginRight; }//setMarginRight()// /** * Sets the layout margin left. * @param marginLeft The layout margin left. */ public void setMarginLeft(int marginLeft) { this.marginLeft = marginLeft; }//setMarginLeft()// }//RowLayout//