Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~qinghui.liu/design into release/10.0

feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
17407abeb2
  1. 11
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 19
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  3. 10
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  4. 3
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java
  5. 22
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  6. 3
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  7. 58
      designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java
  8. 54
      designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java
  9. 9
      designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java
  10. 6
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  11. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java
  12. 2
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java
  13. 2
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java
  14. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java
  15. 13
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  16. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  17. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java
  18. 6
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  19. 13
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  20. 4
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  21. 5
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java
  22. 1
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java
  23. 6
      designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java
  24. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java
  25. 29
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java
  26. 96
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java
  27. 16
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java
  28. 1
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  29. 36
      designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java
  30. 13
      designer-realize/src/main/java/com/fr/start/DesignerLauncher.java

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

@ -27,6 +27,7 @@ import com.fr.log.FineLoggerFactory;
import com.fr.rpc.Result;
import com.fr.stable.AssistUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback;
@ -131,6 +132,11 @@ public class EnvChangeEntrance {
}
}
});
// REPORT-25688如果是war包部署的服务器,给与提示
if (WorkContext.getCurrent().isWarDeploy()) {
FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_War_Deploy_Tip"),
Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE);
}
//REPORT-13810如果只是添加了工作目录,没有切换,这里ToolArea也是要显示新建的工作目录
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
@ -262,6 +268,9 @@ public class EnvChangeEntrance {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
if(StringUtils.isEmpty(selectedEnv.getRemindTime())){
return true;
}
//获取记录的时间
Date remindTime = format.parse(selectedEnv.getRemindTime());
calendar.setTime(remindTime);
@ -325,7 +334,7 @@ public class EnvChangeEntrance {
return noExistServiceSet;
} catch (Exception e){
FineLoggerFactory.getLogger().error(e.getMessage(),e);
return null;
return noExistServiceSet;
}
}

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

@ -38,6 +38,7 @@ import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
@ -218,10 +219,12 @@ public class PreferencePane extends BasicPane {
oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace);
JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
upmSelectorPane.add(useOptimizedUPMCheckbox);
advancePane.add(upmSelectorPane);
if (!OperatingSystem.isLinux()) {
JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
upmSelectorPane.add(useOptimizedUPMCheckbox);
advancePane.add(upmSelectorPane);
}
JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager"));
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
@ -711,7 +714,9 @@ public class PreferencePane extends BasicPane {
this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort()));
useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
if (useOptimizedUPMCheckbox != null) {
useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
}
useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
@ -832,7 +837,9 @@ public class PreferencePane extends BasicPane {
Configurations.update(new Worker() {
@Override
public void run() {
ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected());
if (useOptimizedUPMCheckbox != null) {
ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected());
}
ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected());
}

10
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -2,6 +2,9 @@ package com.fr.design.env;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.design.i18n.Toolkit;
import com.fr.invoke.ReflectException;
import com.fr.log.FineLoggerFactory;
import com.fr.base.operator.common.CommonOperator;
import com.fr.rpc.ExceptionHandler;
import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext;
@ -49,7 +52,12 @@ public class RemoteWorkspace implements Workspace {
@Override
public boolean isWarDeploy() {
return false;
try {
return WorkContext.getCurrent().get(CommonOperator.class).isWarDeploy();
} catch (ReflectException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
}
}
@Override

3
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java

@ -6,6 +6,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import com.fr.base.BaseUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
public class LogDetailPane extends JPanel{
@ -20,7 +21,7 @@ public class LogDetailPane extends JPanel{
fr.setSize(600, 400);
GUICoreUtils.centerWindow(fr);
fr.setResizable(false);
fr.setTitle("日志");
fr.setTitle(Toolkit.i18nText("Fine-Design_Basic_Log"));
fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png"));
fr.getContentPane().setLayout(new BorderLayout());
fr.getContentPane().add(this, BorderLayout.CENTER);

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

@ -10,6 +10,7 @@ import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UITextField;
@ -25,17 +26,7 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.engine.exception.WorkspaceAuthException;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
@ -295,10 +286,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
contentPanel.add(configPanel, BorderLayout.NORTH);
contentPanel.add(accountPanel, BorderLayout.CENTER);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(contentPanel, BorderLayout.NORTH);
panel.add(testPanel, BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(440, 600));
UIScrollPane scrollPane = new UIScrollPane(panel);
this.setLayout(new BorderLayout());
this.add(contentPanel, BorderLayout.NORTH);
this.add(testPanel, BorderLayout.CENTER);
this.add(scrollPane);
}
@Override

3
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -505,6 +505,9 @@ public class FILEChooserPane extends BasicPane {
if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) {
return fileName;
}
if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) {
return fileName + filterExtension;
}
return fileNameWithOutExtension + filterExtension;
}

