Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

# Conflicts:
#	designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java
final/10.0
Jinbokai 6 years ago
parent
commit
db43c46e04
  1. 2
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 5
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
  3. 27
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java
  5. 13
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  6. 39
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java
  7. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  8. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  9. 97
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java
  10. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  11. 165
      designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java
  12. 4
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java
  13. 36
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java
  14. 23
      designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java
  15. 9
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  16. 9
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  17. 16
      designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java
  18. 10
      designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java
  19. 12
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java
  20. 20
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  21. 10
      designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java
  22. 8
      designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java
  23. 2
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  24. 5
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  25. 6
      designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java
  26. 7
      designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java
  27. 17
      designer-realize/src/main/java/com/fr/start/Designer.java

2
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -125,7 +125,7 @@ public class SwitchExistEnv extends MenuDef {
}
});
} catch (AuthException exception) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}),
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
}
}

5
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java

@ -246,8 +246,9 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
*/
public int contains(String filename) {
for (int i = 0; i < historyList.size(); i++) {
String historyPath = historyList.get(i).getPath();
if (ComparatorUtils.equals(historyPath, filename)) {
String historyPath = historyList.get(i).getPath().replaceAll("/", "\\\\");
//文件路径是全路径,历史路径是reportlets/模板名
if (filename.endsWith(historyPath)) {
return i;
}
}

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

@ -51,14 +51,30 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import javax.swing.*;
import com.fr.workspace.connect.WorkspaceConnection;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import javax.swing.border.MatteBorder;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
@ -721,8 +737,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName);
String username = null;
if (info != null){
username = info.getName();
if (info != null) {
WorkspaceConnection connection = info.getConnection();
username = connection == null ? StringUtils.EMPTY : connection.getUserName();
}
defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]");
if (editingTemplate != null) {

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

@ -153,7 +153,7 @@ public class TemplatePane extends JPanel implements MouseListener {
}
setJLabel(selectedName);
} catch (AuthException e) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}),
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false;
}

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

@ -16,12 +16,14 @@ import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.third.guava.base.Strings;
import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.AuthException;
import com.fr.workspace.connect.WorkspaceConnection;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.SwingConstants;
@ -277,6 +279,10 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
this.certPathInput.setText(certPath);
this.certSecretKeyInput.setText(certSecretKey);
} else {
this.remoteEnvURL = RemoteEnvURL.createDefaultURL();
this.usernameInput.setText(StringUtils.EMPTY);
this.passwordInput.setText(StringUtils.EMPTY);
}
fillRemoteEnvURLField();
@ -488,8 +494,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
WorkspaceConnection connection = remoteEnv.getConnection();
DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath());
DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey());
try {
return WorkContext.getConnector().testConnection(connection);
} catch (AuthException e) {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
return null;
}
}
@Override

39
designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java

