diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index b1a3b8e34f..b6f18a1882 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -17,6 +17,7 @@ import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.ProductConstants; +import com.fr.third.javax.annotation.Nonnull; import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; @@ -677,34 +678,31 @@ public class MutilTempalteTabPane extends JComponent { //当前激活的模板 String filename = openedTemplate.get(selectedIndex).getPath(); - - filename = FilenameUtils.standard(filename); - if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) { specifiedTemplate.stopEditing(); int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION) { specifiedTemplate.saveTemplate(); - HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); - - activeTemplate(filename); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + closeTpl(specifiedTemplate, filename); + } else if (returnVal == JOptionPane.NO_OPTION) { + closeTpl(specifiedTemplate, filename); } } else { - HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); - - activeTemplate(filename); - FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + closeTpl(specifiedTemplate, filename); } } + private void closeTpl(@Nonnull JTemplate specifiedTemplate, @Nonnull String fileName) { + HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); + // release lock + WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); + activeTemplate(fileName); + } + /** * 关闭模板 * diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java index 7404ed6995..1d027ac8a1 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java @@ -253,23 +253,16 @@ public class AuthorityListControlPane extends BasicPane { * @param authorities authority */ public void setAuthority(List authorities) { - - if (authorities == null || authorities.isEmpty()) { - return; - } - DefaultListModel model = (DefaultListModel) authorityList.getModel(); model.clear(); - - for (DesignAuthority authority : authorities) { - model.addElement(authority); + if (authorities != null && !authorities.isEmpty()) { + for (DesignAuthority authority : authorities) { + model.addElement(authority); + } + int size = model.getSize() - 1; + authorityList.setSelectedIndex(size); + authorityList.ensureIndexIsVisible(size); } - - int size = model.getSize() - 1; - - authorityList.setSelectedIndex(size); - authorityList.ensureIndexIsVisible(size); - authorityList.revalidate(); authorityList.repaint(); } diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java index a0fbb0babc..1e22dc8083 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java @@ -1,5 +1,6 @@ package com.fr.design.remote.ui; +import com.fr.base.BaseUtils; import com.fr.design.border.UITitledBorder; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; @@ -240,13 +241,14 @@ public class UserManagerPane extends BasicPane { ); // 搜索 - JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - searchPanel.setBorder(BorderFactory.createEmptyBorder()); - keyField.setPreferredSize(new Dimension(250, 20)); + JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); + searchPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + keyField.setPreferredSize(new Dimension(270, 20)); keyField.requestFocus(); keyField.addKeyListener(keyFieldKeyListener); keyField.getDocument().addDocumentListener(documentListener); - keyButton.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search")); + keyButton.setIcon(BaseUtils.readIcon("com/fr/design/images/buttonicon/user_search_normal.png")); + keyButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search")); keyButton.addActionListener(keyButtonActionListener); searchPanel.add(keyField); searchPanel.add(keyButton); @@ -367,9 +369,9 @@ public class UserManagerPane extends BasicPane { final SwingWorker getMemberWorker = new SwingWorker, Void>() { @Override protected List doInBackground() { - addingMembers.clear(); String username = WorkContext.getCurrent().getConnection().getUserName(); synchronized (addingMembers) { + addingMembers.clear(); Collection more = WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword); pageNum = 1; if (!more.isEmpty()) { @@ -395,7 +397,7 @@ public class UserManagerPane extends BasicPane { final SwingWorker loadMoreWorker = new SwingWorker, Void>() { @Override protected List doInBackground() { - + String username = WorkContext.getCurrent().getConnection().getUserName(); synchronized (addingMembers) { addingMembers.remove(RemoteDesignMember.DEFAULT_MEMBER); diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png new file mode 100644 index 0000000000..9a9a2e65a4 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png new file mode 100644 index 0000000000..13829dcb61 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png differ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java index 749fed8c9e..314408c682 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java @@ -114,7 +114,7 @@ public class VanChartBackgroundPane extends BasicPane { } - private void fireStateChanged() { + protected void fireStateChanged() { Object[] listeners = listenerList.getListenerList(); ChangeEvent e = null; diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java index cc6154aec1..a000cc2096 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java @@ -166,7 +166,7 @@ public class NativePrintSettingPane extends JPanel { printerPane.add(printerComboBox); // 份数 - copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 0, Integer.MAX_VALUE, 1)); + copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); GUICoreUtils.setColumnForSpinner(copySpinner, 5); JPanel copyPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); copyPane.add(copySpinner); diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java index 2c80a9fadd..a1b73f8d15 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java +++ b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java @@ -19,7 +19,7 @@ public class ImagePreLoader { int start = 0; for (int i = 0; i < len; i++) { if (i != 0 && i % THRESHOLD == 0) { - loadImage(start,i, service); + loadImage(start, i, service); start = i; } if (len - i < THRESHOLD) { @@ -401,6 +401,9 @@ public class ImagePreLoader { "com/fr/design/images/control/up.png", "com/fr/design/images/control/down.png", "com/fr/design/images/condition/bracket.png", - "com/fr/design/images/condition/unBracket.png" + "com/fr/design/images/condition/unBracket.png", + "com/fr/design/images/buttonicon/user_search_normal.png", + "com/fr/design/remote/images/icon_Member_normal@1x.png", + "/com/fr/design/images/buttonicon/add.png" }; }