Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Ran Eclipse cleaning.

  • Loading branch information...
commit 9cb1a1269c60a587c67f046e569f5967b6be4ecb 1 parent ef3a94f
Ben Samuel authored May 11, 2011
160  src/quicktests/OnePiece.java
@@ -22,86 +22,88 @@
22 22
 	private static final long serialVersionUID = -2574375926597058507L;
23 23
 
24 24
 	public OnePiece() {
25  
-	super();
26  
-	inset = new Rectangle2D.Double();
27  
-	strk = new BasicStroke(1.0f);
28  
-    }
29  
-    Rectangle2D.Double inset;
30  
-    BasicStroke strk;
31  
-    
32  
-    private Point2D p(double mx, double my) {
33  
-	Rectangle2D r = inset;
34  
-	return new Point2D.Double(r.getX() + mx * r.getWidth(), r.getY() + my * r.getHeight());
35  
-    }
36  
-    private double px(double x) {
37  
-	Rectangle2D r = inset;
38  
-	return r.getX() + x * r.getWidth();
39  
-    }
40  
-    private double py(double y) {
41  
-	Rectangle2D r = inset;
42  
-	return r.getY() + y * r.getHeight();
43  
-    }
44  
-    private double dx(double x) {
45  
-	Rectangle2D r = inset;
46  
-	return x * r.getWidth();
47  
-    }
48  
-    private double dy(double y) {
49  
-	Rectangle2D r = inset;
50  
-	return y * r.getHeight();
51  
-    }
52  
-/*public SquigglyPath(Point2D from, Point2D to, double phase, double wavelength, double amplitude) 
  25
+		super();
  26
+		inset = new Rectangle2D.Double();
  27
+		strk = new BasicStroke(1.0f);
  28
+	}
  29
+	Rectangle2D.Double inset;
  30
+	BasicStroke strk;
  31
+
  32
+	private Point2D p(final double mx, final double my) {
  33
+		final Rectangle2D r = inset;
  34
+		return new Point2D.Double(r.getX() + mx * r.getWidth(), r.getY() + my * r.getHeight());
  35
+	}
  36
+	private double px(final double x) {
  37
+		final Rectangle2D r = inset;
  38
+		return r.getX() + x * r.getWidth();
  39
+	}
  40
+	private double py(final double y) {
  41
+		final Rectangle2D r = inset;
  42
+		return r.getY() + y * r.getHeight();
  43
+	}
  44
+	private double dx(final double x) {
  45
+		final Rectangle2D r = inset;
  46
+		return x * r.getWidth();
  47
+	}
  48
+	private double dy(final double y) {
  49
+		final Rectangle2D r = inset;
  50
+		return y * r.getHeight();
  51
+	}
  52
+	/*public SquigglyPath(Point2D from, Point2D to, double phase, double wavelength, double amplitude)
53 53
     public static double nextPhase(double p, double wl, double l)
54 54
 public NibPath(double _x, double _y, double _w, double _h, Class<?> c) */
55  
-    public void paint(Graphics g) {
56  
-	Rectangle2D r = getBounds();
57  
-	inset.setRect(r.getX() + 0.05 * r.getWidth(),
58  
-	    r.getY() + 0.05 * r.getHeight(), r.getWidth() * 0.9, r.getHeight() * 0.9);
  55
+	@Override
  56
+	public void paint(final Graphics g) {
  57
+		final Rectangle2D r = getBounds();
  58
+		inset.setRect(r.getX() + 0.05 * r.getWidth(),
  59
+				r.getY() + 0.05 * r.getHeight(), r.getWidth() * 0.9, r.getHeight() * 0.9);
  60
+
  61
+		final GeneralPath gp = new GeneralPath();
  62
+		gp.append(SegmentPath.moveto(p(0.0, 0.0)), false);
  63
+		final double w = dx(0.3); final double a = 3.0;
  64
+		// North border
  65
+		double hp = 0.0;
  66
+		gp.append(new SquigglyPath(p(0.0, 0.0), p(0.4, 0.0), hp, w, a), false);
  67
+		gp.append(NibPath.rpf(px(0.4), py(0.0), dx(0.2), dy(0.2),
  68
+				0x384a3315).forwardPath(), false);
  69
+		hp = SquigglyPath.nextPhase(hp, w, dx(0.6));
  70
+		gp.append(new SquigglyPath(p(0.6, 0.0), p(1.0, 0.0), hp, w, a), false);
  71
+		// East
  72
+		double vp = 0.3;
  73
+		gp.append(new SquigglyPath(p(1.0, 0.0), p(1.0, 0.8), vp, w, a), false);
  74
+		// South
  75
+		hp = 0.5;
  76
+		gp.append(new SquigglyPath(p(1.0, 0.8), p(0.6, 0.8), hp, w, a), false);
  77
+		gp.append(NibPath.rpf(px(0.4), py(0.8), dx(0.2), dy(0.2),
  78
+				0x384a3315).reversePath(), false);
  79
+		hp = SquigglyPath.nextPhase(hp, w, dx(0.6));
  80
+		gp.append(new SquigglyPath(p(0.4, 0.8), p(0.0, 0.8), hp, w, a), false);
  81
+		// West
  82
+		vp = 0.8;
  83
+		gp.append(new SquigglyPath(p(0.0, 0.8), p(0.0, 0.0), vp, w, a), false);
  84
+		gp.append(SegmentPath.close(), false);
  85
+		final Graphics2D g2d = (Graphics2D) g;
  86
+		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
  87
+				RenderingHints.VALUE_ANTIALIAS_ON);
  88
+		//g2d.fill(inset);
  89
+		//gp.append(new CompoundPath(p), false);
  90
+		g2d.setPaint(Color.GRAY);
  91
+		g2d.fill(gp);
  92
+		g2d.setPaint(Color.BLACK);
  93
+		g2d.setStroke(strk);
  94
+		g2d.draw(gp);
  95
+	}
59 96
 