@ -12,10 +12,6 @@ import com.fr.third.springframework.web.context.support.AnnotationConfigWebAppli
import com.fr.workspace.WorkContext;
import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Wrapper;
import org.apache.catalina.deploy.FilterDef;
import org.apache.catalina.deploy.FilterMap;
import org.apache.catalina.loader.WebappLoader;
import org.apache.catalina.startup.Tomcat;
@ -64,11 +60,7 @@ public class FineEmbedServerActivator extends Activator {
String docBase = new File(WorkContext.getCurrent().getPath()).getParent();
String appName = "/" + FRContext.getCommonOperator().getAppName();
Context context = tomcat.addContext(appName, docBase);
//添加过滤器
addFilter(context);
addDefaultServlet(context);
Tomcat.initWebappDefaults(context);
//覆盖tomcat的WebAppClassLoader
context.setLoader(new FRTomcatLoader());
@ -79,35 +71,6 @@ public class FineEmbedServerActivator extends Activator {
context.addServletContainerInitializer(initializer, classes);
}
private void addFilter(Context context){
FilterDef filterDef = new FilterDef();
filterDef.setFilterName("Forbidden");
filterDef.setFilterClass("com.fr.start.server.ForbidType");
FilterMap filterMap = new FilterMap();
filterMap.setFilterName("Forbidden");
//指定过滤文件类型
filterMap.addURLPattern("*.txt");
filterMap.addURLPattern("*.xml");
filterMap.addURLPattern("*.jar");
context.addFilterDef(filterDef);
context.addFilterMap(filterMap);
}
private void addDefaultServlet(Context context) {
Wrapper defaultServlet = context.createWrapper();
defaultServlet.setName("default");
defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
defaultServlet.addInitParameter("debug", "0");
defaultServlet.addInitParameter("listings", "false");
defaultServlet.setLoadOnStartup(1);
defaultServlet.setOverridable(true);
context.addChild(defaultServlet);
context.addServletMapping("/","default");
}
private void stopServerActivator() {

16
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -18,21 +18,12 @@ import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Rectangle;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
@ -140,7 +131,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
try {
Chart newChart = (Chart) chart.clone();
editingCollection.addNamedChart(name, newChart);
editingCollection.addFunctionRecord(newChart);
} catch (CloneNotSupportedException e1) {
FineLoggerFactory.getLogger().error("Error in Clone");
}

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -1,10 +1,11 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.Utils;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartPreStyle;
import com.fr.chart.base.ChartUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
@ -199,8 +200,8 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
} else if(styleSelectBox.getSelectedIndex() < styleSelectBox.getItemCount() - 1){
ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance();
Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem());
if(preStyle instanceof ChartPreStyle) {
AttrFillStyle def = ((ChartPreStyle) preStyle).getAttrFillStyle();
if (preStyle instanceof ChartColorMatching) {
AttrFillStyle def = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle);
def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem()));
return def;
}else{

97
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java

@ -1,97 +0,0 @@
package com.fr.design.mainframe.chart.gui.style;
import java.awt.*;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
/**
* 预定义的图表配色界面, 其中和属性表中ChartFillStylePane 主要的不同就是标签的位置.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-8-21 下午03:16:27
*/
public class ChartPreFillStylePane extends ChartFillStylePane {
public ChartPreFillStylePane() {
}
protected void initLayout() {// 仅仅是服务器预定 风格界面布局, 和属性表 有所不同.
customPane.setPreferredSize(new Dimension(200, 200));
colorGradient.setPreferredSize(new Dimension(120, 30));
double p = TableLayout.PREFERRED;
double[] columnSize = {p, p };
double[] rowSize = { p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + Inter.getLocText("ColorMatch")), null},
new Component[]{null, customPane},
};
this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST);
}
public void populateBean(AttrFillStyle condition) {
styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount()-1);
if(condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) {
colorAcc.populateBean(ChartConstants.CHART_COLOR_ARRAY);// 新建时 保持默认样式
accButton.setSelected(true);
gradientButton.setSelected(false);
cardLayout.show(changeColorSetPane, "acc");
colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE);
colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black);// 控件中的位置无效.
} else {
int colorStyle = condition.getColorStyle();
gradientButton.setSelected(colorStyle == ChartConstants.COLOR_GRADIENT);
accButton.setSelected(colorStyle == ChartConstants.COLOR_ACC);
int colorSize = condition.getColorSize();
if(colorSize == 2 && gradientButton.isSelected() ) {
cardLayout.show(changeColorSetPane, "gradient");
Color endColor = condition.getColorIndex(1);
Color startColor = condition.getColorIndex(0);
colorGradient.getSelectColorPointBtnP1().setColorInner(startColor);
colorGradient.getSelectColorPointBtnP2().setColorInner(endColor);
colorGradient.repaint();
} else if(colorSize > 2 && accButton.isSelected()){
cardLayout.show(changeColorSetPane, "acc");
Color[] colors = new Color[colorSize];
for(int i = 0; i < colorSize; i++) {
colors[i] = condition.getColorIndex(i);
}
colorAcc.populateBean(colors);
}
}
}
@Override
public AttrFillStyle updateBean() {
AttrFillStyle condition = new AttrFillStyle();
condition.clearColors();
if(gradientButton.isSelected()) {
condition.setColorStyle(ChartConstants.COLOR_GRADIENT);
Color start = colorGradient.getSelectColorPointBtnP1().getColorInner();
Color end = colorGradient.getSelectColorPointBtnP2().getColorInner();
condition.addFillColor(start);
condition.addFillColor(end);
} else {
condition.setColorStyle(ChartConstants.COLOR_ACC);
Color[] colors = colorAcc.updateBean();
for(int i = 0, length = colors.length; i < length; i++) {
condition.addFillColor(colors[i]);
}
}
return condition;
}
}

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -1,12 +1,13 @@
package com.fr.design.mainframe.chart.gui.type;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.FRContext;
import com.fr.base.background.ColorBackground;
import com.fr.chart.base.AttrContents;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartPreStyle;
import com.fr.chart.base.ChartUtils;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Axis;
@ -243,7 +244,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
if(preStyle == null){
plot.getPlotFillStyle().setColorStyle(ChartConstants.COLOR_DEFAULT);
}else{
AttrFillStyle fillStyle = ((ChartPreStyle)preStyle).getAttrFillStyle();
AttrFillStyle fillStyle = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle);
fillStyle.setFillStyleName(name);
plot.setPlotFillStyle(fillStyle);
}

