Browse Source

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

* commit 'e11ab31af65b709beeb8e346bc353bc8ac869a47':
  REPORT-4480 [9.0一轮回归]设计器设置标尺单位无效
  REPORT-4450 聚合报表在缩放后编辑报表块,会出现单元格错乱
master
superman 7 years ago
parent
commit
9fa3c52a42
  1. 38
      designer/src/com/fr/poly/PolyDesignUI.java
  2. 9
      designer/src/com/fr/poly/PolyUtils.java
  3. 1
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  4. 2
      designer_base/src/com/fr/design/scrollruler/HorizontalRulerUI.java
  5. 2
      designer_base/src/com/fr/design/scrollruler/VerticalRulerUI.java

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

@ -3,12 +3,7 @@
*/ */
package com.fr.poly; package com.fr.poly;
import java.awt.Color; import java.awt.*;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@ -29,6 +24,7 @@ import com.fr.page.PaperSettingProvider;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.poly.creator.BlockCreator; import com.fr.poly.creator.BlockCreator;
import com.fr.poly.creator.ECBlockCreator; import com.fr.poly.creator.ECBlockCreator;
import com.fr.poly.creator.ECBlockEditor;
import com.fr.poly.model.AddedData; import com.fr.poly.model.AddedData;
import com.fr.poly.model.AddingData; import com.fr.poly.model.AddingData;
import com.fr.report.report.Report; import com.fr.report.report.Report;
@ -101,6 +97,7 @@ public class PolyDesignUI extends ComponentUI {
paintAddingData(g2d, addData); paintAddingData(g2d, addData);
} }
paintPaginateLine(g2d); paintPaginateLine(g2d);
designer.repaint();
} }
private void paintAddedData(Graphics g) { private void paintAddedData(Graphics g) {
@ -109,8 +106,8 @@ public class PolyDesignUI extends ComponentUI {
BlockCreator creator = addedData.getAddedAt(i); BlockCreator creator = addedData.getAddedAt(i);
// richer:如果当前这个组件正在编辑,那么他是完全被他的编辑器所遮挡的,不需要画出来 // richer:如果当前这个组件正在编辑,那么他是完全被他的编辑器所遮挡的,不需要画出来
if (creator == designer.getSelection()) { if (creator == designer.getSelection()) {
paintPositionLine(g, creator.getX(time), creator.getY(time), paintPositionLine(g, Math.round(creator.getX() * time), Math.round(creator.getY() * time),
(int) (designer.getHorizontalValue()*time), (int) (designer.getVerticalValue()*time)); Math.round(designer.getHorizontalValue()*time), Math.round(designer.getVerticalValue()*time));
if (creator.getEditor().isDragging()) { if (creator.getEditor().isDragging()) {
creator.getEditor().paintAbsorptionline(g); creator.getEditor().paintAbsorptionline(g);
//如果与其他块重合了, 需要画出提示禁止重叠 //如果与其他块重合了, 需要画出提示禁止重叠
@ -121,8 +118,8 @@ public class PolyDesignUI extends ComponentUI {
creator.getEditor().hideForbiddenWindow(); creator.getEditor().hideForbiddenWindow();
} }
} else { } else {
paintCreator(g, creator, (int) (creator.getX()*time - designer.getHorizontalValue()*time), (int) (creator.getY()*time - designer.getVerticalValue()*time), paintCreator(g, creator, creator.getX() - designer.getHorizontalValue(), creator.getY() - designer.getVerticalValue(),
(int) (creator.getWidth()*time), (int) (creator.getHeight()*time)); creator.getWidth(), creator.getHeight());
} }
} }
} }
@ -223,16 +220,19 @@ public class PolyDesignUI extends ComponentUI {
ArrayList<JComponent> dbcomponents = new ArrayList<JComponent>(); ArrayList<JComponent> dbcomponents = new ArrayList<JComponent>();
// richer:禁止双缓冲行为,否则会出现两个图像 // richer:禁止双缓冲行为,否则会出现两个图像
ComponentUtils.disableBuffer(comp, dbcomponents); ComponentUtils.disableBuffer(comp, dbcomponents);
// Graphics clipg = g.create(x, y, width*resolution/ScreenResolution.getScreenResolution(), height*resolution/ScreenResolution.getScreenResolution()); if (comp instanceof ECBlockCreator) {
// Graphics clipg = g.create((int) (x * time), (int) (y * time), (int) (width * time), (int) (height * time));
BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB); comp.paint(clipg);
Graphics2D g2d = img.createGraphics(); clipg.dispose();
comp.printAll(g2d); }else {
g2d.dispose(); BufferedImage img = CoreGraphHelper.createBufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
g.drawImage(img,x,y,width,height,null); 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);
}
// comp.paint(clipg);
// clipg.dispose();
ComponentUtils.resetBuffer(dbcomponents); ComponentUtils.resetBuffer(dbcomponents);
} }

