Mercurial > projects > dwt-addons
diff dwtx/ui/internal/forms/widgets/TextSegment.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 | 11e8159caf7a |
children |
line wrap: on
line diff
--- a/dwtx/ui/internal/forms/widgets/TextSegment.d Sun Aug 03 17:01:51 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/TextSegment.d Thu Aug 07 15:01:33 2008 +0200 @@ -29,7 +29,7 @@ import dwt.dwthelper.utils; import dwtx.dwtxhelper.mangoicu.UBreakIterator; -import tango.util.collection.ArraySeq; +import dwtx.dwtxhelper.Collection; /** * @version 1.0 @@ -47,7 +47,7 @@ private bool wrapAllowed = true; - protected ArraySeq!(Object) areaRectangles; + protected Vector areaRectangles; private TextFragment[] textFragments; @@ -114,7 +114,7 @@ } public this(String text, String fontId, String colorId, bool wrapAllowed) { - areaRectangles = new ArraySeq!(Object); + areaRectangles = new Vector(); this.text = cleanup(text); this.fontId = fontId; this.colorId = colorId; @@ -343,7 +343,7 @@ //int lineY = ly + lineHeight - descent + 1; Rectangle br = new Rectangle(locator.x, ly, ewidth, lineHeight - descent + 3); - areaRectangles.append(new AreaRectangle(br, 0, -1)); + areaRectangles.add(new AreaRectangle(br, 0, -1)); locator.x += ewidth; locator.width = ewidth; locator.rowHeight = Math.max(locator.rowHeight, extent.y); @@ -677,7 +677,7 @@ locator.x - 1:locator.x, ly, isSelectable()?lineExtent.x + 1:lineExtent.x, lineHeight - descent + 3); areaRectangles - .append(new AreaRectangle(br, lineStart, lastLoc)); + .add(new AreaRectangle(br, lineStart, lastLoc)); locator.rowHeight = Math.max(locator.rowHeight, lineExtent.y); @@ -704,7 +704,7 @@ isSelectable()?lineExtent.x + 1:lineExtent.x, lineHeight - descent + 3); //int lineY = ly + lineHeight - descent + 1; - areaRectangles.append(new AreaRectangle(br, lineStart, lastLoc)); + areaRectangles.add(new AreaRectangle(br, lineStart, lastLoc)); locator.x += lastWidth; locator.rowHeight = Math.max(locator.rowHeight, lineExtent.y); } @@ -716,7 +716,7 @@ private void computeTextFragments(GC gc) { if (textFragments !is null) return; - ArraySeq!(Object) list = new ArraySeq!(Object); + ArrayList list = new ArrayList(); auto wb = UBreakIterator.openLineIterator( ULocale.Default, getText() ); scope(exit) wb.close(); int cursor = 0; @@ -725,7 +725,7 @@ continue; String word = text.substring(cursor, loc); Point extent = gc.textExtent(word); - list.append(new TextFragment(cast(short) loc, cast(short) extent.x)); + list.add(new TextFragment(cast(short) loc, cast(short) extent.x)); cursor = loc; } textFragments = arraycast!(TextFragment)(list.toArray());