60  
-	GeneralPath gp = new GeneralPath();
61  
-	gp.append(SegmentPath.moveto(p(0.0, 0.0)), false);
62  
-	double w = dx(0.3); double a = 3.0; 
63  
-	// North border
64  
-	double hp = 0.0;
65  
-	gp.append(new SquigglyPath(p(0.0, 0.0), p(0.4, 0.0), hp, w, a), false);
66  
-	gp.append(NibPath.rpf(px(0.4), py(0.0), dx(0.2), dy(0.2),
67  
-	    0x384a3315).forwardPath(), false);
68  
-	hp = SquigglyPath.nextPhase(hp, w, dx(0.6));
69  
-	gp.append(new SquigglyPath(p(0.6, 0.0), p(1.0, 0.0), hp, w, a), false);
70  
-	// East
71  
-	double vp = 0.3;
72  
-	gp.append(new SquigglyPath(p(1.0, 0.0), p(1.0, 0.8), vp, w, a), false);
73  
-	// South
74  
-	hp = 0.5;
75  
-	gp.append(new SquigglyPath(p(1.0, 0.8), p(0.6, 0.8), hp, w, a), false);
76  
-	gp.append(NibPath.rpf(px(0.4), py(0.8), dx(0.2), dy(0.2), 
77  
-	    0x384a3315).reversePath(), false);
78  
-	hp = SquigglyPath.nextPhase(hp, w, dx(0.6));
79  
-	gp.append(new SquigglyPath(p(0.4, 0.8), p(0.0, 0.8), hp, w, a), false);
80  
-	// West
81  
-	vp = 0.8;
82  
-	gp.append(new SquigglyPath(p(0.0, 0.8), p(0.0, 0.0), vp, w, a), false);
83  
-	gp.append(SegmentPath.close(), false);
84  
-	Graphics2D g2d = (Graphics2D) g;
85  
-	g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
86  
-	    RenderingHints.VALUE_ANTIALIAS_ON);
87  
-	//g2d.fill(inset);
88  
-	//gp.append(new CompoundPath(p), false);
89  
-	g2d.setPaint(Color.GRAY);
90  
-	g2d.fill(gp);
91  
-	g2d.setPaint(Color.BLACK);
92  
-	g2d.setStroke(strk);
93  
-	g2d.draw(gp);
94  
-    }
95  
-    
96  
-    public static void main(String args[]) {
97  
-	JFrame f = new JFrame("OnePiece");
98  
-	f.addWindowListener(new WindowAdapter() {
99  
-	    public void windowClosing(WindowEvent e) {System.exit(0);}
100  
-	});
101  
-	OnePiece op = new OnePiece();
102  
-	f.getContentPane().add("Center", op);
103  
-	f.setSize(300, 300);
104  
-	f.pack();
105  
-	f.setVisible(true);
106  
-    }
  97
+	public static void main(final String args[]) {
  98
+		final JFrame f = new JFrame("OnePiece");
  99
+		f.addWindowListener(new WindowAdapter() {
  100
+			@Override
  101
+			public void windowClosing(final WindowEvent e) {System.exit(0);}
  102
+		});
  103
+		final OnePiece op = new OnePiece();
  104
+		f.getContentPane().add("Center", op);
  105
+		f.setSize(300, 300);
  106
+		f.pack();
  107
+		f.setVisible(true);
  108
+	}
107 109
 }
16  src/quicktests/OnePiece2.java
@@ -18,9 +18,10 @@
18 18
 	 */
19 19
 	private static final long serialVersionUID = -6304004113864637817L;
20 20
 
