Browse Source

Merge pull request #20 in ~NEIL/design from release/10.0 to feature/10.0

* commit 'afd396c75169c4ce622e3828aad2173f17f29865': (22 commits)
  update
  KERNEL-582 国际化定制的地方会越来越多,想办法去掉这种if else写法 && REPORT-18522 将所有海外版设计器的信息回传功能阉割
  将所有海外版设计器的信息回传功能阉割
  处理乱码和入库重复问题
  没有用户名时用uuid作为用户名
  update
  REPORT-17908 启动动画“初始化”的国际化问题
  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
  KERNEL-582 国际化定制的地方会越来越多,想办法去掉这种if else写法
  REPORT-17494 模板版本管理,选项灰化问题
  REPORT-17730 控件名无法保存
  REPORT-15183 有一个改远程url的接口补一下10.0
  ...
research/10.0
neil 6 years ago
parent
commit
e51b63c890
  1. 6
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 21
      designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java
  3. 21
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  4. 5
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  5. 77
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  6. 4
      designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java
  7. 31
      designer-base/src/main/java/com/fr/design/locale/impl/ProductImproveMark.java
  8. 35
      designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java
  9. 44
      designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java
  10. 36
      designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java
  11. 35
      designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java
  12. 2
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java
  13. 2
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImagePreviewPane.java
  14. 27
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  15. 2
      designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java
  16. 19
      designer-base/src/main/java/com/fr/design/utils/ImageUtils.java
  17. 42
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  18. 15
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  19. 13
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  20. 5
      designer-form/src/main/java/com/fr/design/gui/xpane/FormHyperlinkGroupPaneNoPop.java
  21. 3
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  22. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  23. 4
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  24. 33
      designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java
  25. 22
      designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java
  26. 2
      designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java
  27. 22
      designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java

6
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -14,6 +14,7 @@ import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.locale.impl.ProductImproveMark;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.style.color.ColorSelectConfigManager;
@ -23,6 +24,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogFormatter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
@ -688,7 +691,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
* @return 是否加入产品改良
*/
public boolean isJoinProductImprove() {
return joinProductImprove;
LocaleMark<Boolean> localeMark = LocaleCenter.getMark(ProductImproveMark.class);
return localeMark.getValue() && this.joinProductImprove;
}
/**

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

@ -1,15 +1,16 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.locale.impl.VideoMark;
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 com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.util.Locale;
public class VideoAction extends UpdateAction
{
@ -19,21 +20,15 @@ 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"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url;
if (GeneralContext.getLocale().equals(Locale.US)) {
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en");
} else {
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video");
}
BrowseUtils.browser(url);
LocaleMark<String> localeMark = LocaleCenter.getMark(VideoMark.class);
BrowseUtils.browser(localeMark.getValue());
}
public static final MenuKeySet VIDEO = new MenuKeySet() {
@Override

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));
}
}

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);
}

31
designer-base/src/main/java/com/fr/design/locale/impl/ProductImproveMark.java

@ -0,0 +1,31 @@
package com.fr.design.locale.impl;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author Hades
* @date 2019/6/24
*/
public class ProductImproveMark implements LocaleMark<Boolean> {
private Map<Locale, Boolean> map = new HashMap<>();
public ProductImproveMark() {
map.put(Locale.CHINA, true);
map.put(Locale.TAIWAN, false);
map.put(Locale.US, false);
map.put(Locale.KOREA, false);
map.put(Locale.JAPAN, false);
}
@Override
public Boolean getValue() {
Boolean result = map.get(GeneralContext.getLocale());
return result == null ? false : result;
}
}

35
designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java

@ -0,0 +1,35 @@
package com.fr.design.locale.impl;
import com.fr.design.DesignerEnvManager;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author Hades
* @date 2019/6/24
*/
public class SplashMark implements LocaleMark<String> {
private Map<Locale, String> map = new HashMap<Locale, String>();
private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif";
private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_10_en.gif";
private static final String SPLASH_JP_PATH = "/com/fr/design/images/splash_10_jp.gif";
public SplashMark() {
map.put(Locale.CHINA, SPLASH_PATH);
map.put(Locale.KOREA, SPLASH_EN_PATH);
map.put(Locale.JAPAN, SPLASH_JP_PATH);
map.put(Locale.US, SPLASH_EN_PATH);
map.put(Locale.TAIWAN, SPLASH_EN_PATH);
}
@Override
public String getValue() {
String result = map.get(DesignerEnvManager.getEnvManager().getLanguage());
return result == null ? SPLASH_EN_PATH : result;
}
}