9
designer/src/com/fr/poly/PolyUtils.java

@ -115,11 +115,10 @@ public class PolyUtils {
AddedData addedData = designer.getAddedData(); AddedData addedData = designer.getAddedData();
for (int count = addedData.getAddedCount() - 1; count >= 0; count--) { for (int count = addedData.getAddedCount() - 1; count >= 0; count--) {
BlockCreator creator = addedData.getAddedAt(count); BlockCreator creator = addedData.getAddedAt(count);
float times = (float) designer.getResolution()/ScreenResolution.getScreenResolution(); int cx = creator.getX();
int cx = (int) (creator.getX() * times); int cy = creator.getY();
int cy = (int) (creator.getY() * times); int cw = creator.getWidth();
int cw = (int) (creator.getWidth() * times); int ch = creator.getHeight();
int ch = (int) (creator.getHeight() * times);
if (x >= cx && x <= (cx + cw)) { if (x >= cx && x <= (cx + cw)) {
if(y >= cy && y <= (cy + ch)) { if(y >= cy && y <= (cy + ch)) {
return creator; return creator;

1
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -34,6 +34,7 @@ import java.awt.*;
*/ */
public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> { public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
private static final int HEIGHT_MORE = 5; private static final int HEIGHT_MORE = 5;
private int resolution = ScreenResolution.getScreenResolution();
public ECBlockEditor(PolyDesigner designer, ECBlockCreator creator) { public ECBlockEditor(PolyDesigner designer, ECBlockCreator creator) {
super(designer, creator); super(designer, creator);

2
designer_base/src/com/fr/design/scrollruler/HorizontalRulerUI.java

@ -27,7 +27,7 @@ public class HorizontalRulerUI extends RulerUI {
g.setColor(BaseRuler.UNIT_SIGN_COLOR); g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) { if (i % BaseRuler.SCALE_10 == 0) {
double times = (double)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution(); double times = (double)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
String text = Utils.convertNumberStringToString(Math.round(i / times)); String text = Utils.convertNumberStringToString(Math.round((i / times) / showText));
Graphics2D gg = (Graphics2D) g.create((int) (toPX(i) / ratio) - extra + 1, 0, BaseRuler.NUMBER_100, size.height); Graphics2D gg = (Graphics2D) g.create((int) (toPX(i) / ratio) - extra + 1, 0, BaseRuler.NUMBER_100, size.height);
BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_100, BaseRuler.NUMBER_14, text, Style.getInstance().deriveHorizontalAlignment( BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_100, BaseRuler.NUMBER_14, text, Style.getInstance().deriveHorizontalAlignment(
Style.LEFT_TO_RIGHT).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution()); Style.LEFT_TO_RIGHT).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution());

2
designer_base/src/com/fr/design/scrollruler/VerticalRulerUI.java

@ -24,7 +24,7 @@ public class VerticalRulerUI extends RulerUI{
g.setColor(BaseRuler.UNIT_SIGN_COLOR); g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) { if (i % BaseRuler.SCALE_10 == 0) {
double times = (double) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution(); double times = (double) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
String text = Utils.convertNumberStringToString(Math.round(i / times)); String text = Utils.convertNumberStringToString(Math.round((i / times) / showText));
GraphHelper.drawLine(g, size.width, toPX(i) / ratio - extra, 0, toPX(i) / ratio - extra); GraphHelper.drawLine(g, size.width, toPX(i) / ratio - extra, 0, toPX(i) / ratio - extra);
Graphics2D gg = (Graphics2D) g.create(0, (int) (toPX(i) / ratio - extra + 1), size.width, BaseRuler.NUMBER_99); Graphics2D gg = (Graphics2D) g.create(0, (int) (toPX(i) / ratio - extra + 1), size.width, BaseRuler.NUMBER_99);
BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_11, BaseRuler.NUMBER_100, text, Style.getInstance().deriveVerticalAlignment(1).deriveRotation( BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_11, BaseRuler.NUMBER_100, text, Style.getInstance().deriveVerticalAlignment(1).deriveRotation(

Loading…
Cancel
Save