Browse Source

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

feature/big-screen
Maksim 5 years ago
parent
commit
6852af2343
  1. 5
      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. 6
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStyleDefinePane.java
  5. 16
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStylePane.java
  6. 387
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java
  7. 30
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleProvider.java
  8. 54
      designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java
  9. 6
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  10. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java
  11. 2
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java
  12. 2
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java
  13. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java
  14. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.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

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

@ -133,6 +133,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) {

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

6
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStyleDefinePane.java

@ -30,11 +30,15 @@ public class MobileBookMarkStyleDefinePane extends BasicBeanPane<MobileBookMarkS
private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel settingPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
if (!ComparatorUtils.equals(displayName, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_None_BookMark_Style"))) {
JPanel hintLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
hintLabelPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
UILabel hintLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Hint"));
hintLabel.setForeground(Color.GRAY);
settingPane.add(hintLabel, BorderLayout.NORTH);
hintLabelPane.add(hintLabel);
settingPane.add(hintLabelPane, BorderLayout.NORTH);
}
settingPane.add(this.customDefinePane, BorderLayout.CENTER);
this.add(settingPane, BorderLayout.CENTER);

16
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStylePane.java

@ -7,6 +7,8 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.mobile.MobileBookMarkStyle;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@ -23,6 +25,11 @@ import java.util.Set;
* Created by hades on 2019/12/23
*/
public class MobileBookMarkStylePane extends BasicBeanPane<MobileBookMarkStyle> {
public static final int LEFT_PANEL_WIDTH = 140;
public static final int LEFT_PANEL_HEIGHT = 565;
public static final int RIGHT_PANEL_WIDTH = 510;
public static final int RIGHT_PANEL_HEIGHT = 565;
public static ListCellRenderer renderer = new DefaultListCellRenderer() {
@Override
@ -48,6 +55,7 @@ public class MobileBookMarkStylePane extends BasicBeanPane<MobileBookMarkStyle>
private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
this.listModel = new DefaultListModel<>();
this.card = new CardLayout();
this.rightPane = FRGUIPaneFactory.createCardLayout_S_Pane();
@ -79,14 +87,16 @@ public class MobileBookMarkStylePane extends BasicBeanPane<MobileBookMarkStyle>
}
});
JPanel leftPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
leftPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
leftPanel.add(bookMarkList, BorderLayout.CENTER);
leftPanel.setPreferredSize(new Dimension(100, 500));
leftPanel.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, LEFT_PANEL_HEIGHT));
this.add(leftPanel, BorderLayout.WEST);
}
private void initRightPanel() {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
centerPane.setPreferredSize(new Dimension(500, 500));
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
centerPane.setPreferredSize(new Dimension(RIGHT_PANEL_WIDTH, RIGHT_PANEL_HEIGHT));
centerPane.add(rightPane, BorderLayout.CENTER);
this.add(centerPane, BorderLayout.CENTER);
}
@ -94,10 +104,12 @@ public class MobileBookMarkStylePane extends BasicBeanPane<MobileBookMarkStyle>
private List<MobileBookMarkStyleProvider> getMobileBookMarkStyleProvider() {
DefaultMobileBookMarkStyleProvider defaultMobileBookMarkStyleProvider = new DefaultMobileBookMarkStyleProvider();
SidebarMobileBookMarkStyleProvider sidebarMobileBookMarkStyleProvider = new SidebarMobileBookMarkStyleProvider();
Set<MobileBookMarkStyleProvider> mobileBookMarkStyleProviders = ExtraDesignClassManager.getInstance().getArray(
MobileBookMarkStyleProvider.XML_TAG);
List<MobileBookMarkStyleProvider> list = new ArrayList<>();
list.add(defaultMobileBookMarkStyleProvider);
list.add(sidebarMobileBookMarkStyleProvider);
list.addAll(mobileBookMarkStyleProviders);
return Collections.unmodifiableList(list);
}

387
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java