165
designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java

@ -0,0 +1,165 @@
package com.fr.design.module;
import com.fr.base.ChartColorMatching;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartAccColorPane;
import com.fr.design.style.background.gradient.FixedGradientBar;
import com.fr.general.Inter;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
* 预定义的图表配色界面.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-8-21 下午03:16:27
*/
public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
private JPanel changeColorSetPane;
private CardLayout cardLayout;
private UIButton accButton;
private UIButton gradientButton;
private ChartAccColorPane colorAcc;
private FixedGradientBar colorGradient;
public ChartPreFillStylePane() {
initComponents();
initListener();
}
private void initComponents() {
JPanel customPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.LEFT));
buttonPane.add(accButton = new UIButton(Inter.getLocText("FR-Designer_Chart_Acc_Set")));
buttonPane.add(gradientButton = new UIButton(Inter.getLocText("FR-Designer_Gradient-Color")));
customPane.add(buttonPane, BorderLayout.NORTH);
changeColorSetPane = new JPanel(cardLayout = new CardLayout());
changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient");
changeColorSetPane.add(colorAcc = new ChartAccColorPane(), "acc");
cardLayout.show(changeColorSetPane, "acc");
customPane.add(changeColorSetPane, BorderLayout.CENTER);
accButton.setSelected(true);
customPane.setPreferredSize(new Dimension(200, 200));
colorGradient.setPreferredSize(new Dimension(120, 30));
colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE);
colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black);
double p = TableLayout.PREFERRED;
double[] columnSize = {p, p};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + Inter.getLocText("ColorMatch")), null},
new Component[]{null, customPane},
};
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST);
}
private void initListener() {
accButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
accButton.setSelected(true);
gradientButton.setSelected(false);
cardLayout.show(changeColorSetPane, "acc");
}
});
gradientButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gradientButton.setSelected(true);
accButton.setSelected(false);
cardLayout.show(changeColorSetPane, "gradient");
}
});
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("ServerM-Predefined_Styles");
}
public void populateBean(ChartColorMatching condition) {
if (condition == null) {
return;
}
boolean isGradient = condition.getGradient();
List<Color> colorList = condition.getColorList();
if (isGradient) {
gradientButton.setSelected(true);
accButton.setSelected(false);
cardLayout.show(changeColorSetPane, "gradient");
if (colorList.size() == 2) {
colorGradient.getSelectColorPointBtnP1().setColorInner(colorList.get(0));
colorGradient.getSelectColorPointBtnP2().setColorInner(colorList.get(1));
colorGradient.repaint();
}
} else {
accButton.setSelected(true);
gradientButton.setSelected(false);
cardLayout.show(changeColorSetPane, "acc");
if (colorList.size() > 0) {
colorAcc.populateBean(colorList.toArray(new Color[colorList.size()]));
}
}
}
@Override
public ChartColorMatching updateBean() {
ChartColorMatching chartColorMatching = new ChartColorMatching();
List<Color> colorList = new ArrayList<Color>();
if(gradientButton.isSelected()) {
chartColorMatching.setGradient(true);
Color start = colorGradient.getSelectColorPointBtnP1().getColorInner();
Color end = colorGradient.getSelectColorPointBtnP2().getColorInner();
colorList.add(start);
colorList.add(end);
} else {
chartColorMatching.setGradient(false);
Color[] colors = colorAcc.updateBean();
for(Color color : colors) {
colorList.add(color);
}
}
chartColorMatching.setColorList(colorList);
return chartColorMatching;
}
}

