Browse Source

Merge branch 'feature/10.0' of http://www.cloud.finedevelop.com:2015/scm/~zheng/C-design into feature/10.0

master
zheng 7 years ago
parent
commit
74485a2dfc
  1. 50
      designer/src/com/fr/start/module/DesignerStartup.java
  2. 47
      designer/src/com/fr/start/module/PreStartActivator.java
  3. 50
      designer_base/src/com/fr/design/style/FormatPane.java
  4. 1
      designer_base/src/com/fr/start/server/TomcatHost.java
  5. 2
      designer_chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java

50
designer/src/com/fr/start/module/DesignerStartup.java

@ -1,11 +1,7 @@
package com.fr.start.module; package com.fr.start.module;
import com.fr.design.DesignerEnvManager;
import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.stable.CoreActivator; import com.fr.stable.CoreActivator;
import com.fr.stable.ProductConstants;
import com.fr.stable.module.ModuleListener; import com.fr.stable.module.ModuleListener;
import com.fr.start.Designer; import com.fr.start.Designer;
import com.fr.start.EnvSwitcher; import com.fr.start.EnvSwitcher;
@ -13,25 +9,15 @@ import com.fr.start.ReportSplashPane;
import com.fr.start.SplashWindow; import com.fr.start.SplashWindow;
import com.fr.startup.activators.BasicActivator; import com.fr.startup.activators.BasicActivator;
import java.io.File;
/** /**
* Created by juhaoyu on 2018/1/8. * Created by juhaoyu on 2018/1/8.
*/ */
public class DesignerStartup extends Activator { public class DesignerStartup extends Activator {
private static final int MESSAGE_PORT = 51462;
private static final int DEBUG_PORT = 51463;
@Override @Override
public void start() { public void start() {
startSub(PreStartActivator.class); startSub(PreStartActivator.class);
if (checkMultiStart()) {
return;
}
//启动基础部分 //启动基础部分
startSub(BasicActivator.class); startSub(BasicActivator.class);
//启动画面 //启动画面
@ -60,42 +46,6 @@ public class DesignerStartup extends Activator {
return splashWindow; return splashWindow;
} }
private boolean checkMultiStart() {
if (isDebug()) {
setDebugEnv();
} else {
DesignUtils.setPort(getStartPort());
}
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) {
DesignUtils.clientSend(getModule().upFindSingleton(StartupArgs.class).get());
return true;
}
return false;
}
private int getStartPort() {
return MESSAGE_PORT;
}
//在VM options里加入-Ddebug=true激活
private boolean isDebug() {
return ComparatorUtils.equals("true", System.getProperty("debug"));
}
//端口改一下,环境配置文件改一下。便于启动两个设计器,进行对比调试
private void setDebugEnv() {
DesignUtils.setPort(DEBUG_PORT);
DesignerEnvManager.setEnvFile(new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env_debug.xml"));
}
@Override @Override
public void stop() { public void stop() {

47
designer/src/com/fr/start/module/PreStartActivator.java

@ -3,24 +3,71 @@ package com.fr.start.module;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.stable.BuildContext; import com.fr.stable.BuildContext;
import com.fr.stable.ProductConstants;
import java.io.File;
/** /**
* Created by juhaoyu on 2018/1/8. * Created by juhaoyu on 2018/1/8.
*/ */
public class PreStartActivator extends Activator { public class PreStartActivator extends Activator {
private static final int MESSAGE_PORT = 51462;
private static final int DEBUG_PORT = 51463;
@Override @Override
public void start() { public void start() {
RestartHelper.deleteRecordFilesWhenStart(); RestartHelper.deleteRecordFilesWhenStart();
BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); BuildContext.setBuildFilePath("/com/fr/stable/build.properties");
SiteCenter.getInstance(); SiteCenter.getInstance();
if (checkMultiStart()) {
return;
}
initLanguage(); initLanguage();
} }
private boolean checkMultiStart() {
if (isDebug()) {
setDebugEnv();
} else {
DesignUtils.setPort(getStartPort());
}
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) {
DesignUtils.clientSend(getModule().upFindSingleton(StartupArgs.class).get());
return true;
}
return false;
}
private int getStartPort() {
return MESSAGE_PORT;
}
//在VM options里加入-Ddebug=true激活
private boolean isDebug() {
return ComparatorUtils.equals("true", System.getProperty("debug"));
}
//端口改一下,环境配置文件改一下。便于启动两个设计器,进行对比调试
private void setDebugEnv() {
DesignUtils.setPort(DEBUG_PORT);
DesignerEnvManager.setEnvFile(new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env_debug.xml"));
}
private void initLanguage() { private void initLanguage() {
//这两句的位置不能随便调换,因为会影响语言切换的问题 //这两句的位置不能随便调换,因为会影响语言切换的问题
FRContext.setLanguage(DesignerEnvManager.getEnvManager(false).getLanguage()); FRContext.setLanguage(DesignerEnvManager.getEnvManager(false).getLanguage());

50
designer_base/src/com/fr/design/style/FormatPane.java

@ -3,15 +3,20 @@
*/ */
package com.fr.design.style; package com.fr.design.style;
import java.awt.BorderLayout; import com.fr.base.FRContext;
import java.awt.Color; import com.fr.base.TextFormat;
import java.awt.FlowLayout; import com.fr.data.core.FormatField;
import java.awt.event.ActionEvent; import com.fr.data.core.FormatField.FormatContents;
import java.awt.event.ActionListener; import com.fr.design.dialog.BasicPane;
import java.text.DecimalFormat; import com.fr.design.gui.ibutton.UIRadioButton;
import java.text.Format; import com.fr.design.gui.ilable.UILabel;
import java.text.SimpleDateFormat; import com.fr.design.gui.itextfield.UITextField;
import java.util.Date; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
@ -25,21 +30,15 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import com.fr.base.FRContext; import java.awt.Color;
import com.fr.base.TextFormat; import java.awt.FlowLayout;
import com.fr.data.core.FormatField; import java.awt.event.ActionEvent;
import com.fr.data.core.FormatField.FormatContents; import java.awt.event.ActionListener;
import com.fr.design.gui.ibutton.UIRadioButton; import java.text.DecimalFormat;
import com.fr.design.gui.ilable.UILabel; import java.text.Format;
import com.fr.design.gui.itextfield.UITextField; import java.text.SimpleDateFormat;
import com.fr.design.layout.FRGUIPaneFactory; import java.util.Date;
import com.fr.design.dialog.BasicPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
/** /**
* 属性界面中的格式面板 * 属性界面中的格式面板
@ -316,6 +315,9 @@ public class FormatPane extends BasicPane {
*/ */
public Format update() { public Format update() {
String text = patternTextField.getText(); String text = patternTextField.getText();
if (getFormatContents() == FormatContents.TEXT) {
return FormatField.getInstance().getFormat(getFormatContents(), text);
}
if(StringUtils.isEmpty(text)) { if(StringUtils.isEmpty(text)) {
return null; return null;
} }

1
designer_base/src/com/fr/start/server/TomcatHost.java

@ -71,6 +71,7 @@ public class TomcatHost {
this.listener = new AprLifecycleListener(); this.listener = new AprLifecycleListener();
this.server.addLifecycleListener(listener); this.server.addLifecycleListener(listener);
this.tomcat.getHost().setAppBase(StableUtils.getInstallHome() + File.separator + "."); this.tomcat.getHost().setAppBase(StableUtils.getInstallHome() + File.separator + ".");
this.tomcat.getConnector().setURIEncoding("UTF-8");
} catch (Exception e) { } catch (Exception e) {
//todo 最好加一个用server.xml //todo 最好加一个用server.xml
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);

2
designer_chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java

@ -25,7 +25,7 @@ public class ChartMapEditorAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
int port = DesignerEnvManager.getEnvManager().getJettyServerPort(); int port = DesignerEnvManager.getEnvManager().getJettyServerPort();
String web = GeneralContext.getCurrentAppNameOfEnv(); String web = GeneralContext.getCurrentAppNameOfEnv();
String serverlet = ServerConfig.getInstance().getServletMapping(); String serverlet = ServerConfig.getInstance().getReportServletName();
Env env = FRContext.getCurrentEnv(); Env env = FRContext.getCurrentEnv();
StartServer.browserURLWithLocalEnv(env.isLocalEnv() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : env.getPath() + "?op=map"); StartServer.browserURLWithLocalEnv(env.isLocalEnv() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : env.getPath() + "?op=map");
} }

Loading…
Cancel
Save