144 lines
4.2 KiB
Java
144 lines
4.2 KiB
Java
/*
|
|
* 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;
|
|
|
|
public class GridLayout extends Layout {
|
|
public int numColumns = 1;
|
|
public boolean makeColumnsEqualWidth = false;
|
|
public int marginWidth = 0;
|
|
public int marginHeight = 0;
|
|
public int marginLeft = 0;
|
|
public int marginTop = 0;
|
|
public int marginRight = 0;
|
|
public int marginBottom = 0;
|
|
public int horizontalSpacing = 5;
|
|
public int verticalSpacing = 5;
|
|
/**
|
|
* GridLayout constructor.
|
|
* @param container The container that is using the layout.
|
|
*/
|
|
public GridLayout(IAbstractSwtContainer container) {
|
|
super(container);
|
|
}//GridLayout()//
|
|
/**
|
|
* GridLayout constructor.
|
|
* @param cellContainer The container that is using the layout.
|
|
*/
|
|
public GridLayout(ICellContainer cellContainer) {
|
|
super(cellContainer);
|
|
}//GridLayout()//
|
|
/* (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.GridLayout result = new com.foundation.view.swt.layout.GridLayout();
|
|
|
|
result.marginHeight = marginHeight;
|
|
result.marginWidth = marginWidth;
|
|
result.marginLeft = marginLeft;
|
|
result.marginTop = marginTop;
|
|
result.marginRight = marginRight;
|
|
result.marginBottom = marginBottom;
|
|
result.numColumns = numColumns;
|
|
result.makeColumnsEqualWidth = makeColumnsEqualWidth;
|
|
result.horizontalSpacing = horizontalSpacing;
|
|
result.verticalSpacing = verticalSpacing;
|
|
|
|
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 column count.
|
|
* @param type The layout column count.
|
|
*/
|
|
public void setNumColumns(int numColumns) {
|
|
this.numColumns = numColumns;
|
|
}//setNumColumns()//
|
|
/**
|
|
* 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 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()//
|
|
/**
|
|
* Sets whether the layout columns have the same widths.
|
|
* @param makeColumnsEqualWidth Whether the layout columns are equal width.
|
|
*/
|
|
public void setMakeColumnsEqualWidth(boolean makeColumnsEqualWidth) {
|
|
this.makeColumnsEqualWidth = makeColumnsEqualWidth;
|
|
}//setMakeColumnsEqualWidth()//
|
|
/**
|
|
* Sets the layout horizontal spacing.
|
|
* @param horizontalSpacing The layout horizontal spacing.
|
|
*/
|
|
public void setHorizontalSpacing(int horizontalSpacing) {
|
|
this.horizontalSpacing = horizontalSpacing;
|
|
}//setHorizontalSpacing()//
|
|
/**
|
|
* Sets the layout vertical spacing.
|
|
* @param verticalSpacing The layout vertical spacing.
|
|
*/
|
|
public void setVerticalSpacing(int verticalSpacing) {
|
|
this.verticalSpacing = verticalSpacing;
|
|
}//setVerticalSpacing()//
|
|
}//GridLayout// |