Browse Source

REPORT-2897 9.0设计器修改

缩放条在不同的sheet切换不应该继承
去掉表单缩放条
master
MoMeak 7 years ago
parent
commit
d6e3c6045c
  1. 9
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  2. 13
      designer/src/com/fr/design/mainframe/ReportComponentComposite.java
  3. 7
      designer/src/com/fr/poly/PolyDesigner.java
  4. 4
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  5. 6
      designer_form/src/com/fr/design/mainframe/FormArea.java

9
designer/src/com/fr/design/mainframe/ElementCasePane.java

@ -1325,7 +1325,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
* @return 返回正在编辑的状态. * @return 返回正在编辑的状态.
*/ */
public EditingState createEditingState() { public EditingState createEditingState() {
return new ElementCaseEditingState(this.selection, this.verScrollBar.getValue(), this.horScrollBar.getValue()); return new ElementCaseEditingState(this.selection, this.verScrollBar.getValue(), this.horScrollBar.getValue(), this.resolution);
} }
public void setCellNeedTOFormat(CellSelection selection) { public void setCellNeedTOFormat(CellSelection selection) {
@ -1341,8 +1341,9 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
protected Selection selection; protected Selection selection;
protected int verticalValue = 0; protected int verticalValue = 0;
protected int horizontalValue = 0; protected int horizontalValue = 0;
protected int resolution = ScreenResolution.getScreenResolution();
protected ElementCaseEditingState(Selection selection, int verticalValue, int horizontalValue) { protected ElementCaseEditingState(Selection selection, int verticalValue, int horizontalValue, int resolution) {
try { try {
this.selection = selection.clone(); this.selection = selection.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
@ -1350,6 +1351,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
} }
this.verticalValue = verticalValue; this.verticalValue = verticalValue;
this.horizontalValue = horizontalValue; this.horizontalValue = horizontalValue;
this.resolution = resolution;
} }
@Override @Override
@ -1363,7 +1365,8 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
ElementCasePane.this.getVerticalScrollBar().setValue(this.verticalValue); ElementCasePane.this.getVerticalScrollBar().setValue(this.verticalValue);
ElementCasePane.this.getHorizontalScrollBar().setValue(this.horizontalValue); ElementCasePane.this.getHorizontalScrollBar().setValue(this.horizontalValue);
// ElementCasePane.this.setResolution(this.resolution);
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(this.resolution);
// 重绘. // 重绘.
ElementCasePane.this.repaint(); ElementCasePane.this.repaint();
} }

13
designer/src/com/fr/design/mainframe/ReportComponentComposite.java

@ -120,12 +120,16 @@ public class ReportComponentComposite extends JComponent {
EditingState reportPaneEditState = templateStateList.get(newIndex); EditingState reportPaneEditState = templateStateList.get(newIndex);
if (reportPaneEditState != null) { if (reportPaneEditState != null) {
reportPaneEditState.revert(); reportPaneEditState.revert();
updateJSlider();
} }
} else { } else {
while (templateStateList.size() <= newIndex) { while (templateStateList.size() <= newIndex) {
templateStateList.add(null); templateStateList.add(null);
} }
centerCardPane.editingComponet.setSelection(centerCardPane.editingComponet.getDefaultSelectElement()); centerCardPane.editingComponet.setSelection(centerCardPane.editingComponet.getDefaultSelectElement());
if (jSliderContainer != null){
jSliderContainer.reset();
}
} }
if (centerCardPane.editingComponet.elementCasePane == null) { if (centerCardPane.editingComponet.elementCasePane == null) {
@ -141,6 +145,15 @@ public class ReportComponentComposite extends JComponent {
} }
} }
private void updateJSlider(){
if (centerCardPane.editingComponet.elementCasePane == null) {
jSliderContainer.getShowVal().setValue(centerCardPane.getPolyDezi().getResolution() * HUND / ScreenResolution.getScreenResolution());
}else {
jSliderContainer.getShowVal().setValue(centerCardPane.editingComponet.elementCasePane.getResolution() * HUND / ScreenResolution.getScreenResolution());
}
}
/** /**
* 移除选中状态 * 移除选中状态
* *

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

@ -687,14 +687,16 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* @return 返回正在编辑的状态. * @return 返回正在编辑的状态.
*/ */
public EditingState createEditingState() { public EditingState createEditingState() {
return new PolyDesignerEditingState(selection); return new PolyDesignerEditingState(selection, resolution);
} }
private class PolyDesignerEditingState implements EditingState { private class PolyDesignerEditingState implements EditingState {
private String blockName; private String blockName;
private Selection select; private Selection select;
protected int resolution = ScreenResolution.getScreenResolution();
public PolyDesignerEditingState(BlockCreator creator) { public PolyDesignerEditingState(BlockCreator creator, int resolution) {
this.resolution = resolution;
if (creator == null) { if (creator == null) {
return; return;
} }
@ -710,6 +712,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
public void revert() { public void revert() {
PolyDesigner.this.addedData = new AddedData(PolyDesigner.this); PolyDesigner.this.addedData = new AddedData(PolyDesigner.this);
stopEditingState(); stopEditingState();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(this.resolution);
initPolyBlocks(); initPolyBlocks();
startEditing(blockName); startEditing(blockName);
if (selection == null) { if (selection == null) {

4
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -337,6 +337,10 @@ public class JSliderPane extends JPanel {
return this.showValue; return this.showValue;
} }
public void reset(){
this.showValSpinner.setValue(HUNDRED);
}
public static double divide(double v1, double v2, int scale) { public static double divide(double v1, double v2, int scale) {
BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2)); BigDecimal b2 = new BigDecimal(Double.toString(v2));

6
designer_form/src/com/fr/design/mainframe/FormArea.java

@ -119,7 +119,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
// slidePane = new UINumberSlidePane(SLIDER_MIN, SLIDER_FLOAT); // slidePane = new UINumberSlidePane(SLIDER_MIN, SLIDER_FLOAT);
// slidePane.setPreferredSize(new Dimension(260,20)); // slidePane.setPreferredSize(new Dimension(260,20));
slidePane = JFormSliderPane.getInstance(); slidePane = JFormSliderPane.getInstance();
slidePane.setPreferredSize(new Dimension(350, 20)); slidePane.setPreferredSize(new Dimension(200, 20));
JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
@ -130,8 +130,8 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
setWidgetsConfig(); setWidgetsConfig();
// 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小 // 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小
slidePane.setEnabled(false); slidePane.setEnabled(false);
slidePane.setVisible(true); slidePane.setVisible(false);
initTransparent(); // initTransparent();
initCalculateSize(); initCalculateSize();
} }

Loading…
Cancel
Save