@ -0,0 +1,387 @@
package com.fr.design.mainframe.mobile.ui;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.gui.style.NumberDragBar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.mobile.MobileBookMarkStyle;
import com.fr.form.ui.mobile.impl.SidebarMobileBookMarkStyle;
import com.fr.stable.CoreConstants;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
/**
* @author Starryi
* @version 10.0
* Created by Starryi on 2020/02/28
*/
public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane<MobileBookMarkStyle> {
private static final long serialVersionUID = 1L;
private static final int COLUMN_WIDTH = 160;
private UnsignedIntUISpinner buttonWidthSpinner;
private UnsignedIntUISpinner buttonHeightSpinner;
private UnsignedIntUISpinner buttonGapSpinner;
private UnsignedIntUISpinner buttonBorderRadiusSpinner;
private ColorSelectBox normalBackgroundColorBox;
private NumberDragBar normalOpacityDragBar;
private UnsignedIntUISpinner normalOpacitySpinner;
private LineComboBox normalBorderWidthComBox;
private ColorSelectBox normalBorderColorBox;
private UIComboBox normalFontNameComboBox;
private UIComboBox normalFontSizeComboBox;
private UIColorButton normalFontColorButton;
private UIToggleButton normalFontItalicButton;
private UIToggleButton normalFontBoldButton;
private ColorSelectBox selectedBackgroundColorBox;
private NumberDragBar selectedOpacityDragBar;
private UnsignedIntUISpinner selectedOpacitySpinner;
private LineComboBox selectedBorderWidthComBox;
private ColorSelectBox selectedBorderColorBox;
private UIComboBox selectedFontNameComboBox;
private UIComboBox selectedFontSizeComboBox;
private UIColorButton selectedFontColorButton;
private UIToggleButton selectedFontItalicButton;
private UIToggleButton selectedFontBoldButton;
private SidebarMobileBookMarkStyle DEFAULT_STYLE = new SidebarMobileBookMarkStyle();
public SidebarMobileBookMarkStyleCustomDefinePane() {
this.initComponent();
}
private void initComponent() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(this.createNavButtonStylePanel());
this.add(this.createNormalStateStylePanel());
this.add(this.createSelectedStateStylePanel());
}
private JPanel createNavButtonStylePanel() {
buttonWidthSpinner = new UnsignedIntUISpinner(20, 150, 1, DEFAULT_STYLE.getWidth());
buttonHeightSpinner = new UnsignedIntUISpinner(20, 100, 1, DEFAULT_STYLE.getHeight());
buttonGapSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, DEFAULT_STYLE.getGap());
buttonBorderRadiusSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, DEFAULT_STYLE.getBorderRadius());
UILabel sizeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Size") + ":",
SwingConstants.RIGHT);
JPanel sizePane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0);
sizePane.add(buttonWidthSpinner);
sizePane.add(buttonHeightSpinner);
JPanel sizeTipsPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0);
sizeTipsPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Width"),
SwingConstants.CENTER));
sizeTipsPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Height"),
SwingConstants.CENTER));
UILabel gapLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Gap") + ":",
SwingConstants.RIGHT);
UILabel borderRadiusLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Border_Radius") + ":",
SwingConstants.RIGHT);
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, COLUMN_WIDTH};
double[] verticalGaps = {0, 10, 10};
JPanel navButtonSettingsPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{
{sizeLabel, sizePane},
{null, sizeTipsPane},
{gapLabel, buttonGapSpinner},
{borderRadiusLabel, buttonBorderRadiusSpinner},
}, rowSize, columnSize, 5, verticalGaps);
navButtonSettingsPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel containerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
containerPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Style"),
Color.decode("#2F8EF1")));
containerPane.add(navButtonSettingsPanel);
return containerPane;
}
private JPanel createNormalStateStylePanel() {
double p = TableLayout.PREFERRED;
normalBackgroundColorBox = new ColorSelectBox(COLUMN_WIDTH);
normalBackgroundColorBox.setSelectObject(DEFAULT_STYLE.getBackgroundColor());
normalOpacityDragBar = new NumberDragBar(0, 100);
normalOpacityDragBar.setValue(DEFAULT_STYLE.getOpacity());
normalOpacityDragBar.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
normalOpacitySpinner.setValue(normalOpacityDragBar.getValue());
}
});
normalOpacitySpinner = new UnsignedIntUISpinner(0, 100, 1, DEFAULT_STYLE.getOpacity());
normalOpacitySpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
normalOpacityDragBar.setValue((int) normalOpacitySpinner.getValue());
}
});
normalBorderWidthComBox = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
normalBorderWidthComBox.setSelectedLineStyle(DEFAULT_STYLE.getBorderWidth());
normalBorderColorBox = new ColorSelectBox(COLUMN_WIDTH);
normalBorderColorBox.setSelectObject(DEFAULT_STYLE.getBorderColor());
normalFontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report());
normalFontNameComboBox.setSelectedItem(DEFAULT_STYLE.getSelectedFontFamily());
normalFontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
normalFontSizeComboBox.setSelectedItem(DEFAULT_STYLE.getFontSize());
normalFontColorButton = new UIColorButton();
normalFontColorButton.setColor(DEFAULT_STYLE.getFontColor());
normalFontItalicButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
normalFontItalicButton.setSelected(DEFAULT_STYLE.isFontItalic());
normalFontBoldButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
normalFontBoldButton.setSelected(DEFAULT_STYLE.isFontBold());
JPanel opacityPane = new JPanel(new BorderLayout(0, 0));
JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0);
jp.add(normalOpacityDragBar);
jp.add(normalOpacitySpinner);
opacityPane.add(jp, BorderLayout.CENTER);
JPanel fontExtraPane = TableLayoutHelper.createGapTableLayoutPane(
new JComponent[][]{{normalFontSizeComboBox, normalFontColorButton, normalFontItalicButton, normalFontBoldButton}},
new double[]{p},
new double[]{p, p, p, p},
0, 5
);
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, COLUMN_WIDTH, p};
JPanel normalStateStyleSettingsPanel = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Background_Color") + ":", SwingConstants.RIGHT),
normalBackgroundColorBox
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Opacity") + ":", SwingConstants.RIGHT),
opacityPane,
new UILabel("%")
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Width") + ":", SwingConstants.RIGHT),
normalBorderWidthComBox
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Color") + ":", SwingConstants.RIGHT),
normalBorderColorBox
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Font") + ":", SwingConstants.RIGHT),
normalFontNameComboBox,
fontExtraPane
}
}, rowSize, columnSize, 5, 10);
normalStateStyleSettingsPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel containerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
containerPane.setBorder(
GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Normal_Style"),
Color.decode("#2F8EF1"))
);
containerPane.add(normalStateStyleSettingsPanel);
return containerPane;
}
private JPanel createSelectedStateStylePanel() {
double p = TableLayout.PREFERRED;
selectedBackgroundColorBox = new ColorSelectBox(COLUMN_WIDTH);
selectedBackgroundColorBox.setSelectObject(DEFAULT_STYLE.getSelectedBackgroundColor());
selectedOpacityDragBar = new NumberDragBar(0, 100);
selectedOpacityDragBar.setValue(DEFAULT_STYLE.getSelectedOpacity());
selectedOpacityDragBar.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
selectedOpacitySpinner.setValue(selectedOpacityDragBar.getValue());
}
});
selectedOpacitySpinner = new UnsignedIntUISpinner(0, 100, 1, DEFAULT_STYLE.getSelectedOpacity());
selectedOpacitySpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
selectedOpacityDragBar.setValue((int) selectedOpacitySpinner.getValue());
}
});
selectedBorderWidthComBox = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
selectedBorderWidthComBox.setSelectedLineStyle(DEFAULT_STYLE.getSelectedBorderWidth());
selectedBorderColorBox = new ColorSelectBox(COLUMN_WIDTH);
selectedBorderColorBox.setSelectObject(DEFAULT_STYLE.getSelectedBorderColor());
selectedFontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report());
selectedFontNameComboBox.setSelectedItem(DEFAULT_STYLE.getSelectedFontFamily());
selectedFontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
selectedFontSizeComboBox.setSelectedItem(DEFAULT_STYLE.getSelectedFontSize());
selectedFontColorButton = new UIColorButton();
selectedFontColorButton.setColor(DEFAULT_STYLE.getSelectedFontColor());
selectedFontItalicButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
selectedFontItalicButton.setSelected(DEFAULT_STYLE.isSelectedFontItalic());
selectedFontBoldButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
selectedFontBoldButton.setSelected(DEFAULT_STYLE.isSelectedFontBold());
JPanel opacityPane = new JPanel(new BorderLayout(0, 0));
JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0);
jp.add(selectedOpacityDragBar);
jp.add(selectedOpacitySpinner);
opacityPane.add(jp, BorderLayout.CENTER);
JPanel fontExtraPane = TableLayoutHelper.createGapTableLayoutPane(
new JComponent[][]{{selectedFontSizeComboBox, selectedFontColorButton, selectedFontItalicButton, selectedFontBoldButton}},
new double[]{p},
new double[]{p, p, p, p},
0, 5
);
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, COLUMN_WIDTH, p};
JPanel selectedStateStyleSettingsPanel = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Background_Color") + ":", SwingConstants.RIGHT),
selectedBackgroundColorBox
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Opacity") + ":", SwingConstants.RIGHT),
opacityPane,
new UILabel("%")
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Width") + ":", SwingConstants.RIGHT),
selectedBorderWidthComBox
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Color") + ":", SwingConstants.RIGHT),
selectedBorderColorBox
},
{
new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Font") + ":", SwingConstants.RIGHT),
selectedFontNameComboBox,
fontExtraPane
}
}, rowSize, columnSize, 5, 10);
selectedStateStyleSettingsPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel containerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
containerPane.setBorder(
GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Selected_Style"),
Color.decode("#2F8EF1"))
);
containerPane.add(selectedStateStyleSettingsPanel);
return containerPane;
}
@Override
public void populateBean(MobileBookMarkStyle ob) {
SidebarMobileBookMarkStyle style = null;
if (ob instanceof SidebarMobileBookMarkStyle) {
style = (SidebarMobileBookMarkStyle) ob;
}
if (style == null) {
return;
}
buttonWidthSpinner.setValue(style.getWidth());
buttonHeightSpinner.setValue(style.getHeight());
buttonGapSpinner.setValue(style.getGap());
buttonBorderRadiusSpinner.setValue(style.getBorderRadius());
normalBackgroundColorBox.setSelectObject(style.getBackgroundColor());
normalOpacityDragBar.setValue(style.getOpacity());
normalOpacitySpinner.setValue(style.getOpacity());
normalBorderWidthComBox.setSelectedLineStyle(style.getBorderWidth());
normalBorderColorBox.setSelectObject(style.getBorderColor());
normalFontNameComboBox.setSelectedItem(style.getFontFamily());
normalFontSizeComboBox.setSelectedItem(style.getFontSize());
normalFontColorButton.setColor(style.getFontColor());
normalFontItalicButton.setSelected(style.isFontItalic());
normalFontBoldButton.setSelected(style.isFontBold());
selectedBackgroundColorBox.setSelectObject(style.getSelectedBackgroundColor());
selectedOpacityDragBar.setValue(style.getSelectedOpacity());
selectedOpacitySpinner.setValue(style.getSelectedOpacity());
selectedBorderWidthComBox.setSelectedLineStyle(style.getSelectedBorderWidth());
selectedBorderColorBox.setSelectObject(style.getSelectedBorderColor());
selectedFontNameComboBox.setSelectedItem(style.getSelectedFontFamily());
selectedFontSizeComboBox.setSelectedItem(style.getSelectedFontSize());
selectedFontColorButton.setColor(style.getSelectedFontColor());
selectedFontItalicButton.setSelected(style.isSelectedFontItalic());
selectedFontBoldButton.setSelected(style.isSelectedFontBold());
}
@Override
public MobileBookMarkStyle updateBean() {
SidebarMobileBookMarkStyle style = new SidebarMobileBookMarkStyle();
style.setWidth((int) buttonWidthSpinner.getValue());
style.setHeight((int) buttonHeightSpinner.getValue());
style.setGap((int) buttonGapSpinner.getValue());
style.setBorderRadius((int) buttonBorderRadiusSpinner.getValue());
if (normalBackgroundColorBox.getSelectObject() != null) {
style.setBackgroundColor(normalBackgroundColorBox.getSelectObject());
}
style.setOpacity((int) normalOpacitySpinner.getValue());
style.setBorderWidth(normalBorderWidthComBox.getSelectedLineStyle());
style.setBorderColor(normalBorderColorBox.getSelectObject());
if (normalFontNameComboBox.getSelectedItem() != null) {
style.setFontFamily((String) normalFontNameComboBox.getSelectedItem());
}
if (normalFontSizeComboBox.getSelectedItem() != null) {
style.setFontSize((Integer) normalFontSizeComboBox.getSelectedItem());
}
style.setFontColor(normalFontColorButton.getColor());
style.setFontItalic(normalFontItalicButton.isSelected());
style.setFontBold(normalFontBoldButton.isSelected());
if (selectedBackgroundColorBox.getSelectObject() != null) {
style.setSelectedBackgroundColor(selectedBackgroundColorBox.getSelectObject());
}
style.setSelectedOpacity((int) selectedOpacitySpinner.getValue());
style.setSelectedBorderWidth(selectedBorderWidthComBox.getSelectedLineStyle());
style.setSelectedBorderColor(selectedBorderColorBox.getSelectObject());
if (selectedFontNameComboBox.getSelectedItem() != null) {
style.setSelectedFontFamily((String) selectedFontNameComboBox.getSelectedItem());
}
if (selectedFontSizeComboBox.getSelectedItem() != null) {
style.setSelectedFontSize((Integer) selectedFontSizeComboBox.getSelectedItem());
}
style.setSelectedFontColor(selectedFontColorButton.getColor());
style.setSelectedFontItalic(selectedFontItalicButton.isSelected());
style.setSelectedFontBold(selectedFontBoldButton.isSelected());
return style;
}
@Override
protected String title4PopupWindow() {
return null;
}
}

