Browse Source

Merge pull request #1350 in BA/design from ~MOMEAK/design9.0:release/9.0 to release/9.0

* commit '0472632a0e585b496589fbc3f5753bb57b5d34a0':
  REPORT-4888 设计器交互修改 聚合报表单元报表缩放-定位线问题
  REPORT-4888 设计器交互修改 聚合报表单元报表缩放问题
  REPORT-4888 设计器交互修改 聚合报表单元报表缩放问题
master
superman 7 years ago
parent
commit
bcbc263b7d
  1. 27
      designer/src/com/fr/poly/PolyDesignUI.java
  2. 10
      designer/src/com/fr/poly/creator/BlockCreator.java
  3. 6
      designer/src/com/fr/poly/creator/ECBlockCreator.java

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

@ -220,18 +220,21 @@ public class PolyDesignUI extends ComponentUI {
ArrayList<JComponent> dbcomponents = new ArrayList<JComponent>();
// richer:禁止双缓冲行为,否则会出现两个图像
ComponentUtils.disableBuffer(comp, dbcomponents);
if (comp instanceof ECBlockCreator) {
Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time));
comp.paint(clipg);
clipg.dispose();
}else {
BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = img.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
comp.printAll(g2d);
g2d.dispose();
g.drawImage(img, (int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time),null);
}
// if (comp instanceof ECBlockCreator) {
// Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time));
// comp.paint(clipg);
// clipg.dispose();
// }else {
BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2d = img.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
comp.printAll(g2d);
g.drawImage(img, (int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time),null);
g2d.dispose();
// }
ComponentUtils.resetBuffer(dbcomponents);
}

10
designer/src/com/fr/poly/creator/BlockCreator.java

@ -114,10 +114,12 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
public Rectangle getEditorBounds() {
Rectangle bounds = this.getBounds();
Dimension d = getEditor().getCornerSize();
bounds.x -= d.width + designer.getHorizontalValue();
bounds.y -= d.height + designer.getVerticalValue();
bounds.width += d.width + PolyConstants.OPERATION_SIZE;
bounds.height += d.height + PolyConstants.OPERATION_SIZE;
//ECBlockCreator缩放的时候边框需要重新算下
double times = this.designer.getResolution() / (double)resolution;
bounds.x -= d.width/times + designer.getHorizontalValue();
bounds.y -= d.height/times + designer.getVerticalValue();
bounds.width += Math.ceil(d.width/times + PolyConstants.OPERATION_SIZE/times);
bounds.height += Math.ceil(d.height/times + PolyConstants.OPERATION_SIZE/times);
return bounds;
}

6
designer/src/com/fr/poly/creator/ECBlockCreator.java

@ -23,8 +23,6 @@ import com.fr.stable.unit.UnitRectangle;
*/
public class ECBlockCreator extends BlockCreator<PolyECBlock> {
private ECBlockEditor editor;
private static final int CREATOR_WIDTH = 20;
private static final int CREATOR_HEIGHT = 9;
public ECBlockCreator() {
@ -69,12 +67,12 @@ public class ECBlockCreator extends BlockCreator<PolyECBlock> {
@Override
public int getX(float time) {
return Math.round ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH;
return Math.round (this.getX() * time);
}
@Override
public int getY(float time) {
return Math.round ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT;
return Math.round (this.getY() * time);
}
/**

Loading…
Cancel
Save