Browse Source

Merge pull request #940 in DESIGN/design from release/10.0 to refactor/19.4.3

* commit 'dd03377bb5feb549358f034f3b52766a729b7233': (21 commits)
  REPORT-17887 数字控件最大值最小值部分场景保存失败
  REPORT-17277 frm的body点击事件不见了  && REPORT-17897 设计器文件-选项显示不完整  && REPORT-17873 模板-报表填报属性-刷新按钮提示框的国际化问题
  CHART-9401 fix list
  fix list
  CHART-3647 删除多余代码
  update
  REPORT-17656 决策报表报表块复制后值被清空
  MOBILE-21196 【性能】移动端》报表》打开少数单元格插入图片的模板,出现加载缓慢,时间在5s以上不等  设计器部分
  update
  REPORT-17527 推送远程设计触发的报表预览日志
  KERNEL-582 国际化定制的地方会越来越多,想办法去掉这种if else写法
  REPORT-17494 模板版本管理,选项灰化问题
  REPORT-17730 控件名无法保存
  REPORT-15183 有一个改远程url的接口补一下10.0
  update
  REPORT-17186 【决策报表】条件属性添加超链,会自动在超级链接里生成一条
  删除无用import
  REPORT-17500 设计器无法跳转到帮助文档
  REPORT-17500 设计器无法跳转到帮助文档
  REPORT-16650 设计器权限编辑 多角色树多选无效
  ...
research/10.0
zheng 5 years ago
parent
commit
be1058b25a
  1. 5
      designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java
  2. 21
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  3. 89
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  4. 10
      designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java
  5. 5
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  6. 77
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  7. 4
      designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java
  8. 2
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java
  10. 2
      designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java
  11. 19
      designer-base/src/main/java/com/fr/design/utils/ImageUtils.java
  12. 42
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  13. 15
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  14. 13
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  15. 91
      designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java
  16. 5
      designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java
  17. 19
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  18. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  19. 4
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  20. 22
      designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java
  21. 2
      designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java
  22. 2
      designer-realize/src/main/java/com/fr/start/SplashContext.java

5
designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java

@ -6,6 +6,7 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -19,7 +20,7 @@ public class VideoAction extends UpdateAction
this.setMenuKeySet(VIDEO);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png"));
}
@ -30,7 +31,7 @@ public class VideoAction extends UpdateAction
if (GeneralContext.getLocale().equals(Locale.US)) {
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en");
} else {
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video");
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video");
}
BrowseUtils.browser(url);

21
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -8,6 +8,7 @@ import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.editor.editor.IntegerEditor;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
@ -31,6 +32,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory;
@ -79,6 +81,7 @@ public class PreferencePane extends BasicPane {
private static final int CACHING_DEFAULT = 5;
private static final int CACHING_GAP = 5;
private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230;
private static final int OFFSET_HEIGHT = 50;
private static final String TYPE = "pressed";
private static final String DISPLAY_TYPE = "+";
@ -133,7 +136,6 @@ public class PreferencePane extends BasicPane {
private UIComboBox logLevelComboBox, pageLengthComboBox, reportLengthComboBox;
private UIDictionaryComboBox<Locale> languageComboBox;
private IntegerEditor portEditor;
private UITextField jdkHomeTextField;
private UICheckBox oracleSpace;
private UISpinner cachingTemplateSpinner;
private UICheckBox openDebugComboBox;
@ -232,8 +234,8 @@ public class PreferencePane extends BasicPane {
enableVcsPanel.add(vcsEnableCheckBox);
enableVcsPanel.add(remindVcsLabel);
JPanel intervalPanel = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
UILabel everyLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Every"));
UILabel delayLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Delay"));
final UILabel everyLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Every"));
final UILabel delayLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Delay"));
intervalPanel.add(useIntervalCheckBox);
intervalPanel.add(everyLabel);
intervalPanel.add(saveIntervalEditor);
@ -246,10 +248,14 @@ public class PreferencePane extends BasicPane {
saveCommitCheckBox.setEnabled(true);
saveIntervalEditor.setEnabled(true);
useIntervalCheckBox.setEnabled(true);
everyLabel.setEnabled(true);
delayLabel.setEnabled(true);
} else {
saveCommitCheckBox.setEnabled(false);
saveIntervalEditor.setEnabled(false);
useIntervalCheckBox.setEnabled(false);
everyLabel.setEnabled(false);
delayLabel.setEnabled(false);
}
}
});
@ -389,10 +395,10 @@ public class PreferencePane extends BasicPane {
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color"));
gridLineColorTBButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
gridLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
gridLineColorTBButton.setEnabled(this.isEnabled());
paginationLineColorTBButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
paginationLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
paginationLineColorTBButton.setEnabled(this.isEnabled());
JPanel leftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
@ -786,4 +792,9 @@ public class PreferencePane extends BasicPane {
}
});
}
@Override
public BasicDialog showWindow(Window window, DialogActionListener l) {
return showWindowWithCustomSize(window, l, new Dimension(BasicDialog.DEFAULT.width, this.getPreferredSize().height + OFFSET_HEIGHT));
}
}

