|
|
|
@ -30,6 +30,9 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
private static final int WIDTH = 100; |
|
|
|
|
private static final int MIN_TIME = 0; |
|
|
|
|
private static final int MAX_TIME = Integer.MAX_VALUE; |
|
|
|
|
private static final int CONSTANT_TEN = 10; |
|
|
|
|
private static final int CONSTANT_THIRTY = 30; |
|
|
|
|
private static final int CONSTANT_ZERO = 0; |
|
|
|
|
private JPanel contentPane; |
|
|
|
|
//配置方式按钮
|
|
|
|
|
private UIButtonGroup<Integer> configStyleButton; |
|
|
|
@ -43,14 +46,15 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
//轮播切换方式配置接界面
|
|
|
|
|
private JPanel carouselConfigPane; |
|
|
|
|
protected UISpinner timeInterval; |
|
|
|
|
protected UICheckBox arrowCheckbox; |
|
|
|
|
private ColorSelectBoxWithOutTransparent colorSelectBox4carousel; |
|
|
|
|
private UIButtonGroup switchStyleGroup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChangeConfigPane(){ |
|
|
|
|
initButtonGroup(); |
|
|
|
|
configPane = createConfigPane(); |
|
|
|
|
contentPane = createContentPane(); |
|
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 30, 10, 30)); |
|
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(CONSTANT_TEN, CONSTANT_THIRTY, CONSTANT_TEN, CONSTANT_THIRTY)); |
|
|
|
|
this.add(contentPane, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -74,7 +78,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
JPanel panel = new JPanel(new CardLayout()){ |
|
|
|
|
@Override |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
if(configStyleButton.getSelectedIndex() == 0){ |
|
|
|
|
if (configStyleButton.getSelectedIndex() == 0){ |
|
|
|
|
return buttonConfigPane.getPreferredSize(); |
|
|
|
|
} else{ |
|
|
|
|
return carouselConfigPane.getPreferredSize(); |
|
|
|
@ -85,7 +89,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
panel.add(buttonConfigPane, "button"); |
|
|
|
|
panel.add(carouselConfigPane, "carousel"); |
|
|
|
|
|
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(CONSTANT_ZERO, CONSTANT_TEN, CONSTANT_ZERO, CONSTANT_ZERO)); |
|
|
|
|
|
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
@ -94,17 +98,18 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
double[] rowSize = {p,p,p}; |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0); |
|
|
|
|
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH); |
|
|
|
|
arrowCheckbox = new UICheckBox(Inter.getLocText("FR-Base_TurnOn")); |
|
|
|
|
switchStyleGroup = new UIButtonGroup(new String[]{Inter.getLocText("FR-Designer_Show"), Inter.getLocText("FR-Designer_Hide")}); |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Arrow_Style")), switchStyleGroup}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), timeInterval}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("Background")),colorSelectBox4carousel}, |
|
|
|
|
new Component[] {new UILabel(Inter.getLocText("Plugin-ChartF_Arrow_Style")), arrowCheckbox} |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("Background")),colorSelectBox4carousel} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createTitleStylePane(){ |
|
|
|
@ -136,7 +141,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
new Component[]{createButtonBackgroundColorPane(),null}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); |
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initButtonGroup() { |
|
|
|
@ -178,7 +183,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
//轮播切换界面
|
|
|
|
|
timeInterval.setValue(changeConfigAttr.getTimeInterval()); |
|
|
|
|
colorSelectBox4carousel.setSelectObject(changeConfigAttr.getCarouselColor()); |
|
|
|
|
arrowCheckbox.setSelected(changeConfigAttr.isShowArrow()); |
|
|
|
|
switchStyleGroup.setSelectedIndex(changeConfigAttr.isShowArrow() ? 0 : 1); |
|
|
|
|
|
|
|
|
|
checkCardPane(); |
|
|
|
|
|
|
|
|
@ -202,7 +207,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
|
|
|
|
|
changeConfigAttr.setButtonColor(colorSelectBox4button.getSelectObject()); |
|
|
|
|
changeConfigAttr.setTimeInterval((int) timeInterval.getValue()); |
|
|
|
|
changeConfigAttr.setCarouselColor(colorSelectBox4carousel.getSelectObject()); |
|
|
|
|
changeConfigAttr.setShowArrow(arrowCheckbox.isSelected()); |
|
|
|
|
changeConfigAttr.setShowArrow(switchStyleGroup.getSelectedIndex() == 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|