diff --git a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java index d566bbf98..af4bc8a9b 100644 --- a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java @@ -3,11 +3,7 @@ package com.fr.design.cell; import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; -import com.fr.design.mainframe.theme.TemplateThemeBlock; -import com.fr.general.IOUtils; -import javax.swing.Icon; -import javax.swing.JComponent; import javax.swing.JPanel; import java.awt.Dimension; import java.awt.Graphics; @@ -25,14 +21,12 @@ public class CellStylePreviewPane extends JPanel { private static final Image transparentBackgroundImage = Toolkit.getDefaultToolkit().createImage(CellStylePreviewPane.class.getResource("/com/fr/design/images/transparent_background.png")); private final float transparentBackgroundWidth; private final float transparentBackgroundHeight; - private final float transparentBackgroundAspect; private String paintText = "Report"; private Style style = Style.DEFAULT_STYLE; public CellStylePreviewPane() { transparentBackgroundWidth = transparentBackgroundImage.getWidth(null); transparentBackgroundHeight = transparentBackgroundImage.getHeight(null); - transparentBackgroundAspect = 1.0F * transparentBackgroundImage.getWidth(null) / transparentBackgroundImage.getHeight(null); } public void setStyle(Style style) { @@ -72,7 +66,7 @@ public class CellStylePreviewPane extends JPanel { Style.paintContent(g2d, paintText, style, width, height, resolution); - Style.paintBorder(g2d, style, getWidth() - 3, getHeight() - 3); + Style.paintBorder(g2d, style, width, height); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 8bb23786f..70d1f3e0e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -251,7 +251,7 @@ public abstract class JTemplate> if (themeConfigChangeListener != null) { TemplateThemeConfig config = getUsingTemplateThemeConfig(); if (config != null) { - config.addThemeConfigChangeListener(themeConfigChangeListener); + config.removeThemeConfigChangeListener(themeConfigChangeListener); } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java index e00bc445c..7fcfd7310 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java @@ -193,7 +193,7 @@ public class TemplateThemeBlock extends JPanel { } if (displayTheme4NewTemplateMarker && StringUtils.equals(config.getThemeName4NewTemplate(), name)) { - theme4NewTemplateMarkIcon.paintIcon(this, g, 0, 0); + theme4NewTemplateMarkIcon.paintIcon(this, g, 0, thumbnailPane.getHeight() - 16); } if (selected || this.hovering) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java index 87a12a9dd..53e216b0d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.theme.edit; import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.AttrScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.ComponentBodyStylePane; import com.fr.design.gui.style.ComponentIntegralStylePane; @@ -113,7 +114,7 @@ public class ComponentStyleEditPane extends JPanel { } } - private JComponent createTabContainer(final JComponent component) { + private JComponent createTabContainer(final JPanel component) { JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); container.setPreferredSize(new Dimension(container.getPreferredSize().width, 220)); @@ -123,12 +124,12 @@ public class ComponentStyleEditPane extends JPanel { tipLabelPane.add(tipLabel); container.add(tipLabelPane, BorderLayout.NORTH); - JScrollPane scrollPane = new JScrollPane(component); - scrollPane.setPreferredSize(new Dimension(container.getPreferredSize().width, 220)); - scrollPane.setBorder(BorderFactory.createEmptyBorder()); - scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - - container.add(scrollPane, BorderLayout.CENTER); + container.add(new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return component; + } + }, BorderLayout.CENTER); return container; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index 1baac868f..53bea9480 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -251,7 +251,7 @@ public class CreateComponentAction extends UpdateAction { private Image componentToImage(Component comp, Rectangle rect) { - BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); + BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB); comp.paint(im.getGraphics()); return im; } @@ -260,7 +260,7 @@ public class CreateComponentAction extends UpdateAction { private Image moduleToImage(Form form, ElementCaseEditor editor, Map parameterMap, Rectangle rect) { if (editor == null) { - return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); + return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB); } FormElementCaseProvider provider = editor.getElementCase(); provider.setName(editor.getWidgetName()); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java index a845759f7..6cb00b6ff 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java @@ -95,7 +95,9 @@ public class InstallComponentAction extends UpdateAction { } ShareWidgetInfoManager.getInstance().saveXmlInfo(); - boolean needShowMessage = (chosenFiles.length > 1 && chosenFiles.length != failureList.size()) || containRues(chosenFiles); + boolean reuNeedShowMessage = chosenFiles.length > 1 && chosenFiles.length != failureList.size(); + boolean reusNeedShowMessage = containRues(chosenFiles) && !failureList.isEmpty(); + boolean needShowMessage = reuNeedShowMessage || reusNeedShowMessage; return new InstallBackInfo(installStatus, needShowMessage, failureList); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java index 610f688a4..cd3e8c1ad 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java @@ -30,9 +30,14 @@ public class InstallUtils { * 安装组件包 */ public static boolean installReusFile(File chosenFile, long installTime, List list) { - return installReusFile(chosenFile, installTime, list, o -> { + InstallResult installResult = installReusFile(chosenFile, installTime, list, o -> { //do nothing - }).installStatus; + }); + Group group = installResult.group; + if (group.getAllBindInfoList().length == 0) { + DefaultShareGroupManager.getInstance().removeGroup(group); + } + return installResult.installStatus; } /** diff --git a/designer-form/src/main/resources/com/fr/design/form/images/theme4newTemplate.png b/designer-form/src/main/resources/com/fr/design/form/images/theme4newTemplate.png index 43e7c8ff0..457721834 100644 Binary files a/designer-form/src/main/resources/com/fr/design/form/images/theme4newTemplate.png and b/designer-form/src/main/resources/com/fr/design/form/images/theme4newTemplate.png differ diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java index ae805e027..758c4e335 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java @@ -10,6 +10,7 @@ import com.fr.design.menu.MenuKeySet; import javax.swing.*; +import java.awt.event.ActionEvent; /** * @@ -52,4 +53,11 @@ public class GeneralCellAction extends AbstractCellAction implements WorkBookSup public Class getCellValueClass() { return String.class; } + + @Override + public void actionPerformed(ActionEvent evt) { + super.actionPerformed(evt); + this.getEditingComponent().getGrid().getCellEditor().stopCellEditing(); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java index 898474d1c..c0995fe0c 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java @@ -129,7 +129,7 @@ public class TextCellEditor extends AbstractCellEditor { } this.oldValue = Utils.objectToString(value); - this.textField.setText(oldValue); + resetTextWithoutDocumentListener(oldValue); //peter:只读方式获得Style. Style style = null; if(cellElement != null) { @@ -176,4 +176,11 @@ public class TextCellEditor extends AbstractCellEditor { public void keyReleased(KeyEvent evt) { } }; + + + private void resetTextWithoutDocumentListener(String text) { + this.textField.getDocument().removeDocumentListener(documentlistener); + this.textField.setText(text); + this.textField.getDocument().addDocumentListener(documentlistener); + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java index 17300f00d..eb6f5484e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java @@ -42,6 +42,8 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane imp defaultListModel = new DefaultListModel<>(); styleList = new JList<>(defaultListModel); styleList.setCellRenderer(new RadioButtonListCellRenderer()); + styleList.setOpaque(false); + styleList.setBackground(null); setLayout(FRGUIPaneFactory.createBorderLayout()); add(styleList, BorderLayout.CENTER); setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));