Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~kerry/design_10.0 into release/10.0

bugfix/10.0
kerry 6 years ago
parent
commit
c498052bd6
  1. 57
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 8
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  3. 43
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  4. 55
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  5. 2
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  6. 1
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java
  7. 21
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  8. 24
      designer-base/src/main/java/com/fr/design/style/color/PickColorButtonFactory.java
  9. 28
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  10. 62
      designer-base/src/main/java/com/fr/env/TestConnectionResult.java
  11. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  12. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomDefaultSeriesPane.java
  13. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomTypeConditionSeriesPane.java
  14. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/LineSeriesPane.java
  15. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/RadarSeriesPane.java
  16. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java
  17. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java
  18. 16
      designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java
  19. 7
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  20. 17
      designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java
  21. 155
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java
  22. 16
      designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java
  23. 4
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java
  24. 6
      designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java

57
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -5,6 +5,7 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -15,19 +16,25 @@ import com.fr.env.EnvListPane;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.license.exception.RegistEditionException; import com.fr.license.exception.RegistEditionException;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.AssistUtils;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.start.server.ServerTray; import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback; import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.AuthException; import com.fr.workspace.connect.AuthException;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.ERROR_MESSAGE;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
public class EnvChangeEntrance { public class EnvChangeEntrance {
@ -90,6 +97,12 @@ public class EnvChangeEntrance {
}); });
return false; return false;
} }
// 如果版本不一致,且确认 不继续 连接,这里返回 false.
if (!versionCheckAndConfirm(selectedEnv)) {
return false;
}
WorkContext.switchTo(workspace, new WorkContextCallback() { WorkContext.switchTo(workspace, new WorkContextCallback() {
@Override @Override
public void done() { public void done() {
@ -138,6 +151,50 @@ public class EnvChangeEntrance {
return true; return true;
} }
/**
* 切换远程环境之前进行版本检测当版本不一致的时候提示
* 当用户确认选择 ok 才继续
*
* @param selectedEnv 选择的环境
* @return 是否一致
* 1. 非远程环境 返回 true
* 2. 远程环境
* 2.1 不匹配
* 2.1.1 当选择 ok 返回 true
* 2.1.2 当选择 no, 返回 false
* 2.2 匹配 返回 true
* @throws Exception 异常
*/
private boolean versionCheckAndConfirm(DesignerWorkspaceInfo selectedEnv) throws Exception {
if (selectedEnv.getType() == DesignerWorkspaceType.Remote) {
WorkspaceConnectionInfo info = selectedEnv.getConnection();
String serverVersion = new FunctionalHttpRequest(info).getServerVersion();
if (AssistUtils.equals(serverVersion, WorkContext.getVersion())) {
return true;
}
final List<Integer> result = new ArrayList<>(1);
PopTipStrategy.NOW.showTip(new PopTip() {
@Override
public void show() {
String[] option = {Toolkit.i18nText("Fine-Design_Report_Yes"), Toolkit.i18nText("Fine-Design_Report_No")};
int choice = JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Version_Inconsistency"),
UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, UIManager.getIcon("OptionPane.warningIcon"), option, 1);
result.add(choice);
}
});
// 只有选择 yes , 这里的值才为 0, 返回 true
// 否着返回 false, 将不进行下面的连接操作。
return result.size() != 0 && result.get(0) == 0;
}
return true;
}
/** /**
* 编辑items * 编辑items
* *

8
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -2,6 +2,7 @@ package com.fr.design.file;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -59,6 +60,10 @@ public class HistoryTemplateListCache implements CallbackEvent {
public void closeSelectedReport(JTemplate<?, ?> selected) { public void closeSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane(); DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected); DesignTableDataManager.closeTemplate(selected);
//直接关闭模板的时候退出权限编辑
if (DesignModeContext.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().closeAuthorityEditing();
}
if (contains(selected) == -1) { if (contains(selected) == -1) {
return; return;
} }
@ -183,10 +188,13 @@ public class HistoryTemplateListCache implements CallbackEvent {
/** /**
* 判断是否打开过该模板 * 判断是否打开过该模板
* 由于切换环境不会关闭模板可能存在同名的模板所以该方法不能准确找到所选的模板
* *
* @param filename 文件名 * @param filename 文件名
* @return 文件位置 * @return 文件位置
* @deprecated use HistoryTemplateListCache#contains(com.fr.design.mainframe.JTemplate) instead
*/ */
@Deprecated
public int contains(String filename) { public int contains(String filename) {
for (int i = 0; i < historyList.size(); i++) { for (int i = 0; i < historyList.size(); i++) {
String historyPath = historyList.get(i).getPath(); String historyPath = historyList.get(i).getPath();

43
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -18,7 +18,6 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.third.javax.annotation.Nonnull; import com.fr.third.javax.annotation.Nonnull;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator; import com.fr.workspace.server.lock.TplOperator;
@ -674,9 +673,6 @@ public class MutilTempalteTabPane extends JComponent {
return; return;
} }
//当前激活的模板
String filename = openedTemplate.get(selectedIndex).getPath();
filename = FilenameUtils.standard(filename);
if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) { if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) {
specifiedTemplate.stopEditing(); specifiedTemplate.stopEditing();
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?",
@ -684,20 +680,20 @@ public class MutilTempalteTabPane extends JComponent {
if (returnVal == JOptionPane.YES_OPTION) { if (returnVal == JOptionPane.YES_OPTION) {
specifiedTemplate.saveTemplate(); specifiedTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));
closeTpl(specifiedTemplate, filename); closeTpl(specifiedTemplate);
} else if (returnVal == JOptionPane.NO_OPTION) { } else if (returnVal == JOptionPane.NO_OPTION) {
closeTpl(specifiedTemplate, filename); closeTpl(specifiedTemplate);
} }
} else { } else {
closeTpl(specifiedTemplate, filename); closeTpl(specifiedTemplate);
} }
} }
private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate, @Nonnull String fileName) { private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate) {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
closeAndFreeLock(specifiedTemplate); closeAndFreeLock(specifiedTemplate);
activeTemplate(fileName); activePrevTemplateAfterClose();
} }
private void closeAndFreeLock(@Nonnull JTemplate<?, ?> template) { private void closeAndFreeLock(@Nonnull JTemplate<?, ?> template) {
@ -729,11 +725,9 @@ public class MutilTempalteTabPane extends JComponent {
} }
/** /**
* 关闭掉一个模板之后该激活的Tab * 关闭掉一个模板之后激活新的待显示模板
*
* @param fileName 关闭掉一个模板之后该激活的Tab的文件名绝对路径
*/ */
private void activeTemplate(String fileName) { private void activePrevTemplateAfterClose() {
if (openedTemplate.isEmpty()) { if (openedTemplate.isEmpty()) {
//新建并激活模板 //新建并激活模板
DesignerContext.getDesignerFrame().addAndActivateJTemplate(); DesignerContext.getDesignerFrame().addAndActivateJTemplate();
@ -742,23 +736,20 @@ public class MutilTempalteTabPane extends JComponent {
temTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); temTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
} else { } else {
//如果关闭的模板是当前选中的模板,则重新激活 // 如果关闭的模板是当前选中的模板,则重新激活当前 selectIndex 的模板;
if (closeIconIndex == selectedIndex) { // selectIndex 没有变化,但是对应的模板已经变成了前一张模板
if (closeIconIndex == maxPaintIndex) { if (closeIconIndex == selectedIndex || isCloseCurrent) {
// 如果 closeIconIndex 是最后一个被渲染画出的,那么预览上一个,防止数组越界
if (closeIconIndex >= maxPaintIndex) {
// selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true
selectedIndex--; selectedIndex--;
} }
} else if (isCloseCurrent) {
//不是通过关闭按钮,而是通过文件关闭菜单关闭的当前模板的,也重新激活
if (selectedIndex > openedTemplate.size() - 1) {
selectedIndex -= 1;
if (selectedIndex < 0) {
selectedIndex = 0;
}
isCloseCurrent = false; isCloseCurrent = false;
} }
} else { // 如果关闭的模板不是当前选中的模板,那么重新获取一下当前模板的 index,激活该 index
//如果关闭的模板不是当前选中的模板,则激活的模板不变 else {
selectedIndex = HistoryTemplateListCache.getInstance().contains(fileName); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
selectedIndex = HistoryTemplateListCache.getInstance().contains(template);
} }
//如果是已后台关闭的模板,则重新打开文件 //如果是已后台关闭的模板,则重新打开文件
openedTemplate.get(selectedIndex).activeOldJTemplate(); openedTemplate.get(selectedIndex).activeOldJTemplate();

55
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -10,6 +10,7 @@ import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
@ -17,6 +18,7 @@ import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.event.DesignerOpenedListener; import com.fr.design.event.DesignerOpenedListener;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane; import com.fr.design.file.NewTemplatePane;
@ -29,6 +31,7 @@ import com.fr.design.gui.imenu.UIMenuHighLight;
import com.fr.design.gui.iprogressbar.ProgressDialog; import com.fr.design.gui.iprogressbar.ProgressDialog;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
@ -76,7 +79,6 @@ import java.awt.Graphics;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants; import java.awt.dnd.DnDConstants;
@ -160,9 +162,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//用于判断设计器是否打开了 //用于判断设计器是否打开了
private boolean designerOpened = false; private boolean designerOpened = false;
private int contentWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth()); private int contentWidth = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getWidth());
private int contentHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight()); private int contentHeight = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getHeight());
private WindowAdapter windowAdapter = new WindowAdapter() { private WindowAdapter windowAdapter = new WindowAdapter() {
@ -224,16 +226,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
if (DesignerMode.isAuthorityEditing()) { if (DesignModeContext.isAuthorityEditing()) {
DesignerMode.setMode(DesignerMode.NORMAL); closeAuthorityEditing();
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint();
refreshDottedLine();
fireAuthorityStateToNomal();
} }
} }
@ -332,6 +326,18 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.progressDialog = new ProgressDialog(this); this.progressDialog = new ProgressDialog(this);
} }
public void closeAuthorityEditing(){
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL);
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint();
refreshDottedLine();
fireAuthorityStateToNomal();
}
/** /**
* 注册app. * 注册app.
* *
@ -849,18 +855,18 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
editingTemplate.stopEditing(); editingTemplate.stopEditing();
if (!editingTemplate.getEditingFILE().exists()) { if (!editingTemplate.getEditingFILE().exists()) {
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + editingTemplate.getEditingFILE() Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + editingTemplate.getEditingFILE()
+ "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION, + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE); JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) { if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) {
editingTemplate.saveTemplate(); editingTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved",
editingTemplate.getEditingFILE().getName())); editingTemplate.getEditingFILE().getName()));
} }
} else { } else {
if (editingTemplate.saveTemplate()) { if (editingTemplate.saveTemplate()) {
editingTemplate.saveTemplate(); editingTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved",
editingTemplate.getEditingFILE().getName())); editingTemplate.getEditingFILE().getName()));
} }
} }
@ -957,8 +963,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// p:判断一下,如何文件为空或者文件不存在,直接返回. // p:判断一下,如何文件为空或者文件不存在,直接返回.
if (tplFile == null || !tplFile.exists()) { if (tplFile == null || !tplFile.exists()) {
JOptionPane.showMessageDialog(this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"), JOptionPane.showMessageDialog(
ProductConstants.PRODUCT_NAME, JOptionPane.INFORMATION_MESSAGE); this,
Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"),
ProductConstants.PRODUCT_NAME,
JOptionPane.INFORMATION_MESSAGE
);
DesignerFrameFileDealerPane.getInstance().refresh(); DesignerFrameFileDealerPane.getInstance().refresh();
return; return;
} }
@ -968,7 +978,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} catch (DecryptTemplateException e) { } catch (DecryptTemplateException e) {
JOptionPane.showMessageDialog( JOptionPane.showMessageDialog(
this, this,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encrypt_Decrypt_Exception"), Toolkit.i18nText("Fine-Design_Encrypt_Decrypt_Exception"),
UIManager.getString("OptionPane.messageDialogTitle"), UIManager.getString("OptionPane.messageDialogTitle"),
JOptionPane.WARNING_MESSAGE, JOptionPane.WARNING_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon") UIManager.getIcon("OptionPane.errorIcon")
@ -1027,7 +1037,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
MutilTempalteTabPane.getInstance().setTemTemplate( MutilTempalteTabPane.getInstance().setTemTemplate(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
} else { } else {
activeTemplate(tplFile, jt); activeTemplate(jt);
} }
opened = true; opened = true;
break; break;
@ -1042,13 +1052,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
/** /**
* 激活指定的模板 * 激活指定的模板
* *
* @param tplFile 模板文件
* @param jt 当前报表 * @param jt 当前报表
* @date 2014-10-14-下午6:31:23 * @date 2014-10-14-下午6:31:23
*/ */
private void activeTemplate(FILE tplFile, JTemplate jt) { private void activeTemplate(JTemplate jt) {
// 如果该模板已经打开,则进行激活就可以了 // 如果该模板已经打开,则进行激活就可以了
int index = HistoryTemplateListPane.getInstance().contains(tplFile.getPath()); int index = HistoryTemplateListPane.getInstance().contains(jt);
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList();
if (index != -1) { if (index != -1) {
historyList.get(index).activeJTemplate(index, jt); historyList.get(index).activeJTemplate(index, jt);

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

@ -412,6 +412,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
if (propertyItem.isVisible() && propertyItem.isEnabled() && !propertyItem.isPoppedOut()) { if (propertyItem.isVisible() && propertyItem.isEnabled() && !propertyItem.isPoppedOut()) {
propertyCard.show(rightPane, tabName); propertyCard.show(rightPane, tabName);
propertyItem.setTabButtonSelected(); propertyItem.setTabButtonSelected();
//从单元格菜单过来也要关闭弹出窗
hideCurrentPopupPane();
} }
} }

1
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java

@ -73,5 +73,6 @@ public class LogMessageBar extends JPanel {
if (dlg != null) { if (dlg != null) {
dlg.dispose(); dlg.dispose();
} }
THIS = null;
} }
} }

