From e35913ef167a692e34891737a7dd524449aaf480 Mon Sep 17 00:00:00 2001 From: momeak Date: Thu, 14 Sep 2017 15:44:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-4450=20=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9C=A8=E7=BC=A9=E6=94=BE=E5=90=8E=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C=E4=BC=9A=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyDesigner.java | 3 +-- designer/src/com/fr/poly/PolyUtils.java | 9 +++++---- .../com/fr/poly/hanlder/BottomCornerMouseHanlder.java | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/poly/PolyDesigner.java b/designer/src/com/fr/poly/PolyDesigner.java index 09d0f8f65..c8cc3362f 100644 --- a/designer/src/com/fr/poly/PolyDesigner.java +++ b/designer/src/com/fr/poly/PolyDesigner.java @@ -272,7 +272,6 @@ public class PolyDesigner extends ReportComponent= 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; diff --git a/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java b/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java index 3f063e21d..84a626406 100644 --- a/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java +++ b/designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java @@ -15,6 +15,7 @@ import com.fr.design.beans.location.Absorptionline; import com.fr.design.beans.location.MoveUtils; import com.fr.design.beans.location.MoveUtils.RectangleDesigner; import com.fr.design.beans.location.MoveUtils.RectangleIterator; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.general.ComparatorUtils; import com.fr.poly.PolyDesigner; import com.fr.poly.PolyDesigner.SelectionType; @@ -101,6 +102,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter { dragStart.y -= pressed.y; TemplateBlock block = editor.getValue(); + resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); Rectangle bounds = block.getBounds().toRectangle(resolution); Point resultPoint = MoveUtils.sorption(bounds.x + dragStart.x < 0 ? 0 : bounds.x + dragStart.x, bounds.y + dragStart.y < 0 ? 0 : bounds.y + dragStart.y, bounds.width, bounds.height, rectDesigner, false); From 28eeb0192539fe41238450a804753293f574410a Mon Sep 17 00:00:00 2001 From: momeak Date: Thu, 14 Sep 2017 17:29:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-4450=20=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9C=A8=E7=BC=A9=E6=94=BE=E5=90=8E=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C=E4=BC=9A=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E9=94=99=E4=B9=B1=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9xy=E5=9D=90=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyDesignUI.java | 2 +- designer/src/com/fr/poly/creator/ECBlockCreator.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer/src/com/fr/poly/PolyDesignUI.java b/designer/src/com/fr/poly/PolyDesignUI.java index 9fdc8788e..8cc3583d8 100644 --- a/designer/src/com/fr/poly/PolyDesignUI.java +++ b/designer/src/com/fr/poly/PolyDesignUI.java @@ -106,7 +106,7 @@ public class PolyDesignUI extends ComponentUI { BlockCreator creator = addedData.getAddedAt(i); // richer:如果当前这个组件正在编辑,那么他是完全被他的编辑器所遮挡的,不需要画出来 if (creator == designer.getSelection()) { - paintPositionLine(g, Math.round(creator.getX() * time), Math.round(creator.getY() * time), + paintPositionLine(g, Math.round(creator.getX(time)), Math.round(creator.getY(time)), Math.round(designer.getHorizontalValue()*time), Math.round(designer.getVerticalValue()*time)); if (creator.getEditor().isDragging()) { creator.getEditor().paintAbsorptionline(g); diff --git a/designer/src/com/fr/poly/creator/ECBlockCreator.java b/designer/src/com/fr/poly/creator/ECBlockCreator.java index 92313115e..3921bea39 100644 --- a/designer/src/com/fr/poly/creator/ECBlockCreator.java +++ b/designer/src/com/fr/poly/creator/ECBlockCreator.java @@ -23,8 +23,8 @@ import com.fr.stable.unit.UnitRectangle; */ public class ECBlockCreator extends BlockCreator { private ECBlockEditor editor; - private static final int CREATOR_WIDTH = 30; - private static final int CREATOR_HEIGHT = 19; + private static final int CREATOR_WIDTH = 20; + private static final int CREATOR_HEIGHT = 9; public ECBlockCreator() { @@ -69,12 +69,12 @@ public class ECBlockCreator extends BlockCreator { @Override public int getX(float time) { - return (int) ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH; + return Math.round ((this.getX() - CREATOR_WIDTH) * time) + CREATOR_WIDTH; } @Override public int getY(float time) { - return (int) ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT; + return Math.round ((this.getY() - CREATOR_HEIGHT) * time) + CREATOR_HEIGHT; } /** From 372ae835da4a36b5a99e124eb8f619baafaa4f46 Mon Sep 17 00:00:00 2001 From: momeak Date: Thu, 14 Sep 2017 20:02:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-4186=20[=E4=BB=A3=E7=A0=81=E8=B4=A8?= =?UTF-8?q?=E9=87=8F]=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=A0=87=E9=A2=98=EF=BC=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=9C=80=E5=A5=BD=E7=94=A8=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/foldablepane/HeaderPane.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/design/foldablepane/HeaderPane.java b/designer_base/src/com/fr/design/foldablepane/HeaderPane.java index f0d19ee39..8e99896bc 100644 --- a/designer_base/src/com/fr/design/foldablepane/HeaderPane.java +++ b/designer_base/src/com/fr/design/foldablepane/HeaderPane.java @@ -1,5 +1,6 @@ package com.fr.design.foldablepane; +import com.fr.base.GraphHelper; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxUtilities; @@ -53,6 +54,7 @@ public class HeaderPane extends JPanel { RenderingHints.VALUE_ANTIALIAS_ON); BufferedImage panelImage = createPanelImage(); g2d.drawImage(panelImage, null, 0, 0); + GraphHelper.drawString(g2d, this.title, TITLE_X, headHeight - fontSize / 2 - 1); } private BufferedImage createPanelImage() { @@ -67,7 +69,6 @@ public class HeaderPane extends JPanel { if (desktopHints != null) { g2d.setRenderingHints(desktopHints); } - g2d.drawString(this.title, TITLE_X, headHeight - fontSize / 2 - 1); int leftWdith = headWidth - LEFT_X; if (this.isShow) { image = UIConstants.DRAG_DOWN_SELECTED_SMALL; @@ -103,13 +104,13 @@ public class HeaderPane extends JPanel { } public static void main(String[] args) { -// JFrame mainFrame = new JFrame("UI Demo - Gloomyfish"); -// mainFrame.getContentPane().setLayout(new BorderLayout()); -// mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 24), BorderLayout.CENTER); -// mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); -// mainFrame.pack(); -// mainFrame.setSize(300, 400); -// mainFrame.setVisible(true); + JFrame mainFrame = new JFrame("UI Demo - Gloomyfish"); + mainFrame.getContentPane().setLayout(new BorderLayout()); + mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 24), BorderLayout.CENTER); + mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + mainFrame.pack(); + mainFrame.setSize(300, 400); + mainFrame.setVisible(true); } }