4
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java

@ -39,14 +39,10 @@ public class ChartPreStyleAction extends UpdateAction {
@Override
public void doOk() {
pane.updateBean();
// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
// manager.setStyleEditing(null);
}
@Override
public void doCancel() {
// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
// manager.setStyleEditing(null);
}
});

36
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java

@ -1,8 +1,9 @@
package com.fr.design.module;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.Utils;
import com.fr.chart.base.ChartPreStyle;
import com.fr.config.Configuration;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
@ -10,8 +11,9 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.ListMap;
import com.fr.stable.Nameable;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.util.ArrayList;
import java.util.Iterator;
@ -32,7 +34,7 @@ public class ChartPreStyleManagerPane extends JListControlPane {
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{
new NameObjectCreator(Inter.getLocText("FR-Designer_PreStyle"),
ChartPreStyle.class, ChartPreStylePane.class)
ChartColorMatching.class, ChartPreStylePane.class)
};
}
@ -42,14 +44,13 @@ public class ChartPreStyleManagerPane extends JListControlPane {
}
public void populateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror();
ArrayList list = new ArrayList();
Iterator keys = config.names();
while(keys.hasNext()) {
Object key = keys.next();
ChartPreStyle value = (ChartPreStyle)config.getPreStyle(key);
ChartColorMatching value = (ChartColorMatching) config.getPreStyle(key);
list.add(new NameObject(Utils.objectToString(key), value));
}
@ -63,17 +64,18 @@ public class ChartPreStyleManagerPane extends JListControlPane {
}
public void updateBean() {
Configurations.update(new Worker() {
@Override
public void run() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
config.setPreStyleMap(new ListMap());
Nameable[] values = this.update();
config.setCurrentStyle(getSelectedName());
for(int i = 0; i < values.length; i++) {
Nameable value = values[i];
config.putPreStyle(value.getName(), ((NameObject)value).getObject());
Nameable[] values = update();
config.clearAllPreStyle();
for(Nameable value : values) {
config.putPreStyle(value.getName(), ((NameObject) value).getObject());
}
// 通知报表整个刷新.
@ -83,4 +85,12 @@ public class ChartPreStyleManagerPane extends JListControlPane {
}
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ChartPreStyleConfig.class};
}
});
}
}

23
designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java