21
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -8,11 +8,16 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import javax.swing.BorderFactory;
import javax.swing.*; import javax.swing.Box;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -92,11 +97,15 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
centerPane.add(Box.createVerticalStrut(1)); centerPane.add(Box.createVerticalStrut(1));
// mod by anchore 16/11/16 // mod by anchore 16/11/16
UIButton customButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Color")); final UIButton customButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Color"));
customButton.addActionListener(new ActionListener() { // 不能使用 ActionListener,否则设计器工具栏中的"更多颜色"按钮会有问题(REPORT-13654)
customButton.addMouseListener(new MouseAdapter() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void mousePressed(MouseEvent e) {
if (!customButton.isEnabled()) {
return;
}
customButtonPressed(); customButtonPressed();
} }
}); });

24
designer-base/src/main/java/com/fr/design/style/color/PickColorButtonFactory.java

@ -4,11 +4,15 @@ import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.SpecialUIButton; import com.fr.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIBasicButtonUI; import com.fr.design.gui.ibutton.UIBasicButtonUI;
import javax.swing.*; import javax.swing.JButton;
import javax.swing.plaf.ButtonUI; import javax.swing.JComponent;
import javax.swing.plaf.basic.BasicButtonUI; import java.awt.Color;
import java.awt.*; import java.awt.Cursor;
import java.awt.event.*; import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/** /**
* Created by plough on 2016/12/22. * Created by plough on 2016/12/22.
@ -28,7 +32,7 @@ class PickColorButtonFactory {
* @return SpecialUIButton 屏幕取色按钮 * @return SpecialUIButton 屏幕取色按钮
*/ */
static JButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) { static JButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) {
SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI()); final SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI());
PickColorButtonFactory.iconType = iconType; PickColorButtonFactory.iconType = iconType;
if (iconType == IconType.ICON16) { if (iconType == IconType.ICON16) {
@ -42,9 +46,13 @@ class PickColorButtonFactory {
pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize)); pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize));
pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
pickColorButton.addActionListener(new ActionListener() { // 不能使用 ActionListener,否则设计器工具栏中的取色按钮会有问题(REPORT-13654)
pickColorButton.addMouseListener(new MouseAdapter() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void mousePressed(MouseEvent e) {
if (!pickColorButton.isEnabled()) {
return;
}
new ColorPicker(colorSelectable, setColorRealTime); new ColorPicker(colorSelectable, setColorRealTime);
} }
}); });

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