58
designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java

@ -0,0 +1,58 @@
package com.fr.design;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.write.submit.CheckServiceDialog;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
/**
* @author: Maksim
* @Date: Created in 2020/3/5
* @Description:
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({FunctionalHttpRequest.class,EnvChangeEntrance.class,CheckServiceDialog.class})
public class EnvChangeEntranceTest {
@Test
public void showServiceDialog() throws Exception {
try {
EnvChangeEntrance entrance = EnvChangeEntrance.getInstance();
DesignerWorkspaceInfo selectedEnv = EasyMock.mock(DesignerWorkspaceInfo.class);
WorkspaceConnectionInfo connectionInfo = EasyMock.mock(WorkspaceConnectionInfo.class);
String remoteBranch = "Build#persist-2020.02.15.01.01.12.12";
EasyMock.expect(selectedEnv.getConnection()).andReturn(connectionInfo);
EasyMock.expect(selectedEnv.getType()).andReturn(DesignerWorkspaceType.Remote);
EasyMock.expect(selectedEnv.getRemindTime()).andReturn(null);
FunctionalHttpRequest request = EasyMock.mock(FunctionalHttpRequest.class);
EasyMock.expect(request.getServiceList()).andReturn(null);
PowerMock.expectNew(FunctionalHttpRequest.class, connectionInfo).andReturn(request).anyTimes();
EasyMock.expect(request.getServerBranch()).andReturn(remoteBranch);
CheckServiceDialog dialog = EasyMock.mock(CheckServiceDialog.class);
PowerMock.expectNew(CheckServiceDialog.class, EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject()).andReturn(dialog);
EasyMock.replay(request);
EasyMock.replay(selectedEnv);
EasyMock.replay(connectionInfo);
PowerMock.replayAll();
entrance.showServiceDialog(selectedEnv);
Assert.assertTrue(true);
}catch (Exception e){
Assert.assertTrue(false);
}
}
}

54
designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java vendored

@ -0,0 +1,54 @@
package com.fr.design.env;
import com.fr.base.operator.common.CommonOperator;
import com.fr.invoke.ReflectException;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
/**
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2020/1/2
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({WorkContext.class})
public class RemoteWorkspaceTest {
@Test
public void testIsWarDeploy() {
Workspace workspace = EasyMock.mock(Workspace.class);
PowerMock.mockStatic(WorkContext.class);
EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes();
CommonOperator operator = EasyMock.createMock(CommonOperator.class);
EasyMock.expect(workspace.get(CommonOperator.class)).andReturn(operator).anyTimes();
EasyMock.expect(operator.isWarDeploy()).andReturn(true).once();
EasyMock.expect(operator.isWarDeploy()).andReturn(false).once();
EasyMock.expect(operator.isWarDeploy()).andThrow(new ReflectException()).once();
EasyMock.replay(workspace, operator);
PowerMock.replayAll();
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo("url", "username", "password", "certPath", "certSecretKey");
RemoteWorkspace remoteWorkspace= new RemoteWorkspace(null, info);
Assert.assertTrue(remoteWorkspace.isWarDeploy());
Assert.assertFalse(remoteWorkspace.isWarDeploy());
Assert.assertFalse(remoteWorkspace.isWarDeploy());
EasyMock.verify(workspace, operator);
PowerMock.verifyAll();
}
}

9
designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java

@ -25,15 +25,20 @@ public class FILEChooserPaneTest {
ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY);
String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get();
Assert.assertEquals("WorkBook1.cptx", result3);
Assert.assertEquals("WorkBook1.cpt.cptx", result3);
ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY);
String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get();
Assert.assertEquals("WorkBook1.cpt", result4);
Assert.assertEquals("WorkBook1.cptx.cpt", result4);
ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY);
String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get();
Assert.assertEquals("WorkBook1.cptx", result5);
ChooseFileFilter chooseFileFilter6 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY);
String result6 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.xls", chooseFileFilter6).get();
Assert.assertEquals("WorkBook1.xls.cpt", result6);
}
}

6
designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java

@ -24,7 +24,7 @@ import com.fr.design.parameter.ParameterInputPane;
import com.fr.general.GeneralUtils;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
@ -196,7 +196,7 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
//先取保存的数据集名称和区域名,若不存在,就取数据集面板配置的数据集名称和区域名
matchResultTable.populateBean(matchResult);
if (matchResult != null && matchResult.getTableName() != null) {
if (matchResult != null && StringUtils.isNotEmpty(matchResult.getTableName())) {
tableName = matchResult.getTableName();
areaName = matchResult.getColumnName();
}
@ -261,7 +261,7 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
private void populateMatchData(Object[] columnData) {
Set<String> geoAreas = matchAreaTable.getItems();
Map<String, String> resultMap = ChartGEOJSONHelper.matchArea(columnData, geoAreas, matchResultTable.getCustomResult());
Map<String, String> resultMap = ChartGEOJSONHelper.matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult());
Object[][] data = new Object[resultMap.size()][2];

3
designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java

@ -80,8 +80,7 @@ public class MatchAreaTable extends JTable {
return;
}
int index = areaNameIndex.get(areaName);
Map<String, String> resultMap = ChartGEOJSONHelper.matchArea(new Object[]{areaName}, items);
String result = resultMap.get(areaName);
String result = ChartGEOJSONHelper.matchArea(GeneralUtils.objectToString(areaName), items);
getColumnModel().getColumn(1).getCellEditor().stopCellEditing();
this.setValueAt(result, index, 1);
}

2
designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java

@ -5,7 +5,7 @@ import com.fr.base.Utils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.stable.StringUtils;
import javax.swing.AbstractCellEditor;

2
designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java

@ -8,7 +8,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel;

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java

@ -9,7 +9,7 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.vanchart.VanChart;

13
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java

@ -8,16 +8,15 @@ import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
/**
* 一般数据界面
@ -133,6 +132,14 @@ public class NormalChartDataPane extends DataContentsPane {
tableDataPane.checkBoxUse();
}
/**
* 钻取地图需要同时更新层级
*/
public void populate(ChartCollection collection, int level) {
populate(collection);
tableDataPane.refreshLevel(level);
}
/**
* 保存 数据界面内容
*/