44
designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java

@ -0,0 +1,44 @@
package com.fr.design.locale.impl;
import com.fr.general.locale.SupportLocale;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
/**
* 某些国际化环境支持的操作
* 需要增加/删除支持的语言 统一在这里修改 无须改动业务代码
* 后续有新的不同语言下的差异操作 添加新的枚举
* @author Hades
* @date 2019/6/24
*/
public enum SupportLocaleImpl implements SupportLocale {
/**
* 社区菜单支持的国际化环境
*/
COMMUNITY {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.CHINA);
set.add(Locale.TAIWAN);
return set;
}
},
/**
* Facebook支持的国际化环境
*/
FACEBOOK {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.TAIWAN);
return set;
}
}
}

36
designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java

@ -0,0 +1,36 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author Hades
* @date 2019/6/24
*/
public class UserInfoMark implements LocaleMark<String> {
private Map<Locale, String> map = new HashMap<>();
private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn");
private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en");
private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw");
private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp");
public UserInfoMark() {
map.put(Locale.CHINA, CN_LOGIN_HTML);
map.put(Locale.KOREA, EN_LOGIN_HTML);
map.put(Locale.JAPAN, JP_LOGIN_HTML);
map.put(Locale.US, EN_LOGIN_HTML);
map.put(Locale.TAIWAN, TW_LOGIN_HTML);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? EN_LOGIN_HTML : result;
}
}

35
designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java

@ -0,0 +1,35 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @author Hades
* @date 2019/6/24
*/
public class VideoMark implements LocaleMark<String> {
private Map<Locale, String> map = new HashMap<>();
private static final String VIDEO_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en");
private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video");
private static final String VIDEO_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.video.tw");
public VideoMark() {
map.put(Locale.CHINA, VIDEO_CN);
map.put(Locale.KOREA, VIDEO_EN);
map.put(Locale.JAPAN, VIDEO_EN);
map.put(Locale.US, VIDEO_EN);
map.put(Locale.TAIWAN, VIDEO_TW);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? VIDEO_EN : result;
}
}

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));
}

27
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -58,6 +58,9 @@ import com.fr.design.remote.action.RemoteDesignAuthManagerAction;
import com.fr.design.utils.ThemeUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleAction;
import com.fr.general.locale.LocaleCenter;
import com.fr.design.locale.impl.SupportLocaleImpl;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime;
@ -240,7 +243,7 @@ public abstract class ToolBarMenuDock {
public MenuDef[] menus(final ToolBarMenuDockPlus plus) {
//删除之前创建的插件菜单监听
clearPluginListeners();
java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>();
final java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>();
// 添加文件菜单
menuList.add(createFileMenuDef(plus));
@ -258,10 +261,13 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单
menuList.add(createHelpMenuDef());
if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)) {
// 添加社区菜单
addCommunityMenuDef(menuList);
}
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
addCommunityMenuDef(menuList);
}
}, SupportLocaleImpl.COMMUNITY);
// 添加全部UpdateAction到actionmanager中
addAllUpdateActionsToList(menuList);
@ -532,7 +538,7 @@ public abstract class ToolBarMenuDock {
* @return 社区菜单的子菜单
*/
public ShortCut[] createCommunityShortCuts() {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
final java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new BBSAction());
shortCuts.add(new VideoAction());
shortCuts.add(new TutorialAction());
@ -543,9 +549,12 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new CusDemandAction());
shortCuts.add(new CenterAction());
shortCuts.add(new SignAction());
if (Locale.TAIWAN.equals(GeneralContext.getLocale())) {
shortCuts.add(new FacebookFansAction());
}
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new FacebookFansAction());
}
}, SupportLocaleImpl.FACEBOOK);
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
}

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;
}

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
}
}

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