@ -511,14 +511,14 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
} }
private void tryConnectRemoteEnv() { private void tryConnectRemoteEnv() {
final RemoteDesignerWorkspaceInfo remoteEnv = updateBean();
final WorkspaceConnectionInfo connection = remoteEnv.getConnection();
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() { final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() {
@Override @Override
protected Boolean doInBackground() throws Exception { protected Boolean doInBackground() throws Exception {
final RemoteDesignerWorkspaceInfo remoteEnv = updateBean();
WorkspaceConnectionInfo connection = remoteEnv.getConnection();
DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath()); DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath());
DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey()); DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey());
try { try {
@ -532,18 +532,26 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
protected void done() { protected void done() {
okButton.setEnabled(true); okButton.setEnabled(true);
try { try {
Boolean result = get();
if (result == null) { TestConnectionResult result = TestConnectionResult.parse(get(), connection);
message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed")); if (result == TestConnectionResult.Fully_Success) {
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} else {
if (result) {
message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Successful")); message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Successful"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
} else { }
if (result == TestConnectionResult.Partly_Sucess) {
message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Version_Inconsistence_Test"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.warningIcon"));
}
if (result == TestConnectionResult.Fully_Failed) {
message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Failed")); message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
if (result == TestConnectionResult.Auth_Failed) {
message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage()); FineLoggerFactory.getLogger().error(e, e.getMessage());

62
designer-base/src/main/java/com/fr/env/TestConnectionResult.java vendored

@ -0,0 +1,62 @@
package com.fr.env;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest;
/**
* 测试连接的结果
* 不改变原有逻辑的情况下加入一层转化
* 根据这里的转化结果判断需要提示哪些内容
*
* created by Harrison on 2018/12/20
**/
public enum TestConnectionResult {
/**
* 完全成功, 版本匹配测试连接成功
*/
Fully_Success,
/**
* 不完全成功版本不匹配但测试连接成功
*/
Partly_Sucess,
/**
* 完全失败直接没连上
*/
Fully_Failed,
/**
* 验证 Token 失败
*/
Auth_Failed;
public static TestConnectionResult parse(Boolean value, WorkspaceConnectionInfo info) {
if (value == null) {
return Auth_Failed;
}
if (!value) {
return Fully_Failed;
}
try {
String serverVersion = new FunctionalHttpRequest(info).getServerVersion();
if (AssistUtils.equals(serverVersion, WorkContext.getVersion())) {
return Fully_Success;
}
return Partly_Sucess;
} catch (Exception e) {
// 发生异常,说明没连接上。返回完全失败。
FineLoggerFactory.getLogger().error(e.getMessage());
return Fully_Failed;
}
}
}

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java

@ -96,7 +96,7 @@ public class ChartDatapointLabelPane extends BasicPane{
boolean isGuidline = plot.isSupportLeadLine(); boolean isGuidline = plot.isSupportLeadLine();
if(plot.isSupportCategoryFilter()) { if(plot.isSupportCategoryFilter()) {
isCategory = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Format_Category_Name")); isCategory = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"));
} }
isSeries = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")); isSeries = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
isValue = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")); isValue = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value"));

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomDefaultSeriesPane.java

@ -240,7 +240,7 @@ public class CustomDefaultSeriesPane extends BasicPane{
isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth")); isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth"));
lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray()); markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray());
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomTypeConditionSeriesPane.java

@ -449,7 +449,7 @@ public class CustomTypeConditionSeriesPane extends BasicBeanPane<CustomAttr>{
lineStyle.setPreferredSize(new Dimension(150,20)); lineStyle.setPreferredSize(new Dimension(150,20));
markerPane.setPreferredSize(new Dimension(150,20)); markerPane.setPreferredSize(new Dimension(150,20));
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/LineSeriesPane.java

@ -49,7 +49,7 @@ public class LineSeriesPane extends AbstractPlotSeriesPane{
isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth")); isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth"));
lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray()); markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray());
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/RadarSeriesPane.java

