|
Lines 15-20
Link Here
|
| 15 |
import java.util.Hashtable; |
15 |
import java.util.Hashtable; |
| 16 |
import java.util.Vector; |
16 |
import java.util.Vector; |
| 17 |
|
17 |
|
|
|
18 |
import org.eclipse.jface.util.Geometry; |
| 18 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.SWT; |
| 19 |
import org.eclipse.swt.graphics.Color; |
20 |
import org.eclipse.swt.graphics.Color; |
| 20 |
import org.eclipse.swt.graphics.Font; |
21 |
import org.eclipse.swt.graphics.Font; |
|
Lines 206-225
Link Here
|
| 206 |
} |
207 |
} |
| 207 |
|
208 |
|
| 208 |
public Rectangle getBounds() { |
209 |
public Rectangle getBounds() { |
| 209 |
int x = 0, y = 0; |
210 |
if (areaRectangles.size() == 0) |
| 210 |
int width = 0, height = 0; |
211 |
return new Rectangle(0, 0, 0, 0); |
| 211 |
|
212 |
|
| 212 |
for (int i = 0; i < areaRectangles.size(); i++) { |
213 |
AreaRectangle ar0 = (AreaRectangle) areaRectangles.get(0); |
|
|
214 |
Rectangle bounds = Geometry.copy(ar0.rect); |
| 215 |
for (int i = 1; i < areaRectangles.size(); i++) { |
| 213 |
AreaRectangle ar = (AreaRectangle) areaRectangles.get(i); |
216 |
AreaRectangle ar = (AreaRectangle) areaRectangles.get(i); |
| 214 |
if (i == 0) { |
217 |
bounds.add(ar.rect); |
| 215 |
x = ar.rect.x; |
|
|
| 216 |
y = ar.rect.y; |
| 217 |
} else |
| 218 |
x = Math.min(ar.rect.x, x); |
| 219 |
width = Math.max(ar.rect.width, width); |
| 220 |
height += ar.rect.height; |
| 221 |
} |
218 |
} |
| 222 |
return new Rectangle(x, y, width, height); |
219 |
return bounds; |
| 223 |
} |
220 |
} |
| 224 |
|
221 |
|
| 225 |
public boolean advanceLocator(GC gc, int wHint, Locator locator, |
222 |
public boolean advanceLocator(GC gc, int wHint, Locator locator, |