@ -1,16 +1,17 @@
package com.fr.design.module;
import com.fr.chart.base.ChartPreStyle;
import com.fr.base.ChartColorMatching;
import com.fr.chart.base.ChartUtils;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.gui.style.ChartPreFillStylePane;
import com.fr.general.Inter;
import javax.swing.JPanel;
@ -25,7 +26,7 @@ import java.awt.FlowLayout;
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-8-20 下午05:02:00
*/
public class ChartPreStylePane extends BasicBeanPane<ChartPreStyle>{
public class ChartPreStylePane extends BasicBeanPane<ChartColorMatching> {
private ChartPreFillStylePane fillStylePane;
private ChartComponent chartComponent;
@ -79,27 +80,25 @@ public class ChartPreStylePane extends BasicBeanPane<ChartPreStyle>{
}
}
private void refreshWhenStyleChange(ChartPreStyle preStyle) {
// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
// manager.setStyleEditing(preStyle);
private void refreshWhenStyleChange(ChartColorMatching preStyle) {
if(chartComponent != null) {
Plot plot = (Plot) chartComponent.getEditingChart().getBasePlot();
plot.setPlotFillStyle(ChartUtils.chartColorMatching2AttrFillStyle(preStyle));
chartComponent.reset();
}
}
@Override
public void populateBean(ChartPreStyle preStyle) {
public void populateBean(ChartColorMatching preStyle) {
fillStylePane.populateBean(preStyle.getAttrFillStyle());
fillStylePane.populateBean(preStyle);
refreshWhenStyleChange(preStyle);
}
@Override
public ChartPreStyle updateBean() {
ChartPreStyle preStyle = new ChartPreStyle();
preStyle.setAttrFillStyle(fillStylePane.updateBean());
return preStyle;
public ChartColorMatching updateBean() {
return fillStylePane.updateBean();
}
@Override

9
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java

@ -1,6 +1,5 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.base.chart.BaseChart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane;
@ -13,7 +12,7 @@ import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import java.awt.BorderLayout;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@ -102,11 +101,7 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
}
if(dataDefinitionType.getSelectedIndex() == 0){
drillMapDefinition.setFromBottomData(true);
ChartCollection temp = new ChartCollection(new Chart()){
@Override
public void addFunctionRecord(BaseChart chart) {
}
};
ChartCollection temp = new ChartCollection(new Chart());
bottomDataDefinitionPane.updateBean(temp);
drillMapDefinition.setBottomDataDefinition(temp.getSelectedChart().getFilterDefinition());
} else {

9
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java

@ -1,6 +1,5 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.base.chart.BaseChart;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
@ -18,7 +17,7 @@ import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.CardLayout;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@ -116,11 +115,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane<ChartCollection> {
List<TopDefinitionProvider> eachLayerDataDefinitionList = new ArrayList<TopDefinitionProvider>();
for(BasicPane basicPane : paneList){
if(basicPane instanceof SingleLayerDataDefinitionPane){
ChartCollection temp = new ChartCollection(new Chart()){
@Override
public void addFunctionRecord(BaseChart chart) {
}
};
ChartCollection temp = new ChartCollection(new Chart());
((SingleLayerDataDefinitionPane) basicPane).updateBean(temp);
eachLayerDataDefinitionList.add(temp.getSelectedChart().getFilterDefinition());
}

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

@ -3,12 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.designer.beans.actions.behavior.UpdateBehavior;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.*;
import java.awt.event.ActionEvent;
public abstract class FormWidgetEditAction extends TemplateComponentAction<FormDesigner> {
@ -32,17 +27,6 @@ public abstract class FormWidgetEditAction extends TemplateComponentAction<FormD
@Override
public void actionPerformed(ActionEvent evt) {
super.actionPerformed(evt);
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
FunctionProcessor functionProcessor;
if (evt.getSource() instanceof JButton) {
functionProcessor = ReportFunctionProcessor.FORM_WIDGET_EDIT_TOOLBAR;
} else {
functionProcessor = ReportFunctionProcessor.FORM_WIDGET_EDIT_POPUPMENU;
}
processor.recordFunction(functionProcessor);
}
}
public void setUpdateBehavior(UpdateBehavior updateBehavior) {

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

@ -15,11 +15,8 @@ import com.fr.file.FILE;
import com.fr.form.main.Form;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
@ -67,11 +64,6 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
// 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加
jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark());
}
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_FRM);
}
// 设置移动端属性并刷新界面
formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();

12
designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java

@ -7,12 +7,9 @@ import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.WatermarkRenderer;
import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper;
import com.fr.design.report.WatermarkPane;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2018/5/15.
@ -43,11 +40,6 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor {
public void doOk() {
setValue(watermarkPane.update());
fireStateChanged();
// 功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.WATERMARK);
}
}
});
watermarkPane.populate((WatermarkAttr) getValue());

20
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -18,20 +18,12 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.FormFunctionProcessor;
import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@ -175,11 +167,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
updateTipLabel();
ChartMobileFitAttrState selectedAttr = (ChartMobileFitAttrState)((Item)e.getItem()).getValue();
if (selectedAttr.getState() != ChartMobileFitAttrState.AUTO.getState()) {
// 功能埋点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(FormFunctionProcessor.MOBILE_CHART_ADAPTIVITY);
}
}
}
});

