Mercurial > projects > dwt-addons
diff dwtx/jface/viewers/TableLayout.d @ 104:04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
These new wrappers now use the tango.util.containers instead of the tango.util.collections.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 07 Aug 2008 15:01:33 +0200 |
parents | b3daa78bc913 |
children |
line wrap: on
line diff
--- a/dwtx/jface/viewers/TableLayout.d Sun Aug 03 17:01:51 2008 +0200 +++ b/dwtx/jface/viewers/TableLayout.d Thu Aug 07 15:01:33 2008 +0200 @@ -17,8 +17,6 @@ import dwtx.jface.viewers.ColumnPixelData; import dwtx.jface.viewers.ColumnWeightData; -import tango.util.collection.model.Seq; -import tango.util.collection.ArraySeq; import dwt.DWT; import dwt.graphics.Point; @@ -33,6 +31,7 @@ import dwtx.jface.layout.TableColumnLayout; import dwt.dwthelper.utils; +import dwtx.dwtxhelper.Collection; /** * A layout for a table. Call <code>addColumnData</code> to add columns. @@ -71,7 +70,7 @@ * The list of column layout data (element type: * <code>ColumnLayoutData</code>). */ - private Seq!(ColumnLayoutData) columns; + private List columns; /** * Indicates whether <code>layout</code> has yet to be called. @@ -82,7 +81,7 @@ * Creates a new table layout. */ public this() { - columns = new ArraySeq!(ColumnLayoutData); + columns = new ArrayList(); } /** @@ -92,7 +91,7 @@ * the column layout data */ public void addColumnData(ColumnLayoutData data) { - columns.append(data); + columns.add(data); } /* @@ -112,7 +111,8 @@ int width = 0; int size = columns.size(); - foreach( layoutData; columns ){ + for (int i = 0; i < size; ++i) { + ColumnLayoutData layoutData = cast(ColumnLayoutData) columns.get(i); if ( auto col = cast(ColumnPixelData) layoutData ) { width += col.width; if (col.addTrim) { @@ -163,7 +163,7 @@ // First calc space occupied by fixed columns for (int i = 0; i < size; i++) { - ColumnLayoutData col = /+cast(ColumnLayoutData)+/ columns.get(i); + ColumnLayoutData col = cast(ColumnLayoutData) columns.get(i); if ( auto cpd = cast(ColumnPixelData) col ) { int pixels = cpd.width; if (cpd.addTrim) { @@ -190,7 +190,7 @@ int rest = width - fixedWidth; int totalDistributed = 0; for (int i = 0; i < size; ++i) { - ColumnLayoutData col = /+cast(ColumnLayoutData)+/ columns.get(i); + ColumnLayoutData col = cast(ColumnLayoutData) columns.get(i); if (auto cw = cast(ColumnWeightData) col ) { // calculate weight as above // int weight = firstTime ? cw.weight : @@ -212,7 +212,7 @@ if (i is size) { i = 0; } - ColumnLayoutData col = /+cast(ColumnLayoutData)+/ columns.get(i); + ColumnLayoutData col = cast(ColumnLayoutData) columns.get(i); if (cast(ColumnWeightData)col ) { ++widths[i]; --diff;