6
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -75,6 +75,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
}
if(dataContentPane != null) {
dataContentPane.onSelectTableData(dataWrap);
dataContentPane.setTableName(dataWrap.getTableDataName());
}
}
@ -124,6 +125,11 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
add(dataContentPane, BorderLayout.CENTER);
}
}
public void refreshLevel(int level){
dataContentPane.refreshLevel(level);
}
/**
* 更新界面属性
*/

16
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java

@ -6,16 +6,26 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox;
import javax.swing.JSeparator;
import java.util.List;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCollection>{
protected static final double COMPONENT_WIDTH = 124;
private boolean isNeedSummaryCaculateMethod = true;
public String tableName;
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public abstract void updateBean(ChartCollection ob);
@ -129,4 +139,8 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCo
jSeparator.setPreferredSize(new Dimension(246, 2));
return jSeparator;
}
public void refreshLevel(int level) {
}
}

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

@ -8,12 +8,13 @@ import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
/**
* Created by Mitisky on 16/6/20.
@ -77,7 +78,8 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1);
ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob);
bottomDataDefinitionPane.populateBean(bottomDataChartCollection);
bottomDataDefinitionPane.populateBean(bottomDataChartCollection, ChartGEOJSONHelper.BOTTOM_LEVEL);
eachLayerDataDefinitionPane.populateBean(ob);
parent.initAllListeners();

13
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java

@ -7,9 +7,9 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.drillmap.DrillMapHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel;
@ -19,10 +19,11 @@ import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by Mitisky on 16/6/20.
@ -125,6 +126,7 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
if (drillMapPlot != null) {
java.util.List<ZoomLevel> levelList = drillMapPlot.getLayerLevelList();
java.util.List<MapType> mapTypeList = drillMapPlot.getLayerMapTypeList();
List<MapMatchResult> matchResultList = drillMapPlot.getMatchResultList();
if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) {
oldMapType = drillMapPlot.getMapType();
@ -151,6 +153,11 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
mapTypeList.add(mapType);
}
int matchSize = matchResultList.size();
for (int k = matchSize; k < depth; k++) {
matchResultList.add(new MapMatchResult());
}
for (int i = 0; i < depth; i++) {
Component[] components = detailComps[i + 1];
if (components != null) {

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

@ -16,9 +16,9 @@ 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.util.ArrayList;
import java.util.List;
import java.awt.CardLayout;
/**
* Created by Mitisky on 16/6/20.
@ -95,7 +95,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane<ChartCollection> {
MapType mapType = oldMapList.get(i);
if (basicPane instanceof SingleLayerDataDefinitionPane) {
ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType);
((SingleLayerDataDefinitionPane) basicPane).populateBean(clone);
((SingleLayerDataDefinitionPane) basicPane).populateBean(clone, i);
}
}
}

5
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java

@ -78,6 +78,11 @@ public class SingleLayerDataDefinitionPane extends FurtherBasicBeanPane<ChartCol
}
public void populateBean(ChartCollection ob, int level) {
normalChartDataPane.populate(ob, level);
}
@Override
public void updateBean(ChartCollection ob) {
normalChartDataPane.update(ob);

1
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java

@ -49,7 +49,6 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
return tools;
}
protected Chart[] getDefaultCharts() {
return DrillMapIndependentVanChart.DrillMapVanCharts;
}

6
designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java

@ -21,6 +21,7 @@ import com.fr.van.chart.map.designer.data.contentpane.report.VanLineMapPlotRepor
import com.fr.van.chart.map.designer.data.contentpane.report.VanPointMapPlotReportDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanAreaMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanLineMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanMapTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.other.VanChartMapOtherPane;
import com.fr.van.chart.map.designer.other.condition.pane.VanChartMapConditionPane;
@ -77,9 +78,12 @@ public class VanMapChartTypeUI extends AbstractIndependentVanChartUI {
//图表数据结构 恢复用注释。删除下面5个方法 getTableDataSourcePane getReportDataSourcePane getChartDataPane areaPlot linePlot。
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent)
VanMapTableDataContentPane vanMapTableDataContentPane = areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent)
: linePlot(plot) ? new VanLineMapPlotTableDataContentPane(parent)
: new VanPointMapPlotTableDataContentPane(parent);
vanMapTableDataContentPane.setPlot((VanChartMapPlot)plot);
return vanMapTableDataContentPane;
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java

@ -8,7 +8,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter;
@ -16,17 +15,17 @@ import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithO
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
/**
* Created by Mitisky on 16/5/16.
*/
public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContentPane {
public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPane {
private UIComboBox areaNameCom;
protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane;
@ -72,7 +71,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{label, areaNameCom},
new Component[]{label, createAreaPanel(areaNameCom)},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -140,6 +139,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) {
VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider;
mapTableDefinitionProvider.setMatchResult(this.getMatchResult());
updateDefinition(mapTableDefinitionProvider);
}
}
@ -157,6 +157,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) {
VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider;
this.setMatchResult(mapTableDefinitionProvider.getMatchResult());
populateDefinition(mapTableDefinitionProvider);
}
}

