From 1122c29fdb225d00701b40fe97665354def7e10c Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 16 Apr 2020 16:48:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-29732=20&&=20REPORT-29432=20=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/itableeditorpane/UITableModelAdapter.java | 2 +- .../com/fr/design/javascript/JavaScriptImplPane.java | 3 ++- .../widget/accessibles/BaseAccessibleEditor.java | 3 ++- .../java/com/fr/design/parameter/ParameterArrayPane.java | 5 +++-- .../java/com/fr/design/present/dict/FormulaDictPane.java | 7 ++++--- .../src/main/java/com/fr/design/upm/UpmFinder.java | 2 +- .../adapters/layout/FRCardMainBorderLayoutAdapter.java | 5 +++-- .../widget/ui/designer/component/WidgetBoundPane.java | 9 +++++---- .../ui/designer/component/WidgetCardTagBoundPane.java | 5 +++-- .../com/fr/design/cell/editor/DSColumnCellEditor.java | 2 +- .../main/java/com/fr/design/dscolumn/DSColumnPane.java | 2 ++ .../src/main/java/com/fr/design/webattr/WebJsPane.java | 4 ++-- 12 files changed, 29 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java index fc219a30b..7d0411307 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java @@ -235,7 +235,7 @@ public abstract class UITableModelAdapter extends AbstractTabl public void actionPerformed(ActionEvent e) { int[] selectedRow = table.getSelectedRows(); if (ismultiSelected()) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text")); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text")); return; } if (table.getCellEditor() != null) { diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 8806d6853..158c05d1e 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -2,6 +2,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; @@ -62,7 +63,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } if (tempSet.contains(list.get(i).toString())) { list.remove(i); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!"); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!"); parameterChanger(list); return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java index 9f73a06d3..e6ddd8138 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import javax.swing.*; import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; @@ -222,7 +223,7 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor } public static void showMessage(String message, Component editorComponent) { - JOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE); } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index 30cac90eb..d3efcae4a 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -2,6 +2,7 @@ package com.fr.design.parameter; import com.fr.base.Parameter; import com.fr.base.ParameterConfig; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; @@ -36,14 +37,14 @@ public class ParameterArrayPane extends JListControlPane { String tempName = getEditingName(); if (StringUtils.isEmpty(tempName)) { nameableList.stopEditing(); - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); setIllegalIndex(editingIndex); return; } if (!ComparatorUtils.equals(tempName, selectedName) && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { nameableList.stopEditing(); - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); setIllegalIndex(editingIndex); } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java index ff1384620..2eca81466 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.FRWidgetFactory; import com.fr.stable.StringUtils; import javax.swing.*; @@ -20,6 +21,7 @@ public class FormulaDictPane extends FurtherBasicBeanPane { private static final int EDITOR_COLUMN = 15; private static final int LEFT_BORDER = 5; + private static final int MAX_WIDTH = 30; private FormulaEditor keyFormulaEditor; private FormulaEditor valueFormulaEditor; @@ -61,10 +63,9 @@ public class FormulaDictPane extends FurtherBasicBeanPane { valueFormulaContainer.add(new JLabel(icon)); valueFormulaContainer.add(valueFormulaEditor); - Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), UILabel.LEFT), keyFormulaContainer}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), UILabel.LEFT), valueFormulaContainer}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), MAX_WIDTH, UILabel.LEFT), keyFormulaContainer}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), MAX_WIDTH, UILabel.LEFT), valueFormulaContainer}, new Component[]{tag, null} }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index 4febad3a9..9a6205cf4 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -88,7 +88,7 @@ public class UpmFinder { dialog.setVisible(true); } } else { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); dialog.setAutoUpdateAfterInit(); dialog.showDialog(); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java index 1d529743a..9718d4a6f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java @@ -3,6 +3,7 @@ package com.fr.design.designer.beans.adapters.layout; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.form.layout.FRBorderLayout; import com.fr.general.ComparatorUtils; @@ -47,13 +48,13 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { int containerHeight = container.getHeight(); if (rectangle.height > containerHeight) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return true; } } else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) { int containerWidth = container.getWidth(); if (rectangle.width > containerWidth) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return true; } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index c9928759b..ab148f2ae 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.FormDesigner; @@ -115,11 +116,11 @@ public class WidgetBoundPane extends BasicPane { PaddingMargin margin = wabs.getMargin(); if (bounds.width != w) { if (bounds.width == rec.width - margin.getLeft() - margin.getRight()) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); width.setValue(bounds.width); return; } else if (w < minWidth) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth)); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth)); width.setValue(bounds.width); return; } @@ -136,11 +137,11 @@ public class WidgetBoundPane extends BasicPane { int minHeight = (int) (MINHEIGHT * ((WFitLayout) wabs).getResolutionScaling()); if (bounds.height != h) { if (bounds.height == rec.height - margin.getTop() - margin.getBottom()) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); height.setValue(bounds.height); return; } else if (h < minHeight) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight)); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight)); height.setValue(bounds.height); return; } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java index 97bc5aaa3..22d544c1a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java @@ -4,6 +4,7 @@ import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; @@ -48,13 +49,13 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { Rectangle rectangle = tabLayout.getBounds(); if(ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){ if(rectangle.height < size){ - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } parentBounds.height = size; }else{ if(rectangle.width < size){ - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } parentBounds.width = size; diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java index a7fb154e0..97efbda44 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java @@ -65,7 +65,7 @@ public class DSColumnCellEditor extends AbstractCellEditor implements DialogActi this.dsColumnPane = new DSColumnPane(); dsColumnPane.putElementcase(grid.getElementCasePane()); dsColumnPane.putCellElement(cellElement); - BasicDialog dsColumnDialog = this.dsColumnPane.showWindow(SwingUtilities.getWindowAncestor(grid)); + BasicDialog dsColumnDialog = this.dsColumnPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(grid), null, DSColumnPane.DEFAULT_DIMENSION); dsColumnDialog.addDialogActionListener(this); diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java index 4b33304cd..afade5626 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java @@ -26,6 +26,8 @@ import java.beans.PropertyChangeListener; */ public class DSColumnPane extends BasicPane { + public static final Dimension DEFAULT_DIMENSION = new Dimension(700, 600); + private TableDataSource tplEC; private UITabbedPane tabbedPane; private DSColumnBasicPane basicPane = null; diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java index 7c5c2e6b9..b2934b10e 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java @@ -129,7 +129,7 @@ public class WebJsPane extends BasicPane { if (url.matches("^[a-zA-z]+://.+js")) { return url; } else { - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); return ""; } } @@ -190,7 +190,7 @@ public class WebJsPane extends BasicPane { public void actionPerformed(ActionEvent arg0) { String uri = urlText.getText(); if (!uri.matches("^[a-zA-z]+://.+js")) { - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); return; } InputStream in = null;