|
|
@ -61,6 +61,8 @@ public class XCardSwitchButton extends XButton { |
|
|
|
|
|
|
|
|
|
|
|
private static final int MIN_SIZE = 1; |
|
|
|
private static final int MIN_SIZE = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int HALF_NUMBER = 2; |
|
|
|
|
|
|
|
|
|
|
|
// 删除按钮识别区域偏移量
|
|
|
|
// 删除按钮识别区域偏移量
|
|
|
|
private static final int CLOSE_ICON_RIGHT_OFFSET = 15; |
|
|
|
private static final int CLOSE_ICON_RIGHT_OFFSET = 15; |
|
|
|
private static final int CLOSE_ICON_TOP_OFFSET = 15; |
|
|
|
private static final int CLOSE_ICON_TOP_OFFSET = 15; |
|
|
@ -455,7 +457,8 @@ public class XCardSwitchButton extends XButton { |
|
|
|
StringBuilder titleStringBuf = new StringBuilder(); |
|
|
|
StringBuilder titleStringBuf = new StringBuilder(); |
|
|
|
TitlePacker title = getWidgetTitle(); |
|
|
|
TitlePacker title = getWidgetTitle(); |
|
|
|
FRFont font = title.getFrFont(); |
|
|
|
FRFont font = title.getFrFont(); |
|
|
|
FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), font.getSize() + FONT_SIZE_ADJUST); |
|
|
|
int fontSize = font.getSize() + FONT_SIZE_ADJUST; |
|
|
|
|
|
|
|
FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), fontSize); |
|
|
|
FontMetrics fm = GraphHelper.getFontMetrics(newFont); |
|
|
|
FontMetrics fm = GraphHelper.getFontMetrics(newFont); |
|
|
|
for (int i = 0; i < titleText.length(); i++) { |
|
|
|
for (int i = 0; i < titleText.length(); i++) { |
|
|
|
titleStringBuf.append(titleText.charAt(i)); |
|
|
|
titleStringBuf.append(titleText.charAt(i)); |
|
|
@ -469,12 +472,13 @@ public class XCardSwitchButton extends XButton { |
|
|
|
for (int i = 0; i < verticalTextList.size(); i++) { |
|
|
|
for (int i = 0; i < verticalTextList.size(); i++) { |
|
|
|
String paint_str = (String) verticalTextList.get(i); |
|
|
|
String paint_str = (String) verticalTextList.get(i); |
|
|
|
|
|
|
|
|
|
|
|
GraphHelper.drawString(g2d, paint_str, (width - fm.stringWidth(paint_str)) / 2, textY); |
|
|
|
GraphHelper.drawString(g2d, paint_str, |
|
|
|
|
|
|
|
(width - fm.stringWidth(paint_str)) / (HALF_NUMBER * 1.0D), textY); |
|
|
|
textY += textHeight; |
|
|
|
textY += textHeight; |
|
|
|
textY += PT.pt2pix(0, RESLUTION); |
|
|
|
textY += PT.pt2pix(0, RESLUTION); |
|
|
|
if (textY > height - textHeight && i < verticalTextList.size() - 1) { |
|
|
|
if (textY > height - textHeight && i < verticalTextList.size() - 1) { |
|
|
|
textY -= DOTS_HEIGHT; |
|
|
|
textY -= DOTS_HEIGHT; |
|
|
|
paintDots(g2d, textY, (width - fm.stringWidth(paint_str)) / 2); |
|
|
|
paintDots(g2d, textY, (width - fm.stringWidth(paint_str)) / HALF_NUMBER); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|