public class NScreenSimpleRenderer implements INScreenDrawRenderer {
private static int X_MARGIN = 10;
+ private static int IMAGE_MARGIN = 50;
@Override
public void draw(GC gc, Canvas canvas, int state, boolean isSelected, boolean isEnabled,
// int targetY = (canvas.getClientArea().height - IMAGE_SIZE) / 2;
Rectangle rect = canvas.getClientArea();
NScreenType type = model.getType();
- if (type == NScreenType.COMMON || type == NScreenType.ORIENTATION
- || type == NScreenType.PIXELRATIO) {
+// if (type == NScreenType.COMMON || type == NScreenType.ORIENTATION
+// || type == NScreenType.PIXELRATIO) {
gc.setFont(getGroupFont(model));
String content = model.getName();
Point textWH = FontUtil.getTextArea(content, gc);
- int x = rect.x + (rect.width - textWH.x) / 2;
+// int x = rect.x + (rect.width - textWH.x) / 2;
+ int x = rect.x + IMAGE_MARGIN;
int y = rect.y + (rect.height - textWH.y) / 2;
gc.drawText(content, x, y, true);
- } else if (type == NScreenType.RESOLUTION) {
- gc.setFont(getGroupFont(model));
- String content1 = model.getName();
- // String content2 =
- // NScreenUtil.getResolutionText(model.getDeviceWidth(), model.getDeviceHeight(),
- // false)
- // + " "
- // + NScreenUtil.getRatioText(model.getDeviceWidth(),
- // model.getDeviceHeight(), true);
- Point content1WH = FontUtil.getTextArea(content1, gc);
- // Point content2WH = FontUtil.getTextArea(content2, gc);
- int x1 = rect.x + (rect.width - content1WH.x) / 2;
- // int x2 = rect.x + (rect.width - content2WH.x) / 2;
- // int y1 = rect.y + (rect.height - content1WH.y - content2WH.y) / 2;
- int y1 = rect.y + (rect.height - content1WH.y) / 2;
- // int y2 = y1 + content1WH.y;
- gc.drawText(content1, x1, y1, true);
- // gc.drawText(content2, x2, y2, true);
- } else {
-
- }
+// } else if (type == NScreenType.RESOLUTION) {
+// gc.setFont(getGroupFont(model));
+// String content1 = model.getName();
+// // String content2 =
+// // NScreenUtil.getResolutionText(model.getDeviceWidth(), model.getDeviceHeight(),
+// // false)
+// // + " "
+// // + NScreenUtil.getRatioText(model.getDeviceWidth(),
+// // model.getDeviceHeight(), true);
+// Point content1WH = FontUtil.getTextArea(content1, gc);
+// // Point content2WH = FontUtil.getTextArea(content2, gc);
+// int x1 = rect.x + (rect.width - content1WH.x) / 2;
+// // int x2 = rect.x + (rect.width - content2WH.x) / 2;
+// // int y1 = rect.y + (rect.height - content1WH.y - content2WH.y) / 2;
+// int y1 = rect.y + (rect.height - content1WH.y) / 2;
+// // int y2 = y1 + content1WH.y;
+// gc.drawText(content1, x1, y1, true);
+// // gc.drawText(content2, x2, y2, true);
+// } else {
+//
+// }
}
}