89
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -1,7 +1,8 @@
package com.fr.design.actions.file;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.DesignUtils;
@ -10,41 +11,56 @@ import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralUtils;
import com.fr.general.web.ParameterConstants;
import com.fr.stable.project.ProjectConstants;
import com.fr.web.referrer.DesignSessionReferrer;
import javax.swing.JOptionPane;
import java.util.Collections;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
import static javax.swing.JOptionPane.OK_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
import static javax.swing.JOptionPane.showConfirmDialog;
public final class WebPreviewUtils {
public static void preview(JTemplate<?, ?> jt) {
preview(jt, jt.getPreviewType());
}
@SuppressWarnings("unchecked")
public static void preview(JTemplate<?, ?> jt, PreviewProvider provider) {
String baseRoute = jt.route();
if (provider == null) {
actionPerformed(jt, baseRoute, Collections.EMPTY_MAP, ParameterConstants.VIEWLET);
} else {
actionPerformed(jt, baseRoute, provider.parametersForPreview(), provider.getActionType());
String previewType = ParameterConstants.VIEWLET;
Map<String, Object> paraMap = new HashMap<>(getExtraPara());
if (provider != null) {
Map<String, Object> providerParaMap = provider.parametersForPreview();
if (providerParaMap != null) {
paraMap.putAll(providerParaMap);
}
previewType = provider.getActionType();
}
actionPerformed(jt, baseRoute, paraMap, previewType);
}
private static Map<String, Object> getExtraPara() {
Map<String, Object> extraPara = new HashMap<>();
if (DesignModeContext.isVcsMode()) {
extraPara.put("mode", DesignModeContext.getMode().toString());
}
extraPara.putAll(new DesignSessionReferrer.Builder().referrerMap());
return extraPara;
}
private static void actionPerformed(JTemplate<?, ?> jt, String baseRoute, Map<String, Object> map, String actionType) {
if (jt == null) {
return;
}
if (map == null || map == Collections.EMPTY_MAP) {
map = new HashMap<>();
}
if (DesignerMode.isVcsMode()) {
map.put("mode", DesignerMode.getMode().toString());
}
DesignerContext.getDesignerFrame().refreshToolbar();
jt.stopEditing();
/*
* alex:如果没有保存,先保存到Env
@ -54,17 +70,20 @@ public final class WebPreviewUtils {
if (!jt.isSaved() && !jt.saveTemplate2Env()) {
return;
}
FILE currentTemplate = jt.getEditingFILE();
// carl:是否是保存在运行环境下的模板,不是就不能被预览
if (currentTemplate instanceof FileNodeFILE) {
browseUrl(currentTemplate, baseRoute, map, actionType, jt);
} else {
// 说明模板没有保存在报表运行环境下面,提示用户
int selVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Web_Preview_Message"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview_Tool_Tips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
int selVal = showConfirmDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Web_Preview_Message"),
Toolkit.i18nText("Fine-Design_Basic_Preview_Tool_Tips"),
OK_CANCEL_OPTION,
WARNING_MESSAGE);
if (JOptionPane.OK_OPTION == selVal) {
if (OK_OPTION == selVal) {
if (!jt.saveAsTemplate2Env()) {
return;
}
@ -74,7 +93,10 @@ public final class WebPreviewUtils {
}
}
private static void browseUrl(FILE currentTemplate, String baseRoute, Map<String, Object> map, String actionType, JTemplate<?, ?> jt) {
private static void browseUrl(FILE currentTemplate,
String baseRoute,
Map<String, Object> map,
String actionType, JTemplate<?, ?> jt) {
if (!(currentTemplate instanceof FileNodeFILE)) {
return;
}
@ -85,8 +107,8 @@ public final class WebPreviewUtils {
path = path.substring(ProjectConstants.REPORTLETS_NAME.length() + 1);
}
java.util.List<String> parameterNameList = new java.util.ArrayList<String>();
java.util.List<String> parameterValueList = new java.util.ArrayList<String>();
List<String> parameterNameList = new ArrayList<>();
List<String> parameterValueList = new ArrayList<>();
parameterNameList.add(actionType);
parameterValueList.add(path);
@ -96,14 +118,21 @@ public final class WebPreviewUtils {
parameterValueList.add(GeneralUtils.objectToString(map.get(key)));
}
}
DesignUtils.visitEnvServerByParameters(baseRoute, parameterNameList.toArray(new String[parameterNameList.size()]), parameterValueList.toArray(new String[parameterValueList.size()]));
DesignUtils.visitEnvServerByParameters(
baseRoute,
parameterNameList.toArray(new String[0]),
parameterValueList.toArray(new String[0])
);
} else {
int selVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Web_Preview_Message"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview_Tool_Tips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
if (JOptionPane.OK_OPTION == selVal) {
if (!jt.saveAsTemplate()) {
return;
}
int selVal = showConfirmDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Web_Preview_Message"),
Toolkit.i18nText("Fine-Design_Basic_Preview_Tool_Tips"),
OK_CANCEL_OPTION,
WARNING_MESSAGE
);
if (OK_OPTION == selVal) {
jt.saveAsTemplate();
}
}
}

10
designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java

@ -1,10 +1,10 @@
package com.fr.design.actions.help;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.http.HttpToolbox;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
@ -22,11 +22,13 @@ import java.net.URI;
public class TutorialAction extends UpdateAction {
private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com";
public TutorialAction() {
this.setMenuKeySet(HELP_TUTORIAL);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/help.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/help.png"));
this.setAccelerator(getMenuKeySet().getKeyStroke());
}
@ -34,9 +36,11 @@ public class TutorialAction extends UpdateAction {
* 动作
* @param evt 事件
*/
@Override
public void actionPerformed(ActionEvent evt) {
String helpURL = CloudCenter.getInstance().acquireUrlByKind(createDocKey());
if (isServerOnline(helpURL)) {
// 用第三方网址去判断是否处在离线状态
if (isServerOnline(URL_FOR_TEST_NETWORK)) {
try {
Desktop.getDesktop().browse(new URI(helpURL));
return;

5
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

@ -32,6 +32,7 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
@ -331,7 +332,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
DBUtils.refreshDatabase();
String schema = StringUtils.isEmpty(schemaBox.getSelectedItem()) ? null : schemaBox.getSelectedItem();
DataCoreUtils.refreshTables(getConnection(), TableProcedure.TABLE, schema);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Refresh_Database"),
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Database"),
JOptionPane.INFORMATION_MESSAGE);
}
@ -343,7 +344,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
Object userObj = node.getUserObject();
if (userObj instanceof String) {
this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_insert/expandCell.gif"));
this.setIcon(IOUtils.readIcon("com/fr/design/images/m_insert/expandCell.gif"));
} else if (userObj instanceof TableProcedure) {
this.setText(((TableProcedure) userObj).getName());
}

77
designer-base/src/main/java/com/fr/design/dialog/BasicPane.java

@ -40,21 +40,7 @@ public abstract class BasicPane extends JPanel {
* @return 对话框
*/
public BasicDialog showWindow(Window window, DialogActionListener l) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
} else {
dg = new DIALOG((Dialog) window);
}
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.DEFAULT);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
return showWindowWithCustomSize(window, l, BasicDialog.DEFAULT);
}
/**
@ -100,21 +86,7 @@ public abstract class BasicPane extends JPanel {
* @return 对话框
*/
public BasicDialog showWindow4ChartType(Window window, DialogActionListener l) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
} else {
dg = new DIALOG((Dialog) window);
}
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.CHART);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
return showWindowWithCustomSize(window, l, BasicDialog.CHART);
}
/**
@ -125,20 +97,7 @@ public abstract class BasicPane extends JPanel {
* @return 对话框
*/
public BasicDialog showSmallWindow(Window window, DialogActionListener l) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
} else {
dg = new DIALOG((Dialog) window);
}
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.SMALL);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
return showWindowWithCustomSize(window, l, BasicDialog.SMALL);
}
/**
@ -149,20 +108,7 @@ public abstract class BasicPane extends JPanel {
* @return 对话框
*/
public BasicDialog showMediumWindow(Window window, DialogActionListener l) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
} else {
dg = new DIALOG((Dialog) window);
}
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.MEDIUM);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
return showWindowWithCustomSize(window, l, BasicDialog.MEDIUM);
}
/**
@ -173,6 +119,17 @@ public abstract class BasicPane extends JPanel {
* @return 对话框
*/
public BasicDialog showLargeWindow(Window window, DialogActionListener l) {
return showWindowWithCustomSize(window, l, BasicDialog.LARGE);
}
/**
* 以自定义的宽高显示窗口
* @param window 窗口
* @param l 对话框监听器
* @param dimension 自定义尺寸
* @return 对话框
*/
protected BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
@ -183,7 +140,7 @@ public abstract class BasicPane extends JPanel {
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.LARGE);
dg.setBasicDialogSize(dimension);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
@ -350,6 +307,7 @@ public abstract class BasicPane extends JPanel {
}
}
@Override
public void setVisible(boolean isVisible) {
this.nameTextField.setVisible(isVisible);
this.Name.setVisible(isVisible);
@ -377,6 +335,7 @@ public abstract class BasicPane extends JPanel {
*
* @throws Exception 异常
*/
@Override
public void checkValid() throws Exception {
super.checkValid();

4
designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java

@ -7,7 +7,6 @@ import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewer;
import com.fr.design.utils.ImageUtils;
import com.fr.general.ImageWithSuffix;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
@ -16,6 +15,7 @@ import javax.swing.SwingWorker;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
/**
@ -103,7 +103,7 @@ public class ImgChooseWrapper {
if (imageFileChooser.isCheckSelected()) {
imageWithSuffix = ImageUtils.defaultImageCompWithSuff(selectedFile);
} else {
Image image = BaseUtils.readImage(selectedFile.getPath());
BufferedImage image = BaseUtils.readImage(selectedFile.getPath());
String type = ImageUtils.getImageType(selectedFile);
imageWithSuffix = new ImageWithSuffix(image, type);
}

2
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java

@ -114,7 +114,7 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane {
@Override
public Background updateBean() {
ImageFileBackground imageBackground = new ImageFileBackground(previewPane.getImage(), suffix);
ImageFileBackground imageBackground = new ImageFileBackground(previewPane.getImageWithSuffix());
imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(imageLayoutPane.getSelectedItem());
imageBackground.setLayout(imageStyle.getImageLayout());
return imageBackground;

2
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java

@ -304,7 +304,7 @@ public class ImagePreviewPane extends JComponent implements Scrollable, ImagePre
@Override
public void setImage(Image image) {
setImageWithSuffix(image == null ? null : new ImageWithSuffix(image));
setImageWithSuffix(ImageWithSuffix.build(image));
}

2
designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java

@ -63,7 +63,7 @@ public class ImagePreviewPane extends JComponent implements Scrollable, ImagePre
@Override
public void setImage(Image image) {
setImageWithSuffix(image == null ? null : new ImageWithSuffix(image));
setImageWithSuffix(ImageWithSuffix.build(image));
}

19
designer-base/src/main/java/com/fr/design/utils/ImageUtils.java

@ -1,6 +1,7 @@
package com.fr.design.utils;
import com.fr.base.BaseUtils;
import com.fr.base.frpx.util.ImageIOHelper;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.ImageWithSuffix;
@ -70,7 +71,7 @@ public class ImageUtils {
return null;
}
BufferedImage srcImg = BaseUtils.readImage(imageFile.getPath());
Image desImg = srcImg;
BufferedImage desImg = srcImg;
try {
if (canbeCompressedToJPEG(imageFile)) {
@ -186,11 +187,23 @@ public class ImageUtils {
/**
* 获取图片类型
* 先根据ImageReader获取ImageReader获取不到就拿后缀
*
* @param imageFile 图片文件
* @return 图片类型(JPEG, PNG, GIF)
*/
public static String getImageType(File imageFile) {
String imageType = getImageTypeByImageReader(imageFile);
return StringUtils.EMPTY.equals(imageType) ? ImageIOHelper.getSuffix(imageFile) : imageType;
}
/**
* 根据ImageReader获取图片类型
*
* @param imageFile 图片文件
* @return 图片类型(JPEG, PNG, GIF)
*/
public static String getImageTypeByImageReader(File imageFile) {
try {
ImageInputStream iis = ImageIO.createImageInputStream(imageFile);
Iterator<ImageReader> iter = ImageIO.getImageReaders(iis);
@ -226,7 +239,7 @@ public class ImageUtils {
* @param scale 缩放比例比例大于1时为放大小于1大于0为缩小
* @param opacityCompatible 是否处理背景透明
*/
public static Image scale(BufferedImage srcImg, float scale, boolean opacityCompatible) {
public static BufferedImage scale(BufferedImage srcImg, float scale, boolean opacityCompatible) {
if (scale < 0) {
// 自动修正负数
scale = -scale;
@ -234,7 +247,7 @@ public class ImageUtils {
int width = mul(Integer.toString(srcImg.getWidth(null)), Float.toString(scale)).intValue(); // 得到源图宽
int height = mul(Integer.toString(srcImg.getHeight(null)), Float.toString(scale)).intValue(); // 得到源图长
return scale(srcImg, width, height, opacityCompatible);
return CoreGraphHelper.toBufferedImage(scale(srcImg, width, height, opacityCompatible));
}
private static BigDecimal mul(String v1, String v2) {

42
designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -9,13 +9,15 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -23,6 +25,7 @@ import java.awt.event.ActionListener;
* Created by kerry on 2017/9/10.
*/
public class NumberEditorValidatePane extends JPanel {
private UICheckBox allowDecimalsCheckBox;
private UICheckBox allowNegativeCheckBox;
private UICheckBox setMaxValueCheckBox;
@ -104,6 +107,7 @@ public class NumberEditorValidatePane extends JPanel {
private void initListeners() {
allowDecimalsListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
@ -129,8 +133,8 @@ public class NumberEditorValidatePane extends JPanel {
if (!setMinValueCheckBox.isSelected()) {
maxValueSpinner.getTextField().setMinValue(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
double minValue = Double.parseDouble("" + minValueSpinner.getValue());
double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
@ -143,10 +147,11 @@ public class NumberEditorValidatePane extends JPanel {
setMaxListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = new Double(0);
Double value = (double) 0;
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
@ -163,10 +168,11 @@ public class NumberEditorValidatePane extends JPanel {
setMinListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
Double value = new Double(0);
Double value = (double) 0;
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
@ -177,7 +183,7 @@ public class NumberEditorValidatePane extends JPanel {
maxValueSpinner.getTextField().setMinValue(value);
} else {
minValueSpinner.setEnabled(false);
maxValueSpinner.getTextField().setMinValue(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
maxValueSpinner.getTextField().setMinValue(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : (double) 0);
}
}
};
@ -222,28 +228,28 @@ public class NumberEditorValidatePane extends JPanel {
allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setValue(Double.MAX_VALUE);
maxValueSpinner.setEnabled(false);
} else {
setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setEnabled(true);
maxValueSpinner.setValue(new Double(e.getMaxValue()));
maxValueSpinner.setValue(e.getMaxValue());
}
if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setValue(-Double.MAX_VALUE);
minValueSpinner.setEnabled(false);
} else {
setMinValueCheckBox.setSelected(true);
minValueSpinner.setEnabled(true);
minValueSpinner.setValue(new Double(e.getMinValue()));
minValueSpinner.setValue(e.getMinValue());
}
if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){
if (setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()) {
errorMsgTextFieldPane.setVisible(true);
errorMsgTextField.setText(e.getRegErrorMessage());
}else{
} else {
errorMsgTextFieldPane.setVisible(false);
errorMsgTextField.setText(StringUtils.EMPTY);
}
@ -259,15 +265,19 @@ public class NumberEditorValidatePane extends JPanel {
if (setMinValueCheckBox.isSelected()) {
ob.setMinValue(minValueSpinner.getValue());
} else {
ob.setMinValue(-Double.MAX_VALUE);
}
if (setMaxValueCheckBox.isSelected()) {
ob.setMaxValue(maxValueSpinner.getValue());
} else {
ob.setMaxValue(Double.MAX_VALUE);
}
if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){
if (setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()) {
errorMsgTextFieldPane.setVisible(true);
}else{
} else {
errorMsgTextFieldPane.setVisible(false);
errorMsgTextField.setText(StringUtils.EMPTY);
}

15
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -3,9 +3,11 @@ package com.fr.env;
import com.fr.base.FRContext;
import com.fr.base.ServerConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder;
import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -303,10 +305,17 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override
public RemoteDesignerWorkspaceInfo updateBean() {
String url = this.remoteWorkspaceURL.getURL();
String username = this.usernameInput.getText();
String password = new String(this.passwordInput.getPassword());
DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG);
if (envProcessor != null) {
url = envProcessor.changeEnvPathBeforeConnect(username, password, url);
}
WorkspaceConnectionInfo connection = new WorkspaceConnectionInfo(
this.remoteWorkspaceURL.getURL(),
this.usernameInput.getText(),
new String(this.passwordInput.getPassword()),
url,
username,
password,
this.certPathInput.getText(),
new String(this.certSecretKeyInput.getPassword()));

13
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.map.designer.type;
import com.fr.base.Parameter;
import com.fr.base.Utils;
import com.fr.decision.webservice.v10.map.WMSFactory;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListPane;
@ -19,6 +20,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient;
import com.fr.geojson.helper.GEOJSONHelper;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.plugin.chart.base.ViewCenter;
import com.fr.plugin.chart.map.VanChartMapPlot;
@ -26,9 +28,7 @@ import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
import com.fr.plugin.chart.map.layer.WMSLayer;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.geojson.helper.GEOJSONHelper;
import com.fr.plugin.chart.map.server.MapLayerConfigManager;
import com.fr.plugin.chart.service.WMSFactory;
import com.fr.plugin.chart.type.GISLayerType;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel;
@ -57,6 +57,7 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mitisky on 16/5/11.
@ -380,7 +381,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
public void actionPerformed(ActionEvent e) {
new SwingWorker<Void, Double>() {
private java.util.List<WMSLayer> list;
private java.util.List<WMSLayer> list = new ArrayList<>();
@Override
protected Void doInBackground() throws Exception {
@ -392,7 +393,11 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
}
String res = httpClient.getResponseText();
list = WMSFactory.readLayers(res);
List<String> layers = WMSFactory.readLayers(res);
list.clear();
for (String layer : layers) {
list.add(new WMSLayer(layer, false));
}
return null;
}

91
designer-form/src/main/java/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java

@ -4,14 +4,18 @@ import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.tree.TreePath;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.AuthorityEditPane;
@ -22,6 +26,9 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
/**
@ -34,15 +41,21 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
private Widget[] widgets = null;
private UICheckBox widgetVisible = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible"));
private UICheckBox widgetAvailable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Enabled"));
private String[] selectedArray;
private ItemListener visibleItemListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
if (selectedRoles == null) {
return;
}
if (widgets != null && widgets.length > 0) {
for (int i = 0; i < widgets.length; i++) {
widgets[i].changeVisibleAuthorityState(selectedRoles, widgetVisible.isSelected());
initSelectedArray();
if (ArrayUtils.isEmpty(selectedArray)) {
return;
}
for (String selectedRole : selectedArray) {
for (Widget widget : widgets) {
widget.changeVisibleAuthorityState(selectedRole, widgetVisible.isSelected());
}
}
doAfterAuthority();
@ -51,6 +64,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
private ItemListener usableItemListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
if (ComparatorUtils.equals(selectedRoles, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Role"))) {
@ -59,9 +73,13 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
if (selectedRoles == null) {
return;
}
if (widgets != null && widgets.length > 0) {
for (int i = 0; i < widgets.length; i++) {
widgets[i].changeUsableAuthorityState(selectedRoles, widgetAvailable.isSelected());
initSelectedArray();
if (ArrayUtils.isEmpty(selectedArray)) {
return;
}
for (String selectedRole : selectedArray) {
for (Widget widget : widgets) {
widget.changeUsableAuthorityState(selectedRole, widgetAvailable.isSelected());
}
}
doAfterAuthority();
@ -78,7 +96,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
private void doAfterAuthority() {
designer.repaint();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified();
RolesAlreadyEditedPane.getInstance().refreshDockingView();
RolesAlreadyEditedPane.getInstance().setReportAndFSSelectedRoles();
RolesAlreadyEditedPane.getInstance().repaint();
@ -90,6 +108,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
*
* @date 2014-12-21-下午6:19:43
*/
@Override
public void populateType() {
type.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Form_Widget_Config"));
}
@ -99,15 +118,16 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
*
* @date 2014-12-21-下午7:12:27
*/
@Override
public void populateName() {
String nameText = "";
if (widgets == null || widgets.length <= 0) {
return;
}
for (int i = 0; i < widgets.length; i++) {
nameText += "," + widgets[i].getClass().getSimpleName();
List<String> widgetNames = new ArrayList<String>();
for (Widget widget : widgets) {
widgetNames.add(widget.getClass().getSimpleName());
}
name.setText(nameText.substring(1));
name.setText(StableUtils.join(widgetNames, ","));
}
/**
@ -116,6 +136,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
* @return 面板
* @date 2014-12-21-下午6:19:03
*/
@Override
public JPanel populateCheckPane() {
checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
@ -138,10 +159,11 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
/**
* 对单元格区域进行操作时的权限编辑页面
*/
@Override
public void populateDetials() {
//更新说明要是JWorkBook的话,说明鼠标焦点又改变了
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true);
signelSelection();
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().setAuthorityMode(true);
singleSelection();
refreshCreator();
//如果是布局选中不支持的元素则显示“该元素不支持权限控制”
@ -186,8 +208,8 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
//实现单选
private void signelSelection() {
if (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().isJWorkBook()) {
private void singleSelection() {
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().isJWorkBook()) {
//清工具栏
JComponent component = DesignerContext.getDesignerFrame().getToolbarComponent();
if (component instanceof AuthorityEditToolBarComponent) {
@ -195,7 +217,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
}
//清空报表主体的单元格选择
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().removeTemplateSelection();
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().removeTemplateSelection();
}
}
@ -204,5 +226,40 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
widgets = size == 0 ? null : designer.getSelectionModel().getSelection().getSelectedWidgets();
}
private void initSelectedArray() {
TreePath[] selectionPaths = ReportAndFSManagePane.getInstance().getRoleTree().getCheckBoxTreeSelectionModel().getSelectionPaths();
if (selectionPaths.length == 1) {
if (((ExpandMutableTreeNode) (selectionPaths[0].getLastPathComponent())).getChildCount() > 0) {
ExpandMutableTreeNode node = (ExpandMutableTreeNode) ((ExpandMutableTreeNode) (selectionPaths[0].getLastPathComponent())).getLastChild();
selectedArray = new String[node.getChildCount()];
for (int i = 0, len = node.getChildCount(); i < len; i++) {
ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) node.getChildAt(i);
String nodeName = treeNode.getUserObject().toString();
selectedArray[i] = nodeName;
}
} else {
selectedArray = pathToString(selectionPaths);
}
} else {
selectedArray = pathToString(selectionPaths);
}
}
private String[] pathToString(TreePath[] path) {
List<String> roles = new ArrayList<String>();
if (!ArrayUtils.isEmpty(path)) {
for (TreePath tempPath : path) {
String temp = tempPath.toString();
boolean exist = StringUtils.isNotEmpty(temp) && temp.startsWith("[") && temp.endsWith("]");
if (exist) {
temp = temp.substring(1, temp.length() - 1);
String[] selectedRoles = temp.split("," + StringUtils.BLANK);
String role = selectedRoles[2].trim();
roles.add(role);
}
}
}
return roles.toArray(new String[0]);
}
}

5
designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java

@ -23,4 +23,9 @@ public class FormHyperlinkGroupPaneNoPop extends FormHyperlinkGroupPane{
protected boolean isNewStyle() {
return false;
}
@Override
public void saveSettings() {
// do nothing
}
}

19
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.widget.ui;
import com.fr.base.BaseUtils;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
@ -28,13 +27,13 @@ import com.fr.design.widget.Operator;
import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane;
import com.fr.form.ui.FormWidgetHelper;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
@ -91,6 +90,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
return new WidgetBoundPane(xCreator);
}
@Override
protected JPanel createContentPane() {
return null;
}
@ -218,21 +218,15 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
UITextField widgetNameField = widgetPropertyPane.getWidgetNameField();
String toSetWidgetName = widgetNameField.getText();
String currentWidgetName = widget.getWidgetName();
// 设置的组件名和当前组件名相同 直接返回
if (ComparatorUtils.equals(toSetWidgetName, currentWidgetName)) {
return;
}
String containerName = designer.getTarget().getContainer().getWidgetName();
Widget existWidget = FormWidgetHelper.findWidgetByName(widget, widgetNameField.getText());
// 判断设置的组件名是否和容器同名以及组件是否在容器在存在 满足任何其一 抛出提示
boolean exist = ComparatorUtils.equals(containerName, toSetWidgetName) || existWidget != null;
boolean exist = designer.getTarget().isNameExist(toSetWidgetName) && !ComparatorUtils.equals(toSetWidgetName, currentWidgetName);
if (exist) {
widgetNameField.setText(currentWidgetName);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, BaseUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
return;
}
widgetPropertyPane.update(widget);
xCreator.resetCreatorName(toSetWidgetName);
// 上面一行更新了组件 这里必须重新调用getWidgetName
xCreator.resetCreatorName(widget.getWidgetName());
xCreator.resetVisible(widget.isVisible());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
return;
@ -262,6 +256,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
creator.firePropertyChange();
}
@Override
public String getIconPath() {
return StringUtils.EMPTY;
}

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -195,7 +195,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll();
layout.resetStyle();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent();
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {
XCreator xCreator = (XCreator) component;
@ -208,6 +208,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
}
xwAbsoluteBodyLayout.add(component);
}
xWFitLayout.setBackupParent(xwAbsoluteBodyLayout);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{wAbsoluteBodyLayout}));

4
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -68,6 +68,7 @@ import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.general.ImageWithSuffix;
import com.fr.general.ModuleContext;
import com.fr.grid.Grid;
import com.fr.grid.GridUtils;
@ -89,6 +90,7 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.module.Module;
@ -621,7 +623,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
if (workBook instanceof WorkBookAdapter) {
elem.setValue(new CellImagePainter(cellImage));
} else {
elem.setValue(cellImage.getImage());
elem.setValue(ImageWithSuffix.build(cellImage.getImage(),cellImage.getSuffix()));
}
}

22
designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java

@ -2,16 +2,15 @@ package com.fr.design.report;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.frpx.pack.PictureCollection;
import com.fr.base.frpx.util.ImageIOHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ImageWithSuffix;
import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter;
@ -28,6 +27,7 @@ import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
/**
@ -46,11 +46,6 @@ public class SelectImagePane extends BasicPane {
private Image previewImage = null;
/**
* 默认格式
*/
private String suffix = PictureCollection.DEFAULT_SUFFIX;
private File imageFile;
public SelectImagePane() {
@ -127,13 +122,12 @@ public class SelectImagePane extends BasicPane {
if (selectedFile != null && selectedFile.isFile()) {
String filePath = selectedFile.getPath();
suffix = ImageIOHelper.getSuffix(filePath);
Image image = BaseUtils.readImage(filePath);
BufferedImage image = BaseUtils.readImage(filePath);
CoreGraphHelper.waitForImage(image);
imageFile = selectedFile;
setImageStyle();
previewPane.setImage(image);
previewPane.setImageWithSuffix(ImageWithSuffix.build(image, ImageUtils.getImageType(selectedFile)));
previewPane.setImageStyle(imageStyle);
previewImage = image;
} else {
@ -184,7 +178,6 @@ public class SelectImagePane extends BasicPane {
setImage((Image) value);
} else if (value instanceof CellImagePainter) {
setImage(((CellImagePainter) value).getImage());
suffix = ((CellImagePainter) value).getSuffix();
}
style = cell.getStyle();
@ -214,11 +207,8 @@ public class SelectImagePane extends BasicPane {
public CellImage update() {
CellImage cellImage = new CellImage();
cellImage.setImage(previewPane.getImage());
cellImage.setImage(previewPane.getImageWithSuffix());
cellImage.setStyle(this.imageStyle);
if (suffix != null) {
cellImage.setSuffix(suffix);
}
return cellImage;
}

2
designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java

@ -29,6 +29,8 @@ public class GridCornerMouseHandler extends MouseInputAdapter {
private void doSelectAll() {
ElementCasePane reportPane = this.gridCorner.getElementCasePane();
// 全选时,停止编辑状态
reportPane.getGrid().stopEditing();
ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane);
reportPane.setSelection(new CellSelection(0, 0, lastColumnRow.getColumn(), lastColumnRow.getRow()));

2
designer-realize/src/main/java/com/fr/start/SplashContext.java

@ -175,4 +175,4 @@ public class SplashContext {
return "/com/fr/design/images/splash_10.gif";
}
}
}
}
Loading…
Cancel
Save