Browse Source

合并代码或者修改冲突时 merge错误 改回正确的

master
fr_shine 8 years ago
parent
commit
48723cc220
  1. 24
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

24
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -39,27 +39,35 @@ public class MinMaxValuePane extends JPanel {
mainUnitField = new UITextField(6); mainUnitField = new UITextField(6);
isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit")); isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit"));
secUnitField = new UITextField(6); secUnitField = new UITextField(6);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f }; double[] columnSize = {p, f};
double[] rowSize = { p, p, p, p};
Component[][] components = getPanelComponents(); Component[][] components = getPanelComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, getRowSize(p), columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
addComponentListener(components);
}
for(int i = 0; i < components.length; i++) { protected double[] getRowSize(double p) {
((UICheckBox)components[i][0]).addActionListener(new ActionListener() { return new double[]{p, p, p, p};
}
public void addComponentListener(Component[][] components) {
for (int i = 0; i < components.length; i++) {
((UICheckBox) components[i][0]).addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkBoxUse(); checkBoxUse();
} }
}); });
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]);
} }
} }
protected Component[][] getPanelComponents() { protected Component[][] getPanelComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{minCheckBox, minValueField}, new Component[]{minCheckBox, minValueField},
@ -69,7 +77,7 @@ public class MinMaxValuePane extends JPanel {
}; };
} }
private void checkBoxUse() { protected void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected()); minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected());

Loading…
Cancel
Save