@ -225,7 +225,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
return;
}
widgetPropertyPane.update(widget);
xCreator.resetCreatorName(currentWidgetName);
// 上面一行更新了组件 这里必须重新调用getWidgetName
xCreator.resetCreatorName(widget.getWidgetName());
xCreator.resetVisible(widget.isVisible());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
return;

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()));
}
}

33
designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java

@ -2,12 +2,9 @@ package com.fr.design.mainframe.messagecollect.entity;
import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.general.CloudCenter;
import com.fr.general.CloudClient;
import com.fr.general.IOUtils;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
import com.fr.stable.CoreConstants;
@ -22,7 +19,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.UUID;
/**
@ -32,11 +28,7 @@ import java.util.UUID;
public class FileEntityBuilder {
private static final String FOCUS_POINT_FILE_ROOT_PATH = "FocusPoint";
private static final String FOCUS_POINT_FILE_UPLOAD_TOPIC = "__fine_intelli_file_upload__";
private static final String FILE_FROM = "design";
private static final String FOCUS_POINT_FILE_UPLOAD_TYPE = "FocusPoint";
private static final String FOCUS_POINT_FILE_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.feedback");
private static final String FOCUS_POINT_URL_KEY = "focuspoint";
/**
* 文件夹路径
@ -109,29 +101,8 @@ public class FileEntityBuilder {
String filePath = FOCUS_POINT_FILE_ROOT_PATH + CoreConstants.SEPARATOR + today + CoreConstants.SEPARATOR + keyFileName;
String bbsUserName = MarketConfig.getInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID();
String name = bbsUserName == null ? uuid : bbsUserName;
String name = StringUtils.isEmpty(bbsUserName) ? uuid : bbsUserName;
client.uploadFile(file, filePath, name, FILE_FROM);
addMessageQueue(filePath, bbsUserName, uuid);
}
private static void addMessageQueue(String filePath, String userName, String uuid) {
JSONObject uploadInfo = new JSONObject(FOCUS_POINT_FILE_UPLOAD_URL);
String focusPointUrl = uploadInfo.optString(FOCUS_POINT_URL_KEY);
try {
HashMap<String, Object> params = new HashMap<>();
params.put("topic", FOCUS_POINT_FILE_UPLOAD_TOPIC);
params.put("username", URLEncoder.encode(userName, EncodeConstants.ENCODING_UTF_8));
params.put("uuid", uuid);
params.put("filepath", filePath);
params.put("timestamp", String.valueOf(System.currentTimeMillis()));
params.put("signature", String.valueOf(CommonUtils.signature()));
params.put("type", FOCUS_POINT_FILE_UPLOAD_TYPE);
if(StringUtils.isNotEmpty(focusPointUrl)){
HttpToolbox.post(focusPointUrl, params);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
client.uploadFile(file, filePath, URLEncoder.encode(name, EncodeConstants.ENCODING_UTF_8), FILE_FROM);
}
}

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()));

22
designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java

@ -8,11 +8,14 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.DescriptionTextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.locale.impl.UserInfoMark;
import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import javax.swing.*;
import javax.swing.border.TitledBorder;
@ -31,11 +34,6 @@ public class CollectUserInformationDialog extends UIDialog {
private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000;
private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn");
private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en");
private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw");
private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp");
private UITextField keyTextField;
private ActionListener actionListener = new ActionListener() {
@ -129,19 +127,9 @@ public class CollectUserInformationDialog extends UIDialog {
private void getKeyAction() {
Locale locale = GeneralContext.getLocale();
String url = EN_LOGIN_HTML;
if (ComparatorUtils.equals(locale, Locale.TAIWAN)) {
url = TW_LOGIN_HTML;
}
if (ComparatorUtils.equals(locale, Locale.CHINA)) {
url = CN_LOGIN_HTML;
}
if (ComparatorUtils.equals(locale, Locale.JAPAN)) {
url = JP_LOGIN_HTML;
}
LocaleMark<String> localeMark = LocaleCenter.getMark(UserInfoMark.class);
try {
Desktop.getDesktop().browse(new URI(url));
Desktop.getDesktop().browse(new URI(localeMark.getValue()));
} catch (Exception ignored) {
}

Loading…
Cancel
Save