@ -45,7 +45,7 @@ public class RadarSeriesPane extends AbstractPlotSeriesPane{
isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill")); isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill"));
lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray()); markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray());
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);

7
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java

@ -4,6 +4,7 @@ import com.fr.chart.base.ChartConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -28,7 +29,7 @@ public class VanChartBeautyPane extends BasicBeanPane<Integer> {
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style")), styleBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style")), styleBox},
} ; } ;
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
@ -36,8 +37,8 @@ public class VanChartBeautyPane extends BasicBeanPane<Integer> {
} }
protected String[] getNameArray(){ protected String[] getNameArray(){
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Default_Name"), return new String[]{Toolkit.i18nText("Fine-Design_Chart_Default_Name"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Top_Down_Shade") Toolkit.i18nText("Fine-Design_Chart_Style_TopDownShade")
}; };
} }
@Override @Override

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.component.format; package com.fr.van.chart.designer.component.format;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -18,6 +19,7 @@ public class CategoryNameFormatPaneWithCheckBox extends VanChartFormatPaneWithCh
@Override @Override
protected String getCheckBoxText() { protected String getCheckBoxText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Format_Category_Name"); //"分类名" 图表(新特性)标签、提示时有用到
return Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name");
} }
} }

16
designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java

@ -3,11 +3,15 @@ package com.fr.design.actions;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark; import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark;
import com.fr.design.actions.JTemplateAction; import com.fr.design.actions.JTemplateAction;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.form.mobile.FormMobileAttrPane; import com.fr.design.form.mobile.FormMobileAttrPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
@ -73,6 +77,9 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent());
//改变布局为自适应布局,只在移动端属性设置保存后改变一次
doChangeBodyLayout();
WidgetPropertyPane.getInstance().refreshDockingView(); WidgetPropertyPane.getInstance().refreshDockingView();
jf.fireTargetModified(); jf.fireTargetModified();
} }
@ -80,6 +87,15 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
dialog.setVisible(true); dialog.setVisible(true);
} }
private void doChangeBodyLayout(){
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
XLayoutContainer rootLayout = formDesigner.getRootComponent();
if (rootLayout.getComponentCount() == 1 && rootLayout.getXCreator(0).acceptType(XWAbsoluteBodyLayout.class)) {
rootLayout = (XWAbsoluteBodyLayout) rootLayout.getXCreator(0);
}
((XWFitLayout)formDesigner.getRootComponent()).switch2FitBodyLayout(rootLayout);
}
@Focus(id = "com.fr.mobile.mobile_template_frm", text = "Fine-Design_Function_Mobile_Template_Frm", source = Original.EMBED) @Focus(id = "com.fr.mobile.mobile_template_frm", text = "Fine-Design_Function_Mobile_Template_Frm", source = Original.EMBED)
private void recordFunction() { private void recordFunction() {
// do nothing // do nothing

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

@ -137,14 +137,9 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
XLayoutContainer rootLayout = selectedBodyLayout(formDesigner); XLayoutContainer rootLayout = selectedBodyLayout(formDesigner);
if (rootLayout != formDesigner.getRootComponent() if (rootLayout != formDesigner.getRootComponent()
&& formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) { && formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) {
//原单例面板populate根据当前样式populate属性面板,现加入移动端逻辑:可能需要根据面板属性改变样式
Form form = formDesigner.getTarget();
if (form.getFormMobileAttr().isMobileOnly() && form.getFormMobileAttr().isAdaptivePropertyAutoMatch()) {
((XWFitLayout)formDesigner.getRootComponent()).switch2FitBodyLayout(rootLayout);
} else {
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()}));
}
} }
paddingBound.populate(ob); paddingBound.populate(ob);
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());