30
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleProvider.java

@ -0,0 +1,30 @@
package com.fr.design.mainframe.mobile.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.impl.AbstractMobileBookMarkStyleProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.form.ui.mobile.MobileBookMarkStyle;
import com.fr.form.ui.mobile.impl.SidebarMobileBookMarkStyle;
/**
* @author Starryi
* @version 10.0
* Created by Starryi on 2020/02/28
*/
public class SidebarMobileBookMarkStyleProvider extends AbstractMobileBookMarkStyleProvider {
@Override
public Class<? extends MobileBookMarkStyle> classForMobileBookMarkStyle() {
return SidebarMobileBookMarkStyle.class;
}
@Override
public Class<? extends BasicBeanPane<MobileBookMarkStyle>> classForMobileBookMarkStyleAppearance() {
return SidebarMobileBookMarkStyleCustomDefinePane.class;
}
@Override
public String displayName() {
return Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar");
}
}

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

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;

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

@ -503,6 +503,13 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
if (this.isSelected()) {
indexList.get(0).setSelected(true);
changeCollectionSelected(indexList.get(0).getButtonName());
} else {//删除的tab非选中状态, 原为选中状态的tab保持选中不变
for (ChartChangeButton button : indexList) {
if (button.isSelected()) {
changeCollectionSelected(button.getButtonName());
break;
}
}
}
}

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,10 +6,10 @@ 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>{
@ -17,6 +17,16 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCo
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