Browse Source

Pull request #2041: REPORT-36612 && REPORT-37010 && REPORT-37062 缩放验收bug修复

Merge in DESIGN/design from ~KERRY/design_10.0:release/10.0 to release/10.0

* commit '4db084214fa6f3a36f0b2b0d0c637066ba934332':
  REPORT-36612 && REPORT-37010 && REPORT-37062 缩放验收bug修复
feature/big-screen
kerry 4 years ago
parent
commit
71850d30a2
  1. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  2. 19
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  3. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java

2
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -117,7 +117,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
addFormRuler(); addFormRuler();
} }
this.setFocusTraversalKeysEnabled(false); this.setFocusTraversalKeysEnabled(false);
this.addMouseWheelListener(showValSpinnerMouseWheelListener); this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener);
registerShortCutKey(); registerShortCutKey();
} }

19
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -83,10 +83,12 @@ import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -993,7 +995,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
@Nullable @Nullable
public XCreator getComponentAt(int x, int y, XCreator[] except) { public XCreator getComponentAt(int x, int y, XCreator[] except) {
XLayoutContainer container = y + this.getPaintY() < paraHeight - formArea.getVerticalValue() ? paraComponent : rootComponent; XLayoutContainer container = y < paraHeight - formArea.getVerticalValue() ? paraComponent : rootComponent;
if (container == null) { if (container == null) {
container = rootComponent; container = rootComponent;
} }
@ -1281,6 +1283,21 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
this.formArea = formArea; this.formArea = formArea;
} }
public void paint(Graphics g){
//重新设置下绘制的起点和缩放幅度
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(this.getPaintX(), this.getPaintY());
at.scale(this.getScale(), this.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
super.paint(g);
}
/** /**
* 绘制组件根节点 * 绘制组件根节点
* *

7
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -68,13 +68,6 @@ public class FormDesignerUI extends ComponentUI {
public void paint(final Graphics g, JComponent c) { public void paint(final Graphics g, JComponent c) {
XCreator rootComponent = designer.getRootComponent(); XCreator rootComponent = designer.getRootComponent();
this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution(); this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution();
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(designer.getPaintX(), designer.getPaintY());
at.scale(designer.getScale(), designer.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
if (rootComponent != null) { if (rootComponent != null) {
// 设计自适应界面 // 设计自适应界面
repaintFit(g, rootComponent, c); repaintFit(g, rootComponent, c);

2
designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java

@ -35,7 +35,7 @@ public class ReportComponentComposite extends JComponent implements RemoveListen
private static final int MAX = 400; private static final int MAX = 400;
private static final int HUND = 100; private static final int HUND = 100;
private static final int MIN = 10; private static final int MIN = 10;
private static final int DIR = 15; private static final int DIR = 10;
private JWorkBook parent; private JWorkBook parent;
private UIModeControlContainer parentContainer = null; private UIModeControlContainer parentContainer = null;

2
designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java

@ -35,7 +35,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
private static final int MAX = 400; private static final int MAX = 400;
private static final int HUND = 100; private static final int HUND = 100;
private static final int MIN = 10; private static final int MIN = 10;
private static final int DIR = 15; private static final int DIR = 10;
private static final double MIN_TIME = 0.4; private static final double MIN_TIME = 0.4;
public FormElementCaseDesigner elementCaseDesigner; public FormElementCaseDesigner elementCaseDesigner;
private BaseJForm jForm; private BaseJForm jForm;

Loading…
Cancel
Save