Browse Source

REPORT-4604 设计器视觉修改

master
MoMeak 7 years ago
parent
commit
faeddc13c3
  1. 10
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  2. 24
      designer/src/com/fr/design/present/BarCodePane.java
  3. 1
      designer/src/com/fr/poly/PolyDesignUI.java
  4. 3
      designer/src/com/fr/poly/PolyDesigner.java
  5. 30
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  6. 2
      designer_base/src/com/fr/design/gui/style/BackgroundPane.java

10
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -79,9 +79,13 @@ public class ReportFloatPane extends JPanel {
insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float"));
insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png");
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane();
if (elementCasePaneDelegate != null) {
refreshInsertFloatMenu(elementCasePaneDelegate);
JComponent currentElementCasePane = editingTemplate.getCurrentElementCasePane();
if (currentElementCasePane != null) {
insertFloatMenu.clearShortCuts();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, currentElementCasePane);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
}
}

24
designer/src/com/fr/design/present/BarCodePane.java

@ -9,6 +9,8 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -45,9 +47,9 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
private final int NUM16 = 16;
private BarCodePreviewPane barCodePreviewPane;
private UIComboBox typeComboBox;
private UIBasicSpinner barWidthSpinner;
private UIBasicSpinner barHeightSpinner;
private UIBasicSpinner RCodesizespinner;
private UISpinner barWidthSpinner;
private UISpinner barHeightSpinner;
private UISpinner RCodesizespinner;
private UICheckBox drawingTextCheckBox;
private UIComboBox RCodeVersionComboBox;
private UIComboBox RCodeErrorCorrectComboBox;
@ -62,8 +64,8 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
private void initComponents() {
barCodePreviewPane = new BarCodePreviewPane();
this.barWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(10.0, 1, 100, 1.0));
this.barHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(30, 1, 100, 1));
this.barWidthSpinner = new UISpinner(1,100.0,1.0,10.0);
this.barHeightSpinner = new UISpinner(1,100.0,1.0,30);
this.barWidthSpinner.setPreferredSize(new Dimension(60, 20));
this.barHeightSpinner.setPreferredSize(new Dimension(60, 20));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -72,7 +74,7 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
borderPane.add(barCodePreviewPane, BorderLayout.CENTER);
setTypeComboBox();
setSome();
RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1));
RCodesizespinner = new UISpinner(1,6,1,2);
RCodeVersionComboBox = new UIComboBox();
RCodeErrorCorrectComboBox = new UIComboBox();
typeSetLabel = new UILabel(Inter.getLocText("FR-Designer_Type_Set"), UILabel.LEFT);
@ -126,10 +128,10 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
}
private void setSome() {
JFormattedTextField heightTextField = ((JSpinner.DefaultEditor) barHeightSpinner.getEditor()).getTextField();
UINumberField heightTextField = barHeightSpinner.getTextField();
heightTextField.setColumns(2);
JFormattedTextField widthTextField = ((JSpinner.DefaultEditor) barWidthSpinner.getEditor()).getTextField();
UINumberField widthTextField = barWidthSpinner.getTextField();
widthTextField.setColumns(2);
}
@ -268,7 +270,7 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
}
this.setTestText(BarCodeUtils.getTestTextByBarCode(barcodeAttr.getType()));
this.typeComboBox.setSelectedIndex(barcodeAttr.getType());
this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth()));
this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth()) * 10);
this.barHeightSpinner.setValue(new Integer(barcodeAttr.getBarHeight()));
this.drawingTextCheckBox.setSelected(barcodeAttr.isDrawingText());
this.RCodesizespinner.setValue(new Integer(barcodeAttr.getRcodeDrawPix()));
@ -281,11 +283,11 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
if ((typeComboBox.getSelectedIndex() == NUM16)) {
barcodeAttr.setRCodeVersion(this.RCodeVersionComboBox.getSelectedIndex());
barcodeAttr.setRCodeErrorCorrect(this.RCodeErrorCorrectComboBox.getSelectedIndex());
barcodeAttr.setRcodeDrawPix(((Integer) this.RCodesizespinner.getValue()).intValue());
barcodeAttr.setRcodeDrawPix((int) this.RCodesizespinner.getValue());
}
barcodeAttr.setType(this.typeComboBox.getSelectedIndex());
barcodeAttr.setBarWidth(((Double) this.barWidthSpinner.getValue()).doubleValue() / 10);
barcodeAttr.setBarHeight(((Integer) this.barHeightSpinner.getValue()).intValue());
barcodeAttr.setBarHeight((int) this.barHeightSpinner.getValue());
barcodeAttr.setDrawingText(this.drawingTextCheckBox.isSelected());
return new BarcodePresent(barcodeAttr);
}