17
designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java

@ -10,8 +10,11 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.Worker;
import com.fr.transaction.WorkerCallBack;
import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -23,7 +26,7 @@ import java.awt.event.ActionEvent;
public class StyleListAction extends UpdateAction { public class StyleListAction extends UpdateAction {
public StyleListAction() { public StyleListAction() {
this.setMenuKeySet(PREDEFINED_STYLES); this.setMenuKeySet(PREDEFINED_STYLES);
this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/style.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/style.png"));
this.generateAndSetSearchText(StyleManagerPane.class.getName()); this.generateAndSetSearchText(StyleManagerPane.class.getName());
@ -31,6 +34,7 @@ public class StyleListAction extends UpdateAction {
/** /**
* 动作 * 动作
*
* @param evt 事件 * @param evt 事件
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -40,24 +44,23 @@ public class StyleListAction extends UpdateAction {
styleListDialog.addDialogActionListener(new DialogActionAdapter() { styleListDialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) {
@Override @Override
public void run() { public void run() {
styleListPane.update(ServerPreferenceConfig.getInstance()); styleListPane.update(ServerPreferenceConfig.getInstance());
} }
}.addCallBack(new CallBackAdaptor(){
@Override @Override
public Class<? extends Configuration>[] targets() { public void afterCommit() {
return new Class[]{ServerPreferenceConfig.class}; DesignerContext.getDesignerBean("predefinedStyle").refreshBeanElement();
} }
}); }));
} }
}); });
ServerPreferenceConfig mirror = ServerPreferenceConfig.getInstance().mirror(); ServerPreferenceConfig mirror = ServerPreferenceConfig.getInstance().mirror();
styleListPane.populate(mirror); styleListPane.populate(mirror);
styleListDialog.setVisible(true); styleListDialog.setVisible(true);
} }
@Override @Override

155
designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

@ -5,11 +5,6 @@ package com.fr.design.mainframe;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.dialect.DialectFactory;
import com.fr.data.core.db.dml.Delete;
import com.fr.data.core.db.dml.Select;
import com.fr.data.core.db.dml.Table;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfoUploader; import com.fr.design.mainframe.errorinfo.ErrorInfoUploader;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
@ -19,18 +14,13 @@ import com.fr.general.DateUtils;
import com.fr.general.DesUtils; import com.fr.general.DesUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.http.HttpClient;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.intelli.record.FocusPoint; import com.fr.intelli.record.FocusPoint;
import com.fr.intelli.record.MetricException;
import com.fr.intelli.record.MetricRegistry; import com.fr.intelli.record.MetricRegistry;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.log.message.ParameterMessage;
import com.fr.record.DBRecordXManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -58,17 +48,15 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
/** /**
* @author neil * @author neil
@ -79,7 +67,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
// 24小时上传一次 // 24小时上传一次
private static final long DELTA = 24 * 3600 * 1000L; private static final long DELTA = 24 * 3600 * 1000L;
private static final long SEND_DELAY = 30 * 1000L; private static final long SEND_DELAY = 300 * 1000L;
private static final String FILE_NAME = "fr.info"; private static final String FILE_NAME = "fr.info";
private static final String XML_START_STOP_LIST = "StartStopList"; private static final String XML_START_STOP_LIST = "StartStopList";
private static final String XML_START_STOP = "StartStop"; private static final String XML_START_STOP = "StartStop";
@ -226,12 +214,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
if (currentTime - lastTime <= DELTA) { if (currentTime - lastTime <= DELTA) {
return; return;
} }
JSONArray content = null; JSONArray content = getFunctionsContent(currentTime, lastTime);
try {
content = getFunctionsContent(currentTime, lastTime);
} catch (JSONException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
boolean success = false; boolean success = false;
FineLoggerFactory.getLogger().info("Start sent function records to the cloud center..."); FineLoggerFactory.getLogger().info("Start sent function records to the cloud center...");
String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD); String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD);
@ -443,7 +426,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}); });
} }
public static JSONArray getFunctionsContent(long current, long last) throws JSONException{ public JSONArray getFunctionsContent(long current, long last) {
//记录当前条数,达到200条合并成一个请求 //记录当前条数,达到200条合并成一个请求
int count = 0; int count = 0;
JSONArray functionArray = new JSONArray(); JSONArray functionArray = new JSONArray();
@ -452,21 +435,20 @@ public class InformationCollector implements XMLReadable, XMLWriter {
.addRestriction(RestrictionFactory.gte(COLUMN_TIME, last)); .addRestriction(RestrictionFactory.gte(COLUMN_TIME, last));
try { try {
DataList<FocusPoint> focusPoints = MetricRegistry.getMetric().find(FocusPoint.class,condition); DataList<FocusPoint> focusPoints = MetricRegistry.getMetric().find(FocusPoint.class,condition);
JSONArray temp = new JSONArray(); TreeSet<FunctionRecord> focusPointsList = new TreeSet<>();
if(!focusPoints.isEmpty()){ if(!focusPoints.isEmpty()){
for(int i=0;i< focusPoints.getList().size();i++){ for(int i=0;i< focusPoints.getList().size();i++){
FocusPoint focusPoint = focusPoints.getList().get(i); FocusPoint focusPoint = focusPoints.getList().get(i);
if(focusPoint != null){ if(focusPoint != null){
if((++count <= MAX_EACH_REQUEST_RECORD_COUNT)){ if((++count <= MAX_EACH_REQUEST_RECORD_COUNT)){
temp.put(getOneRecord(focusPoint)); focusPointsList.add(getOneRecord(focusPoint));
} else { } else {
count = 0; count = 0;
functionArray.put(temp); functionArray.put(setToJSONArray(focusPointsList));
temp = new JSONArray(); focusPointsList.add(getOneRecord(focusPoint));
temp.put(getOneRecord(focusPoint));
} }
if(i == (focusPoints.getList().size() -1)){ if(i == (focusPoints.getList().size() -1)){
functionArray.put(temp); functionArray.put(setToJSONArray(focusPointsList));
} }
} }
} }
@ -478,16 +460,33 @@ public class InformationCollector implements XMLReadable, XMLWriter {
return functionArray; return functionArray;
} }
private static JSONObject getOneRecord(FocusPoint focusPoint) throws JSONException{ private FunctionRecord getOneRecord(FocusPoint focusPoint) {
FunctionRecord functionRecord = new FunctionRecord();
functionRecord.setId(focusPoint.getId() == null?StringUtils.EMPTY : focusPoint.getId());
functionRecord.setText(focusPoint.getText() == null?StringUtils.EMPTY : focusPoint.getText());
functionRecord.setSource(focusPoint.getSource());
functionRecord.setTime(focusPoint.getTime().getTime());
functionRecord.setTitle(focusPoint.getTitle() == null?StringUtils.EMPTY : focusPoint.getTitle());
functionRecord.setUsername(MarketConfig.getInstance().getBbsUsername() == null?StringUtils.EMPTY : MarketConfig.getInstance().getBbsUsername());
functionRecord.setUuid(DesignerEnvManager.getEnvManager().getUUID() == null?StringUtils.EMPTY : DesignerEnvManager.getEnvManager().getUUID());
return functionRecord;
}
private JSONArray setToJSONArray(Set set) throws JSONException {
JSONArray jsonArray = new JSONArray();
for(Iterator iter = set.iterator(); iter.hasNext(); ) {
FunctionRecord functionRecord = (FunctionRecord)iter.next();
com.fr.json.JSONObject record = new com.fr.json.JSONObject(); com.fr.json.JSONObject record = new com.fr.json.JSONObject();
record.put(ATTR_ID, focusPoint.getId()); record.put(ATTR_ID, functionRecord.getId());
record.put(ATTR_TEXT, focusPoint.getText()); record.put(ATTR_TEXT, functionRecord.getText());
record.put(ATTR_SOURCE, focusPoint.getSource()); record.put(ATTR_SOURCE, functionRecord.getSource());
record.put(ATTR_TIME, focusPoint.getTime().getTime()); record.put(ATTR_TIME, functionRecord.getTime());
record.put(ATTR_TITLE, focusPoint.getTitle()); record.put(ATTR_TITLE, functionRecord.getTitle());
record.put(ATTR_USER_NAME, MarketConfig.getInstance().getBbsUsername()); record.put(ATTR_USER_NAME, functionRecord.getUsername());
record.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); record.put(ATTR_UUID, functionRecord.getUuid());
return record; jsonArray.put(record);
}
return jsonArray;
} }
private class StartStopTime implements XMLReadable, XMLWriter { private class StartStopTime implements XMLReadable, XMLWriter {
@ -529,4 +528,84 @@ public class InformationCollector implements XMLReadable, XMLWriter {
} }
private class FunctionRecord implements Comparable{
private String id;
private String text;
private int source;
private long time;
private String title;
private String username;
private String uuid;
public FunctionRecord(){
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public int getSource() {
return source;
}
public void setSource(int source) {
this.source = source;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Override
public int compareTo(Object o) {
FunctionRecord functionRecord = (FunctionRecord) o;
if(this.getId().equals((functionRecord.getId())) && this.getText().equals(functionRecord.getText())
&& this.getSource() == functionRecord.getSource() && this.getTime() == functionRecord.getTime()
&& this.getTitle().equals(functionRecord.getTitle()) && this.getUsername().equals(functionRecord.getUsername())
&& this.getUuid().equals(functionRecord.getUuid())){
return 0;
}
return 1;
}
}
} }

16
designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java

@ -2,6 +2,7 @@ package com.fr.design.present;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.config.StyleMap;
import com.fr.design.gui.controlpane.AbstractNameableCreator; import com.fr.design.gui.controlpane.AbstractNameableCreator;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
@ -13,6 +14,8 @@ import com.fr.design.style.StylePane;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerAdaptor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -90,17 +93,16 @@ public class StyleArrayPane extends JListControlPane {
/** /**
* Update. * Update.
*/ */
public void update(ServerPreferenceConfig configManager) { public void update(final ServerPreferenceConfig configManager) {
configManager.clearAllStyle(); //configManager.clearAllStyle();
// Nameable[]居然不能强转成Parameter[],一定要这么写... // Nameable[]居然不能强转成Parameter[],一定要这么写...
Nameable[] nameables = this.update(); Nameable[] nameables = this.update();
final StyleMap styleMap = new StyleMap();
for (int i = 0; i < nameables.length; i++) { for (int i = 0; i < nameables.length; i++) {
configManager.putStyle(((NameObject)nameables[i]).getName(), (Style)((NameObject)nameables[i]).getObject()); styleMap.put(((NameObject)nameables[i]).getName(), (Style)((NameObject)nameables[i]).getObject());
}
DesignerContext.getDesignerBean("predefinedStyle").refreshBeanElement();
} }
configManager.setStyleMap(styleMap);
}
} }

4
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -508,6 +508,10 @@ public class CellSelection extends Selection {
popup.add(DeprecatedActionManager.getInsertMenu(ePane)); popup.add(DeprecatedActionManager.getInsertMenu(ePane));
popup.add(DeprecatedActionManager.getDeleteMenu(ePane)); popup.add(DeprecatedActionManager.getDeleteMenu(ePane));
popup.add(DeprecatedActionManager.getClearMenu(ePane)); popup.add(DeprecatedActionManager.getClearMenu(ePane));
popup.addSeparator();
addExtraMenu(ePane, popup);
return popup; return popup;
} }

6
designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java

@ -1,6 +1,5 @@
package com.fr.grid.selection; package com.fr.grid.selection;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.CleanAuthorityAction;
@ -27,7 +26,6 @@ import com.fr.design.mainframe.ElementCasePane.Clear;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
@ -149,6 +147,10 @@ public class FloatSelection extends Selection {
popup.add(new EditFloatElementNameAction(ePane).createMenuItem()); popup.add(new EditFloatElementNameAction(ePane).createMenuItem());
popup.addSeparator();
addExtraMenu(ePane, popup);
return popup; return popup;
} }

Loading…
Cancel
Save