Browse Source

bug fix

master
XiaXiang 8 years ago
parent
commit
06af382b35
  1. 39
      designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java

39
designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java

@ -15,17 +15,27 @@ import java.awt.event.MouseEvent;
* Created by XiaXiang on 2017/5/26. * Created by XiaXiang on 2017/5/26.
*/ */
public class RemindPane extends JPanel { public class RemindPane extends JPanel {
public static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 12);
public static final Font LARGE_FONT = new Font("Song_TypeFace", 0, 18);
private UIButton openButton; private UIButton openButton;
private JPanel backgroundPane; private JPanel backgroundPane;
private UILabel backgroundLabel; private UILabel noRemindLabel;
private UILabel checkLabel; private UILabel checkLabel;
private Icon checkIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/check.png"); private Icon checkIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/check.png");
private Icon unCheckIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/uncheck.png"); private Icon unCheckIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/uncheck.png");
private Icon closeIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind_close.png"); private Icon closeIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind_close.png");
private Icon labelIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind.png"); private Icon labelIcon = IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/remind.png");
private Icon openIcon = IOUtils.readIcon("com/fr/design/mainframe/alphafine/images/open.png"); private Icon openIcon = IOUtils.readIcon("com/fr/design/mainframe/alphafine/images/open.png");
private static final int WIDTH = 600;
private static final int HEIGHT = 400;
private static final int CLOSE = 30;
private static final Rectangle OPEN = new Rectangle(30, 300, 150, 40);
private static final Rectangle REMIND = new Rectangle(95, 350, 100, 20);
private static final Rectangle CHECK = new Rectangle(70, 350, 20, 20);
public static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 12);
public static final Font LARGE_FONT = new Font("Song_TypeFace", 0, 18);
public JComponent closeButton = new JComponent() { public JComponent closeButton = new JComponent() {
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
closeIcon.paintIcon(this, g, 0, 0); closeIcon.paintIcon(this, g, 0, 0);
@ -33,11 +43,16 @@ public class RemindPane extends JPanel {
}; };
public RemindPane(AlphafineConfigManager manager, UIDialog remindDialog) { public RemindPane(AlphafineConfigManager manager, UIDialog remindDialog) {
this.setPreferredSize(new Dimension(600, 400)); this.setPreferredSize(new Dimension(WIDTH, HEIGHT));
initUI(manager, remindDialog); initUI(manager, remindDialog);
this.setLayout(getAbsoluteLayout()); this.setLayout(getAbsoluteLayout());
} }
/**
* 初始化面板
* @param manager
* @param dialog
*/
private void initUI(final AlphafineConfigManager manager, final UIDialog dialog) { private void initUI(final AlphafineConfigManager manager, final UIDialog dialog) {
openButton = new UIButton(); openButton = new UIButton();
@ -52,9 +67,9 @@ public class RemindPane extends JPanel {
} }
}); });
backgroundLabel = new UILabel(Inter.getLocText("FR-Designer-Alphafine_No_Remind")); noRemindLabel = new UILabel(Inter.getLocText("FR-Designer-Alphafine_No_Remind"));
backgroundLabel.setFont(MEDIUM_FONT); noRemindLabel.setFont(MEDIUM_FONT);
backgroundLabel.setForeground(Color.white); noRemindLabel.setForeground(Color.white);
checkLabel = new UILabel(); checkLabel = new UILabel();
checkLabel.setIcon(unCheckIcon); checkLabel.setIcon(unCheckIcon);
checkLabel.addMouseListener(new MouseAdapter() { checkLabel.addMouseListener(new MouseAdapter() {
@ -86,7 +101,7 @@ public class RemindPane extends JPanel {
add(closeButton, 0); add(closeButton, 0);
add(checkLabel, 1); add(checkLabel, 1);
add(openButton, 2); add(openButton, 2);
add(backgroundLabel, 3); add(noRemindLabel, 3);
add(backgroundPane, 4); add(backgroundPane, 4);
} }
@ -115,10 +130,10 @@ public class RemindPane extends JPanel {
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
int width = parent.getWidth(); int width = parent.getWidth();
int height = parent.getHeight(); int height = parent.getHeight();
closeButton.setBounds((width - 30), 0, 30, 30); closeButton.setBounds((width - CLOSE), 0, CLOSE, CLOSE);
openButton.setBounds(30, 300, 150, 40); openButton.setBounds(OPEN);
backgroundLabel.setBounds(95, 350, 100, 20); noRemindLabel.setBounds(REMIND);
checkLabel.setBounds(70, 350, 20, 20); checkLabel.setBounds(CHECK);
backgroundPane.setBounds(0, 0, width, height); backgroundPane.setBounds(0, 0, width, height);
} }

Loading…
Cancel
Save