|
|
|
@ -58,10 +58,16 @@ import java.util.Set;
|
|
|
|
|
import static com.fine.theme.utils.FineUIScale.scale; |
|
|
|
|
|
|
|
|
|
public class UICalendarPanel extends JPanel { |
|
|
|
|
private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12); |
|
|
|
|
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, 12); |
|
|
|
|
private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(scale(12)); |
|
|
|
|
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, scale(12)); |
|
|
|
|
private static final int WEEKDAY_COUNT = 7; |
|
|
|
|
private static final int TOTAL_DAYS_COUNT = 42; |
|
|
|
|
|
|
|
|
|
private static final int WIDTH = scale(31); |
|
|
|
|
private static final int HEIGHT = scale(19); |
|
|
|
|
private static final int START_X = scale(30); |
|
|
|
|
private static final int START_Y = scale(19); |
|
|
|
|
|
|
|
|
|
//卡顿日志所在地址
|
|
|
|
|
private static final String JOURNAL_FILE_PATH = StableUtils.pathJoin(ProductConstantsBase.getEnvHome(), "journal_log"); |
|
|
|
|
protected Color selectedBackground; |
|
|
|
@ -432,7 +438,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
gp.setBorder(null); |
|
|
|
|
UIDayLabel label = new UIDayLabel(setupCalendar.getTime()); |
|
|
|
|
label.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 9)); |
|
|
|
|
label.setBorder(new ScaledEmptyBorder(0, 0, 0, 9)); |
|
|
|
|
if ("1".equals(label.getText())) { |
|
|
|
|
isCurrentMonth = !isCurrentMonth; |
|
|
|
|
} |
|
|
|
@ -655,12 +661,12 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
|
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|
super.paint(g); |
|
|
|
|
int width = 31; |
|
|
|
|
int height = 19; |
|
|
|
|
int width = UICalendarPanel.WIDTH; |
|
|
|
|
int height = UICalendarPanel.HEIGHT; |
|
|
|
|
Color oldColor = g.getColor(); |
|
|
|
|
g.setColor(new Color(0xDADADA)); |
|
|
|
|
int start_x = 30; |
|
|
|
|
int start_y = 19; |
|
|
|
|
int start_x = UICalendarPanel.START_X; |
|
|
|
|
int start_y = UICalendarPanel.START_Y; |
|
|
|
|
for (int i = 0; i < 6; i++) { |
|
|
|
|
g.drawLine(start_x, 0, start_x, getHeight()); |
|
|
|
|
start_x += width; |
|
|
|
@ -683,19 +689,19 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
|
|
|
|
|
private void paintChindPane(Graphics g, int index) { |
|
|
|
|
if (index % 7 == 0) { |
|
|
|
|
int y1 = index / 7 * 19; |
|
|
|
|
g.drawLine(0, y1, 30, y1); |
|
|
|
|
g.drawLine(0, y1 + 19, 30, y1 + 19); |
|
|
|
|
g.drawLine(30, y1, 30, y1 + 19); |
|
|
|
|
int y1 = index / 7 * UICalendarPanel.HEIGHT; |
|
|
|
|
g.drawLine(0, y1, UICalendarPanel.START_X, y1); |
|
|
|
|
g.drawLine(0, y1 + UICalendarPanel.HEIGHT, UICalendarPanel.START_X, y1 + UICalendarPanel.HEIGHT); |
|
|
|
|
g.drawLine(UICalendarPanel.START_X, y1, UICalendarPanel.START_X, y1 + UICalendarPanel.HEIGHT); |
|
|
|
|
} else if (index % 7 == 6) { |
|
|
|
|
int y1 = index / 7 * 19; |
|
|
|
|
g.drawLine(185, y1, 216, y1); |
|
|
|
|
g.drawLine(185, y1 + 19, 216, y1 + 19); |
|
|
|
|
g.drawLine(185, y1, 185, y1 + 19); |
|
|
|
|
int y1 = index / 7 * UICalendarPanel.HEIGHT; |
|
|
|
|
g.drawLine(scale(185), y1, scale(216), y1); |
|
|
|
|
g.drawLine(scale(185), y1 + UICalendarPanel.HEIGHT, scale(216), y1 + UICalendarPanel.HEIGHT); |
|
|
|
|
g.drawLine(scale(185), y1, scale(185), y1 + UICalendarPanel.HEIGHT); |
|
|
|
|
} else { |
|
|
|
|
int x1 = index % 7 * 31 - 1; |
|
|
|
|
int y1 = index / 7 * 19; |
|
|
|
|
g.drawRect(x1, y1, 31, 19); |
|
|
|
|
int x1 = index % 7 * UICalendarPanel.WIDTH - 1; |
|
|
|
|
int y1 = index / 7 * UICalendarPanel.HEIGHT; |
|
|
|
|
g.drawRect(x1, y1, UICalendarPanel.WIDTH, UICalendarPanel.HEIGHT); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -833,7 +839,7 @@ public class UICalendarPanel extends JPanel {
|
|
|
|
|
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); |
|
|
|
|
uiLabel.setBackground(null); |
|
|
|
|
uiLabel.setBorder(null); |
|
|
|
|
uiLabel.setPreferredSize(new Dimension(6, 10)); |
|
|
|
|
uiLabel.setPreferredSize(scale(new Dimension(6, 10))); |
|
|
|
|
return uiLabel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|