21  
-	public void paint(Graphics g) {
22  
-		Graphics2D g2d = (Graphics2D) g;
23  
-		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
  21
+	@Override
  22
+	public void paint(final Graphics g) {
  23
+		final Graphics2D g2d = (Graphics2D) g;
  24
+		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
24 25
 				RenderingHints.VALUE_ANTIALIAS_ON);
25 26
 		g2d.translate((getBounds().getWidth() - PieceWidth()) / 2, (getBounds().getHeight() - PieceHeight()) / 2);
26 27
 		g2d.setStroke(new BasicStroke(1.0f));
@@ -42,12 +43,13 @@ private Shape BorderShape() {
42 43
 		return null;
43 44
 	}
44 45
 
45  
-	public static void main(String args[]) {
46  
-		JFrame f = new JFrame("OnePiece");
  46
+	public static void main(final String args[]) {
  47
+		final JFrame f = new JFrame("OnePiece");
47 48
 		f.addWindowListener(new WindowAdapter() {
48  
-			public void windowClosing(WindowEvent e) {System.exit(0);}
  49
+			@Override
  50
+			public void windowClosing(final WindowEvent e) {System.exit(0);}
49 51
 		});
50  
-		OnePiece op = new OnePiece();
  52
+		final OnePiece op = new OnePiece();
51 53
 		f.getContentPane().add("Center", op);
52 54
 		f.setSize(300, 300);
53 55
 		f.pack();
55  src/veb/Area.java
@@ -7,7 +7,7 @@
7 7
 	final public int ex;
8 8
 	final public int sy;
9 9
 	final public int ey;
10  
-	public Area(int sx, int sy, int ex, int ey) {
  10
+	public Area(final int sx, final int sy, final int ex, final int ey) {
11 11
 		assert ex >= sx && ey >= sy && sx >= 0 && sy >= 0;
12 12
 		this.sx = sx;
13 13
 		this.ex = ex;
@@ -16,16 +16,16 @@ public Area(int sx, int sy, int ex, int ey) {
16 16
 	}
17 17
 	public int width() { return ex - sx; }
18 18
 	public int height() { return ey - sy; }
19  
-	public Area scale(int s) {
  19
+	public Area scale(final int s) {
20 20
 		return new Area(sx * s, sy * s, ex * s, ey * s);
21 21
 	}
22  
-	public Area inset(int i) {
  22
+	public Area inset(final int i) {
23 23
 		return new Area(sx + i, sy + i, ex - i, ey - i);
24 24
 	}
25  
-	public Area offset(int x, int y) {
  25
+	public Area offset(final int x, final int y) {
26 26
 		return new Area(sx + x, sy + y, ex + x, ey + y);
27 27
 	}
28  
-	public boolean overlap(Area o) {
  28
+	public boolean overlap(final Area o) {
29 29
 		if(o == null)
30 30
 			return false;
31 31
 		return sx < o.ex && o.sx < ex && sy < o.ey && o.sy < ey;
@@ -55,14 +55,14 @@ public int hashCode() {
55 55
 	 * @see java.lang.Object#equals(java.lang.Object)
56 56
 	 */
57 57
 	@Override
58  
-	public boolean equals(Object obj) {
  58
+	public boolean equals(final Object obj) {
59 59
 		if (this == obj)
60 60
 			return true;
61 61
 		if (obj == null)
62 62
 			return false;
63 63
 		if (!(obj instanceof Area))
64 64
 			return false;
65  
-		Area other = (Area) obj;
  65
+		final Area other = (Area) obj;
66 66
 		if (ex != other.ex)
67 67
 			return false;
68 68
 		if (ey != other.ey)
@@ -73,6 +73,7 @@ public boolean equals(Object obj) {
73 73
 			return false;
74 74
 		return true;
75 75
 	}
  76
+	@Override
76 77
 	public Iterator<Area> iterator() {
77 78
 		return new Iterator<Area>() {
78 79
 			int x = sx;
@@ -83,7 +84,7 @@ public boolean hasNext() {
83 84
 			}
84 85
 			@Override
85 86
 			public Area next() {
86  
-				Area a = new Area(x, y, x + 1, y + 1);
  87
+				final Area a = new Area(x, y, x + 1, y + 1);
87 88
 				x++;
88 89
 				if(x >= ex) {
89 90
 					x = sx;
@@ -97,7 +98,7 @@ public void remove() {
97 98
 			}
98 99
 		};
99 100
 	}
100  
-	public int xdist(Area o) {
  101
+	public int xdist(final Area o) {
101 102
 		if(sx < o.ex && o.sx < ex)
102 103
 			return 0;
103 104
 		if(o.ex < sx)
@@ -106,7 +107,7 @@ public int xdist(Area o) {
106 107
 			return o.sx - ex;
107 108
 		throw new AssertionError(o);
108 109
 	}
109  
-	public int ydist(Area o) {
  110
+	public int ydist(final Area o) {
110 111
 		if(sy < o.ey && o.sy < ey)
111 112
 			return 0;
112 113
 		if(o.ey < sy)
@@ -115,7 +116,7 @@ public int ydist(Area o) {
115 116
 			return o.sy - ey;
116 117
 		throw new AssertionError(o);
117 118
 	}
118  
-	public Area adjacent(int axis) {
  119
+	public Area adjacent(final int axis) {
119 120
 		switch(axis) {
120 121
 		case 0:
121 122
 			return new Area(ex, sy, ex + 1, ey);
@@ -128,13 +129,12 @@ public Area zeroize() {
128 129
 		return new Area(0, 0, ex - sx, ey - sy);
129 130
 	}
130 131
 	public final static Area ZERO_AREA = new Area(0, 0, 0, 0);
131  
-	public static Area coverage(Iterable<Area> ax) {
132  
-		Iterator<Area> i = ax.iterator();
133  
-		if(!i.hasNext()) {
  132
+	public static Area coverage(final Iterable<Area> ax) {
  133
+		final Iterator<Area> i = ax.iterator();
  134
+		if(!i.hasNext())
134 135
 			return ZERO_AREA;
135  
-		}
136 136
 		int lx, ly, hx, hy;
137  
-		Area a = i.next();
  137
+		final Area a = i.next();
138 138
 		lx = a.sx; ly = a.sy; hx = a.ex; hy = a.ey;
139 139
 		while(i.hasNext()) {
140 140
 			if(a.sx < lx) lx = a.sx;
@@ -144,30 +144,29 @@ public static Area coverage(Iterable<Area> ax) {
144 144
 		}
145 145
 		return new Area(lx, ly, hx, hy);
146 146
 	}
147  
-	public static Area coverage(Area... ax) {
  147
+	public static Area coverage(final Area... ax) {
148 148
 		return coverage(ax);
149 149
 	}
150  
-	public boolean coveredBy(Iterable<Area> ax) {
151  
-		int rowwidth = width();
  150
+	public boolean coveredBy(final Iterable<Area> ax) {
  151
+		final int rowwidth = width();
152 152
 		int cells = rowwidth * height();
153  
-		boolean[] c = new boolean[cells];
154  
-		for(Area a : ax) {
155  
-			for(Area p : a) {
  153
+		final boolean[] c = new boolean[cells];
  154
+		for(final Area a : ax)
  155
+			for(final Area p : a) {
156 156
 				if(!overlap(p))
157 157
 					return false;
158  
-				int i = (p.sy - sy) * rowwidth + p.sx - sx;
  158
+				final int i = (p.sy - sy) * rowwidth + p.sx - sx;
159 159
 				assert !c[i];
160 160
 				c[i] = true;
161 161
 				cells--;
162 162
 			}
163  
-		}
164 163
 		return cells == 0;
165 164
 	}
166  
-	public boolean extendedBy(Iterable<Area> ax) {
167  
-		Area ext = coverage(ax);
  165
+	public boolean extendedBy(final Iterable<Area> ax) {
  166
+		final Area ext = coverage(ax);
168 167
 		if(!ext.coveredBy(ax))
169 168
 			return false;
170  
-		return (ex == ext.sx && sy == ext.sy && ey == ext.ey)
171  
-			|| (ey == ext.sy && sx == ext.sx && ex == ext.ex);
  169
+		return ex == ext.sx && sy == ext.sy && ey == ext.ey
  170
+		|| ey == ext.sy && sx == ext.sx && ex == ext.ex;
172 171
 	}
173 172
 }
2  src/veb/Direction.java
@@ -10,7 +10,7 @@
10 10
 	private final Vector v;
11 11
 	private static final int yflip = 1;
12 12
 	private static Direction[] members = new Direction[] { north, east, south, west };
13  
-	private Direction(int x, int y) {
  13
+	private Direction(final int x, final int y) {
14 14
 		this.x = x;
15 15
 		this.y = y * yflip;
16 16
 		v = new Vector(x, y);
3  src/veb/Drawable.java
... ...
@@ -1,8 +1,7 @@
1 1
 package veb;
2 2
 
3 3
 public interface Drawable {
4  
-	Vector getSize(); 
5  
-	void draw(Surface surf, Vector origin, Vector size);
  4
+	Vector getSize();
6 5
 	Drawable merge(Drawable o);
7 6
 	boolean isEmpty();
8 7
 	@Override
10  src/veb/Elem.java
@@ -3,7 +3,7 @@
3 3
 public class Elem {
4 4
 	private final Area a;
5 5
 	private final Drawable d;
6  
-	public Elem(Area a, Drawable d) {
  6
+	public Elem(final Area a, final Drawable d) {
7 7
 		this.a = a;
8 8
 		this.d = d;
9 9
 	}
@@ -27,22 +27,22 @@ public String toString() {
27 27
 	public int hashCode() {
28 28
 		final int prime = 31;
29 29
 		int result = 1;
30  
-		result = prime * result + ((a == null) ? 0 : a.hashCode());
31  
-		result = prime * result + ((d == null) ? 0 : d.hashCode());
  30
+		result = prime * result + (a == null ? 0 : a.hashCode());
  31
+		result = prime * result + (d == null ? 0 : d.hashCode());
32 32
 		return result;
33 33
 	}
34 34
 	/* (non-Javadoc)
35 35
 	 * @see java.lang.Object#equals(java.lang.Object)
36 36
 	 */
37 37
 	@Override
38  
-	public boolean equals(Object obj) {
  38
+	public boolean equals(final Object obj) {
39 39
 		if (this == obj)
40 40
 			return true;
41 41
 		if (obj == null)
42 42
 			return false;
43 43
 		if (!(obj instanceof Elem))
44 44
 			return false;
45  
-		Elem other = (Elem) obj;
  45
+		final Elem other = (Elem) obj;
46 46
 		if (a == null) {
47 47
 			if (other.a != null)
48 48
 				return false;
98  src/veb/Grid.java
@@ -13,7 +13,7 @@
13 13
 	final private int rowwidth;
14 14
 	final private Elem[] ex;
15 15
 	final private Map<Drawable, Set<Area>> m;
16  
-	private Grid(Area a) {
  16
+	private Grid(final Area a) {
17 17
 		assert a.sx == 0 && a.sy == 0;
18 18
 		dims = a;
19 19
 		rowwidth = width();
@@ -26,91 +26,87 @@ public int width() {
26 26
 	public int height() {
27 27
 		return dims.height();
28 28
 	}
29  
-	private void setCell(int x, int y, Elem e) {
  29
+	private void setCell(final int x, final int y, final Elem e) {
30 30
 		ex[y * rowwidth + x] = e;
31  
-		Drawable d = e.getD();
  31
+		final Drawable d = e.getD();
32 32
 		if(!m.containsKey(d))
33 33
 			m.put(d, new HashSet<Area>());
34 34
 		m.get(d).add(e.getA());
35 35
 	}
36  
-	public Area getArea(int x, int y) {
  36
+	public Area getArea(final int x, final int y) {
37 37
 		return ex[y * rowwidth + x].getA();
38 38
 	}
39  
-	public Drawable getDrawable(int x, int y) {
  39
+	public Drawable getDrawable(final int x, final int y) {
40 40
 		return ex[y * rowwidth + x].getD();
41 41
 	}
42 42
 	final static private int dt = Content.DECO_THICK;
43  
-	final static private int de = Content.DECO_EXTENT;	
44  
-	private void setArea(Area a, Content c) {
45  
-		Area ai = a.inset(de);
46  
-		Elem e = new Elem(ai, c);
47  
-		for(Area p : a) {
  43
+	final static private int de = Content.DECO_EXTENT;
  44
+	private void setArea(final Area a, final Content c) {
  45
+		final Area ai = a.inset(de);
  46
+		final Elem e = new Elem(ai, c);
  47
+		for(final Area p : a)
48 48
 			if(p.overlap(ai))
49 49
 				setCell(p.sx, p.sy, e);
50 50
 			else {
51  
-				Drawable d = c.getDecoration(ai.xdist(p), ai.ydist(p));
  51
+				final Drawable d = c.getDecoration(ai.xdist(p), ai.ydist(p));
52 52
 				setCell(p.sx, p.sy, new Elem(p, d));
53 53
 			}
54  
-		}
55 54
 	}
56  
-	private void setCells(Area a, Drawable d) {
57  
-		Elem e = new Elem(a, d);
58  
-		for(Area p : a) {
  55
+	private void setCells(final Area a, final Drawable d) {
  56
+		final Elem e = new Elem(a, d);
  57
+		for(final Area p : a)
59 58
 			setCell(p.sx, p.sy, e);
60  
-		}
61 59
 	}
62  
-	private void removeArea(Area a) {
63  
-		for(Area p: a) {
64  
-			int i = p.sx + rowwidth * p.sy;
65  
-			Elem e = ex[i];
  60
+	private void removeArea(final Area a) {
  61
+		for(final Area p: a) {
  62
+			final int i = p.sx + rowwidth * p.sy;
  63
+			final Elem e = ex[i];
66 64
 			ex[i] = null;
67  
-			Drawable d = e.getD();
68  
-			Area ea = e.getA();
69  
-			Set<Area> ax = m.get(d);
  65
+			final Drawable d = e.getD();
  66
+			final Area ea = e.getA();
  67
+			final Set<Area> ax = m.get(d);
70 68
 			ax.remove(ea);
71 69
 			if(ax.isEmpty())
72 70
 				m.remove(d);
73 71
 		}
74 72
 	}
75  
-	public static Grid fromMap(Map<Content, Area> m) {
76  
-		if(m.isEmpty()) {
  73
+	public static Grid fromMap(final Map<Content, Area> m) {
  74
+		if(m.isEmpty())
77 75
 			return new Grid(new Area(0, 0, 0, 0));
78  
-		}
79  
-		Area ac = Area.coverage(m.values());
80  
-		Area dims = ac.zeroize().scale(dt);
81  
-		Grid g = new Grid(dims);
82  
-		for(Entry<Content, Area> e : m.entrySet()) {
  76
+		final Area ac = Area.coverage(m.values());
  77
+		final Area dims = ac.zeroize().scale(dt);
  78
+		final Grid g = new Grid(dims);
  79
+		for(final Entry<Content, Area> e : m.entrySet())
83 80
 			g.setArea(e.getValue().offset(-ac.sx, -ac.sy).scale(dt), e.getKey());
84  
-		}
85 81
 		return g;
86 82
 	}
  83
+	@Override
87 84
 	public Iterator<Elem> iterator() {
88  
-		ArrayList<Elem> al = new ArrayList<Elem>();
89  
-		for(Entry<Drawable, Set<Area>> da: m.entrySet()) {
90  
-			Drawable d = da.getKey();
91  
-			for(Area a : da.getValue()) {
  85
+		final ArrayList<Elem> al = new ArrayList<Elem>();
  86
+		for(final Entry<Drawable, Set<Area>> da: m.entrySet()) {
  87
+			final Drawable d = da.getKey();
  88
+			for(final Area a : da.getValue())
92 89
 				al.add(new Elem(a, d));
93  
-			}
94 90
 		}
95 91
 		return al.iterator();
96 92
 	}
97 93
 	public void mergeDecorations() {
98  
-		for(int axis = 0; axis < 2; axis++) {
99  
-			for(Entry<Drawable, Set<Area>> da: m.entrySet()) {
100  
-				Drawable d = da.getKey();
  94
+		for(int axis = 0; axis < 2; axis++)
  95
+			for(final Entry<Drawable, Set<Area>> da: m.entrySet()) {
  96
+				final Drawable d = da.getKey();
101 97
 				if(d == null || d instanceof Content)
102 98
 					continue;
103  
-				for(Area a: da.getValue()) {
  99
+				for(final Area a: da.getValue()) {
104 100
 					Area aa;
105 101
 					do {
106 102
 						aa = a.adjacent(axis);
107 103
 						if(aa.width() > 1 || aa.height() > 1)
108 104
 							break;
109  
-						Elem e = ex[aa.sy * rowwidth + aa.sx];
110  
-						Drawable dd = e.getD();
  105
+						final Elem e = ex[aa.sy * rowwidth + aa.sx];
  106
+						final Drawable dd = e.getD();
111 107
 						if(dd == null || dd.isEmpty())
112 108
 							continue;
113  
-						Drawable dm = d.merge(dd);
  109
+						final Drawable dm = d.merge(dd);
114 110
 						if(dm == null)
115 111
 							continue;
116 112
 						aa = Area.coverage(a, aa);
@@ -119,21 +115,20 @@ public void mergeDecorations() {
119 115
 					} while(aa.overlap(dims));
120 116
 				}
121 117
 			}
122  
-		}
123 118
 	}
124 119
 	public void simplify() {
125  
-		for(int axis = 0; axis < 2; axis++) {
126  
-			for(Entry<Drawable, Set<Area>> da: m.entrySet()) {
127  
-				Drawable d = da.getKey();
  120
+		for(int axis = 0; axis < 2; axis++)
  121
+			for(final Entry<Drawable, Set<Area>> da: m.entrySet()) {
  122
+				final Drawable d = da.getKey();
128 123
 				if(d == null || d instanceof Content)
129 124
 					continue;
130  
-				areaLoop: for(Area a: da.getValue()) {
  125
+				areaLoop: for(final Area a: da.getValue()) {
131 126
 					Area aa = a.adjacent(axis);
132 127
 					if(!aa.overlap(dims))
133 128
 						break;
134  
-					ArrayList<Area> al = new ArrayList<Area>();
135  
-					for(Area p: aa) {
136  
-						Elem e = ex[p.sy * rowwidth + p.sx];
  129
+					final ArrayList<Area> al = new ArrayList<Area>();
  130
+					for(final Area p: aa) {
  131
+						final Elem e = ex[p.sy * rowwidth + p.sx];
137 132
 						if(e.getD() != d)
138 133
 							continue areaLoop;
139 134
 						al.add(e.getA());
@@ -146,6 +141,5 @@ public void simplify() {
146 141
 					setCells(aa, d);
147 142
 				}
148 143
 			}
149  
-		}
150 144
 	}
151 145
 }
48  src/veb/Layout.java
@@ -7,8 +7,8 @@
7 7
 	final private Tree tree;
8 8
 	final private Surface surface;
9 9
 	private Grid grid;
10  
-	
11  
-	public Layout(Direction d, Tree gt, Surface s) {
  10
+
  11
+	public Layout(final Direction d, final Tree gt, final Surface s) {
12 12
 		tree = gt;
13 13
 		surface = s;
14 14
 	}
@@ -19,39 +19,39 @@ public Layout(Direction d, Tree gt, Surface s) {
19 19
 	 *  Collapse dmd to d where possible.
20 20
 	 */
21 21
 	public void layout() {
22  
-		Map<Content, Area> map = new HashMap<Content, Area>();
  22
+		final Map<Content, Area> map = new HashMap<Content, Area>();
23 23
 		_layout(map, tree.getRoot(), 0, 0);
24 24
 		grid = Grid.fromMap(map);
25 25
 		grid.mergeDecorations();
26  
-		grid.simplify();	
  26
+		grid.simplify();
27 27
 	}
28  
-	private int _layout(Map<Content, Area> g, Content n, int x, int y) {
29  
-		int sx = x, cx = x;
30  
-		for(Content d : tree.getChildrenOf(n)) {
  28
+	private int _layout(final Map<Content, Area> g, final Content n, final int x, final int y) {
  29
+		final int sx = x;
  30
+		int cx = x;
  31
+		for(final Content d : tree.getChildrenOf(n))
31 32
 			cx = _layout(g, d, cx, y + 1);
32  
-		}
33 33
 		if(cx == sx)
34 34
 			cx += 1;
35 35
 		g.put(n, new Area(sx, y, cx, y + 1));
36 36
 		return cx;
37 37
 	}
38 38
 	public void draw() {
39  
-		Scalar[] rows = new Scalar[grid.height() + 1];
40  
-		Scalar[] cols = new Scalar[grid.width() + 1];
41  
-		for(Elem e : grid) {
42  
-			Area a = e.getA();
43  
-			Drawable d = e.getD();
44  
-			Vector v = d.getSize();
  39
+		final Scalar[] rows = new Scalar[grid.height() + 1];
  40
+		final Scalar[] cols = new Scalar[grid.width() + 1];
  41
+		for(final Elem e : grid) {
  42
+			final Area a = e.getA();
  43
+			final Drawable d = e.getD();
  44
+			final Vector v = d.getSize();
45 45
 			if(v.x != null) {
46 46
 				int x = a.sx;
47  
-				for(Scalar s : v.x.spread(a.width())) {
  47
+				for(final Scalar s : v.x.spread(a.width())) {
48 48
 					cols[x] = s.add(cols[x]);
49 49
 					x++;
50 50
 				}
51 51
 			}
52 52
 			if(v.y != null) {
53 53
 				int y = a.sy;
54  
-				for(Scalar s : v.y.spread(a.height())) {
  54
+				for(final Scalar s : v.y.spread(a.height())) {
55 55
 					rows[y] = s.add(rows[y]);
56 56
 					y++;
57 57
 				}
@@ -59,24 +59,24 @@ public void draw() {
59 59
 		}
60 60
 		Scalar off = Scalar.inst(0L);
61 61
 		for(int i = 0; i < rows.length - 1; i++) {
62  
-			Scalar height = rows[i] == null ? Scalar.inst(0L) : rows[i];
  62
+			final Scalar height = rows[i] == null ? Scalar.inst(0L) : rows[i];
63 63
 			rows[i] = off;
64 64
 			off = off.add(height);
65 65
 		}
66 66
 		rows[rows.length - 1] = off;
67 67
 		off = Scalar.inst(0L);
68 68
 		for(int i = 0; i < cols.length - 1; i++) {
69  
-			Scalar width = cols[i] == null ? Scalar.inst(0L) : cols[i];
  69
+			final Scalar width = cols[i] == null ? Scalar.inst(0L) : cols[i];
70 70
 			cols[i] = off;
71 71
 			off = off.add(width);
72 72
 		}
73 73
 		cols[cols.length - 1] = off;
74  
-		for(Elem e : grid) {
75  
-			Area a = e.getA();
76  
-			Drawable d = e.getD();
77  
-			Vector o = new Vector(cols[a.sx], rows[a.sy]);
78  
-			Vector p = new Vector(cols[a.ex], rows[a.ey]);
79  
-			surface.draw(o, p.subtract(o), d);
  74
+		for(final Elem e : grid) {
  75
+			final Area a = e.getA();
  76
+			final Drawable d = e.getD();
  77
+			final Vector o = new Vector(cols[a.sx], rows[a.sy]);
  78
+			final Vector p = new Vector(cols[a.ex], rows[a.ey]);
  79
+			surface.draw(o, p, a, d);
80 80
 		}
81 81
 	}
82 82
 }
113  src/veb/Scalar.java
@@ -15,9 +15,9 @@
15 15
 	public long getLong() { return (long) getDouble(); }
16 16
 	public int getInt() { return (int) getDouble(); }
17 17
 	public abstract Scalar scale(int s);
18  
-	public static Scalar inst(double x) { return new ScalarDouble(x); }
19  
-	public static Scalar inst(long x) { return new ScalarLong(x); } 
20  
-	public static Scalar inst(int x) { return new ScalarInt(x); }
  18
+	public static Scalar inst(final double x) { return new ScalarDouble(x); }
  19
+	public static Scalar inst(final long x) { return new ScalarLong(x); }
  20
+	public static Scalar inst(final int x) { return new ScalarInt(x); }
21 21
 	public abstract Scalar add(Scalar other);
22 22
 	public abstract boolean isIntegral();
23 23
 	@Override
@@ -28,77 +28,76 @@
28 28
 	public String toString() {
29 29
 		return String.format("Scalar[%s]", isIntegral() ? getLong() : getDouble());
30 30
 	}
31  
-	public Iterable<Scalar> spread(int o) {
  31
+	public Iterable<Scalar> spread(final int o) {
32 32
 		if(o == 0)
33 33
 			return Collections.emptyList();
34 34
 		if(o < 0)
35 35
 			return scale(-1)._spread(-o);
36 36
 		return _spread(o);
37 37
 	}
38  
-	public Scalar divide(int divisor) {
  38
+	public Scalar divide(final int divisor) {
39 39
 		if(isIntegral())
40 40
 			return Scalar.inst(getLong() / divisor + (getLong() % divisor == 0 ? 0 : 1));
41 41
 		else
42 42
 			return Scalar.inst(getDouble() / divisor);
43 43
 	}
44  
-	public Scalar subtract(Scalar other) {
  44
+	public Scalar subtract(final Scalar other) {
45 45
 		return add(other.scale(-1));
46 46
 	}
47 47
 	protected Iterable<Scalar> _spread(final int o) {
48 48
 		assert o > 0; // Positive
49  
-		if(isIntegral()) {
  49
+		if(isIntegral())
50 50
 			return new Iterable<Scalar>() {
51  
-				@Override
52  
-				public Iterator<Scalar> iterator() {
53  
-					return new Iterator<Scalar>() {
54  
-						double d = getDouble();
55  
-						int i = 0;
56  
-						@Override
57  
-						public boolean hasNext() {
58  
-							return i < o;
59  
-						}
60  
-						@Override
61  
-						public Scalar next() {
62  
-							i++;
63  
-							return Scalar.inst(((long) d * i / o)
64  
-									- ((long) d * (i-1) / o));
65  
-						}
66  
-						@Override
67  
-						public void remove() {
68  
-							throw new AssertionError();
69  
-						}
70  
-					};
71  
-				}
72  
-			};
73  
-		} else {
  51
+			@Override
  52
+			public Iterator<Scalar> iterator() {
  53
+				return new Iterator<Scalar>() {
  54
+					double d = getDouble();
  55
+					int i = 0;
  56
+					@Override
  57
+					public boolean hasNext() {
  58
+						return i < o;
  59
+					}
  60
+					@Override
  61
+					public Scalar next() {
  62
+						i++;
  63
+						return Scalar.inst((long) d * i / o
  64
+								- (long) d * (i-1) / o);
  65
+					}
  66
+					@Override
  67
+					public void remove() {
  68
+						throw new AssertionError();
  69
+					}
  70
+				};
  71
+			}
  72
+		};
  73
+		else
74 74
 			return new Iterable<Scalar>() {
75  
-				@Override
76  
-				public Iterator<Scalar> iterator() {
77  
-					return new Iterator<Scalar>() {
78  
-						double d = getDouble();
79  
-						Scalar step = Scalar.inst(getDouble() / o);
80  
-						@Override
81  
-						public boolean hasNext() {
82  
-							return d >= 0.0d;
83  
-						}
84  
-						@Override
85  
-						public Scalar next() {
86  
-							if(d > step.getDouble()) {
87  
-								d -= step.getDouble();
88  
-								return step;
89  
-							} else {
90  
-								Scalar last = Scalar.inst(d);
91  
-								d = 0.0d;
92  
-								return last;
93  
-							}
94  
-						}
95  
-						@Override
96  
-						public void remove() {
97  
-							throw new AssertionError();
  75
+			@Override
  76
+			public Iterator<Scalar> iterator() {
  77
+				return new Iterator<Scalar>() {
  78
+					double d = getDouble();
  79
+					Scalar step = Scalar.inst(getDouble() / o);
  80
+					@Override
  81
+					public boolean hasNext() {
  82
+						return d >= 0.0d;
  83
+					}
  84
+					@Override
  85
+					public Scalar next() {
  86
+						if(d > step.getDouble()) {
  87
+							d -= step.getDouble();
  88
+							return step;
  89
+						} else {
  90
+							final Scalar last = Scalar.inst(d);
  91
+							d = 0.0d;
  92
+							return last;
98 93
 						}
99  
-					};
100  
-				}
101  
-			};
102  
-		}
  94
+					}
  95
+					@Override
  96
+					public void remove() {
  97
+						throw new AssertionError();
  98
+					}
  99
+				};
  100
+			}
  101
+		};
103 102
 	}
104 103
 }
12  src/veb/ScalarDouble.java
@@ -9,13 +9,13 @@
9 9
  */
10 10
 public final class ScalarDouble extends Scalar {
11 11
 	final double val;
12  
-	public ScalarDouble(double x) { val = x; }
  12
+	public ScalarDouble(final double x) { val = x; }
13 13
 	@Override
14 14
 	public double getDouble() {
15 15
 		return val;
16 16
 	}
17 17
 	@Override
18  
-	public Scalar scale(int s) {
  18
+	public Scalar scale(final int s) {
19 19
 		return new ScalarDouble(val * s);
20 20
 	}
21 21
 	@Override
@@ -24,7 +24,7 @@ public boolean isIntegral() {
24 24
 		return false;
25 25
 	}
26 26
 	@Override
27  
-	public Scalar add(Scalar other) {
  27
+	public Scalar add(final Scalar other) {
28 28
 		return new ScalarDouble(val + other.getDouble());
29 29
 	}
30 30
 	/* (non-Javadoc)
@@ -36,21 +36,21 @@ public int hashCode() {
36 36
 		int result = 1;
37 37
 		long temp;
38 38
 		temp = Double.doubleToLongBits(val);
39  
-		result = prime * result + (int) (temp ^ (temp >>> 32));
  39
+		result = prime * result + (int) (temp ^ temp >>> 32);
40 40
 		return result;
41 41
 	}
42 42
 	/* (non-Javadoc)
43 43
 	 * @see java.lang.Object#equals(java.lang.Object)
44 44
 	 */
45 45
 	@Override
46  
-	public boolean equals(Object obj) {
  46
+	public boolean equals(final Object obj) {
47 47
 		if (this == obj)
48 48
 			return true;
49 49
 		if (obj == null)
50 50
 			return false;
51 51
 		if (!(obj instanceof ScalarDouble))
52 52
 			return false;
53  
-		ScalarDouble other = (ScalarDouble) obj;
  53
+		final ScalarDouble other = (ScalarDouble) obj;
54 54
 		if (Double.doubleToLongBits(val) != Double.doubleToLongBits(other.val))
55 55
 			return false;
56 56
 		return true;
12  src/veb/ScalarInt.java
@@ -2,12 +2,12 @@
2 2
 
3 3
 public final class ScalarInt extends Scalar {
4 4
 	private final int val;
5  
-	public ScalarInt(int x) {
  5
+	public ScalarInt(final int x) {
6 6
 		val = x;
7 7
 	}
8 8
 	@Override
9 9
 	public double getDouble() {
10  
-		return (double) val;
  10
+		return val;
11 11
 	}
12 12
 	@Override
13 13
 	public long getLong() {
@@ -18,11 +18,11 @@ public int getInt() {
18 18
 		return val;
19 19
 	}
20 20
 	@Override
21  
-	public Scalar scale(int s) {
  21
+	public Scalar scale(final int s) {
22 22
 		return new ScalarInt(val * s);
23 23
 	}
24 24
 	@Override
25  
-	public Scalar add(Scalar other) {
  25
+	public Scalar add(final Scalar other) {
26 26
 		if(other == null)
27 27
 			return this;
28 28
 		if(other instanceof ScalarInt)
@@ -47,14 +47,14 @@ public int hashCode() {
47 47
 	 * @see java.lang.Object#equals(java.lang.Object)
48 48
 	 */
49 49
 	@Override
50  
-	public boolean equals(Object obj) {
  50
+	public boolean equals(final Object obj) {
51 51
 		if (this == obj)
52 52
 			return true;
53 53
 		if (obj == null)
54 54
 			return false;
55 55
 		if (!(obj instanceof ScalarInt))
56 56
 			return false;
57  
-		ScalarInt other = (ScalarInt) obj;
  57
+		final ScalarInt other = (ScalarInt) obj;
58 58
 		if (val != other.val)
59 59
 			return false;
60 60
 		return true;
14  src/veb/ScalarLong.java
@@ -9,20 +9,20 @@
9 9
  */
10 10
 public final class ScalarLong extends Scalar {
11 11
 	private final long val;
12  
-	public ScalarLong(long x) {
  12
+	public ScalarLong(final long x) {
13 13
 		val = x;
14 14
 	}
15 15
 	@Override
16 16
 	public double getDouble() {
17 17
 		// TODO Auto-generated method stub
18  
-		return (double) val;
  18
+		return val;
19 19
 	}
20 20
 	@Override
21 21
 	public long getLong() {
22 22
 		return val;
23 23
 	}
24 24
 	@Override
25  
-	public Scalar scale(int s) {
  25
+	public Scalar scale(final int s) {
26 26
 		return new ScalarLong(val * s);
27 27
 	}
28 28
 	@Override
@@ -31,7 +31,7 @@ public boolean isIntegral() {
31 31
 		return true;
32 32
 	}
33 33
 	@Override
34  
-	public Scalar add(Scalar other) {
  34
+	public Scalar add(final Scalar other) {
35 35
 		if(other == null)
36 36
 			return this;
37 37
 		if(!other.isIntegral())
@@ -45,21 +45,21 @@ public Scalar add(Scalar other) {
45 45
 	public int hashCode() {
46 46
 		final int prime = 31;
47 47
 		int result = 1;
48  
-		result = prime * result + (int) (val ^ (val >>> 32));
  48
+		result = prime * result + (int) (val ^ val >>> 32);
49 49
 		return result;
50 50
 	}
51 51
 	/* (non-Javadoc)
52 52
 	 * @see java.lang.Object#equals(java.lang.Object)
53 53
 	 */
54 54
 	@Override
55  
-	public boolean equals(Object obj) {
  55
+	public boolean equals(final Object obj) {
56 56
 		if (this == obj)
57 57
 			return true;
58 58
 		if (obj == null)
59 59
 			return false;
60 60
 		if (!(obj instanceof ScalarLong))
61 61
 			return false;
62  
-		ScalarLong other = (ScalarLong) obj;
  62
+		final ScalarLong other = (ScalarLong) obj;
63 63
 		if (val != other.val)
64 64
 			return false;
65 65
 		return true;
2  src/veb/Surface.java
@@ -8,5 +8,5 @@
8 8
  *
9 9
  */
10 10
 public interface Surface {
11  
-	void draw(Vector o, Vector s, Drawable dec);
  11
+	void draw(Vector origin, Vector size, Area where, Drawable dec);
12 12
 }
24  src/veb/Vector.java
@@ -3,29 +3,29 @@
3 3
 public final class Vector {
4 4
 	public final Scalar x;
5 5
 	public final Scalar y;
6  
-	public Vector(Scalar x, Scalar y) {
  6
+	public Vector(final Scalar x, final Scalar y) {
7 7
 		this.x = x;
8 8
 		this.y = y;
9 9
 	}
10  
-	public Vector(double x, double y) {
  10
+	public Vector(final double x, final double y) {
11 11
 		this.x = Scalar.inst(x);
12 12
 		this.y = Scalar.inst(y);
13 13
 	}
14  
-	public Vector(long x, long y) {
  14
+	public Vector(final long x, final long y) {
15 15
 		this.x = Scalar.inst(x);
16 16
 		this.y = Scalar.inst(y);
17 17
 	}
18  
-	public Vector(int x, int y) {
  18
+	public Vector(final int x, final int y) {
19 19
 		this.x = Scalar.inst(x);
20 20
 		this.y = Scalar.inst(y);
21 21
 	}
22  
-	public Vector add(Vector o) {
  22
+	public Vector add(final Vector o) {
23 23
 		return new Vector(x.add(o.x), y.add(o.y));
24 24
 	}
25  
-	public Vector subtract(Vector o) {
  25
+	public Vector subtract(final Vector o) {
26 26
 		return new Vector(x.subtract(o.x), y.subtract(o.y));
27 27
 	}
28  
-	public Vector scale(int s) {
  28
+	public Vector scale(final int s) {
29 29
 		return new Vector(x.scale(s), y.scale(s));
30 30
 	}
31 31
 	public Vector rotatecw() {
@@ -34,7 +34,7 @@ public Vector rotatecw() {
34 34
 	public Vector rotateccw() {
35 35
 		return new Vector(y, x.scale(-1));
36 36
 	}
37  
-	public Scalar getAxis(int a) {
  37
+	public Scalar getAxis(final int a) {
38 38
 		if(a == 0)
39 39
 			return x;
40 40
 		else if(a == 1)
@@ -49,22 +49,22 @@ else if(a == 1)
49 49
 	public int hashCode() {
50 50
 		final int prime = 31;
51 51
 		int result = 1;
52  
-		result = prime * result + ((x == null) ? 0 : x.hashCode());
53  
-		result = prime * result + ((y == null) ? 0 : y.hashCode());
  52
+		result = prime * result + (x == null ? 0 : x.hashCode());
  53
+		result = prime * result + (y == null ? 0 : y.hashCode());
54 54
 		return result;
55 55
 	}
56 56
 	/* (non-Javadoc)
57 57
 	 * @see java.lang.Object#equals(java.lang.Object)
58 58
 	 */
59 59
 	@Override
60  
-	public boolean equals(Object obj) {
  60
+	public boolean equals(final Object obj) {
61 61
 		if (this == obj)
62 62
 			return true;
63 63
 		if (obj == null)
64 64
 			return false;
65 65
 		if (!(obj instanceof Vector))
66 66
 			return false;
67  
-		Vector other = (Vector) obj;
  67
+		final Vector other = (Vector) obj;
68 68
 		if (x == null) {
69 69
 			if (other.x != null)
70 70
 				return false;
91  src/veb/swing/CompoundPath.java
@@ -12,7 +12,7 @@
12 12
     but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14 14
     Public License for more details.
15  
-    
  15
+
16 16
     You should have received a copy of the GNU General Public License along
17 17
     with VisualExpressionBuilder, in the file COPYING in the root directory of
18 18
     the distribution. If not, see <http://www.gnu.org/licenses/>.
@@ -29,46 +29,51 @@
29 29
  * PathIterator contract doesn't say anything about that.
30 30
  */
31 31
 public class CompoundPath implements PathIterator {
32  
-    private Iterator<? extends PathIterator> pii;
33  
-    PathIterator pi;
34  
-    public CompoundPath(Iterable<? extends PathIterator> pathCollection) {
35  
-	pii = pathCollection.iterator();
36  
-	pi = null;
37  
-    }
38  
-    public int currentSegment(double[] coords) {
39  
-	updatePi();
40  
-	if(pi == null)
41  
-	    return -1; // invalid segment type
42  
-	return pi.currentSegment(coords);
43  
-    }
44  
-    public int currentSegment(float[] coords) {
45  
-	updatePi();
46  
-	if(pi == null)
47  
-	    return -1; // ditto
48  
-	return pi.currentSegment(coords);
49  
-    }
50  
-    public int getWindingRule() {
51  
-	updatePi();
52  
-	if(pi == null)
53  
-	    return -1; // invalid winding rule
54  
-	return pi.getWindingRule();
55  
-    }
56  
-    public boolean isDone() {
57  
-	updatePi();
58  
-	return pi != null;
59  
-    }
60  
-    public void next() {
61  
-	updatePi();
62  
-	pi.next();
63  
-	if(pi.isDone())
64  
-	    pi = null;
65  
-    }
66  
-    private void updatePi() {
67  
-	if(pi == null)
68  
-	    while(pii.hasNext()) {
69  
-		pi = pii.next();
70  
-		if(!pi.isDone())
71  
-		    return;
72  
-	    }
73  
-    }
  32
+	private final Iterator<? extends PathIterator> pii;
  33
+	PathIterator pi;
  34
+	public CompoundPath(final Iterable<? extends PathIterator> pathCollection) {
  35
+		pii = pathCollection.iterator();
  36
+		pi = null;
  37
+	}
  38
+	@Override
  39
+	public int currentSegment(final double[] coords) {
  40
+		updatePi();
  41
+		if(pi == null)
  42
+			return -1; // invalid segment type
  43
+		return pi.currentSegment(coords);
  44
+	}
  45
+	@Override
  46
+	public int currentSegment(final float[] coords) {
  47
+		updatePi();
  48