|
|
@ -17,7 +17,6 @@ import com.fr.report.fit.ReportFitAttr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.border.EmptyBorder; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
@ -33,6 +32,7 @@ import static com.fr.design.i18n.Toolkit.i18nText; |
|
|
|
public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { |
|
|
|
public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel contentJPanel; |
|
|
|
protected JPanel contentJPanel; |
|
|
|
|
|
|
|
protected UILabel belowSetLabel; |
|
|
|
protected UIComboBox itemChoose; |
|
|
|
protected UIComboBox itemChoose; |
|
|
|
protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>(); |
|
|
|
protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
@ -97,7 +97,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
attrJPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
attrJPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
attrJPanel.setBorder(new EmptyBorder(0, 100, 10, 100)); |
|
|
|
attrJPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); |
|
|
|
contentJPanel.add(attrJPanel); |
|
|
|
contentJPanel.add(attrJPanel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -136,9 +136,18 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { |
|
|
|
|
|
|
|
|
|
|
|
protected void initPreviewJPanel() { |
|
|
|
protected void initPreviewJPanel() { |
|
|
|
previewJPanel = new FitPreviewPane(); |
|
|
|
previewJPanel = new FitPreviewPane(); |
|
|
|
|
|
|
|
previewJPanel.setBorder(BorderFactory.createEmptyBorder(0, getPreviewJPanelLeft(), 0, 0)); |
|
|
|
contentJPanel.add(previewJPanel); |
|
|
|
contentJPanel.add(previewJPanel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int getPreviewJPanelLeft() { |
|
|
|
|
|
|
|
int left = 0; |
|
|
|
|
|
|
|
if (belowSetLabel.getPreferredSize() != null) { |
|
|
|
|
|
|
|
left = belowSetLabel.getPreferredSize().width + BELOW_SET_COMPONENT_HSPACE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return left; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected int getStateInPC(int index) { |
|
|
|
protected int getStateInPC(int index) { |
|
|
|
FitType[] fitTypes = fitAttrModel.getFitTypes(); |
|
|
|
FitType[] fitTypes = fitAttrModel.getFitTypes(); |
|
|
|
return fitTypes[index].getState(); |
|
|
|
return fitTypes[index].getState(); |
|
|
@ -188,29 +197,26 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { |
|
|
|
protected void initComponents() { |
|
|
|
protected void initComponents() { |
|
|
|
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
|
|
|
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
|
|
|
contentJPanel = new JPanel(); |
|
|
|
contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0); |
|
|
|
contentJPanel.setLayout(FRGUIPaneFactory.createCenterFlowLayout()); |
|
|
|
|
|
|
|
this.add(contentJPanel); |
|
|
|
this.add(contentJPanel); |
|
|
|
initItemChoose(); |
|
|
|
initItemChoose(); |
|
|
|
|
|
|
|
initPrompt(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initItemChoose() { |
|
|
|
private void initItemChoose() { |
|
|
|
JPanel chooseJPanel = new JPanel(); |
|
|
|
JPanel chooseJPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); |
|
|
|
chooseJPanel.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
|
|
|
|
ItemListener itemListener = getItemListener(); |
|
|
|
ItemListener itemListener = getItemListener(); |
|
|
|
itemChoose = new UIComboBox(getItemNames()); |
|
|
|
itemChoose = new UIComboBox(getItemNames()); |
|
|
|
itemChoose.addItemListener(itemListener); |
|
|
|
itemChoose.addItemListener(itemListener); |
|
|
|
UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); |
|
|
|
belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); |
|
|
|
|
|
|
|
JPanel hSpaceLabel = new JPanel(); |
|
|
|
|
|
|
|
hSpaceLabel.setSize(BELOW_SET_COMPONENT_HSPACE, 0); |
|
|
|
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ |
|
|
|
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ |
|
|
|
belowSetLabel, itemChoose}, FlowLayout.LEFT, BELOW_SET_COMPONENT_HSPACE); |
|
|
|
belowSetLabel, hSpaceLabel, itemChoose}, FlowLayout.LEFT); |
|
|
|
chooseJPanel.add(buttonPane); |
|
|
|
chooseJPanel.add(buttonPane); |
|
|
|
chooseJPanel.setPreferredSize(new Dimension(500, 50)); |
|
|
|
chooseJPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); |
|
|
|
JPanel jPanel = new JPanel(); |
|
|
|
contentJPanel.add(chooseJPanel); |
|
|
|
jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
jPanel.add(chooseJPanel, BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentJPanel.add(jPanel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -221,6 +227,9 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initPrompt() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void refresh() { |
|
|
|
protected void refresh() { |
|
|
|
validate(); |
|
|
|
validate(); |
|
|
|
repaint(); |
|
|
|
repaint(); |
|
|
|