From b82ad6f4a45bb1330ddba05e3ee38e49601f5732 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 7 Sep 2017 09:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormArea.java | 26 +++++++------- .../src/com/fr/design/mainframe/JForm.java | 35 +++++++++++-------- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormArea.java b/designer_form/src/com/fr/design/mainframe/FormArea.java index 0ccae9b99..81ddf6ae2 100644 --- a/designer_form/src/com/fr/design/mainframe/FormArea.java +++ b/designer_form/src/com/fr/design/mainframe/FormArea.java @@ -35,6 +35,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { private static final int ROTATIONS = 50; private static final int SHOWVALMAX = 400; private static final int SHOWVALMIN = 10; + private static final int RESIZE_PANE_GAP = 8; private FormDesigner designer; private int horizontalValue = 0; private int verticalValue = 0; @@ -119,11 +120,10 @@ public class FormArea extends JComponent implements ScrollRulerComponent { slidePane = JFormSliderPane.getInstance(); slidePane.setPreferredSize(new Dimension(200, 20)); - - JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ - {tipsPane, new UILabel(), widthPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel("x"), - heightPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel(), slidePane}}, - rowSize, columnSize, 8); + JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane( + new JComponent[][]{{ tipsPane, new UILabel(), widthPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel("x"), + heightPane, new UILabel(Inter.getLocText("FR-Designer_Indent-Pixel")), new UILabel(), slidePane }}, + rowSize, columnSize, RESIZE_PANE_GAP); this.add(FormRulerLayout.BOTTOM, resizePane); setWidgetsConfig(); // 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小 @@ -439,14 +439,13 @@ public class FormArea extends JComponent implements ScrollRulerComponent { int id = evt.getID(); switch (id) { case MouseEvent.MOUSE_WHEEL: { - int rotations = evt.getWheelRotation(); - int value = this.verScrollBar.getValue() + rotations * ROTATIONS; - value = Math.min(value, verticalMax); - value = Math.max(0, value); + int value = this.verScrollBar.getValue() + evt.getWheelRotation() * ROTATIONS; + value = Math.max(0, Math.min(value, verticalMax)); doLayout(); //加dolayout是因为每次滚动都要重置 Max的大小 this.verScrollBar.setValue(value); break; } + default: } } @@ -743,9 +742,12 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } private class FormRulerLayout extends RulerLayout { - private int DESIGNERWIDTH = 960; - private int DESIGNERHEIGHT = 540; - private int TOPGAP = 8; + private static final int DESIGNER_WIDTH = 960; + private static final int DESIGNER_HEIGHT = 540; + private static final int TOPGAP = 8; + + private int DESIGNERWIDTH = DESIGNER_WIDTH; + private int DESIGNERHEIGHT = DESIGNER_HEIGHT; public FormRulerLayout() { super(); diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 0f979a8ec..6a98530da 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -93,6 +93,8 @@ public class JForm extends JTemplate implements BaseJForm { @Override public void refreshEastPropertiesPane() { + // 暂时用不到,遇到的时候再加刷新右侧tab面板的代码 + return; } @Override @@ -126,7 +128,7 @@ public class JForm extends JTemplate implements BaseJForm { @Override public void setJTemplateResolution(int resolution) { - + return; } @Override @@ -270,14 +272,14 @@ public class JForm extends JTemplate implements BaseJForm { } public void setSheetCovered(boolean isCovered) { - + return; } /** * 刷新容器 */ public void refreshContainer() { - + return; } /** @@ -289,6 +291,7 @@ public class JForm extends JTemplate implements BaseJForm { @Override public void setScale(int resolution) { + return; } @Override @@ -464,12 +467,12 @@ public class JForm extends JTemplate implements BaseJForm { @Override public ShortCut[] shortcut4TemplateMenu() { if (this.index == FORM_TAB) { - return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ + return (ShortCut[]) ArrayUtils.addAll( new ShortCut[]{ new TemplateParameterAction(this), new FormMobileAttrAction(this) }, new ShortCut[0]); } else { - return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ + return (ShortCut[]) ArrayUtils.addAll( new ShortCut[]{ new TemplateParameterAction(this), new FormMobileAttrAction(this) }, this.elementCaseDesign.shortcut4TemplateMenu()); @@ -680,16 +683,14 @@ public class JForm extends JTemplate implements BaseJForm { return; } - if (formDesign.isReportBlockEditing()) { - if (elementCaseDesign != null) { - EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT); - EastRegionContainerPane.getInstance().removeParameterPane(); - EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane()); - EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane()); - EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane()); - EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane()); - return; - } + if (formDesign.isReportBlockEditing() && elementCaseDesign != null) { + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT); + EastRegionContainerPane.getInstance().removeParameterPane(); + EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane()); + EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane()); + EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane()); + EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane()); + return; } EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); @@ -699,6 +700,10 @@ public class JForm extends JTemplate implements BaseJForm { EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); + refreshWidgetLibPane(); + } + + private void refreshWidgetLibPane() { if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) { new Thread() { public void run() {