From b0320541a95626d2e2da510e9b15a2a2908dd875 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 24 Aug 2021 11:34:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-57706=20&&=20REPORT-57694=20?= =?UTF-8?q?=E6=96=B0=E8=87=AA=E9=80=82=E5=BA=94-=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E5=88=97=E5=AE=BD=E8=AE=BE=E7=BD=AE66.66.=E4=BD=86?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=BA66=E5=83=8F=E7=B4=A0=EF=BC=9B?= =?UTF-8?q?=E6=96=B0=E8=87=AA=E9=80=82=E5=BA=94-=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E8=AE=BE=E7=BD=AE=E8=A1=8C=E9=AB=98=E4=B8=BA3000?= =?UTF-8?q?=E5=90=8E=E7=9B=B4=E6=8E=A5=E9=9A=90=E8=97=8F=E8=A1=8C=E4=BA=86?= =?UTF-8?q?=EF=BC=88=E8=A1=8C=E9=AB=98=E5=8F=98=E4=B8=BA0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/frpane/UnitInputPane.java | 21 +++++++++++-------- .../grid/AbstractGridHeaderMouseHandler.java | 17 +++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java index bab3e8851..5769fdacf 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.GeneralUtils; import com.fr.stable.AssistUtils; import com.fr.stable.StringUtils; @@ -27,7 +28,8 @@ import java.math.BigDecimal; * For input Number. */ public abstract class UnitInputPane extends BasicPane { - private static final double NUM_POINT = 0.000001; + private static final double MAX_NUM = 3000.0D; + private static final double NUM_POINT = 0.000001; private int scale = -1; String title; @@ -46,7 +48,7 @@ public abstract class UnitInputPane extends BasicPane { centerPane.add(titleLabel); // Denny:在对话框中加入JSpinner对象 - numberFieldSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 999, 1)); + numberFieldSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, MAX_NUM, 1)); GUICoreUtils.setColumnForSpinner(numberFieldSpinner, 24); numberFieldSpinner.setPreferredSize(new Dimension(60, 20)); numberFieldSpinner.setMinimumSize(new Dimension(60, 20)); @@ -71,17 +73,17 @@ public abstract class UnitInputPane extends BasicPane { public void populate(float floatValue) { popValue = floatValue; - numberFieldSpinner.setModel(new SpinnerNumberModel(0.00, 0.00, 999.00, 0.01)); + numberFieldSpinner.setModel(new SpinnerNumberModel(0.00, 0.00, MAX_NUM, 0.01)); JFormattedTextField temp = GUICoreUtils.getSpinnerTextField(numberFieldSpinner); addChangeListener(temp); - BigDecimal de = new BigDecimal(floatValue + ""); + BigDecimal de = new BigDecimal(GeneralUtils.objectToString(floatValue)); if (scale > 0) { floatValue = de.setScale(scale, BigDecimal.ROUND_DOWN).floatValue(); } else { floatValue = de.floatValue(); } - //选中多列, 并且列宽不完全一致的话, 就不显示值了. + //选中多列, 并且列宽不完全一致的话, 就不显示值了. temp.setText(AssistUtils.equals(floatValue, 0) ? StringUtils.EMPTY : Utils.convertNumberStringToString(new Float(floatValue))); // denny:默认应该为选中,方便用户修改 @@ -99,8 +101,8 @@ public abstract class UnitInputPane extends BasicPane { public double update() throws ValueNotChangeException { // 值没变就不改 if (!changed) { - throw vncExp; - } + throw vncExp; + } // Denny: get numberFieldSpinner 的 TextField JFormattedTextField temp = GUICoreUtils.getSpinnerTextField(numberFieldSpinner); @@ -108,7 +110,8 @@ public abstract class UnitInputPane extends BasicPane { if (temp.getText().length() == 0) { return 0; } - BigDecimal de = new BigDecimal(temp.getText()); + + BigDecimal de = new BigDecimal(GeneralUtils.objectToString(temp.getValue())); if (scale > 0) { return de.setScale(scale, BigDecimal.ROUND_DOWN).floatValue(); } else { @@ -176,4 +179,4 @@ public abstract class UnitInputPane extends BasicPane { // 鼠标按键在组件上单击时 } }; -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java index b04e4ad1e..044f0a458 100644 --- a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java +++ b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java @@ -157,7 +157,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { dragType = GridUtils.DRAG_CELL_SIZE; isDragPermited = true; dragIndex = index; - showToolTip(evt, createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution))); + showToolTip(evt, createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1))); return true; } if (between(evt, tmpSize1, tmpSize2)) { @@ -301,21 +301,18 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { protected abstract void resetGridSelectionBySelect(int index, ElementCasePane ePane); - private String createToolTipString(double doubleValue, double totalDoubleValue) { + private String createToolTipString(UNIT unitValue, UNIT totalUnitValue) { int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); -// int resolution = ScreenResolution.getScreenResolution(); - FU ulen = FU.valueOfPix((int) doubleValue, resolution); - FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution); ReportLengthUNITProvider lengthUNIT = DesignerUIModeConfig.getInstance().parseLengthUNIT(unitType); String unit = lengthUNIT.unitText(); - double len = lengthUNIT.unit2Value4Scale(ulen); - double tlen = lengthUNIT.unit2Value4Scale(tulen); + double len = lengthUNIT.unit2Value4Scale(unitValue); + double tlen = lengthUNIT.unit2Value4Scale(totalUnitValue); StringBuilder sb = new StringBuilder(); sb.append(String.format("%.2f", new Double(len))) .append('/').append(String.format("%.2f", new Double(tlen))) .append(unit).append('(') - .append((int)(doubleValue)).append('/') - .append((int)(totalDoubleValue)) + .append((int)(unitValue.toPixD(resolution))).append('/') + .append((int)(totalUnitValue.toPixD(resolution))) .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) .append(')'); return sb.toString(); @@ -416,7 +413,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { DynamicUnitList sizeList = getSizeList(report); // int resolution = ScreenResolution.getScreenResolution(); - this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution))); + this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1))); } ePane.repaint(); From 1beaddc1e5fcc17280242d1467aa1301a76a840f Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 24 Aug 2021 13:37:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-57582=E3=80=90FRX=E3=80=91=E6=96=B0?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E5=BD=B1=E5=93=8D=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=89=93=E5=BC=80cpt=EF=BC=8C=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E5=BE=88=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/fit/common/TemplateTool.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java index 0d8696ba3..323a28ad0 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java @@ -39,6 +39,7 @@ public class TemplateTool { @Override public void on(Event event, JTemplate jTemplate) { if (!(jTemplate instanceof JForm)) { + JFormType.OLD_TYPE.switchUIMode(); return; } JFormType currentType = JFormType.OLD_TYPE;