1
designer/src/com/fr/poly/PolyDesignUI.java

@ -97,7 +97,6 @@ public class PolyDesignUI extends ComponentUI {
paintAddingData(g2d, addData);
}
paintPaginateLine(g2d);
designer.repaint();
}
private void paintAddedData(Graphics g) {

3
designer/src/com/fr/poly/PolyDesigner.java

@ -189,8 +189,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
public void updateUI() {
((PolyArea) this.polyArea).setResolution(resolution);
polyArea.repaint();
// this.polyArea = (JComponent) new PolyArea(this, resolution);
repaint();
}
/**

30
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -39,7 +39,9 @@ import java.util.Arrays;
*/
public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final int ANGEL = 90;
private static final Dimension SPINNER_DIMENSION = new Dimension(70, 20);
private static final int GAP = 23;
private static final int VERGAP = 3;
private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20);
private static final String[] TEXT = {Inter.getLocText("FR-Designer_StyleAlignment_Wrap_Text"), Inter.getLocText("FR-Designer_StyleAlignment_Single_Line"),
Inter.getLocText("FR-Designer_StyleAlignment_Single_Line(Adjust_Font)"), Inter.getLocText("FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)")};
@ -221,17 +223,33 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
spaceBeforeSpinner.setPreferredSize(SPINNER_DIMENSION);
spaceAfterSpinner.setPreferredSize(SPINNER_DIMENSION);
lineSpaceSpinner.setPreferredSize(SPINNER_DIMENSION);
JPanel indentationPane = new JPanel(new BorderLayout());
indentationPane.add(new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_Indentation")), SwingConstants.LEFT));
indentationPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, GAP));
JPanel partSpacingPane = new JPanel(new BorderLayout());
partSpacingPane.add(new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_PartSpacing")), SwingConstants.LEFT));
partSpacingPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, GAP));
JPanel spacingPane = new JPanel(new BorderLayout());
spacingPane.add(new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_Spacing")), SwingConstants.LEFT));
spacingPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, GAP));
Component[][] components = new Component[][]{
new Component[]{null, null, null},
new Component[]{new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_Indentation")) + " ", SwingConstants.LEFT), creatSpinnerPane(leftIndentSpinner), creatSpinnerPane(rightIndentSpinner)},
new Component[]{indentationPane, creatSpinnerPane(leftIndentSpinner), creatSpinnerPane(rightIndentSpinner)},
new Component[]{null, new UILabel((Inter.getLocText("FR-Designer_Left")), SwingConstants.CENTER), new UILabel((Inter.getLocText("FR-Designer_Right")), SwingConstants.CENTER)},
new Component[]{new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_PartSpacing")) + " ", SwingConstants.LEFT), creatSpinnerPane(spaceBeforeSpinner), creatSpinnerPane(spaceAfterSpinner)},
new Component[]{null, null, null},
new Component[]{null, null, null},
new Component[]{partSpacingPane, creatSpinnerPane(spaceBeforeSpinner), creatSpinnerPane(spaceAfterSpinner)},
new Component[]{null, new UILabel((Inter.getLocText("FR-Designer_Front")), SwingConstants.CENTER), new UILabel((Inter.getLocText("FR-Designer_Behind")), SwingConstants.CENTER)},
new Component[]{new UILabel((Inter.getLocText("FR-Designer_Style_Line_Spacing")) + " ", SwingConstants.LEFT), creatSpinnerPane(lineSpaceSpinner), null},
new Component[]{null, null, null},
new Component[]{null, null, null},
new Component[]{spacingPane, creatSpinnerPane(lineSpaceSpinner), null},
};
double[] rowSize = {p, p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f, f};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, VERGAP);
}
private JPanel creatSpinnerPane(Component comp) {

2
designer_base/src/com/fr/design/gui/style/BackgroundPane.java

@ -80,7 +80,7 @@ public class BackgroundPane extends AbstractBasicStylePane {
double[] rowSize = {p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
this.add(panel, BorderLayout.CENTER);
}

Loading…
Cancel
Save