public class DAChartBoardItemCell extends Composite {
private final static int DEFAULT_FOLD_TOGGLE_BUTTON_SIZE = 10;
private final static int DEFAULT_EXPAND_TOGGLE_BUTTON_SIZE = 16;
- private final static int DEFAULT_TOGGLE_BUTTON_MARGIN = 4;
+ private final static int DEFAULT_TOGGLE_BUTTON_MARGIN = 1;
private final static int DEFAULT_TOGGLE_BUTTON_TOP_MARGIN = 3;
private final static int DEFAULT_TOGGLE_BUTTON_RIGHT_MARGIN = 2;
private final static int DEFAULT_FOLD_TOGGLE_BUTTON_MARGIN = 23;
Rectangle rect = ((Canvas) (e.widget)).getClientArea();
drawNameCellBackGround(e.gc, rect);
int startY = rect.height / 2;
- if (rect.height > NAME_CELL_IMAGE_NAME_MARGIN) {
- //drawNameImage(e.gc, itemIcon, rect, NAME_ICON_X, NAME_ICON_Y);
- e.gc.drawImage(itemIcon, NAME_ICON_X, (rect.height / 2) - 18);
+ if (rect.height > NAME_CELL_IMAGE_NAME_MARGIN && itemIcon != null) {
+ e.gc.drawImage(itemIcon, NAME_ICON_X, (rect.height / 2) - 19);
startY = NAME_ICON_Y + NAME_CELL_IMAGE_NAME_MARGIN;
}
- if (itemIcon == null) {
- Point allNamep = e.gc.textExtent(itemName, SWT.DRAW_DELIMITER);
- startY = rect.height / 2 - allNamep.y / 2 + NAME_CELL_DEFAULT_MARGIN;
- }
+
e.gc.setForeground(ColorResources.BLACK);
e.gc.setFont(parent.getNameFont());
- //drawText(e.gc, itemName, rect, rect.height / 2 - NAME_CELL_DEFAULT_MARGIN);
- e.gc.drawText(itemName, 49, rect.height / 2 - NAME_CELL_DEFAULT_MARGIN, true);
+
+ if (itemIcon == null) {
+ drawText(e.gc, itemName, rect, rect.height / 2 - 20);
+ }
+ else {
+ e.gc.drawText(itemName, 49, rect.height / 2 - NAME_CELL_DEFAULT_MARGIN, true);
+ }
+
}
});
nameCell.addPaintListener(nameCellPaintListener);
FormData data = new FormData();
if (hasAdditionalInfo == false) {
- data.top = new FormAttachment(50,
- -(DEFAULT_FOLD_TOGGLE_BUTTON_SIZE / 2));
+ data.top = new FormAttachment(100, -DEFAULT_FOLD_TOGGLE_BUTTON_SIZE);
} else {
data.top = new FormAttachment(0, DEFAULT_FOLD_TOGGLE_BUTTON_MARGIN);
}
String[] temp = text.split("\n");
int lineLength = temp.length;
Point[] p = new Point[lineLength];
- int middleX = rect.width / 2;
+ int middleX = (rect.width / 2) - 5;
for (int i = 0; i < lineLength; i++) {
p[i] = gc.textExtent(temp[i]);