29
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java

@ -1,11 +1,15 @@
package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.AreaPane;
import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane;
import java.awt.Component;
/**
* Created by hufan on 2016/12/15.
@ -16,7 +20,30 @@ public class VanLineMapPlotTableDataContentPane extends VanPointMapPlotTableData
}
protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new LineMapAreaPane(longLatAreaTableComboPane);
return new LineMapAreaPane(longLatAreaTableComboPane) {
@Override
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new AreaPane(parentPane) {
@Override
protected Component[][] getComponent () {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
@Override
protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
endAreaPane = new AreaPane(parentPane) {
@Override
protected Component[][] getComponent () {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
}
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {

96
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java

@ -0,0 +1,96 @@
package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chartx.TwoTuple;
import com.fr.design.chartx.component.MapAreaMatchPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode;
import java.util.Set;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-12-25
*/
public abstract class VanMapTableDataContentPane extends AbstractTableDataContentPane {
private VanChartMapPlot plot;
//钻取地图有层级,默认-1代表无层级关系
private int level = ChartGEOJSONHelper.DEFAULT_LEVEL;
private MapMatchResult matchResult = new MapMatchResult();
public void setLevel(int level) {
this.level = level;
}
public void setPlot(VanChartMapPlot plot) {
this.plot = plot;
}
public MapMatchResult getMatchResult() {
return matchResult;
}
public void setMatchResult(MapMatchResult matchResult) {
this.matchResult = matchResult;
}
public JPanel createAreaPanel(final UIComboBox areaBox) {
JPanel areaPanel = new JPanel(new BorderLayout(4, 0));
areaBox.setPreferredSize(new Dimension(70, 20));
areaPanel.add(areaBox, BorderLayout.CENTER);
UIButton uiButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
uiButton.addActionListener(new ActionListener() {
private TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems;
@Override
public void actionPerformed(ActionEvent e) {
if (treeNodeAndItems == null) {
treeNodeAndItems = ChartGEOJSONHelper.getTreeNodeAndItems(plot.getGeoUrl(), level);
}
final MapAreaMatchPane pane = new MapAreaMatchPane(treeNodeAndItems);
String nameTable = getTableName();
pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem()));
BasicDialog dialog = pane.showWindow(new JFrame());
dialog.addDialogActionListener(new DialogActionListener() {
@Override
public void doOk() {
pane.updateBean(matchResult);
}
@Override
public void doCancel() {
}
});
dialog.setVisible(true);
}
});
areaPanel.add(uiButton, BorderLayout.EAST);
return areaPanel;
}
@Override
public void refreshLevel(int level) {
this.setLevel(level);
}
}

