Files
Brainstorm/Foundation TCV SWT Client/src/com/foundation/tcv/swt/client/FillLayout.java
2014-05-30 10:31:51 -07:00

88 lines
2.4 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.tcv.swt.client;
import org.eclipse.swt.SWT;
import com.foundation.tcv.swt.IFillLayout;
import com.foundation.tcv.view.ViewMessage;
public class FillLayout extends Layout implements IFillLayout {
private int type = SWT.HORIZONTAL;
private int marginWidth = 0;
private int marginHeight = 0;
private int spacing = 0;
/**
* FillLayout constructor.
*/
public FillLayout() {
}//FillLayout()//
/* (non-Javadoc)
* @see com.foundation.tcv.swt.client.Layout#createLayout(java.lang.Object)
*/
public org.eclipse.swt.widgets.Layout createLayout(Object rowObject) {
com.foundation.view.swt.layout.FillLayout result = new com.foundation.view.swt.layout.FillLayout();
result.type = type;
result.marginHeight = marginHeight;
result.marginWidth = marginWidth;
result.spacing = spacing;
return result;
}//createLayout()//
/* (non-Javadoc)
* @see com.foundation.tcv.swt.client.Layout#initialize()
*/
public void initialize() {
}//initialize()//
/* (non-Javadoc)
* @see com.foundation.tcv.swt.client.Layout#release()
*/
public void release() {
}//release()//
/* (non-Javadoc)
* @see com.foundation.tcv.swt.client.Layout#synchronize()
*/
public void synchronize() {
}//synchronize()//
/* (non-Javadoc)
* @see com.foundation.tcv.swt.client.Layout#processMessage(com.foundation.tcv.view.ViewMessage)
*/
public Object processMessage(ViewMessage viewMessage) {
Object result = null;
switch(viewMessage.getMessageNumber()) {
case MESSAGE_INITIALIZE: {
setContainer((AbstractComponent) getComponent(viewMessage.getMessageInteger()));
break;
}//case//
case MESSAGE_SET_TYPE: {
this.type = viewMessage.getMessageInteger();
break;
}//case//
case MESSAGE_SET_MARGIN_HEIGHT: {
this.marginHeight = viewMessage.getMessageInteger();
break;
}//case//
case MESSAGE_SET_MARGIN_WIDTH: {
this.marginWidth = viewMessage.getMessageInteger();
break;
}//case//
case MESSAGE_SET_SPACING: {
this.spacing = viewMessage.getMessageInteger();
break;
}//case//
default: {
result = super.processMessage(viewMessage);
break;
}//default//
}//switch//
return result;
}//processMessage()//
}//FillLayout//