private void layoutBullet(GC gc, Locator loc, int lineHeight, Hashtable<String, Object> resourceTable) { int x = loc.x - getIndent() + getBulletIndent(); int rowHeight = loc.heights.get(0)[0]; if (style == CIRCLE) { int y = loc.y + rowHeight / 2 - CIRCLE_DIAM / 2; bbounds = new Rectangle(x, y, CIRCLE_DIAM, CIRCLE_DIAM); } else if (style == TEXT && text != null) { //int height = gc.getFontMetrics().getHeight(); Point textSize = gc.textExtent(text); bbounds = new Rectangle(x, loc.y, textSize.x, textSize.y); } else if (style == IMAGE && text != null) { Image image = (Image) resourceTable.get(text); if (image != null) { Rectangle ibounds = image.getBounds(); int y = loc.y + rowHeight / 2 - ibounds.height / 2; bbounds = new Rectangle(x, y, ibounds.width, ibounds.height); } } }
private void layoutBullet(GC gc, Locator loc, int lineHeight, Hashtable<String, Object> resourceTable) { int x = loc.x - getIndent() + getBulletIndent(); int rowHeight = loc.heights.get(0)[0]; if (style == CIRCLE) { int y = loc.y + rowHeight / 2 - CIRCLE_DIAM / 2; bbounds = new Rectangle(x, y, CIRCLE_DIAM, CIRCLE_DIAM); } else if (style == TEXT && text != null) { //int height = gc.getFontMetrics().getHeight(); Point textSize = gc.textExtent(text); bbounds = new Rectangle(x, loc.y, textSize.x, textSize.y); } else if (style == IMAGE && text != null) { Image image = (Image) resourceTable.get(text); if (image != null) { Rectangle ibounds = image.getBounds(); int y = loc.y + rowHeight / 2 - ibounds.height / 2; bbounds = new Rectangle(x, y, ibounds.width, ibounds.height); } } }