10
designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -12,12 +12,9 @@ import com.fr.file.FILE;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.main.TemplateWorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
@ -67,11 +64,6 @@ public class ReportMobileAttrAction extends JWorkBookAction{
// 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加
wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark());
}
// 记录功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_CPT);
}
// 设置移动端属性并刷新界面
wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后
jwb.fireTargetModified();

8
designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java

@ -9,10 +9,7 @@ import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.WatermarkPane;
import com.fr.main.impl.WorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.core.ReportUtils;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import java.awt.event.ActionEvent;
@ -45,11 +42,6 @@ public class ReportWatermarkAction extends JWorkBookAction {
public void doOk() {
wbTpl.addAttrMark(watermarkPane.update());
jwb.fireTargetModified();
// 功能点
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.WATERMARK);
}
}
}).setVisible(true);
}

2
designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -107,7 +107,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
return StringUtils.EMPTY;
}
String bookPath = infor.getBookPath();
String bookPath = infor.getRelativePath();
// 这个iofile只读一个templateid, 其他以后有需要再读.
IOFile file = new IOFile() {
@Override

5
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.socketio;
import com.fr.config.RemoteConfigEvent;
import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.TemplatePane;
import com.fr.design.mainframe.loghandler.DesignerLogHandler;
import com.fr.event.EventDispatcher;
import com.fr.general.Inter;
@ -14,6 +15,7 @@ import com.fr.third.guava.base.Optional;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.engine.connector.FineWorkspaceConnector;
import com.fr.workspace.engine.server.rpc.netty.RemoteCallClient;
import com.fr.workspace.server.socket.SocketInfoOperator;
import io.socket.client.IO;
@ -79,8 +81,9 @@ public class DesignerSocketIO {
@Override
public void call(Object... objects) {
if (status != Status.Disconnecting) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Disconnected"}),
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Fine-Designer_Basic_Remote_Disconnected"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
TemplatePane.getInstance().editItems();
}
status = Status.Disconnected;
}

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

@ -235,7 +235,11 @@ public class FloatSelection extends Selection {
public QuickEditor getQuickEditor(TargetComponent tc) {
ElementCasePane ePane = (ElementCasePane) tc;
FloatElement selectedFloat = ePane.getEditingElementCase().getFloatElement(selectedFloatName);
Object value = selectedFloat.getValue();
Object value = null;
//处理撤销时npe
if(selectedFloat != null) {
value = selectedFloat.getValue();
}
value = value == null ? "" : value;
value = value instanceof Number ? value.toString() : value;
QuickEditor editor = ActionFactory.getFloatEditor(value.getClass());

7
designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

@ -90,7 +90,12 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
@Override
protected void refreshDetails() {
String str;
Object value = floatElement.getValue();
Object value = null;
//处理撤销时npe
if (floatElement != null){
value = floatElement.getValue();
}
if (value == null) {
str = StringUtils.EMPTY;
} else if (value instanceof BaseFormula) {

17
designer-realize/src/main/java/com/fr/start/Designer.java

@ -42,12 +42,12 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.module.Module;
import com.fr.module.ModuleContext;
import com.fr.record.analyzer.FineAnalyzer;
import com.fr.stable.BuildContext;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.lifecycle.LifecycleFatalError;
import com.fr.stable.xml.XMLTools;
import com.fr.start.fx.SplashFx;
import com.fr.start.jni.SplashMac;
@ -56,14 +56,9 @@ import com.fr.start.preload.ImagePreLoader;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.*;
import javax.swing.border.MatteBorder;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@ -96,8 +91,6 @@ public class Designer extends BaseDesigner {
*/
public static void main(String[] args) {
FineAnalyzer.init();
BuildContext.setBuildFilePath("/com/fr/stable/build.properties");
@ -115,7 +108,11 @@ public class Designer extends BaseDesigner {
Module designerRoot = ModuleContext.parseRoot("designer-startup.xml");
//传递启动参数
designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args));
try {
designerRoot.start();
} catch (LifecycleFatalError fatal) {
System.exit(0);
}
if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray

Loading…
Cancel
Save