From 8d368d6abd3473cfef75e9cd2c97e1c43b90dc78 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 10 Aug 2017 14:02:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E9=80=89=E4=B8=AD=E5=85=83=E7=B4=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyUtils.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer/src/com/fr/poly/PolyUtils.java b/designer/src/com/fr/poly/PolyUtils.java index e18fabe030..a0d13a0429 100644 --- a/designer/src/com/fr/poly/PolyUtils.java +++ b/designer/src/com/fr/poly/PolyUtils.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import com.fr.base.FRContext; +import com.fr.base.ScreenResolution; import com.fr.base.chart.BaseChart; import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BasePlot; @@ -114,10 +115,11 @@ public class PolyUtils { AddedData addedData = designer.getAddedData(); for (int count = addedData.getAddedCount() - 1; count >= 0; count--) { BlockCreator creator = addedData.getAddedAt(count); - int cx = creator.getX(); - int cy = creator.getY(); - int cw = creator.getWidth(); - int ch = creator.getHeight(); + float times = (float) designer.getResolution()/ScreenResolution.getScreenResolution(); + int cx = (int) (creator.getX() * times); + int cy = (int) (creator.getY() * times); + int cw = (int) (creator.getWidth() * times); + int ch = (int) (creator.getHeight() * times); if (x >= cx && x <= (cx + cw)) { if(y >= cy && y <= (cy + ch)) { return creator; From 6d9b8ad2a8be67addc9c80ddbe4c984778e76cdf Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 10 Aug 2017 17:16:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E7=BC=A9=E6=94=BE=E5=90=8E=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E9=97=AE=E9=A2=98=202.=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E6=9D=A1=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E9=80=89=E4=B8=AD=203.=E6=8A=A5=E8=A1=A8=E7=BC=A9?= =?UTF-8?q?=E6=94=BE40%=E4=BB=A5=E4=B8=8B=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JWorkBook.java | 40 ++++++++++++------- .../form/FormReportComponentComposite.java | 7 ++++ .../com/fr/design/mainframe/JSliderPane.java | 22 +++++----- 3 files changed, 43 insertions(+), 26 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 16fa43c77a..55874853d7 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -87,6 +87,7 @@ public class JWorkBook extends JTemplate { private static final String SHARE_SUFFIX = "_share"; private static final String SHARE_FOLDER = "share"; private static final int TOOLBARPANEDIMHEIGHT = 26; + private static final double MIN_TIME = 0.4; private UIModeControlContainer centerPane; public ReportComponentComposite reportComposite; @@ -363,7 +364,13 @@ public class JWorkBook extends JTemplate { this.resolution = resolution; ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; PolyDesigner polyDezi = reportComposite.centerCardPane.getPolyDezi(); - if (elementCasePane != null){ + if (elementCasePane != null) { + //分页线 + if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { + elementCasePane.getGrid().setShowGridLine(false); + } else { + elementCasePane.getGrid().setShowGridLine(true); + } elementCasePane.setResolution(resolution); elementCasePane.getGrid().getGridMouseAdapter().setResolution(resolution); elementCasePane.getGrid().setResolution(resolution); @@ -375,29 +382,30 @@ public class JWorkBook extends JTemplate { grid.setHorizontalExtent(GridUtils.getExtentValue(0, columnWidthList, grid.getWidth(), resolution)); elementCasePane.getGrid().updateUI(); //更新Column和Row - ((DynamicScrollBar)elementCasePane.getVerticalScrollBar()).setDpi(resolution); - ((DynamicScrollBar)elementCasePane.getHorizontalScrollBar()).setDpi(resolution); + ((DynamicScrollBar) elementCasePane.getVerticalScrollBar()).setDpi(resolution); + ((DynamicScrollBar) elementCasePane.getHorizontalScrollBar()).setDpi(resolution); elementCasePane.getGridColumn().setResolution(resolution); elementCasePane.getGridColumn().updateUI(); elementCasePane.getGridRow().setResolution(resolution); elementCasePane.getGridRow().updateUI(); } - if (polyDezi != null){ + if (polyDezi != null) { polyDezi.setResolution(resolution); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution); polyDezi.updateUI(); } HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified(); } + @Override - public int selfAdaptUpdate(){ + public int selfAdaptUpdate() { PolyDesigner polyDezi = reportComposite.centerCardPane.getPolyDezi(); ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; - if (resolution == 0){ + if (resolution == 0) { resolution = ScreenResolution.getScreenResolution(); } - if (polyDezi != null && polyDezi.getSelection() != null){ - BlockCreator blockCreator =polyDezi.getSelection(); + if (polyDezi != null && polyDezi.getSelection() != null) { + BlockCreator blockCreator = polyDezi.getSelection(); double x = blockCreator.getEditorBounds().getX(); double y = blockCreator.getEditorBounds().getY(); polyDezi.setHorizontalValue((int) x); @@ -406,30 +414,33 @@ public class JWorkBook extends JTemplate { double creatorWidth = blockCreator.getEditorBounds().width; double areaHeight = polyDezi.polyArea.getHeight(); double areaWidth = polyDezi.polyArea.getWidth(); - if (creatorWidth == 0||creatorHeight == 0){ + if (creatorWidth == 0 || creatorHeight == 0) { return resolution; } - double time =(areaHeight/creatorHeight)<(areaWidth/creatorWidth) ? (areaHeight/creatorHeight) : (areaWidth/creatorWidth); + double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth); return (int) (time * ScreenResolution.getScreenResolution()); - }else if (elementCasePane != null) { + } else if (elementCasePane != null) { ElementCasePane reportPane = elementCasePane.getGrid().getElementCasePane(); + if (reportPane.getSelection().getSelectedColumns().length == 0) { + return resolution; + } int column = reportPane.getSelection().getSelectedColumns()[0]; double columnLength = reportPane.getSelection().getSelectedColumns().length; double columnExtent = reportPane.getGrid().getHorizontalExtent(); int row = reportPane.getSelection().getSelectedRows()[0]; double rowLength = reportPane.getSelection().getSelectedRows().length; double rowExtent = reportPane.getGrid().getVerticalExtent(); - if (columnLength == 0||rowLength == 0){ + if (columnLength == 0 || rowLength == 0) { return resolution; } - double time = (columnExtent/columnLength) < (rowExtent/rowLength) ? (columnExtent/columnLength) : (rowExtent/rowLength); + double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength); if (reportPane.isHorizontalScrollBarVisible()) { reportPane.getVerticalScrollBar().setValue(row); reportPane.getHorizontalScrollBar().setValue(column); } return (int) (time * elementCasePane.getGrid().getResolution()); - }else { + } else { return resolution; } } @@ -790,7 +801,6 @@ public class JWorkBook extends JTemplate { * 是否支持预览 * * @return 预览接口 - * */ public PreviewProvider[] supportPreview() { Set set = ExtraDesignClassManager.getInstance().getArray(PreviewProvider.MARK_STRING); diff --git a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java index ecff0addf7..a8d048a91c 100644 --- a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java +++ b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java @@ -33,6 +33,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo private static final int MAX = 400; private static final int HUND = 100; private static final int MIN = 10; + private static final double MIN_TIME = 0.4; public FormElementCaseDesigner elementCaseDesigner; private BaseJForm jForm; @@ -112,6 +113,12 @@ public class FormReportComponentComposite extends JComponent implements TargetMo private void setScale(int resolution) { ElementCasePane elementCasePane = elementCaseDesigner.getEditingElementCasePane(); + //分页线 + if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { + elementCasePane.getGrid().setShowGridLine(false); + } else { + elementCasePane.getGrid().setShowGridLine(true); + } elementCasePane.setResolution(resolution); elementCasePane.getGrid().getGridMouseAdapter().setResolution(resolution); elementCasePane.getGrid().setResolution(resolution); diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 2e54054eaf..7f3ad51f45 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -91,7 +91,6 @@ public class JSliderPane extends JPanel { } - public static final JSliderPane getInstance() { // if (THIS == null) { // THIS = new JSliderPane(); @@ -101,8 +100,8 @@ public class JSliderPane extends JPanel { } private void initSlider() { - slider = new UISlider(0, HUNDRED, HALF_HUNDRED){ - public Point getToolTipLocation(MouseEvent event){ + slider = new UISlider(0, HUNDRED, HALF_HUNDRED) { + public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; @@ -115,8 +114,8 @@ public class JSliderPane extends JPanel { } private void initShowValSpinner() { - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){ - public Point getToolTipLocation(MouseEvent event){ + showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)) { + public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; @@ -126,16 +125,16 @@ public class JSliderPane extends JPanel { } private void initDownUpButton() { - downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")){ - public Point getToolTipLocation(MouseEvent event){ + downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")) { + public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; downButton.setOpaque(false); downButton.setBorderPainted(false); downButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Down")); - upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")){ - public Point getToolTipLocation(MouseEvent event){ + upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")) { + public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; @@ -149,8 +148,8 @@ public class JSliderPane extends JPanel { } private void initShowValButton() { - showValButton = new JButton(showValSpinner.getValue() + "%"){ - public Point getToolTipLocation(MouseEvent event){ + showValButton = new JButton(showValSpinner.getValue() + "%") { + public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; @@ -278,6 +277,7 @@ public class JSliderPane extends JPanel { getTimes(sliderValue); showValue = times; showValSpinner.setValue(times); + customButton.setSelected(true); } }); } else { From cb043f57124c44a5eb92357c7cdfe1bcfae127ab Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 10 Aug 2017 17:20:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/mainframe/JWorkBook.java | 2 +- .../fr/design/mainframe/form/FormReportComponentComposite.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 55874853d7..2b23dabb7f 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -365,7 +365,7 @@ public class JWorkBook extends JTemplate { ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; PolyDesigner polyDezi = reportComposite.centerCardPane.getPolyDezi(); if (elementCasePane != null) { - //分页线 + //网格线 if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { elementCasePane.getGrid().setShowGridLine(false); } else { diff --git a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java index a8d048a91c..f091cbe8aa 100644 --- a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java +++ b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java @@ -113,7 +113,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo private void setScale(int resolution) { ElementCasePane elementCasePane = elementCaseDesigner.getEditingElementCasePane(); - //分页线 + //网格线 if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { elementCasePane.getGrid().setShowGridLine(false); } else {