|
|
@ -36,11 +36,23 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
private UIComboBox custom; |
|
|
|
private UIComboBox custom; |
|
|
|
private JPanel centerPane; |
|
|
|
private JPanel centerPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 按钮排布+按钮排布下拉框panel;
|
|
|
|
|
|
|
|
private JPanel buttonAlignPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 固定列数 数字panel
|
|
|
|
|
|
|
|
private JPanel columnSizePane; |
|
|
|
private UISpinner leftSpinner; |
|
|
|
private UISpinner leftSpinner; |
|
|
|
private UISpinner rightSpinner; |
|
|
|
private UISpinner rightSpinner; |
|
|
|
private UISpinner topSpinner; |
|
|
|
private UISpinner topSpinner; |
|
|
|
private UISpinner bottomSpinner; |
|
|
|
private UISpinner bottomSpinner; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UIComboBox layoutTypeCombo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UIComboBox buttonAlignCombo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UISpinner columnSizeSpinner; |
|
|
|
|
|
|
|
|
|
|
|
private JRadioButton leftAlignRadioButton; |
|
|
|
private JRadioButton leftAlignRadioButton; |
|
|
|
private JRadioButton centerAlignRadioButton; |
|
|
|
private JRadioButton centerAlignRadioButton; |
|
|
|
|
|
|
|
|
|
|
@ -122,12 +134,12 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addPaddingPane() { |
|
|
|
private void addPaddingPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
double[] columnSize = {p, p}; |
|
|
|
centerPane.add(DesignerUtils.createTitleSplitLine(Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout"))); |
|
|
|
centerPane.add(DesignerUtils.createTitleSplitLine(Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout"))); |
|
|
|
|
|
|
|
|
|
|
|
UILabel paddingHintLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Button_Padding")); |
|
|
|
UILabel paddingHintLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Button_Padding")); |
|
|
|
UILabel emptyHintLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("")); |
|
|
|
UILabel emptyHintLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("")); |
|
|
|
UILabel buttonAlignHintLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel leftLabel = new UILabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Padding_Left")); |
|
|
|
UILabel leftLabel = new UILabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Padding_Left")); |
|
|
|
leftSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, DesignerUtils.kDefaultHorizontalPadding); |
|
|
|
leftSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, DesignerUtils.kDefaultHorizontalPadding); |
|
|
|
|
|
|
|
|
|
|
@ -140,6 +152,52 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
UILabel bottomLabel = new UILabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Padding_Bottom")); |
|
|
|
UILabel bottomLabel = new UILabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Padding_Bottom")); |
|
|
|
bottomSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, DesignerUtils.kDefaultVerticalPadding); |
|
|
|
bottomSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, DesignerUtils.kDefaultVerticalPadding); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 布局方式下拉框
|
|
|
|
|
|
|
|
UILabel layoutTypeLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout_Type")); |
|
|
|
|
|
|
|
layoutTypeCombo = new UIComboBox(new String[]{ |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout_Single_Line"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout_Auto"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout_Fixed") |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
layoutTypeCombo.setPreferredSize(new Dimension(DesignerUtils.NORMAL_COMBO_WIDTH, 20)); |
|
|
|
|
|
|
|
layoutTypeCombo.addItemListener(new ItemListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
|
|
|
if (layoutTypeCombo.getSelectedIndex() == 0) { |
|
|
|
|
|
|
|
buttonAlignPane.setVisible(true); |
|
|
|
|
|
|
|
columnSizePane.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (layoutTypeCombo.getSelectedIndex() == 1) { |
|
|
|
|
|
|
|
buttonAlignPane.setVisible(false); |
|
|
|
|
|
|
|
columnSizePane.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (layoutTypeCombo.getSelectedIndex() == 2) { |
|
|
|
|
|
|
|
buttonAlignPane.setVisible(false); |
|
|
|
|
|
|
|
columnSizePane.setVisible(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 按钮排布下拉框
|
|
|
|
|
|
|
|
UILabel buttonAlignLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment")); |
|
|
|
|
|
|
|
buttonAlignCombo = new UIComboBox(new String[]{ |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Nature"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Center"), |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
buttonAlignCombo.setPreferredSize(new Dimension(DesignerUtils.LARGE_COMBO_WIDTH, 20)); |
|
|
|
|
|
|
|
buttonAlignPane = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
|
|
|
new Component[][]{new Component[]{buttonAlignLabel, buttonAlignCombo}}, |
|
|
|
|
|
|
|
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, |
|
|
|
|
|
|
|
LayoutConstants.VGAP_SMALL |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 固定列数——数字输入框
|
|
|
|
|
|
|
|
UILabel columnSizeLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Layout_Fixed_Number")); |
|
|
|
|
|
|
|
columnSizeSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 1); |
|
|
|
|
|
|
|
columnSizeSpinner.setPreferredSize(new Dimension(DesignerUtils.LARGE_COMBO_WIDTH, 20)); |
|
|
|
|
|
|
|
columnSizePane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{columnSizeLabel, columnSizeSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
|
|
|
|
columnSizePane.setVisible(false); |
|
|
|
|
|
|
|
|
|
|
|
leftAlignRadioButton = new JRadioButton(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Left"), true); |
|
|
|
leftAlignRadioButton = new JRadioButton(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Left"), true); |
|
|
|
centerAlignRadioButton = new JRadioButton(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Center"), false); |
|
|
|
centerAlignRadioButton = new JRadioButton(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Center"), false); |
|
|
|
|
|
|
|
|
|
|
@ -147,26 +205,30 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
JPanel rightSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{rightLabel, rightSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel rightSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{rightLabel, rightSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel topSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{topLabel, topSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel topSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{topLabel, topSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel bottomSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{bottomLabel, bottomSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel bottomSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{bottomLabel, bottomSpinner}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); |
|
|
|
|
|
|
|
|
|
|
|
JPanel vPaddingSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{topSpinnerPanel, bottomSpinnerPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel vPaddingSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{topSpinnerPanel, bottomSpinnerPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, LayoutConstants.VGAP_SMALL); |
|
|
|
|
|
|
|
|
|
|
|
JPanel hPaddingSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{leftSpinnerPanel, rightSpinnerPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel hPaddingSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{leftSpinnerPanel, rightSpinnerPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, LayoutConstants.VGAP_SMALL); |
|
|
|
|
|
|
|
|
|
|
|
JPanel layoutPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{leftAlignRadioButton, centerAlignRadioButton}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, LayoutConstants.VGAP_SMALL); |
|
|
|
JPanel layoutTypePanel = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
|
|
|
new Component[][]{new Component[]{layoutTypeCombo}}, |
|
|
|
|
|
|
|
TableLayoutHelper.FILL_LASTCOLUMN, |
|
|
|
|
|
|
|
IntervalConstants.INTERVAL_W1, |
|
|
|
|
|
|
|
LayoutConstants.VGAP_SMALL |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
ButtonGroup layoutRadioButtonGroup = new ButtonGroup(); |
|
|
|
ButtonGroup layoutRadioButtonGroup = new ButtonGroup(); |
|
|
|
layoutRadioButtonGroup.add(leftAlignRadioButton); |
|
|
|
layoutRadioButtonGroup.add(leftAlignRadioButton); |
|
|
|
layoutRadioButtonGroup.add(centerAlignRadioButton); |
|
|
|
layoutRadioButtonGroup.add(centerAlignRadioButton); |
|
|
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
double[] columnSize = {p, p}; |
|
|
|
|
|
|
|
JPanel paddingPanel = TableLayoutHelper.createCommonTableLayoutPane(new Component[][]{ |
|
|
|
JPanel paddingPanel = TableLayoutHelper.createCommonTableLayoutPane(new Component[][]{ |
|
|
|
{paddingHintLabel, vPaddingSpinnerPanel}, |
|
|
|
{paddingHintLabel, vPaddingSpinnerPanel}, |
|
|
|
{emptyHintLabel, hPaddingSpinnerPanel}, |
|
|
|
{emptyHintLabel, hPaddingSpinnerPanel}, |
|
|
|
{buttonAlignHintLabel, layoutPanel}, |
|
|
|
{layoutTypeLabel, layoutTypePanel}, |
|
|
|
}, rowSize, columnSize, 10); |
|
|
|
}, rowSize, columnSize, 10); |
|
|
|
|
|
|
|
|
|
|
|
centerPane.add(paddingPanel); |
|
|
|
centerPane.add(paddingPanel); |
|
|
|
|
|
|
|
centerPane.add(buttonAlignPane); |
|
|
|
|
|
|
|
centerPane.add(columnSizePane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addBackgroundPane() { |
|
|
|
private void addBackgroundPane() { |
|
|
@ -240,7 +302,7 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
|
|
|
|
|
|
|
|
UILabel initialFontLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Font_init")); |
|
|
|
UILabel initialFontLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Font_init")); |
|
|
|
initialFontConfPane = new FontConfigPane(); |
|
|
|
initialFontConfPane = new FontConfigPane(); |
|
|
|
initialFontConfPane.setFontColor(new Color(204, 204, 204)); |
|
|
|
initialFontConfPane.setFontColor(new Color(102, 102, 102)); |
|
|
|
JPanel fontPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initialFontLabel, initialFontConfPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
|
|
|
JPanel fontPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initialFontLabel, initialFontConfPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
|
|
|
centerPane.add(fontPanel); |
|
|
|
centerPane.add(fontPanel); |
|
|
|
UILabel selectedFontLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Font_Select")); |
|
|
|
UILabel selectedFontLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Font_Select")); |
|
|
@ -260,6 +322,9 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
rightSpinner.setValue(mobileStyle.getRightPadding()); |
|
|
|
rightSpinner.setValue(mobileStyle.getRightPadding()); |
|
|
|
topSpinner.setValue(mobileStyle.getTopPadding()); |
|
|
|
topSpinner.setValue(mobileStyle.getTopPadding()); |
|
|
|
bottomSpinner.setValue(mobileStyle.getBottomPadding()); |
|
|
|
bottomSpinner.setValue(mobileStyle.getBottomPadding()); |
|
|
|
|
|
|
|
layoutTypeCombo.setSelectedIndex(mobileStyle.getButtonLayoutType()); |
|
|
|
|
|
|
|
buttonAlignCombo.setSelectedIndex(mobileStyle.getButtonAlign()); |
|
|
|
|
|
|
|
columnSizeSpinner.setValue(mobileStyle.getButtonColumnSize()); |
|
|
|
leftAlignRadioButton.setSelected(mobileStyle.getButtonAlign() == DesignerUtils.kAlignLeft); |
|
|
|
leftAlignRadioButton.setSelected(mobileStyle.getButtonAlign() == DesignerUtils.kAlignLeft); |
|
|
|
centerAlignRadioButton.setSelected(mobileStyle.getButtonAlign() == DesignerUtils.kAlignCenter); |
|
|
|
centerAlignRadioButton.setSelected(mobileStyle.getButtonAlign() == DesignerUtils.kAlignCenter); |
|
|
|
initialColorSelectBox.setSelectObject(mobileStyle.getInitialBackgroundColor()); |
|
|
|
initialColorSelectBox.setSelectObject(mobileStyle.getInitialBackgroundColor()); |
|
|
@ -285,7 +350,9 @@ public class CapsuleCustomDefinePane extends MobileStyleCustomDefinePane { |
|
|
|
mobileStyle.setRightPadding(rightSpinner.getValue()); |
|
|
|
mobileStyle.setRightPadding(rightSpinner.getValue()); |
|
|
|
mobileStyle.setTopPadding(topSpinner.getValue()); |
|
|
|
mobileStyle.setTopPadding(topSpinner.getValue()); |
|
|
|
mobileStyle.setBottomPadding(bottomSpinner.getValue()); |
|
|
|
mobileStyle.setBottomPadding(bottomSpinner.getValue()); |
|
|
|
mobileStyle.setButtonAlign(leftAlignRadioButton.isSelected() ? DesignerUtils.kAlignLeft : DesignerUtils.kAlignCenter); |
|
|
|
mobileStyle.setButtonAlign(buttonAlignCombo.getSelectedIndex()); |
|
|
|
|
|
|
|
mobileStyle.setButtonLayoutType(layoutTypeCombo.getSelectedIndex()); |
|
|
|
|
|
|
|
mobileStyle.setButtonColumnSize((int)columnSizeSpinner.getValue()); |
|
|
|
mobileStyle.setInitialBackgroundColor(initialColorSelectBox.getSelectObject()); |
|
|
|
mobileStyle.setInitialBackgroundColor(initialColorSelectBox.getSelectObject()); |
|
|
|
mobileStyle.setSelectedBackgroundColor(selectedColorSelectBox.getSelectObject()); |
|
|
|
mobileStyle.setSelectedBackgroundColor(selectedColorSelectBox.getSelectObject()); |
|
|
|
mobileStyle.setBorderType(borderLineCombo.getSelectedLineStyle()); |
|
|
|
mobileStyle.setBorderType(borderLineCombo.getSelectedLineStyle()); |
|
|
|