|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.fr.design.mainframe; |
|
|
|
package com.fr.design.mainframe; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
@ -35,16 +36,16 @@ public class JSliderPane extends JPanel { |
|
|
|
private static final int SIX = 6; |
|
|
|
private static final int SIX = 6; |
|
|
|
private static final int TEN = 10; |
|
|
|
private static final int TEN = 10; |
|
|
|
private static final int ONE_EIGHT = 18; |
|
|
|
private static final int ONE_EIGHT = 18; |
|
|
|
private static final int FONT_SIZE = 14; |
|
|
|
private static final int FONT_SIZE = 12; |
|
|
|
private static final int SPINNER_WIDTH = 45; |
|
|
|
private static final int SPINNER_WIDTH = 45; |
|
|
|
private static final int SPINNER_HEIGHT = 16; |
|
|
|
private static final int SPINNER_HEIGHT = 20; |
|
|
|
private static final int HALF_HUNDRED = 50; |
|
|
|
private static final int HALF_HUNDRED = 50; |
|
|
|
private static final int HUNDRED = 100; |
|
|
|
private static final int HUNDRED = 100; |
|
|
|
private static final int TWO_HUNDRED = 200; |
|
|
|
private static final int TWO_HUNDRED = 200; |
|
|
|
private static final int THREE_HUNDRED = 300; |
|
|
|
private static final int THREE_HUNDRED = 300; |
|
|
|
private static final int FOUR_HUNDRED = 400; |
|
|
|
private static final int FOUR_HUNDRED = 400; |
|
|
|
private static final int DIALOG_WIDTH = 150; |
|
|
|
private static final int DIALOG_WIDTH = 150; |
|
|
|
private static final int DIALOG_HEIGHT = 240; |
|
|
|
private static final int DIALOG_HEIGHT = 200; |
|
|
|
private static final int SLIDER_WIDTH = 220; |
|
|
|
private static final int SLIDER_WIDTH = 220; |
|
|
|
private static final int SLIDER_HEIGHT = 20; |
|
|
|
private static final int SLIDER_HEIGHT = 20; |
|
|
|
private static final int SHOWVALBUTTON_WIDTH = 40; |
|
|
|
private static final int SHOWVALBUTTON_WIDTH = 40; |
|
|
@ -97,22 +98,19 @@ public class JSliderPane extends JPanel { |
|
|
|
// NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
|
|
|
|
// NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
|
|
|
|
// formatter.setAllowsInvalid(false);
|
|
|
|
// formatter.setAllowsInvalid(false);
|
|
|
|
downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); |
|
|
|
downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); |
|
|
|
// downButton.setPreferredSize(new Dimension(16,16));
|
|
|
|
|
|
|
|
downButton.setOpaque(false); |
|
|
|
downButton.setOpaque(false); |
|
|
|
downButton.setBorderPainted(false); |
|
|
|
downButton.setBorderPainted(false); |
|
|
|
upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); |
|
|
|
upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); |
|
|
|
// upButton.setPreferredSize(new Dimension(21,21));
|
|
|
|
|
|
|
|
upButton.setOpaque(false); |
|
|
|
upButton.setOpaque(false); |
|
|
|
upButton.setBorderPainted(false); |
|
|
|
upButton.setBorderPainted(false); |
|
|
|
downButton.setActionCommand("less"); |
|
|
|
downButton.setActionCommand("less"); |
|
|
|
upButton.setActionCommand("more"); |
|
|
|
upButton.setActionCommand("more"); |
|
|
|
downButton.addActionListener(buttonActionListener); |
|
|
|
downButton.addActionListener(buttonActionListener); |
|
|
|
upButton.addActionListener(buttonActionListener); |
|
|
|
upButton.addActionListener(buttonActionListener); |
|
|
|
|
|
|
|
|
|
|
|
showValButton = new JButton(showValSpinner.getValue() + "%"); |
|
|
|
showValButton = new JButton(showValSpinner.getValue() + "%"); |
|
|
|
showValButton.setOpaque(false); |
|
|
|
showValButton.setOpaque(false); |
|
|
|
showValButton.setMargin(new Insets(0,0,0,0)); |
|
|
|
showValButton.setMargin(new Insets(0,0,0,0)); |
|
|
|
showValButton.setFont(new Font("OpenSans", Font.PLAIN, 12)); |
|
|
|
showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); |
|
|
|
showValButton.setBackground(BACK_COLOR); |
|
|
|
showValButton.setBackground(BACK_COLOR); |
|
|
|
showValButton.setBorderPainted(false); |
|
|
|
showValButton.setBorderPainted(false); |
|
|
|
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); |
|
|
|
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); |
|
|
@ -126,7 +124,6 @@ public class JSliderPane extends JPanel { |
|
|
|
panel.add(showValButton); |
|
|
|
panel.add(showValButton); |
|
|
|
panel.setBackground(BACK_COLOR); |
|
|
|
panel.setBackground(BACK_COLOR); |
|
|
|
this.add(panel, BorderLayout.NORTH); |
|
|
|
this.add(panel, BorderLayout.NORTH); |
|
|
|
// this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final JSliderPane getInstance() { |
|
|
|
public static final JSliderPane getInstance() { |
|
|
@ -144,7 +141,9 @@ public class JSliderPane extends JPanel { |
|
|
|
fiveTenButton = new UIRadioButton("50%"); |
|
|
|
fiveTenButton = new UIRadioButton("50%"); |
|
|
|
twoFiveButton = new UIRadioButton("25%"); |
|
|
|
twoFiveButton = new UIRadioButton("25%"); |
|
|
|
selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); |
|
|
|
selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); |
|
|
|
|
|
|
|
selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); |
|
|
|
customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton")); |
|
|
|
customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton")); |
|
|
|
|
|
|
|
customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); |
|
|
|
twoHundredButton.addItemListener(radioButtonItemListener); |
|
|
|
twoHundredButton.addItemListener(radioButtonItemListener); |
|
|
|
oneHundredButton.addItemListener(radioButtonItemListener); |
|
|
|
oneHundredButton.addItemListener(radioButtonItemListener); |
|
|
|
SevenFiveButton.addItemListener(radioButtonItemListener); |
|
|
|
SevenFiveButton.addItemListener(radioButtonItemListener); |
|
|
@ -178,14 +177,14 @@ public class JSliderPane extends JPanel { |
|
|
|
new Component[]{selfAdaptButton, null}, |
|
|
|
new Component[]{selfAdaptButton, null}, |
|
|
|
new Component[]{customButton, createSpinnerPanel()} |
|
|
|
new Component[]{customButton, createSpinnerPanel()} |
|
|
|
}; |
|
|
|
}; |
|
|
|
dialogContentPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createSpinnerPanel() { |
|
|
|
private JPanel createSpinnerPanel() { |
|
|
|
JPanel spinnerPanel = new JPanel(new FlowLayout()); |
|
|
|
JPanel spinnerPanel = new JPanel(new FlowLayout()); |
|
|
|
spinnerPanel.add(showValSpinner); |
|
|
|
spinnerPanel.add(showValSpinner); |
|
|
|
UILabel percent = new UILabel("%"); |
|
|
|
UILabel percent = new UILabel("%"); |
|
|
|
percent.setFont(new Font("Dialog", Font.PLAIN, FONT_SIZE)); |
|
|
|
percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); |
|
|
|
spinnerPanel.add(percent); |
|
|
|
spinnerPanel.add(percent); |
|
|
|
return spinnerPanel; |
|
|
|
return spinnerPanel; |
|
|
|
} |
|
|
|
} |
|
|
@ -417,7 +416,7 @@ class PopupPane extends JPopupMenu { |
|
|
|
private JComponent contentPane; |
|
|
|
private JComponent contentPane; |
|
|
|
private static final int UPLABEL_HEIGHT = 25; |
|
|
|
private static final int UPLABEL_HEIGHT = 25; |
|
|
|
private static final int DIALOG_WIDTH = 157; |
|
|
|
private static final int DIALOG_WIDTH = 157; |
|
|
|
private static final int DIALOG_HEIGHT = 240; |
|
|
|
private static final int DIALOG_HEIGHT = 200; |
|
|
|
private static final int UPLABEL_WIDTH = 300; |
|
|
|
private static final int UPLABEL_WIDTH = 300; |
|
|
|
private JComponent centerPane; |
|
|
|
private JComponent centerPane; |
|
|
|
private UILabel upLabel; |
|
|
|
private UILabel upLabel; |
|
|
@ -433,7 +432,6 @@ class PopupPane extends JPopupMenu { |
|
|
|
centerPane.add(dialogContentPanel, BorderLayout.NORTH); |
|
|
|
centerPane.add(dialogContentPanel, BorderLayout.NORTH); |
|
|
|
contentPane.add(upLabel, BorderLayout.NORTH); |
|
|
|
contentPane.add(upLabel, BorderLayout.NORTH); |
|
|
|
contentPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
contentPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
// contentPane.setBorder(new MatteBorder(1,1,1,1,Color.darkGray));
|
|
|
|
|
|
|
|
this.add(contentPane, BorderLayout.CENTER); |
|
|
|
this.add(contentPane, BorderLayout.CENTER); |
|
|
|
this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); |
|
|
|
this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); |
|
|
|
this.setOpaque(false); |
|
|
|
this.setOpaque(false); |
|
|
|