16
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java

@ -2,12 +2,14 @@ package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.AreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane;
@ -15,11 +17,11 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
/**
* Created by Mitisky on 16/5/17.
@ -214,7 +216,17 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData
}
protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new PointMapAreaPane(longLatAreaTableComboPane);
return new PointMapAreaPane(longLatAreaTableComboPane) {
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new AreaPane(parentPane) {
protected Component[][] getComponent () {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
}
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {

1
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -89,7 +89,6 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
}
}
}
/**
* 不同地图类型的超链不需要复制
*

36
designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java

@ -14,9 +14,14 @@ import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.cellattr.core.RichText;
import com.fr.report.cell.cellattr.core.RichTextConverter;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultHighlighter;
import javax.swing.text.Element;
import javax.swing.text.Highlighter;
import javax.swing.text.StyledDocument;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@ -44,6 +49,7 @@ public class RichTextEditingPane extends UITextPane{
*/
public RichTextEditingPane() {
this.addMouseListener(doubleClickFormulaListener);
this.addFocusListener(focusListener);
}
/**
@ -195,4 +201,34 @@ public class RichTextEditingPane extends UITextPane{
}
}
};
private FocusListener focusListener = new FocusAdapter() {
/**
* 移除高亮重新选中文本
* @param e
*/
public void focusGained(FocusEvent e) {
RichTextEditingPane richTextPane = RichTextEditingPane.this;
richTextPane.getHighlighter().removeAllHighlights();
richTextPane.select(richTextPane.getSelectionStart(), richTextPane.getSelectionEnd());
}
/**
* 失去焦点时被选中的文本保持着被选中时的样式
* @param e
*/
public void focusLost(FocusEvent e) {
RichTextEditingPane richTextPane = RichTextEditingPane.this;
int start = richTextPane.getSelectionStart();
int end = richTextPane.getSelectionEnd();
richTextPane.select(start, end);
Highlighter highlighter = richTextPane.getHighlighter();
richTextPane.getHighlighter().removeAllHighlights();
try {
highlighter.addHighlight(start, end, DefaultHighlighter.DefaultPainter);
} catch (BadLocationException exception) {
FineLoggerFactory.getLogger().error(exception.getMessage(), exception);
}
}
};
}

13
designer-realize/src/main/java/com/fr/start/DesignerLauncher.java

@ -3,6 +3,9 @@ package com.fr.start;
import com.fr.process.FineProcess;
import com.fr.process.engine.FineJavaProcessFactory;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.stable.StableUtils;
import java.io.File;
/**
* @author hades
@ -11,6 +14,10 @@ import com.fr.process.engine.core.FineProcessContext;
*/
public class DesignerLauncher {
private static final String BIN = "bin";
private static final String DOT =".";
private static final String BIN_HOME = generateBinHome();
private static final DesignerLauncher INSTANCE = new DesignerLauncher();
private String[] args;
@ -19,6 +26,11 @@ public class DesignerLauncher {
}
private static String generateBinHome() {
return DOT.equals(StableUtils.getInstallHome()) ?
DOT : StableUtils.getInstallHome() + File.separator + BIN;
}
public static DesignerLauncher getInstance() {
return INSTANCE;
}
@ -32,6 +44,7 @@ public class DesignerLauncher {
inheritJvmSettings().
jvmSettings(DesignerJavaRuntime.getInstance().getJvmOptions()).
arguments(args).
directory(BIN_HOME).
startProcess(DesignerProcessType.INSTANCE);
DesignerSuperListener.getInstance().start();
}

Loading…
Cancel
Save