Browse Source

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

persist/11.0
jinbokai 5 years ago
parent
commit
3b18407317
  1. 26
      designer-base/src/main/java/com/fr/design/RestartHelper.java
  2. 10
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  3. 24
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  4. 16
      designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java
  5. 8
      designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java
  6. 6
      designer-base/src/main/java/com/fr/design/gui/itable/UITable.java
  7. 2
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java
  8. 8
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaEditorKit.java
  9. 3
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaUI.java
  10. 4
      designer-base/src/main/java/com/fr/design/gui/toast/Toast.java
  11. 16
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  12. 2
      designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java
  13. 21
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  14. 4
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java
  15. 4
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java
  16. 11
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  17. 77
      designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java
  18. 59
      designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java
  19. 30
      designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java
  20. 74
      designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java
  21. 63
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  22. 25
      designer-base/src/main/java/com/fr/design/os/impl/UpdateDialogAction.java
  23. 80
      designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java
  24. 11
      designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java
  25. 56
      designer-base/src/main/java/com/fr/design/update/domain/UpdateConstants.java
  26. 22
      designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java
  27. 2
      designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreDialog.java
  28. 40
      designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java
  29. 60
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  30. 37
      designer-base/src/main/java/com/fr/design/upm/UpmFinder.java
  31. 37
      designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java
  32. 19
      designer-base/src/main/java/com/fr/design/utils/ImageUtils.java
  33. 13
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  34. 43
      designer-base/src/main/java/com/fr/start/Demo.java
  35. 32
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  36. 11
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java
  37. 33
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java
  38. 98
      designer-chart/src/main/java/com/fr/design/chartx/component/CategorySeriesFilterPane.java
  39. 6
      designer-chart/src/main/java/com/fr/design/chartx/component/MultiTinyFormulaPane.java
  40. 72
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java
  41. 79
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java
  42. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java
  43. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java
  44. 7
      designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java
  45. 27
      designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java
  46. 32
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  47. 29
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleInteractivePane.java
  48. 5
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java
  49. 24
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java
  50. 26
      designer-chart/src/main/java/com/fr/van/chart/column/VanColumnChartTypeUI.java
  51. 101
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  52. 85
      designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java
  53. 127
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  54. 23
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java
  55. 352
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  56. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePaneWithMapZoom.java
  57. 47
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/MapZoomPane.java
  58. 224
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPane.java
  59. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPaneWithOutMode.java
  60. 48
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  61. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java
  62. 45
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  63. 170
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  64. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  65. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java
  66. 85
      designer-chart/src/main/java/com/fr/van/chart/designer/style/component/LimitPane.java
  67. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  68. 197
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  69. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  70. 38
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  71. 18
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java
  72. 9
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java
  73. 155
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  74. 27
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java
  75. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java
  76. 26
      designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java
  77. 20
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java
  78. 22
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java
  79. 31
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java
  80. 42
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java
  81. 13
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java
  82. 3
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java
  83. 4
      designer-form/src/main/java/com/fr/design/form/layout/FRTitleLayout.java
  84. 2
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  85. 6
      designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java
  86. 11
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

26
designer-base/src/main/java/com/fr/design/RestartHelper.java

@ -1,13 +1,16 @@
package com.fr.design; package com.fr.design;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.RestartAction;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -168,11 +171,8 @@ public class RestartHelper {
}catch (Exception e){ }catch (Exception e){
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
if (OperatingSystem.isMacOS()) { OSBasedAction osBasedAction = OSSupportCenter.getAction(RestartAction.class);
restartInMacOS(installHome, filesToBeDelete); osBasedAction.execute(filesToBeDelete);
} else {
restartInWindows(installHome, filesToBeDelete);
}
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} finally { } finally {
@ -187,7 +187,7 @@ public class RestartHelper {
} }
} }
private static void restartInMacOS(String installHome, String[] filesToBeDelete) throws Exception { /* private static void restartInMacOS(String installHome, String[] filesToBeDelete) throws Exception {
ProcessBuilder builder = new ProcessBuilder(); ProcessBuilder builder = new ProcessBuilder();
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
commands.add("open"); commands.add("open");
@ -210,4 +210,16 @@ public class RestartHelper {
builder.command(commands); builder.command(commands);
builder.start(); builder.start();
} }
private static void restartInLinux(String installHome, String[] filesToBeDelete) throws Exception {
ProcessBuilder builder = new ProcessBuilder();
List<String> commands = new ArrayList<String>();
//现在先写的是restart.sh
commands.add(installHome + File.separator + "bin" + File.separator + "restart.sh");
if (ArrayUtils.isNotEmpty(filesToBeDelete)) {
commands.add(StableUtils.join(filesToBeDelete, "+"));
}
builder.command(commands);
builder.start();
}*/
} }

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

@ -28,7 +28,7 @@ import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.update.push.DesignerPushUpdateManager; import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -213,10 +213,15 @@ public class PreferencePane extends BasicPane {
joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve"));
improvePane.add(joinProductImproveCheckBox); improvePane.add(joinProductImproveCheckBox);
if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) { if(SupportOSImpl.AUTOPUSHUPDATE.support()){
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox); improvePane.add(autoPushUpdateCheckBox);
} }
/*
if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) {
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox);
}*/
JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
spaceUpPane.add(oraclePane, BorderLayout.NORTH); spaceUpPane.add(oraclePane, BorderLayout.NORTH);
@ -305,7 +310,6 @@ public class PreferencePane extends BasicPane {
gcButton.setEnabled(gcEnableCheckBox.isSelected()); gcButton.setEnabled(gcEnableCheckBox.isSelected());
} }
}); });
//集群下禁用 //集群下禁用
if (ClusterBridge.isClusterMode()) { if (ClusterBridge.isClusterMode()) {
gcEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false);

24
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -1,24 +1,17 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.config.ServerPreferenceConfig;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.data.datapane.connect.ConnectionShowPane; import com.fr.design.data.datapane.connect.ConnectionShowPane;
import com.fr.design.data.datapane.connect.DatabaseConnectionPane; import com.fr.design.data.datapane.connect.DatabaseConnectionPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.NameInspector; import com.fr.design.gui.NameInspector;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.dcm.UniversalDatabaseOpener; import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.design.os.impl.DatabaseDialogAction;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -60,14 +53,11 @@ public class ConnectionListAction extends UpdateAction {
* @param evt 事件 * @param evt 事件
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (ServerPreferenceConfig.getInstance().isUseUniverseDBM()) { OSBasedAction osBasedAction = OSSupportCenter.getAction(DatabaseDialogAction.class);
UniversalDatabaseOpener.showUniverseDatabaseDialog(); osBasedAction.execute();
} else {
openDesignDatabaseManager();
}
} }
private void openDesignDatabaseManager() { /* private void openDesignDatabaseManager() {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final ConnectionConfig datasourceManager = ConnectionConfig.getInstance(); final ConnectionConfig datasourceManager = ConnectionConfig.getInstance();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() { final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
@ -108,7 +98,7 @@ public class ConnectionListAction extends UpdateAction {
}); });
databaseListDialog.setVisible(true); databaseListDialog.setVisible(true);
} }
*/
/** /**
* 更新datasourceManager * 更新datasourceManager

16
designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java

@ -1,11 +1,11 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.upm.UpmFinder; import com.fr.design.os.impl.PMDialogAction;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -16,22 +16,18 @@ import java.awt.event.ActionEvent;
* @since 8.0 * @since 8.0
*/ */
public class PluginManagerAction extends UpdateAction { public class PluginManagerAction extends UpdateAction {
private static String PLUGIN_MANAGER_ROUTE = "#management/plugin";
public PluginManagerAction() { public PluginManagerAction() {
this.setMenuKeySet(PLUGIN_MANAGER); this.setMenuKeySet(PLUGIN_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()); this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/server/plugin.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/server/plugin.png"));
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// 可以启用新版本的插件商店(使用JxBrowser作为容器) // 可以启用新版本的插件商店(使用JxBrowser作为容器)
if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM()) { OSBasedAction osBasedAction = OSSupportCenter.getAction(PMDialogAction.class);
UpmFinder.showUPMDialog(); osBasedAction.execute();
} else {
WebViewDlgHelper.createPluginDialog();
}
} }
public static final MenuKeySet PLUGIN_MANAGER = new MenuKeySet() { public static final MenuKeySet PLUGIN_MANAGER = new MenuKeySet() {

8
designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java

@ -3,6 +3,9 @@ package com.fr.design.gui.iprogressbar;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -28,7 +31,12 @@ public class ProgressDialog extends UIDialog {
setUndecorated(true); setUndecorated(true);
setSize(parent.getSize()); setSize(parent.getSize());
setLocationRelativeTo(null); setLocationRelativeTo(null);
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
setOpacity(0.5f); setOpacity(0.5f);
}
}, SupportOSImpl.OPACITY);
initComponent(); initComponent();
} }

6
designer-base/src/main/java/com/fr/design/gui/itable/UITable.java

@ -291,8 +291,7 @@ public class UITable extends JTable implements UIObserver {
* *
*/ */
public TableCellEditor getDefaultEditor(Class<?> columnClass) { public TableCellEditor getDefaultEditor(Class<?> columnClass) {
columnClass = UITable.class; return super.getDefaultEditor(UITable.class);
return super.getDefaultEditor(columnClass);
} }
@Override @Override
@ -300,8 +299,7 @@ public class UITable extends JTable implements UIObserver {
* *
*/ */
public TableCellRenderer getDefaultRenderer(Class<?> columnClass) { public TableCellRenderer getDefaultRenderer(Class<?> columnClass) {
columnClass = UITable.class; return super.getDefaultRenderer(UITable.class);
return super.getDefaultRenderer(columnClass);
} }
/** /**

2
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxView.java

@ -374,7 +374,7 @@ public class SyntaxView extends View implements TabExpander,
if (host.isCodeFoldingEnabled()) { if (host.isCodeFoldingEnabled()) {
visibleLineCount -= host.getFoldManager().getHiddenLineCount(); visibleLineCount -= host.getFoldManager().getHiddenLineCount();
} }
return visibleLineCount * lineHeight; return (float) visibleLineCount * lineHeight;
default: default:
throw new IllegalArgumentException("Invalid axis: " + axis); throw new IllegalArgumentException("Invalid axis: " + axis);
} }

8
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaEditorKit.java

@ -741,10 +741,10 @@ public class RTextAreaEditorKit extends DefaultEditorKit {
public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { public void actionPerformedImpl(ActionEvent e, RTextArea textArea) {
Font font = textArea.getFont(); Font font = textArea.getFont();
float oldSize = font.getSize2D(); float oldSize = font.getSize2D();
float newSize = oldSize - decreaseAmount; double newSize = (double)oldSize - (double)decreaseAmount;
if (newSize>=MINIMUM_SIZE) { if (newSize>=MINIMUM_SIZE) {
// Shrink by decreaseAmount. // Shrink by decreaseAmount.
font = font.deriveFont(newSize); font = font.deriveFont((float)newSize);
textArea.setFont(font); textArea.setFont(font);
} }
else if (oldSize>MINIMUM_SIZE) { else if (oldSize>MINIMUM_SIZE) {
@ -1329,10 +1329,10 @@ public class RTextAreaEditorKit extends DefaultEditorKit {
public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { public void actionPerformedImpl(ActionEvent e, RTextArea textArea) {
Font font = textArea.getFont(); Font font = textArea.getFont();
float oldSize = font.getSize2D(); float oldSize = font.getSize2D();
float newSize = oldSize + increaseAmount; double newSize = (double)oldSize + (double)increaseAmount;
if (newSize<=MAXIMUM_SIZE) { if (newSize<=MAXIMUM_SIZE) {
// Grow by increaseAmount. // Grow by increaseAmount.
font = font.deriveFont(newSize); font = font.deriveFont((float)newSize);
textArea.setFont(font); textArea.setFont(font);
} }
else if (oldSize<MAXIMUM_SIZE) { else if (oldSize<MAXIMUM_SIZE) {

3
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaUI.java

@ -463,9 +463,10 @@ public class RTextAreaUI extends BasicTextAreaUI {
if (textArea.getFadeCurrentLineHighlight()) { if (textArea.getFadeCurrentLineHighlight()) {
Graphics2D g2d = (Graphics2D)g; Graphics2D g2d = (Graphics2D)g;
Color bg = textArea.getBackground(); Color bg = textArea.getBackground();
float visibleWidth = (float)(visibleRect.x + visibleRect.width);
GradientPaint paint = new GradientPaint( GradientPaint paint = new GradientPaint(
visibleRect.x,0, highlight, visibleRect.x,0, highlight,
visibleRect.x+visibleRect.width,0, visibleWidth,0,
bg==null ? Color.WHITE : bg); bg==null ? Color.WHITE : bg);
g2d.setPaint(paint); g2d.setPaint(paint);
g2d.fillRect(visibleRect.x,textArea.currentCaretY, g2d.fillRect(visibleRect.x,textArea.currentCaretY,

4
designer-base/src/main/java/com/fr/design/gui/toast/Toast.java

@ -42,7 +42,7 @@ public class Toast extends JFrame {
//int x = (int) (owner.getLocation().getX() + (owner.getWidth() / 2)); //int x = (int) (owner.getLocation().getX() + (owner.getWidth() / 2));
int x = (int) (owner.getLocation().getX() + owner.getWidth() - textWidth); int x = (int) (owner.getLocation().getX() + owner.getWidth() - textWidth);
int y = (int) (owner.getLocation().getY() + owner.getHeight() / 2); int y = (int) (owner.getLocation().getY() + (double)owner.getHeight() / 2);
setLocation(new Point(x, y)); setLocation(new Point(x, y));
@ -110,7 +110,7 @@ public class Toast extends JFrame {
try { try {
Toast toastFrame = new Toast(owner, toastText); Toast toastFrame = new Toast(owner, toastText);
toastFrame.fadeIn(); toastFrame.fadeIn();
Thread.sleep(durationSec * 1000); Thread.sleep((long)durationSec * 1000);
toastFrame.fadeOut(); toastFrame.fadeOut();
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();

16
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -558,15 +558,15 @@ public class FRGUIPaneFactory {
*/ */
public static int caculateWidth(int width) { public static int caculateWidth(int width) {
int w = 0; int w = 0;
float m = (width + WIDTH_OFFSET_M) / WIDTH_PARA_F; double m = (double)(width + WIDTH_OFFSET_M) / (double)WIDTH_PARA_F;
float n = (width + WIDTH_OFFSET_N) / WIDTH_PARA_F; double n = (double)(width + WIDTH_OFFSET_N ) / (double)WIDTH_PARA_F;
float i = Math.abs((((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m); double i = Math.abs(((double) ((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m);
float j = Math.abs((((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n); double j = Math.abs(((double) ((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n);
float x = i > j ? i : j; double x = i > j ? i : j;
if (AssistUtils.equals(x, i)) { if (AssistUtils.equals(x, i)) {
w = Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M; w = (int) (Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M);
} else if (AssistUtils.equals(x, j)) { } else if (AssistUtils.equals(x, j)) {
w = Math.round(n) * WIDTH_PARA_INT - WIDTH_OFFSET_N; w = (int) (Math.round(n) * WIDTH_PARA_INT - WIDTH_OFFSET_N);
} }
return w; return w;
} }
@ -579,7 +579,7 @@ public class FRGUIPaneFactory {
*/ */
public static int caculateHeight(int height) { public static int caculateHeight(int height) {
int h = 0; int h = 0;
float x = (height + HEIGHT_OFFSET) / HEIGHT_PARA; double x = (double)(height + HEIGHT_OFFSET) / HEIGHT_PARA;
h = ((int) x + 1) * HEIGHT_PARA; h = ((int) x + 1) * HEIGHT_PARA;
return h; return h;
} }

2
designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java

@ -372,7 +372,7 @@ public class TableLayoutHelper {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
JPanel jp1 = TableLayoutHelper.createTableLayoutPane(createTestComponents("jp1"), TableLayoutHelper.FILL_NONE); JPanel jp1 = TableLayoutHelper.createTableLayoutPane(createTestComponents("jp1"), TableLayoutHelper.FILL_NONE);
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp2"), TableLayoutHelper.FILL_LASTCOL_AND_ROW, 2 * TEN, 2 * TEN); JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp2"), TableLayoutHelper.FILL_LASTCOL_AND_ROW, (double)2 * TEN, (double)2 * TEN);
JPanel jp3 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp3"), JPanel jp3 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp3"),
new double[]{f, p, f, p}, new double[]{f, f}, 4, 4); new double[]{f, p, f, p}, new double[]{f, f}, 4, 4);
JPanel jp4 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp4"), JPanel jp4 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp4"),

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

@ -40,6 +40,7 @@ import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.menu.MenuManager; import com.fr.design.menu.MenuManager;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.exception.DecryptTemplateException; import com.fr.exception.DecryptTemplateException;
@ -58,6 +59,8 @@ import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.start.OemHandler; import com.fr.start.OemHandler;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -83,6 +86,7 @@ import java.awt.Graphics;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Component;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants; import java.awt.dnd.DnDConstants;
@ -449,21 +453,34 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
return northEastPane; return northEastPane;
} }
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) { private void refreshNorthEastPane(final JPanel northEastPane, final ToolBarMenuDock ad) {
northEastPane.removeAll(); northEastPane.removeAll();
northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
northEastPane.add(LogMessageBar.getInstance()); northEastPane.add(LogMessageBar.getInstance());
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor != null) { if (processor != null) {
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane()); final Component[] bbsLoginPane = {null};
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
bbsLoginPane[0] = ad.createBBSLoginPane();
}
}, SupportOSImpl.USERINFOPANE);
processor.hold(northEastPane, LogMessageBar.getInstance(), bbsLoginPane[0]);
} }
northEastPane.add(ad.createAlphaFinePane()); northEastPane.add(ad.createAlphaFinePane());
if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
ad.createAlphaFinePane().setVisible(false); ad.createAlphaFinePane().setVisible(false);
} }
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
northEastPane.add(ad.createBBSLoginPane()); northEastPane.add(ad.createBBSLoginPane());
} }
}, SupportOSImpl.USERINFOPANE);
}
public void initTitleIcon() { public void initTitleIcon() {

4
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java

@ -164,11 +164,11 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
Dimension d = getSize(); Dimension d = getSize();
this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, (double)d.width - 1, (double)d.height - 1));
if (this.pIndex == patternIndex) {// it's selected. if (this.pIndex == patternIndex) {// it's selected.
g2d.setPaint(UIConstants.LINE_COLOR); g2d.setPaint(UIConstants.LINE_COLOR);
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, (double)d.width - 1, (double)d.height - 1));
} }
} }

4
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java

@ -101,7 +101,7 @@ public class TextureBackgroundQuickPane extends BackgroundQuickPane {
Dimension d = getSize(); Dimension d = getSize();
g2d.setPaint(this.buttonTexturePaint); g2d.setPaint(this.buttonTexturePaint);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, (double) d.width - 1, (double)d.height - 1));
if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's
// selected. // selected.
@ -109,7 +109,7 @@ public class TextureBackgroundQuickPane extends BackgroundQuickPane {
} else { } else {
g2d.setPaint(null); g2d.setPaint(null);
} }
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, (double)d.width - 1, (double) d.height - 1));
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {

11
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -54,6 +54,7 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.remote.action.RemoteDesignAuthManagerAction;
import com.fr.design.update.actions.SoftwareUpdateAction; import com.fr.design.update.actions.SoftwareUpdateAction;
import com.fr.design.utils.ThemeUtils; import com.fr.design.utils.ThemeUtils;
@ -70,6 +71,8 @@ import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType; import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.start.OemHandler; import com.fr.start.OemHandler;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -524,7 +527,7 @@ public abstract class ToolBarMenuDock {
* @return 帮组菜单的子菜单 * @return 帮组菜单的子菜单
*/ */
public ShortCut[] createHelpShortCuts() { public ShortCut[] createHelpShortCuts() {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>(); final java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new WebDemoAction()); shortCuts.add(new WebDemoAction());
// 英文,把 video 和帮助文档放到 Help 下面 // 英文,把 video 和帮助文档放到 Help 下面
if (GeneralContext.getLocale().equals(Locale.US)) { if (GeneralContext.getLocale().equals(Locale.US)) {
@ -541,8 +544,14 @@ public abstract class ToolBarMenuDock {
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (DesignerEnvManager.getEnvManager().isOpenDebug()) { if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
shortCuts.add(new FineUIAction()); shortCuts.add(new FineUIAction());
} }
}, SupportOSImpl.FINEUI);
}
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[0]); return shortCuts.toArray(new ShortCut[0]);

77
designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java

@ -0,0 +1,77 @@
package com.fr.design.os.impl;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.dcm.UniversalDatabaseOpener;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.ConnectionConfig;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import static com.fr.design.actions.server.ConnectionListAction.doWithDatasourceManager;
/**
* 数据连接窗口
* @author pengda
* @date 2019/10/9
*/
public class DatabaseDialogAction implements OSBasedAction {
@Override
public void execute(Object... objects) {
if (ServerPreferenceConfig.getInstance().isUseUniverseDBM() && !OperatingSystem.isLinux()) {
UniversalDatabaseOpener.showUniverseDatabaseDialog();
} else {
openDesignDatabaseManager();
}
}
private void openDesignDatabaseManager() {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final ConnectionConfig datasourceManager = ConnectionConfig.getInstance();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
public void complete() {
ConnectionConfig connectionConfig = datasourceManager.mirror();
populate(connectionConfig);
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.renameConnection(oldName, newName);
}
};
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
databaseManagerPane.update(datasourceManager);
}
}.addCallBack(new CallBackAdaptor() {
@Override
public boolean beforeCommit() {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog);
}
@Override
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
}));
}
});
databaseListDialog.setVisible(true);
}
}

59
designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java

@ -0,0 +1,59 @@
package com.fr.design.os.impl;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import java.io.IOException;
/**
* @author pengda
* @date 2019/10/9
*/
public class DemoAction implements OSBasedAction {
@Override
public void execute(Object... objects) {
String installHome = StableUtils.getInstallHome();
if (installHome == null) {
FineLoggerFactory.getLogger().error("Can not find the install home, please check it.");
return;
}
String executorPath;
if (OperatingSystem.isMacos()) {
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app");
} else if(OperatingSystem.isWindows()){
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo");
}else{
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.sh demo");
}
if (OperatingSystem.isMacos()) {
ProcessBuilder builder = new ProcessBuilder();
builder.command("open", "-a", executorPath, "--args", "demo");
try {
builder.start();
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else if(OperatingSystem.isWindows()){
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
Runtime rt = Runtime.getRuntime();
try {
rt.exec(executorPath);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}else{
//先用和win一样的方式
Runtime rt = Runtime.getRuntime();
try {
rt.exec(executorPath);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
}

30
designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java

@ -0,0 +1,30 @@
package com.fr.design.os.impl;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.upm.UpmFinder;
import com.fr.design.utils.DesignUtils;
import com.fr.stable.os.Arch;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
/**
* 插件管理窗口
* @author pengda
* @date 2019/10/9
*/
public class PMDialogAction implements OSBasedAction {
private static String PLUGIN_MANAGER_ROUTE = "#management/plugin";
@Override
public void execute(Object... objects) {
if(Arch.getArch() == Arch.ARM){
DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null);
return;
}
if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && !OperatingSystem.isLinux()) {
UpmFinder.showUPMDialog();
} else {
WebViewDlgHelper.createPluginDialog();
}
}
}

74
designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java

@ -0,0 +1,74 @@
package com.fr.design.os.impl;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class RestartAction implements OSBasedAction {
@Override
public void execute(Object... objects) {
String[] filesToBeDelete = (String[])objects;
String installHome = StableUtils.getInstallHome();
try{
if (OperatingSystem.isMacos()) {
restartInMacOS(installHome, filesToBeDelete);
} else if(OperatingSystem.isWindows()){
restartInWindows(installHome, filesToBeDelete);
}else{
//增加一个Linux系统
restartInLinux(installHome,filesToBeDelete);
}
}catch(Exception e){
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
private static void restartInMacOS(String installHome, String[] filesToBeDelete) throws Exception {
ProcessBuilder builder = new ProcessBuilder();
List<String> commands = new ArrayList<String>();
commands.add("open");
commands.add(installHome + File.separator + "bin" + File.separator + "restart.app");
if (ArrayUtils.isNotEmpty(filesToBeDelete)) {
commands.add("--args");
commands.add(StableUtils.join(filesToBeDelete, "+"));
}
builder.command(commands);
builder.start();
}
private static void restartInWindows(String installHome, String[] filesToBeDelete) throws Exception {
ProcessBuilder builder = new ProcessBuilder();
List<String> commands = new ArrayList<String>();
commands.add(installHome + File.separator + "bin" + File.separator + "restart.exe");
if (ArrayUtils.isNotEmpty(filesToBeDelete)) {
commands.add(StableUtils.join(filesToBeDelete, "+"));
}
builder.command(commands);
builder.start();
}
private static void restartInLinux(String installHome, String[] filesToBeDelete) throws Exception {
ProcessBuilder builder = new ProcessBuilder();
List<String> commands = new ArrayList<String>();
//现在先写的是restart.sh
commands.add(installHome + File.separator + "bin" + File.separator + "restart.sh");
if (ArrayUtils.isNotEmpty(filesToBeDelete)) {
commands.add(StableUtils.join(filesToBeDelete, "+"));
}
builder.command(commands);
builder.start();
}
}

63
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -0,0 +1,63 @@
package com.fr.design.os.impl;
import com.fr.base.FRContext;
import com.fr.general.GeneralContext;
import com.fr.stable.os.Arch;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.SupportOS;
import com.fr.workspace.WorkContext;
/**
* @author pengda
* @date 2019/10/9
*/
public enum SupportOSImpl implements SupportOS {
/**
* ARM下屏蔽登录
*/
USERINFOPANE{
public boolean support(){
return Arch.getArch() != Arch.ARM;
}
},
/**
* Linux系统屏蔽透明度
*/
OPACITY{
public boolean support(){
return !OperatingSystem.isLinux();
}
},
/**
* Linux系统屏蔽FineUI选项
*/
FINEUI{
public boolean support(){
return !OperatingSystem.isLinux();
}
},
/**
* 自动更新推送
*/
AUTOPUSHUPDATE{
@Override
public boolean support() {
boolean isLocalEnv = WorkContext.getCurrent().isLocal();
boolean isChineseEnv = GeneralContext.isChineseEnv();
boolean isLinux = OperatingSystem.isLinux();
// 远程设计和非中文环境以及Linux环境,都不生效
return isLocalEnv && isChineseEnv && !isLinux;
}
},
/**
* BBS窗口
*/
BBSDIALOG{
@Override
public boolean support() {
return FRContext.isChineseEnv() && !OperatingSystem.isMacos() && Arch.getArch() != Arch.ARM;
}
}
}

25
designer-base/src/main/java/com/fr/design/os/impl/UpdateDialogAction.java

@ -0,0 +1,25 @@
package com.fr.design.os.impl;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.update.ui.dialog.UpdateMainDialog;
import com.fr.design.utils.DesignUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
/**
* 更新升级窗口
* @author pengda
* @date 2019/10/9
*/
public class UpdateDialogAction implements OSBasedAction {
private static String UPDATE_ROUTE = "#management/backup";
@Override
public void execute(Object... objects) {
if(!OperatingSystem.isLinux()) {
UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame());
dialog.showDialog();
}else{
DesignUtils.visitEnvServerByParameters( UPDATE_ROUTE,null,null);
}
}
}

80
designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java

@ -0,0 +1,80 @@
package com.fr.design.update.actions;
import com.fr.decision.update.backup.Recover;
import com.fr.decision.update.data.UpdateConstants;
import com.fr.decision.update.exception.UpdateException;
import com.fr.general.CommonIOUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import java.io.File;
import java.io.IOException;
/**
* @author Bryant
* @version 10.0
* Created by Bryant on 2019-10-09
*/
public class RecoverForDesigner implements Recover {
@Override
public boolean recover() {
try{
CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNERBACKUPPATH),
StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME));
return true;
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage() + "Recover error for designer");
return false;
}
}
@Override
public boolean backup() {
String installHome = StableUtils.getInstallHome();
//jar包备份文件的目录为"backup/"+jar包当前版本号
String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO()));
backupFilesFromInstallEnv(todayBackupDir);
backupFilesFromInstallLib(installHome, todayBackupDir);
try {
File file = new File(StableUtils.pathJoin(installHome, UpdateConstants.DOWNLOADPATH));
CommonUtils.mkdirs(file);
IOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME),
StableUtils.pathJoin(installHome, UpdateConstants.DESIGNERBACKUPPATH));
return true;
}catch (IOException e) {
UpdateException exception = new UpdateException("Backup Exception for designer" + e.getMessage());
FineLoggerFactory.getLogger().error(exception.getMessage(),exception);
return false;
}
}
private void backupFilesFromInstallEnv(String todayBackupDir) {
try {
CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)));
IOUtils.copyFilesInDirByPath(
StableUtils.pathJoin(WorkContext.getCurrent().getPath(),ProjectConstants.LIB_NAME),
StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH));
} catch (IOException e) {
UpdateException exception = new UpdateException(e.getMessage());
FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in env failed");
}
}
private void backupFilesFromInstallLib(String installHome, String todayBackupDir) {
try {
CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)));
IOUtils.copyFilesInDirByPath(
StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME),
StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH));
} catch (IOException e) {
UpdateException exception = new UpdateException(e.getMessage());
FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in install failed");
}
}
}

11
designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java

@ -2,8 +2,9 @@ package com.fr.design.update.actions;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.UpdateDialogAction;
import com.fr.design.update.ui.dialog.UpdateMainDialog; import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -12,7 +13,6 @@ import java.awt.event.ActionEvent;
*/ */
public class SoftwareUpdateAction extends UpdateAction { public class SoftwareUpdateAction extends UpdateAction {
public SoftwareUpdateAction() { public SoftwareUpdateAction() {
setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_UpdateAndUpgrade")); setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_UpdateAndUpgrade"));
setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update/update_new.png")); setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update/update_new.png"));
@ -26,8 +26,9 @@ public class SoftwareUpdateAction extends UpdateAction {
*/ */
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); //说之后更新升级要用jxbrowser,Linux下进平台
dialog.showDialog(); OSBasedAction osBasedAction = OSSupportCenter.getAction(UpdateDialogAction.class);
osBasedAction.execute();
} }
} }

56
designer-base/src/main/java/com/fr/design/update/domain/UpdateConstants.java

@ -1,56 +0,0 @@
package com.fr.design.update.domain;
/**
* Created by XINZAI on 2018/8/21.
*/
import java.awt.Color;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* 更新升级的常量
*/
public interface UpdateConstants {
String APPS_FOLDER_NAME = "webapps";
int CONNECTION_TIMEOUT = 1000 * 5;
Color BAR_COLOR = new Color(0x3384F0);
String CHANGELOG_X_START = "2018-07-11";
String DEFAULT_APP_NAME = "FineReport";
String DESIGNER_BACKUP_DIR = "designerbackup";
String UPDATE_CACHE_CONFIG_X = "updateCacheConfig10";
String UPDATE_CACHE_INFO_X = "updateCacheInfo10";
String JXBROWSER = "jxbrowser";
List<String> JARS_FOR_SERVER_X = Collections.unmodifiableList(Arrays.asList(new String[]{
"fine-activator-10.0.jar",
"fine-core-10.0.jar",
"fine-report-engine-10.0.jar",
"fine-decision-10.0.jar",
"fine-decision-report-10.0.jar",
"fine-schedule-10.0.jar",
"fine-schedule-report-10.0.jar",
"fine-swift-log-adaptor-10.0.jar",
"fine-webui-10.0.jar",
"fine-datasource-10.0.jar",
"fine-third-10.0.jar",
"fine-accumulator-10.0.jar"
}));
List<String> JARS_FOR_DESIGNER_X = Collections.unmodifiableList(Arrays.asList(new String[]{
"fine-report-designer-10.0.jar",
"aspectjrt.jar"
}));
List<String> LOG_TYPE = Collections.unmodifiableList(Arrays.asList(new String[]{
"REPORT", "MOBILE", "CHART", "PFC", "BI"
}));
}

22
designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java

@ -4,6 +4,7 @@ import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.event.DesignerOpenedListener; import com.fr.design.event.DesignerOpenedListener;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.update.ui.dialog.UpdateMainDialog; import com.fr.design.update.ui.dialog.UpdateMainDialog;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -12,6 +13,9 @@ import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -81,21 +85,6 @@ public class DesignerPushUpdateManager {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
/**
* "自动更新推送"选项是否生效
*/
public boolean isAutoPushUpdateSupported() {
boolean isLocalEnv = WorkContext.getCurrent().isLocal();
boolean isChineseEnv = GeneralContext.isChineseEnv();
return isAutoPushUpdateSupported(isLocalEnv, isChineseEnv);
}
private boolean isAutoPushUpdateSupported(boolean isLocalEnv, boolean isChineseEnv) {
// 远程设计和非中文环境,都不生效
return isLocalEnv && isChineseEnv;
}
/** /**
* 检查更新如果有合适的更新版本则弹窗 * 检查更新如果有合适的更新版本则弹窗
*/ */
@ -129,8 +118,7 @@ public class DesignerPushUpdateManager {
initUpdateInfo(currentVersion, latestVersion); initUpdateInfo(currentVersion, latestVersion);
} }
} }
return SupportOSImpl.AUTOPUSHUPDATE.support() && updateInfo.hasNewPushVersion();
return isAutoPushUpdateSupported() && updateInfo.hasNewPushVersion();
} }
private boolean isValidJarVersion(String fullCurrentVersion, String fullLatestVersion) { private boolean isValidJarVersion(String fullCurrentVersion, String fullLatestVersion) {

2
designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreDialog.java

@ -1,9 +1,9 @@
package com.fr.design.update.ui.dialog; package com.fr.design.update.ui.dialog;
import com.fr.decision.update.data.UpdateConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.update.domain.UpdateConstants;
import com.fr.design.update.factory.DirectoryOperationFactory; import com.fr.design.update.factory.DirectoryOperationFactory;
import com.fr.design.update.ui.widget.ColorfulCellRender; import com.fr.design.update.ui.widget.ColorfulCellRender;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;

40
designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java

@ -1,16 +1,16 @@
package com.fr.design.update.ui.dialog; package com.fr.design.update.ui.dialog;
import com.fr.decision.update.data.UpdateConstants;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.update.domain.UpdateConstants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -45,7 +45,7 @@ public class RestoreResultDialog extends JDialog {
initCommonComponents(); initCommonComponents();
} }
public RestoreResultDialog(Frame parent, boolean modal, String jarDir) { RestoreResultDialog(Frame parent, boolean modal, String jarDir) {
super(parent, modal); super(parent, modal);
this.jarRestoreDir = jarDir; this.jarRestoreDir = jarDir;
if (ComparatorUtils.equals(jarDir, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Restore_Old_Version"))) { if (ComparatorUtils.equals(jarDir, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Restore_Old_Version"))) {
@ -100,7 +100,7 @@ public class RestoreResultDialog extends JDialog {
this.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Jar_Restore")); this.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Jar_Restore"));
} }
public static boolean deletePreviousPropertyFile() { static boolean deletePreviousPropertyFile() {
File moveFile = new File(RestartHelper.MOVE_FILE); File moveFile = new File(RestartHelper.MOVE_FILE);
File delFile = new File(RestartHelper.RECORD_FILE); File delFile = new File(RestartHelper.RECORD_FILE);
if (StableUtils.mkdirs(moveFile) && StableUtils.mkdirs(delFile)) { if (StableUtils.mkdirs(moveFile) && StableUtils.mkdirs(delFile)) {
@ -159,7 +159,7 @@ public class RestoreResultDialog extends JDialog {
private void putJarBackupFiles() { private void putJarBackupFiles() {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
java.util.List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
putJarBackupFilesToInstallLib(installHome, map, list); putJarBackupFilesToInstallLib(installHome, map, list);
@ -168,23 +168,29 @@ public class RestoreResultDialog extends JDialog {
RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()])); RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()]));
} }
private void putJarBackupFilesToInstallLib(String installHome, Map<String, String> map, java.util.List<String> list) { private void putJarBackupFilesToInstallLib(String installHome, Map<String, String> map, List<String> list) {
List<String> files = UpdateConstants.JARS_FOR_DESIGNER_X;
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
for (String file : files) { File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH));
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file), File[] files = installLib.listFiles();
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file)); if (files != null) {
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file)); for (File file : files) {
map.put(file.getAbsolutePath(),
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
}
} }
} }
private void putJarBackupFilesToInstallEnv(String installHome, Map<String, String> map, java.util.List<String> list) { private void putJarBackupFilesToInstallEnv(String installHome, Map<String, String> map, List<String> list) {
List<String> files = UpdateConstants.JARS_FOR_SERVER_X;
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
for (String file : files) { File installEnv = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH));
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file), File[] files = installEnv.listFiles();
StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); if (files != null) {
list.add(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); for (File file : files) {
map.put(file.getAbsolutePath(),
StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName()));
list.add(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName()));
}
} }
} }
} }

60
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -1,5 +1,6 @@
package com.fr.design.update.ui.dialog; package com.fr.design.update.ui.dialog;
import com.fr.decision.update.data.UpdateConstants;
import com.fr.decision.update.info.UpdateCallBack; import com.fr.decision.update.info.UpdateCallBack;
import com.fr.decision.update.info.UpdateProgressCallBack; import com.fr.decision.update.info.UpdateProgressCallBack;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
@ -14,7 +15,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.update.actions.FileProcess; import com.fr.design.update.actions.FileProcess;
import com.fr.design.update.domain.UpdateConstants;
import com.fr.design.update.domain.UpdateInfoCachePropertyManager; import com.fr.design.update.domain.UpdateInfoCachePropertyManager;
import com.fr.design.update.factory.DirectoryOperationFactory; import com.fr.design.update.factory.DirectoryOperationFactory;
import com.fr.design.update.ui.widget.LoadingLabel; import com.fr.design.update.ui.widget.LoadingLabel;
@ -29,13 +29,7 @@ import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.*;
import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.third.org.apache.http.ProtocolException;
import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse;
import com.fr.third.org.apache.http.client.methods.HttpGet; import com.fr.third.org.apache.http.client.methods.HttpGet;
import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; import com.fr.third.org.apache.http.impl.client.CloseableHttpClient;
@ -60,6 +54,7 @@ import java.util.Locale;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import static java.nio.charset.StandardCharsets.*; import static java.nio.charset.StandardCharsets.*;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
/** /**
* Created by XINZAI on 2018/8/21. * Created by XINZAI on 2018/8/21.
@ -590,8 +585,9 @@ public class UpdateMainDialog extends UIDialog {
updateButton.addActionListener(new ActionListener() { updateButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
backup(); String[] option = {Toolkit.i18nText("Fine-Design_Report_Yes"), Toolkit.i18nText("Fine-Design_Report_No")};
int a = JOptionPane.showConfirmDialog(getParent(), Toolkit.i18nText("Fine-Design_Update_Info_Information"),Toolkit.i18nText("Fine-Design_Update_Info_Title"), JOptionPane.OK_CANCEL_OPTION); int a = JOptionPane.showOptionDialog(getParent(), Toolkit.i18nText("Fine-Design_Update_Info_Information"),
Toolkit.i18nText("Fine-Design_Update_Info_Title"),JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, UIManager.getIcon("OptionPane.warningIcon"), option, 1);
if (a == 0) { if (a == 0) {
progressBar.setVisible(true); progressBar.setVisible(true);
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message"));
@ -601,14 +597,15 @@ public class UpdateMainDialog extends UIDialog {
new FileProcess(callBack) { new FileProcess(callBack) {
@Override @Override
public void onDownloadSuccess() { public void onDownloadSuccess() {
updateButton.setEnabled(true);
progressBar.setVisible(false); progressBar.setVisible(false);
deleteForDesignerUpdate();
RestartHelper.restart(); RestartHelper.restart();
} }
@Override @Override
public void onDownloadFailed() { public void onDownloadFailed() {
progressBar.setVisible(false); progressBar.setVisible(false);
JOptionPane.showMessageDialog(getParent(),Toolkit.i18nText("Fine-Design_Update_Info_Failed_Message")); deleteForDesignerUpdate();
JOptionPane.showMessageDialog(getParent(), Toolkit.i18nText("Fine-Design_Update_Info_Failed_Message"));
RestartHelper.restart(); RestartHelper.restart();
} }
}.execute(); }.execute();
@ -617,40 +614,11 @@ public class UpdateMainDialog extends UIDialog {
}); });
} }
/** private void deleteForDesignerUpdate() {
* Jar还原按钮兼容 File designerBackup = new File(StableUtils.pathJoin(StableUtils.getInstallHome(),UpdateConstants.DESIGNERBACKUPPATH));
*/ CommonUtils.deleteFile(designerBackup);
private void backup() { File downloadForDesigner = new File(StableUtils.pathJoin(StableUtils.getInstallHome(),UpdateConstants.DOWNLOADPATH));
String installHome = StableUtils.getInstallHome(); CommonUtils.deleteFile(downloadForDesigner);
//jar包备份文件的目录为"backup/"+jar包当前版本号
String todayBackupDir = StableUtils.pathJoin(installHome, getBackupDirectory(), (GeneralUtils.readBuildNO()));
backupFilesFromInstallEnv(installHome, todayBackupDir);
backupFilesFromInstallLib(installHome, todayBackupDir);
jarCurrentLabel.setText(downloadFileConfig.optString("buildNO"));
}
private void backupFilesFromInstallEnv(String installHome, String todayBackupDir) {
for (String file : UpdateConstants.JARS_FOR_SERVER_X) {
try {
IOUtils.copy(
new File(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)),
new File(StableUtils.pathJoin(todayBackupDir)));
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
}
}
private void backupFilesFromInstallLib(String installHome, String todayBackupDir) {
for (String file : UpdateConstants.JARS_FOR_DESIGNER_X) {
try {
IOUtils.copy(
new File(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file)),
new File(StableUtils.pathJoin(todayBackupDir)));
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
}
} }
//获取备份目录 //获取备份目录

37
designer-base/src/main/java/com/fr/design/upm/UpmFinder.java

@ -1,17 +1,16 @@
package com.fr.design.upm; package com.fr.design.upm;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoader;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.update.domain.UpdateConstants;
import com.fr.design.update.ui.dialog.UpdateMainDialog; import com.fr.design.update.ui.dialog.UpdateMainDialog;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent; import com.fr.workspace.WorkspaceEvent;
@ -56,25 +55,37 @@ public class UpmFinder {
} }
public static void showUPMDialog() { public static void showUPMDialog() {
boolean flag = false; boolean flag = true;
File file = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME)); try {
File[] files = file.listFiles(); Class.forName("com.teamdev.jxbrowser.chromium.Browser");
if (files != null) { } catch (ClassNotFoundException e) {
for (File file1 : files) { flag = false;
if (file1.getName().contains(UpdateConstants.JXBROWSER)) {
flag = true;
break;
} }
if (flag) {
if (!checkUPMResourcesExist()){
// upm下载
int val = JOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Need_Install"),
Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
if (val == JOptionPane.OK_OPTION){
try {
UpmResourceLoader.INSTANCE.download();
UpmResourceLoader.INSTANCE.install();
JOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE);
} catch (Exception e){
FineLoggerFactory.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Updater_Download_Failed"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE);
} }
}else {
FineLoggerFactory.getLogger().error("Designer lib can not be null");
} }
if (flag) { }
else {
UpmShowPane upmPane = new UpmShowPane(); UpmShowPane upmPane = new UpmShowPane();
if (dialog == null) { if (dialog == null) {
dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane); dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane);
} }
dialog.setVisible(true); dialog.setVisible(true);
}
} else { } else {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message"));
UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame());

37
designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java

@ -29,7 +29,8 @@ public class UpmShowPane extends BasicPane {
UpmShowPane() { UpmShowPane() {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
if (UpmFinder.checkUPMResourcesExist()) { // 先屏蔽掉这个判断,后续可能修改交互
// if (UpmFinder.checkUPMResourcesExist()) {
modernUIPane = new ModernUIPane.Builder<>() modernUIPane = new ModernUIPane.Builder<>()
.prepare(new ScriptContextAdapter() { .prepare(new ScriptContextAdapter() {
@Override @Override
@ -46,23 +47,23 @@ public class UpmShowPane extends BasicPane {
modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap());
} }
}); });
} else { // } else {
modernUIPane = new ModernUIPane.Builder<>() // modernUIPane = new ModernUIPane.Builder<>()
.withComponent(WarnComponent.KEY) // .withComponent(WarnComponent.KEY)
.prepare(new ScriptContextAdapter() { // .prepare(new ScriptContextAdapter() {
@Override // @Override
public void onScriptContextCreated(ScriptContextEvent event) { // public void onScriptContextCreated(ScriptContextEvent event) {
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); // JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window");
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); // window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser()));
} // }
}).build(); // }).build();
EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() { // EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() {
@Override // @Override
public void on(Event event, String param) { // public void on(Event event, String param) {
modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); // modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap());
} // }
}); // });
} // }
add(modernUIPane, BorderLayout.CENTER); add(modernUIPane, BorderLayout.CENTER);
} }
} }

19
designer-base/src/main/java/com/fr/design/utils/ImageUtils.java

@ -240,6 +240,7 @@ public class ImageUtils {
* @param opacityCompatible 是否处理背景透明 * @param opacityCompatible 是否处理背景透明
*/ */
public static BufferedImage scale(BufferedImage srcImg, float scale, boolean opacityCompatible) { public static BufferedImage scale(BufferedImage srcImg, float scale, boolean opacityCompatible) {
int scaleType;
if (scale < 0) { if (scale < 0) {
// 自动修正负数 // 自动修正负数
scale = -scale; scale = -scale;
@ -247,7 +248,15 @@ public class ImageUtils {
int width = mul(Integer.toString(srcImg.getWidth(null)), Float.toString(scale)).intValue(); // 得到源图宽 int width = mul(Integer.toString(srcImg.getWidth(null)), Float.toString(scale)).intValue(); // 得到源图宽
int height = mul(Integer.toString(srcImg.getHeight(null)), Float.toString(scale)).intValue(); // 得到源图长 int height = mul(Integer.toString(srcImg.getHeight(null)), Float.toString(scale)).intValue(); // 得到源图长
return CoreGraphHelper.toBufferedImage(scale(srcImg, width, height, opacityCompatible)); int srcHeight = srcImg.getHeight(null);
int srcWidth = srcImg.getWidth(null);
if (srcHeight < height || srcWidth < width) {
// 放大图片使用平滑模式
scaleType = Image.SCALE_SMOOTH;
} else {
scaleType = Image.SCALE_DEFAULT;
}
return CoreGraphHelper.toBufferedImage(scale(srcImg, width, height, opacityCompatible, scaleType));
} }
private static BigDecimal mul(String v1, String v2) { private static BigDecimal mul(String v1, String v2) {
@ -268,18 +277,12 @@ public class ImageUtils {
* @param opacityCompatible 是否处理背景透明 * @param opacityCompatible 是否处理背景透明
* @return {@link Image} * @return {@link Image}
*/ */
private static Image scale(BufferedImage srcImg, int width, int height, boolean opacityCompatible) { public static Image scale(BufferedImage srcImg, int width, int height, boolean opacityCompatible, int scaleType) {
int srcHeight = srcImg.getHeight(null); int srcHeight = srcImg.getHeight(null);
int srcWidth = srcImg.getWidth(null); int srcWidth = srcImg.getWidth(null);
int scaleType;
if (srcHeight == height && srcWidth == width) { if (srcHeight == height && srcWidth == width) {
// 源与目标长宽一致返回原图 // 源与目标长宽一致返回原图
return srcImg; return srcImg;
} else if (srcHeight < height || srcWidth < width) {
// 放大图片使用平滑模式
scaleType = Image.SCALE_SMOOTH;
} else {
scaleType = Image.SCALE_DEFAULT;
} }
if (opacityCompatible) {//需要保留透明度背景 if (opacityCompatible) {//需要保留透明度背景
BufferedImage toImg = CoreGraphHelper.createBufferedImage(width, height, srcImg.getType()); BufferedImage toImg = CoreGraphHelper.createBufferedImage(width, height, srcImg.getType());

13
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -16,12 +16,12 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
@ -39,6 +39,9 @@ import java.awt.event.FocusEvent;
import java.awt.event.FocusListener; import java.awt.event.FocusListener;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
/** /**
* carl自定义Icon编辑 * carl自定义Icon编辑
@ -452,13 +455,7 @@ public class CustomIconPane extends BasicPane {
String path = jf.getSelectedFile().getAbsolutePath(); String path = jf.getSelectedFile().getAbsolutePath();
// 图片存储有最大值48*48限制,没有超过最大值时,按原图大小存储,超过最大值后,压缩至最大值存储 // 图片存储有最大值48*48限制,没有超过最大值时,按原图大小存储,超过最大值后,压缩至最大值存储
Image image = BaseUtils.readImage(path); Image image = BaseUtils.readImage(path);
BufferedImage bufferedImage = CoreGraphHelper.createBufferedImage(Math.min(image.getWidth(null), IconManager.MAXSTORAGE_ICONWIDTH), iconImage = ImageUtils.scale((BufferedImage) image, Math.min(image.getWidth(null), IconManager.MAXSTORAGE_ICONWIDTH), Math.min(image.getHeight(null), IconManager.MAXSTORAGE_ICONHEIGHT), true, Image.SCALE_SMOOTH);
Math.min(image.getHeight(null), IconManager.MAXSTORAGE_ICONHEIGHT), BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = bufferedImage.createGraphics();
g2d.drawImage(image, 0, 0, Math.min(image.getWidth(null), IconManager.MAXSTORAGE_ICONWIDTH), Math.min(image.getHeight(null), IconManager.MAXSTORAGE_ICONHEIGHT), null);
bufferedImage.flush();
g2d.dispose();
iconImage = bufferedImage;
if (iconImage != null) { if (iconImage != null) {
showImageLabel.setIcon(new ImageIcon(iconImage)); showImageLabel.setIcon(new ImageIcon(iconImage));
} }

43
designer-base/src/main/java/com/fr/start/Demo.java

@ -1,46 +1,13 @@
package com.fr.start; package com.fr.start;
import com.fr.design.os.impl.DemoAction;
import com.fr.log.FineLoggerFactory; import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.OperatingSystem; import com.fr.stable.os.support.OSSupportCenter;
import com.fr.stable.StableUtils;
import java.io.IOException;
public class Demo { public class Demo {
public static void main(String[] args) { public static void main(String[] args) {
String installHome = StableUtils.getInstallHome(); OSBasedAction osBasedAction = OSSupportCenter.getAction(DemoAction.class);
if (installHome == null) { osBasedAction.execute();
FineLoggerFactory.getLogger().error("Can not find the install home, please check it.");
return;
}
String executorPath;
if (OperatingSystem.isMacOS()) {
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app");
} else {
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo");
}
if (OperatingSystem.isMacOS()) {
ProcessBuilder builder = new ProcessBuilder();
builder.command("open", "-a", executorPath, "--args", "demo");
try {
builder.start();
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else {
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
Runtime rt = Runtime.getRuntime();
try {
rt.exec(executorPath);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
System.exit(0); System.exit(0);
} }
} }

32
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -11,6 +11,18 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider; import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.type.ui.AreaChartTypeUI; import com.fr.design.type.ui.AreaChartTypeUI;
import com.fr.design.type.ui.BarChartTypeUI; import com.fr.design.type.ui.BarChartTypeUI;
import com.fr.design.type.ui.BubbleChartTypeUI; import com.fr.design.type.ui.BubbleChartTypeUI;
@ -28,18 +40,6 @@ import com.fr.design.type.ui.RadarChartTypeUI;
import com.fr.design.type.ui.RangeChartTypeUI; import com.fr.design.type.ui.RangeChartTypeUI;
import com.fr.design.type.ui.StockChartTypeUI; import com.fr.design.type.ui.StockChartTypeUI;
import com.fr.design.type.ui.XYScatterChartTypeUI; import com.fr.design.type.ui.XYScatterChartTypeUI;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.extended.chart.AbstractChart; import com.fr.extended.chart.AbstractChart;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -80,7 +80,7 @@ import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.area.AreaIndependentVanChartInterface; import com.fr.van.chart.area.AreaIndependentVanChartInterface;
import com.fr.van.chart.bar.BarIndependentVanChartInterface; import com.fr.van.chart.bar.BarIndependentVanChartInterface;
import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface;
import com.fr.van.chart.column.ColumnIndependentVanChartInterface; import com.fr.van.chart.column.VanColumnChartTypeUI;
import com.fr.van.chart.custom.CustomIndependentVanChartInterface; import com.fr.van.chart.custom.CustomIndependentVanChartInterface;
import com.fr.van.chart.drillmap.DrillMapIndependentVanChartInterface; import com.fr.van.chart.drillmap.DrillMapIndependentVanChartInterface;
import com.fr.van.chart.funnel.designer.FunnelIndependentVanChartInterface; import com.fr.van.chart.funnel.designer.FunnelIndependentVanChartInterface;
@ -93,7 +93,7 @@ import com.fr.van.chart.multilayer.MultiPieIndependentVanChartInterface;
import com.fr.van.chart.pie.PieIndependentVanChartInterface; import com.fr.van.chart.pie.PieIndependentVanChartInterface;
import com.fr.van.chart.radar.RadarIndependentVanChartInterface; import com.fr.van.chart.radar.RadarIndependentVanChartInterface;
import com.fr.van.chart.scatter.ScatterIndependentVanChartInterface; import com.fr.van.chart.scatter.ScatterIndependentVanChartInterface;
import com.fr.van.chart.structure.desinger.StructureIndependentVanChartInterface; import com.fr.van.chart.structure.desinger.VanStructureChartTypeUI;
import com.fr.van.chart.treemap.TreeMapIndependentVanChartInterface; import com.fr.van.chart.treemap.TreeMapIndependentVanChartInterface;
import com.fr.van.chart.wordcloud.designer.WordCloudIndependentVanChartInterface; import com.fr.van.chart.wordcloud.designer.WordCloudIndependentVanChartInterface;
@ -182,7 +182,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
private static void readVanChart() { private static void readVanChart() {
addChartTypeInterface(VAN_CHART_PRIORITY, PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new VanColumnChartTypeUI());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface());
@ -199,7 +199,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new StructureIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI());
} }

11
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java

@ -24,7 +24,6 @@ import java.util.List;
* 一列组件<T extends JComponent> 可增可删通过JComponent后面的加减button增删 * 一列组件<T extends JComponent> 可增可删通过JComponent后面的加减button增删
*/ */
public abstract class AbstractMultiComponentPane<T extends JComponent> extends JPanel { public abstract class AbstractMultiComponentPane<T extends JComponent> extends JPanel {
private static final int COM_W = 96;
private static final int H = 20; private static final int H = 20;
private static final int ICON_W = 20; private static final int ICON_W = 20;
@ -50,7 +49,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
firstFieldComponent = createFirstFieldComponent(); firstFieldComponent = createFirstFieldComponent();
firstFieldComponent.setPreferredSize(new Dimension(COM_W, H)); firstFieldComponent.setPreferredSize(new Dimension(componentWidth(), H));
addButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); addButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(ICON_W, H)); addButton.setPreferredSize(new Dimension(ICON_W, H));
@ -64,7 +63,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
}); });
final JPanel panel = new JPanel(); final JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2)); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 2));
panel.add(label); panel.add(label);
panel.add(firstFieldComponent); panel.add(firstFieldComponent);
@ -78,6 +77,10 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
this.add(boxPane, BorderLayout.CENTER); this.add(boxPane, BorderLayout.CENTER);
} }
protected int componentWidth() {
return 96;
}
private JPanel addComboBoxAndButtonToBox(T uiComboBox, UIButton uiButton) { private JPanel addComboBoxAndButtonToBox(T uiComboBox, UIButton uiButton) {
final JPanel panel = new JPanel(); final JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2)); panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
@ -93,7 +96,7 @@ public abstract class AbstractMultiComponentPane<T extends JComponent> extends J
private void addNewComboBox() { private void addNewComboBox() {
final T comboBox = createOtherFieldComponent(); final T comboBox = createOtherFieldComponent();
comboBox.setPreferredSize(new Dimension(COM_W, H)); comboBox.setPreferredSize(new Dimension(componentWidth(), H));
UIButton delButton = new UIButton(IOUtils.readIcon("com/fr/design/images/toolbarbtn/close.png")); UIButton delButton = new UIButton(IOUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
delButton.setPreferredSize(new Dimension(ICON_W, H)); delButton.setPreferredSize(new Dimension(ICON_W, H));

33
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java

@ -2,10 +2,12 @@ package com.fr.design.chartx.component;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chartx.data.field.DataFilterProperties; import com.fr.chartx.data.field.DataFilterProperties;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.data.PresentComboBox; import com.fr.design.mainframe.chart.gui.data.PresentComboBox;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
@ -22,7 +24,7 @@ import java.awt.Dimension;
/** /**
* Created by shine on 2019/07/18. * Created by shine on 2019/07/18.
*/ */
public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<DataFilterProperties> { public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<DataFilterProperties> implements UIObserver {
private static final int FIL_HEIGHT = 150; private static final int FIL_HEIGHT = 150;
@ -34,14 +36,12 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
private PresentComboBox present; private PresentComboBox present;
private AbstractAttrNoScrollPane parent;
private JPanel topPane; private JPanel topPane;
private UIObserverListener listener;
public AbstractSingleFilterPane() { public AbstractSingleFilterPane() {
super(true); super(true);
//todo@shinerefactor present的时候这边可以整理下
// this.parent = parent;
} }
@Override @Override
@ -72,13 +72,13 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
private JPanel initPane() { private JPanel initPane() {
useTopCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); useTopCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout()); JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout()); JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(useTopCheckBox, BorderLayout.NORTH); panel1.add(useTopCheckBox, BorderLayout.NORTH);
topNumTextField = new UITextField(); topNumTextField = new UITextField();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
mergeOtherCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); mergeOtherCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
mergeOtherCheckBox.setSelected(true); mergeOtherCheckBox.setSelected(true);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -94,7 +94,7 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
//默认不显示 //默认不显示
topPane.setVisible(false); topPane.setVisible(false);
panel1.add(topPane, BorderLayout.CENTER); panel1.add(topPane, BorderLayout.CENTER);
hideNullCheckBox = new UICheckBox(title4PopupWindow() + " is null, hidden"); hideNullCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Null_Hide", title4PopupWindow(), title4PopupWindow()));
panel2.add(hideNullCheckBox, BorderLayout.NORTH); panel2.add(hideNullCheckBox, BorderLayout.NORTH);
useTopCheckBox.addChangeListener(new ChangeListener() { useTopCheckBox.addChangeListener(new ChangeListener() {
@ -120,10 +120,19 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane<Data
return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row, column); return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row, column);
} }
@Override
public void registerChangeListener(UIObserverListener listener) {
this.listener = listener;
}
@Override
public boolean shouldResponseChangeListener() {
return true;
}
private void fire() { private void fire() {
if (this.parent != null) { if (this.listener != null) {
parent.attributeChanged(); listener.doChange();
} }
} }

98
designer-chart/src/main/java/com/fr/design/chartx/component/CategorySeriesFilterPane.java

@ -0,0 +1,98 @@
package com.fr.design.chartx.component;
import com.fr.chartx.data.field.ColumnField;
import com.fr.chartx.data.field.DataFilterProperties;
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
/**
* @author shine
* @version 10.0
* Created by shine on 2019/9/26
*/
public class CategorySeriesFilterPane extends JPanel {
private AbstractSingleFilterPane seriesFilterPane;
private AbstractSingleFilterPane categoryFilterPane;
public CategorySeriesFilterPane() {
seriesFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Series");
}
};
categoryFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Style_Category");
}
};
JPanel groupPane = new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
};
JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(new JPanel(), BorderLayout.NORTH);
contentPane.add(groupPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), contentPane), BorderLayout.CENTER);
}
public void populateMultiCategoryFieldCollection(MultiCategoryColumnFieldCollection fieldCollection) {
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
populateSeries(seriesValueCorrelationDefinition.getFilterProperties());
}
List<ColumnField> categoryList = fieldCollection.getCategoryList();
if (!categoryList.isEmpty()) {
populateCategory(categoryList.get(0).getFilterProperties());
}
}
public void updateMultiCategoryFieldCollection(MultiCategoryColumnFieldCollection fieldCollection) {
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition();
if (seriesValueCorrelationDefinition != null) {
seriesValueCorrelationDefinition.setFilterProperties(updateSeries());
}
List<ColumnField> categoryList = fieldCollection.getCategoryList();
if (!categoryList.isEmpty()) {
categoryList.get(0).setFilterProperties(updateCategory());
}
}
private void populateSeries(DataFilterProperties series) {
seriesFilterPane.populateBean(series);
}
private void populateCategory(DataFilterProperties category) {
categoryFilterPane.populateBean(category);
}
private DataFilterProperties updateSeries() {
return seriesFilterPane.updateBean();
}
private DataFilterProperties updateCategory() {
return categoryFilterPane.updateBean();
}
}

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

@ -8,6 +8,12 @@ import com.fr.design.formula.TinyFormulaPane;
* Created by shine on 2019/4/12. * Created by shine on 2019/4/12.
*/ */
public class MultiTinyFormulaPane extends AbstractMultiComponentPane<TinyFormulaPane> { public class MultiTinyFormulaPane extends AbstractMultiComponentPane<TinyFormulaPane> {
@Override
protected int componentWidth() {
return 116;
}
@Override @Override
protected TinyFormulaPane createFirstFieldComponent() { protected TinyFormulaPane createFirstFieldComponent() {
return new TinyFormulaPane(); return new TinyFormulaPane();

72
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java

@ -1,14 +1,14 @@
package com.fr.design.chartx.fields.diff; package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.ColumnField; import com.fr.chartx.data.field.ColumnField;
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.chartx.component.AbstractSingleFilterPane; import com.fr.design.chartx.component.CategorySeriesFilterPane;
import com.fr.design.chartx.component.MultiTinyFormulaPane; import com.fr.design.chartx.component.MultiTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List; import java.util.List;
/** /**
@ -18,43 +18,21 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
private MultiTinyFormulaPane multiCategoryPane; private MultiTinyFormulaPane multiCategoryPane;
private AbstractSingleFilterPane seriesFilterPane; private CategorySeriesFilterPane filterPane;
private AbstractSingleFilterPane categoryFilterPane;
private void createMultiFormulaPane() {
if (multiCategoryPane == null) {
multiCategoryPane = new MultiTinyFormulaPane();
}
}
@Override @Override
protected JPanel createNorthPane() { protected void initComponents() {
multiCategoryPane = new MultiTinyFormulaPane();
filterPane = new CategorySeriesFilterPane();
createMultiFormulaPane(); JPanel northPane = new JPanel(new BorderLayout(0, 6));
northPane.add(multiCategoryPane, BorderLayout.NORTH);
northPane.add(createCenterPane(), BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 8));
return multiCategoryPane; this.setLayout(new BorderLayout(0, 6));
} this.add(northPane, BorderLayout.NORTH);
this.add(filterPane, BorderLayout.CENTER);
@Override
protected JPanel createSouthPane() {
if (seriesFilterPane == null) {
seriesFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
//todo@shinerefactor
return "series";
}
};
categoryFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return "category";
}
};
}
return new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
};
} }
@Override @Override
@ -64,9 +42,6 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
@Override @Override
protected TinyFormulaPane[] formulaPanes() { protected TinyFormulaPane[] formulaPanes() {
createMultiFormulaPane();
List<TinyFormulaPane> list = multiCategoryPane.componentList(); List<TinyFormulaPane> list = multiCategoryPane.componentList();
return list.toArray(new TinyFormulaPane[list.size()]); return list.toArray(new TinyFormulaPane[list.size()]);
} }
@ -80,15 +55,7 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
populateSeriesValuePane(multiCategoryColumnFieldCollection); populateSeriesValuePane(multiCategoryColumnFieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = multiCategoryColumnFieldCollection.getSeriesValueCorrelationDefinition(); filterPane.populateMultiCategoryFieldCollection(multiCategoryColumnFieldCollection);
if (seriesValueCorrelationDefinition != null) {
seriesFilterPane.populateBean(seriesValueCorrelationDefinition.getFilterProperties());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryFilterPane.populateBean(categoryList.get(0).getFilterProperties());
}
} }
@Override @Override
@ -101,14 +68,7 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS
updateSeriesValuePane(fieldCollection); updateSeriesValuePane(fieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition(); filterPane.updateMultiCategoryFieldCollection(fieldCollection);
if (seriesValueCorrelationDefinition != null) {
seriesValueCorrelationDefinition.setFilterProperties(seriesFilterPane.updateBean());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryList.get(0).setFilterProperties(categoryFilterPane.updateBean());
}
return fieldCollection; return fieldCollection;
} }

79
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java

@ -1,14 +1,15 @@
package com.fr.design.chartx.fields.diff; package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.ColumnField; import com.fr.chartx.data.field.ColumnField;
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.chartx.component.AbstractSingleFilterPane; import com.fr.design.chartx.component.CategorySeriesFilterPane;
import com.fr.design.chartx.component.MultiComboBoxPane; import com.fr.design.chartx.component.MultiComboBoxPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.util.List; import java.util.List;
@ -19,52 +20,33 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
private MultiComboBoxPane multiCategoryPane; private MultiComboBoxPane multiCategoryPane;
private AbstractSingleFilterPane seriesFilterPane; private CategorySeriesFilterPane filterPane;
private AbstractSingleFilterPane categoryFilterPane;
@Override @Override
protected String[] fieldLabels() { protected void initComponents() {
return new String[0]; multiCategoryPane = new MultiComboBoxPane();
} filterPane = new CategorySeriesFilterPane();
@Override JPanel northPane = new JPanel(new BorderLayout(0, 6));
protected UIComboBox[] filedComboBoxes() { northPane.add(multiCategoryPane, BorderLayout.NORTH);
List<UIComboBox> list = initMultiCategoryPane().componentList(); northPane.add(new JSeparator(), BorderLayout.CENTER);
return list.toArray(new UIComboBox[list.size()]); northPane.add(createCenterPane(), BorderLayout.SOUTH);
} northPane.setBorder(BorderFactory.createEmptyBorder(4, 24, 0, 15));
private MultiComboBoxPane initMultiCategoryPane() { this.setLayout(new BorderLayout(0, 6));
if (multiCategoryPane == null) { this.add(northPane, BorderLayout.NORTH);
multiCategoryPane = new MultiComboBoxPane(); this.add(filterPane, BorderLayout.CENTER);
}
return multiCategoryPane;
} }
@Override @Override
protected JPanel createNorthPane() { protected String[] fieldLabels() {
return initMultiCategoryPane(); return new String[0];
} }
@Override @Override
protected JPanel createSouthPane() { protected UIComboBox[] filedComboBoxes() {
if (seriesFilterPane == null) { List<UIComboBox> list = multiCategoryPane.componentList();
seriesFilterPane = new AbstractSingleFilterPane() { return list.toArray(new UIComboBox[list.size()]);
@Override
public String title4PopupWindow() {
//todo@shinerefactor
return "series";
}
};
categoryFilterPane = new AbstractSingleFilterPane() {
@Override
public String title4PopupWindow() {
return "category";
}
};
}
return new VanChartGroupPane(new String[]{seriesFilterPane.title4PopupWindow(), categoryFilterPane.title4PopupWindow()}
, new JPanel[]{seriesFilterPane, categoryFilterPane}) {
};
} }
@Override @Override
@ -81,15 +63,7 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
populateSeriesValuePane(multiCategoryColumnFieldCollection); populateSeriesValuePane(multiCategoryColumnFieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = multiCategoryColumnFieldCollection.getSeriesValueCorrelationDefinition(); filterPane.populateMultiCategoryFieldCollection(multiCategoryColumnFieldCollection);
if (seriesValueCorrelationDefinition != null) {
seriesFilterPane.populateBean(seriesValueCorrelationDefinition.getFilterProperties());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryFilterPane.populateBean(categoryList.get(0).getFilterProperties());
}
} }
@Override @Override
@ -102,14 +76,7 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
updateSeriesValuePane(columnFieldCollection); updateSeriesValuePane(columnFieldCollection);
SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = columnFieldCollection.getSeriesValueCorrelationDefinition(); filterPane.updateMultiCategoryFieldCollection(columnFieldCollection);
if (seriesValueCorrelationDefinition != null) {
seriesValueCorrelationDefinition.setFilterProperties(seriesFilterPane.updateBean());
}
if (categoryList != null && !categoryList.isEmpty()) {
categoryList.get(0).setFilterProperties(categoryFilterPane.updateBean());
}
return columnFieldCollection; return columnFieldCollection;
} }

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

@ -59,7 +59,7 @@ public class StructureCellDataFieldsPane extends AbstractCellDataFieldsPane<Stru
nodeName, nodeName,
nodeId, nodeId,
parentId, parentId,
nodeValue, seriesName,
nodeValue, nodeValue,
}; };
} }

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

@ -63,7 +63,7 @@ public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane<Struct
nodeName, nodeName,
nodeId, nodeId,
parentId, parentId,
nodeValue, seriesName,
nodeValue, nodeValue,
calculateCombox calculateCombox
}; };

7
designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java

@ -15,15 +15,15 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
private static final long serialVersionUID = 5497989595104913025L; private static final long serialVersionUID = 5497989595104913025L;
public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot){ public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot); super(parent, plot);
} }
protected JPanel getContentInPlotType(){ protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p}; double[] row = {p, p, p, p, p, p, p};
double[] col = {f}; double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -32,7 +32,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
new Component[]{createMarkerPane()}, new Component[]{createMarkerPane()},
new Component[]{createAreaFillColorPane()}, new Component[]{createAreaFillColorPane()},
new Component[]{createStackedAndAxisPane()}, new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()}, new Component[]{createTrendLinePane()},
}; };

27
designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java

@ -1,5 +1,6 @@
package com.fr.van.chart.bar; package com.fr.van.chart.bar;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
@ -10,7 +11,9 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.column.VanChartColumnConditionPane; import com.fr.van.chart.column.VanChartColumnConditionPane;
import com.fr.van.chart.column.VanChartColumnSeriesPane; import com.fr.van.chart.column.VanChartColumnSeriesPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI; import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -57,21 +60,37 @@ public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanCha
return new VanChartBarPlotPane(); return new VanChartBarPlotPane();
} }
public ConditionAttributesPane getPlotConditionPane(Plot plot){ public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartColumnConditionPane(plot); return new VanChartColumnConditionPane(plot);
} }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartColumnSeriesPane(parent, plot); return new VanChartColumnSeriesPane(parent, plot);
} }
/** /**
* 图表的属性界面数组 * 图表的属性界面数组
*
* @return 属性界面 * @return 属性界面
*/ */
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBarStylePane(listener); VanChartStylePane stylePane = new VanChartBarStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(); VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePane() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane}; return new AbstractChartAttrPane[]{stylePane, otherPane};
} }

32
designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java

@ -15,7 +15,9 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane; import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
@ -63,22 +65,23 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
public String getIconPath() { public String getIconPath() {
return "com/fr/design/images/form/toolbar/bubble.png"; return "com/fr/design/images/form/toolbar/bubble.png";
} }
@Override @Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartBubbleSeriesPane(parent, plot); return new VanChartBubbleSeriesPane(parent, plot);
} }
@Override @Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
if(((VanChartBubblePlot) plot).isForceBubble()){ if (((VanChartBubblePlot) plot).isForceBubble()) {
return super.getTableDataSourcePane(plot, parent); return super.getTableDataSourcePane(plot, parent);
} }
return new VanChartBubblePlotTableDataContentPane(parent); return new VanChartBubblePlotTableDataContentPane(parent);
} }
@Override @Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
if(((VanChartBubblePlot) plot).isForceBubble()){ if (((VanChartBubblePlot) plot).isForceBubble()) {
return super.getReportDataSourcePane(plot, parent); return super.getReportDataSourcePane(plot, parent);
} }
return new BubblePlotReportDataContentPane(parent); return new BubblePlotReportDataContentPane(parent);
@ -86,19 +89,30 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
/** /**
* 图表的属性界面数组 * 图表的属性界面数组
*
* @return 属性界面 * @return 属性界面
*/ */
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBubbleStylePane(listener); VanChartStylePane stylePane = new VanChartBubbleStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){ VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() { protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartBubbleInteractivePane(); return new VanChartInteractivePaneWithOutSort() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
} }
}; };
return new AbstractChartAttrPane[]{stylePane, otherPane}; return new AbstractChartAttrPane[]{stylePane, otherPane};
} }
public ConditionAttributesPane getPlotConditionPane(Plot plot){ public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartBubbleConditionPane(plot); return new VanChartBubbleConditionPane(plot);
} }
} }

29
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleInteractivePane.java

@ -1,29 +0,0 @@
package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOutSort {
protected String[] getNameArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
return super.getNameArray();
}
protected String[] getValueArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
return super.getValueArray();
}
}

5
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java

@ -6,9 +6,9 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChart; import com.fr.plugin.chart.bubble.BubbleIndependentVanChart;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
@ -116,8 +116,7 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
*/ */
@Override @Override
protected void resetChartAttr4SamePlot(Chart chart){ protected void resetChartAttr4SamePlot(Chart chart){
VanChartZoom vanChartZoom = new VanChartZoom(); ((VanChart) chart).setZoomAttribute(new ZoomAttribute());
((VanChart)chart).setVanChartZoom(vanChartZoom);
//重置监控刷新选项 //重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart); resetRefreshMoreLabelAttr((VanChart)chart);
} }

24
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java

@ -6,8 +6,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble; import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.van.chart.bubble.component.VanChartBubblePane; import com.fr.van.chart.bubble.component.VanChartBubblePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane; import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
@ -44,31 +42,27 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{null} new Component[]{null}
}; };
if (!((VanChartBubblePlot)plot).isForceBubble()) {
components[3] = new Component[]{createLargeDataModelPane()};
}
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane; return contentPane;
} }
//设置色彩面板内容 //设置色彩面板内容
@Override @Override
protected void setColorPaneContent (JPanel panel) { protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.CENTER); panel.add(createAlphaPane(), BorderLayout.CENTER);
} }
@Override @Override
//堆积和坐标轴设置(自定义柱形图等用到) //堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() { protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(){ stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane() {
@Override @Override
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() { protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomAxisConditionPane.class; return VanChartCustomAxisConditionPane.class;
} }
@Override @Override
public String getPaneTitle(){ public String getPaneTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
} }
}; };
@ -81,18 +75,18 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane);
} }
protected void populateCondition(ConditionAttr defaultAttr){ protected void populateCondition(ConditionAttr defaultAttr) {
super.populateCondition(defaultAttr); super.populateCondition(defaultAttr);
if(bubblePane != null) { if (bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class); VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble); bubblePane.populateBean(attrBubble);
} }
} }
protected void updateCondition(ConditionAttr defaultAttr){ protected void updateCondition(ConditionAttr defaultAttr) {
super.updateCondition(defaultAttr); super.updateCondition(defaultAttr);
if(bubblePane != null){ if (bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class); VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
if (attrBubble != null) { if (attrBubble != null) {
defaultAttr.remove(attrBubble); defaultAttr.remove(attrBubble);
} }

26
designer-chart/src/main/java/com/fr/van/chart/column/ColumnIndependentVanChartInterface.java → designer-chart/src/main/java/com/fr/van/chart/column/VanColumnChartTypeUI.java

@ -2,8 +2,14 @@ package com.fr.van.chart.column;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI; import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
@ -11,7 +17,7 @@ import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI;
/** /**
* Created by Mitisky on 15/9/24. * Created by Mitisky on 15/9/24.
*/ */
public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { public class VanColumnChartTypeUI extends AbstractMultiCategoryVanChartUI {
@Override @Override
public String getName() { public String getName() {
@ -60,13 +66,13 @@ public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVan
return new VanChartColumnSeriesPane(parent, plot); return new VanChartColumnSeriesPane(parent, plot);
} }
// @Override @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) { public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractDataPane(listener) { return new AbstractVanSingleDataPane(listener) {
// @Override @Override
// protected SingleDataPane createSingleDataPane() { protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane());
// } }
// }; };
// } }
} }

101
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -7,7 +7,6 @@ import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.style.FormatPane; import com.fr.design.gui.style.FormatPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.column.VanChartColumnPlot;
@ -86,14 +85,15 @@ public class PlotFactory {
autoAdjustLabelPlots.add(VanChartStructurePlot.class); autoAdjustLabelPlots.add(VanChartStructurePlot.class);
} }
public static boolean plotAutoAdjustLabelPosition(Plot plot){ public static boolean plotAutoAdjustLabelPosition(Plot plot) {
return autoAdjustLabelPlots.contains(plot.getClass()); return autoAdjustLabelPlots.contains(plot.getClass());
} }
/** /**
*
* 标签Map * 标签Map
*/ */
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>> labelMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>>(); private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>> labelMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>>();
static { static {
labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class);
labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class); labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class);
@ -104,6 +104,7 @@ public class PlotFactory {
* 图例Map * 图例Map
*/ */
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>> legendMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>>(); private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>> legendMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>>();
static { static {
legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class); legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class);
legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class); legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class);
@ -119,6 +120,7 @@ public class PlotFactory {
* 数据点提示Map * 数据点提示Map
*/ */
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> toolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>(); private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> toolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>();
static { static {
toolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotTooltipPane.class); toolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotTooltipPane.class);
toolTipMap.put(VanChartScatterPlot.class, VanChartScatterPlotTooltipPane.class); toolTipMap.put(VanChartScatterPlot.class, VanChartScatterPlotTooltipPane.class);
@ -156,18 +158,19 @@ public class PlotFactory {
} }
/** /**
* 监控刷新 自动数据点提示Map * 监控刷新 自动数据点提示Map
*/ */
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> refreshToolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>(); private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> refreshToolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>();
static { static {
refreshToolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotRefreshTooltipPane.class); refreshToolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotRefreshTooltipPane.class);
refreshToolTipMap.put(VanChartBubblePlot.class, VanChartBubbleRefreshTooltipPane.class); refreshToolTipMap.put(VanChartBubblePlot.class, VanChartBubbleRefreshTooltipPane.class);
} }
private static Map<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>> refreshTooltipContentMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>>(); private static Map<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>> refreshTooltipContentMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>>();
static { static {
@ -186,18 +189,19 @@ public class PlotFactory {
/** /**
* 根据图表类型创建标签界面 * 根据图表类型创建标签界面
*
* @param plot 图表 * @param plot 图表
* @param stylePane 样式界面 * @param stylePane 样式界面
* @return 标签界面 * @return 标签界面
*/ */
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane) { public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(labelMap.containsKey(key)){ if (labelMap.containsKey(key)) {
try{ try {
Class<? extends VanChartPlotLabelPane> cl = labelMap.get(key); Class<? extends VanChartPlotLabelPane> cl = labelMap.get(key);
Constructor<? extends VanChartPlotLabelPane > constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); Constructor<? extends VanChartPlotLabelPane> constructor = cl.getConstructor(Plot.class, VanChartStylePane.class);
return constructor.newInstance(plot, stylePane); return constructor.newInstance(plot, stylePane);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
@ -206,18 +210,19 @@ public class PlotFactory {
/** /**
* 根据图表类型创建图例界面 * 根据图表类型创建图例界面
*
* @param plot 图表 * @param plot 图表
* @param stylePane 样式界面 * @param stylePane 样式界面
* @return 图例界面 * @return 图例界面
*/ */
public static VanChartPlotLegendPane createPlotLegendPane(Plot plot, VanChartStylePane stylePane) { public static VanChartPlotLegendPane createPlotLegendPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(legendMap.containsKey(key)){ if (legendMap.containsKey(key)) {
try{ try {
Class<? extends VanChartPlotLegendPane> cl = legendMap.get(key); Class<? extends VanChartPlotLegendPane> cl = legendMap.get(key);
Constructor<? extends VanChartPlotLegendPane > constructor = cl.getConstructor(VanChartStylePane.class); Constructor<? extends VanChartPlotLegendPane> constructor = cl.getConstructor(VanChartStylePane.class);
return constructor.newInstance(stylePane); return constructor.newInstance(stylePane);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
@ -226,18 +231,19 @@ public class PlotFactory {
/** /**
* 根据图表类型创建数据点提示界面 * 根据图表类型创建数据点提示界面
*
* @param plot 图表 * @param plot 图表
* @param stylePane 样式界面 * @param stylePane 样式界面
* @return 数据点提示界面 * @return 数据点提示界面
*/ */
public static VanChartPlotTooltipPane createPlotTooltipPane(Plot plot, VanChartStylePane stylePane) { public static VanChartPlotTooltipPane createPlotTooltipPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(toolTipMap.containsKey(key)){ if (toolTipMap.containsKey(key)) {
try{ try {
Class<? extends VanChartPlotTooltipPane> cl = toolTipMap.get(key); Class<? extends VanChartPlotTooltipPane> cl = toolTipMap.get(key);
Constructor<? extends VanChartPlotTooltipPane > constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); Constructor<? extends VanChartPlotTooltipPane> constructor = cl.getConstructor(Plot.class, VanChartStylePane.class);
return constructor.newInstance(plot, stylePane); return constructor.newInstance(plot, stylePane);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
@ -246,19 +252,20 @@ public class PlotFactory {
/** /**
* 根据图表类型创建标签的具体内容界面.分类名系列名等 * 根据图表类型创建标签的具体内容界面.分类名系列名等
*
* @param plot 图表 * @param plot 图表
* @param parent 样式界面 * @param parent 样式界面
* @param showOnPane formatpane用到 * @param showOnPane formatpane用到
* @return 标签的具体内容界面 * @return 标签的具体内容界面
*/ */
public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){ public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(labelContentMap.containsKey(key)){ if (labelContentMap.containsKey(key)) {
try{ try {
Class<? extends VanChartTooltipContentPane> cl = labelContentMap.get(key); Class<? extends VanChartTooltipContentPane> cl = labelContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane > constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane); return constructor.newInstance(parent, showOnPane);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
@ -267,19 +274,20 @@ public class PlotFactory {
/** /**
* 根据图表类型创建数据点提示的具体内容界面.分类名系列名等 * 根据图表类型创建数据点提示的具体内容界面.分类名系列名等
*
* @param plot 图表 * @param plot 图表
* @param parent 样式界面 * @param parent 样式界面
* @param showOnPane formatpane用到 * @param showOnPane formatpane用到
* @return 数据点提示的具体内容界面 * @return 数据点提示的具体内容界面
*/ */
public static VanChartTooltipContentPane createPlotTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){ public static VanChartTooltipContentPane createPlotTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(tooltipContentMap.containsKey(key)){ if (tooltipContentMap.containsKey(key)) {
try{ try {
Class<? extends VanChartTooltipContentPane> cl = tooltipContentMap.get(key); Class<? extends VanChartTooltipContentPane> cl = tooltipContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane > constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane); return constructor.newInstance(parent, showOnPane);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
@ -287,56 +295,59 @@ public class PlotFactory {
} }
/** /**
* 根据图表类型创建数据点提示界面 * 根据图表类型创建数据点提示界面
*
* @param plot 图表 * @param plot 图表
* @return 数据点提示界面 * @return 数据点提示界面
*/ */
public static VanChartPlotTooltipPane createPlotRefreshTooltipPane(Plot plot) { public static VanChartPlotTooltipPane createPlotRefreshTooltipPane(Plot plot) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(refreshToolTipMap.containsKey(key)){ if (refreshToolTipMap.containsKey(key)) {
try{ try {
Class<? extends VanChartPlotTooltipPane> cl = refreshToolTipMap.get(key); Class<? extends VanChartPlotTooltipPane> cl = refreshToolTipMap.get(key);
Constructor<? extends VanChartPlotTooltipPane > constructor = cl.getConstructor(Plot.class); Constructor<? extends VanChartPlotTooltipPane> constructor = cl.getConstructor(Plot.class);
return constructor.newInstance(plot); return constructor.newInstance(plot);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
return new VanChartPlotRefreshTooltipPane(plot); return new VanChartPlotRefreshTooltipPane(plot);
} }
/** /**
* 根据图表类型创建监控刷新中数据点提示的具体内容界面.分类名系列名等 * 根据图表类型创建监控刷新中数据点提示的具体内容界面.分类名系列名等
*
* @param plot 图表 * @param plot 图表
* @param parent 交互属性界面 * @param parent 交互属性界面
* @param showOnPane formatpane用到 * @param showOnPane formatpane用到
* @return 数据点提示的具体内容界面 * @return 数据点提示的具体内容界面
*/ */
public static VanChartTooltipContentPane createPlotRefreshTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){ public static VanChartTooltipContentPane createPlotRefreshTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) {
Class<? extends Plot> key = plot.getClass(); Class<? extends Plot> key = plot.getClass();
if(refreshTooltipContentMap.containsKey(key)){ if (refreshTooltipContentMap.containsKey(key)) {
try{ try {
Class<? extends VanChartTooltipContentPane> cl = refreshTooltipContentMap.get(key); Class<? extends VanChartTooltipContentPane> cl = refreshTooltipContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane > constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane); return constructor.newInstance(parent, showOnPane);
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
return new VanChartRefreshTooltipContentPane(parent, showOnPane); return new VanChartRefreshTooltipContentPane(parent, showOnPane);
} }
public static FormatPane createAutoFormatPane(){ public static FormatPane createAutoFormatPane() {
FormatPane formatPane = new FormatPane(){ FormatPane formatPane = new FormatPane() {
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane) {
typePane.setBorder(BorderFactory.createEmptyBorder()); typePane.setBorder(BorderFactory.createEmptyBorder());
return new Component[][]{ return new Component[][]{
new Component[]{typePane,null}, new Component[]{typePane, null},
new Component[]{centerPane, null}, new Component[]{centerPane, null},
}; };
} }
protected UIComboBoxRenderer createComBoxRender(){
protected UIComboBoxRenderer createComBoxRender() {
return new UIComboBoxRenderer() { return new UIComboBoxRenderer() {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@ -361,12 +372,8 @@ public class PlotFactory {
/** /**
* 判断是否为大数据模式 * 判断是否为大数据模式
*/ */
public static boolean largeDataModel(Plot plot){ public static boolean largeDataModel(Plot plot) {
return plot != null && plot.getDataProcessor().getMark() == LargeDataModel.MARK; return plot != null && plot.convertDataProcessor().getMark() == LargeDataModel.MARK;
}
public static boolean lineMapLargeModel(Plot plot){
return plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getLineMapDataProcessor().getMark() == LargeDataModel.MARK;
} }
} }

85
designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java

@ -0,0 +1,85 @@
package com.fr.van.chart.designer.component;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.i18n.Toolkit;
import com.fr.general.FRFont;
import com.fr.plugin.chart.type.LineType;
import com.fr.stable.Constants;
import javax.swing.JLabel;
import javax.swing.JList;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
* Created by shine on 2019/08/30.
*/
public class LineTypeComboBox extends UIComboBox {
public LineTypeComboBox(LineType[] lineType) {
super(lineType);
this.setRenderer(new CellRenderer());
}
private static class CellRenderer extends UIComboBoxRenderer {
private LineType lineType;
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel comp = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
this.lineType = (LineType) value;
comp.setText(null);
return comp;
}
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2d = (Graphics2D) g;
Dimension d = getSize();
g2d.setColor(getForeground());
switch (this.lineType) {
case NONE:
FRFont font = FRContext.getDefaultValues().getFRFont();
int resolution = ScreenResolution.getScreenResolution();
Font rfont = font.applyResolutionNP(resolution);
g2d.setFont(rfont);
FontMetrics fm = GraphHelper.getFontMetrics(rfont);
GraphHelper.drawString(g2d, Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2 + fm.getAscent());
break;
case NORMAL:
GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2);
break;
case DASH:
GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2, Constants.LINE_DASH);
break;
default:
break;
}
}
public Dimension getPreferredSize() {
return new Dimension(60, 16);
}
public Dimension getMinimumSize() {
return getPreferredSize();
}
}
}

127
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -2,21 +2,24 @@ package com.fr.van.chart.designer.component;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle; import com.fr.plugin.chart.type.LineStyle;
import com.fr.stable.Constants; import com.fr.plugin.chart.type.LineType;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
/** /**
* line相关设置 * line相关设置
@ -24,64 +27,121 @@ import java.awt.Component;
public class VanChartLineTypePane extends BasicPane { public class VanChartLineTypePane extends BasicPane {
private static final long serialVersionUID = -6581862503009962973L; private static final long serialVersionUID = -6581862503009962973L;
protected LineComboBox lineWidth;//线型 private LineTypeComboBox lineTypeComboBox;//线型
private UISpinner lineWidthSpinner;//线宽
protected UIButtonGroup<LineStyle> lineStyle;//形态 protected UIButtonGroup<LineStyle> lineStyle;//形态
protected UIButtonGroup nullValueBreak;//空值断开 private UIButtonGroup nullValueBreak;//空值断开
private JPanel lineWidthPane;
public VanChartLineTypePane() { public VanChartLineTypePane() {
lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
JPanel typeAndWidthPane = createTypeAndWidthPane();
createLineStyle(); createLineStyle();
nullValueBreak = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); nullValueBreak = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")});
lineTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLineWidth();
}
});
this.setLayout(new BorderLayout());
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
this.add(createContentPane(p, f), BorderLayout.CENTER); double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
Component[] lineStyleComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
nullValueBreakComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak};
Component[][] components = createContentComponent(lineStyleComponent, nullValueBreakComponent);
double[] row = new double[components.length];
Arrays.fill(row, p);
double[] col = {f, e};
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout(0, 6));
this.add(typeAndWidthPane, BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER);
}
private JPanel createTypeAndWidthPane() {
lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
lineTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLineWidth();
}
});
Component[][] lineTypeComps = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox}
};
Component[][] lineWidthComps = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)}
};
double p = TableLayout.PREFERRED, f = TableLayout.FILL, e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p}, col = {f, e};
JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, row, col);
lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, row, col);
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
contentPane.add(lineTypePane, BorderLayout.CENTER);
contentPane.add(lineWidthPane, BorderLayout.SOUTH);
return contentPane;
} }
protected void createLineStyle() { protected void createLineStyle() {
String[] textArray = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), String[] textArray = new String[]{Toolkit.i18nText("Fine-Design_Chart_Normal_Line"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_StepLine"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; Toolkit.i18nText("Fine-Design_Chart_StepLine"), Toolkit.i18nText("Fine-Design_Chart_CurveLine")};
lineStyle = new UIButtonGroup<LineStyle>(textArray, LineStyle.values()); lineStyle = new UIButtonGroup<LineStyle>(textArray, LineStyle.values());
} }
protected JPanel createContentPane(double p, double f) { protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
double[] row = {p, p, p, p}; return new Component[][]{
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; lineStyleComponent,
double[] col = {f, e}; nullValueBreakComponent
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidth)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")),lineStyle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")),nullValueBreak},
}; };
}
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); private void checkLineWidth() {
if (lineWidthPane != null && lineTypeComboBox != null) {
lineWidthPane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(), LineType.NONE));
}
} }
public void checkLarge(boolean large){ public void checkLarge(boolean large) {
if(large){ if (large) {
lineWidth.setSelectedLineStyle(Constants.LINE_NONE); lineTypeComboBox.setSelectedItem(LineType.NONE);
} }
lineWidth.setEnabled(!large); lineTypeComboBox.setEnabled(!large);
lineStyle.setEnabled(!large); lineStyle.setEnabled(!large);
} }
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line"); return Toolkit.i18nText("Fine-Design_Chart_Line");
} }
public void populate(VanChartAttrLine line) { public void populate(VanChartAttrLine line) {
if (line == null) { if (line == null) {
line = initVanChartAttrLine(); line = initVanChartAttrLine();
} }
lineWidth.setSelectedLineStyle(line.getLineWidth()); lineTypeComboBox.setSelectedItem(line.getLineType());
lineWidthSpinner.setValue(line.getLineWidth());
lineStyle.setSelectedItem(line.getLineStyle()); lineStyle.setSelectedItem(line.getLineStyle());
nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1); nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1);
} }
@ -92,7 +152,8 @@ public class VanChartLineTypePane extends BasicPane {
public VanChartAttrLine update() { public VanChartAttrLine update() {
VanChartAttrLine line = new VanChartAttrLine(); VanChartAttrLine line = new VanChartAttrLine();
line.setLineWidth(lineWidth.getSelectedLineStyle()); line.setLineType((LineType) lineTypeComboBox.getSelectedItem());
line.setLineWidth(lineWidthSpinner.getValue());
line.setLineStyle(lineStyle.getSelectedItem()); line.setLineStyle(lineStyle.getSelectedItem());
line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0); line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0);
return line; return line;

23
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java

@ -1,30 +1,17 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.Component; import java.awt.Component;
/** /**
* 线-线型 * 线型+线宽+空值断开
*/ */
public class VanChartLineWidthPane extends VanChartLineTypePane { public class VanChartLineWidthPane extends VanChartLineTypePane {
private static final long serialVersionUID = 4537158946119294689L; private static final long serialVersionUID = 4537158946119294689L;
protected JPanel createContentPane(double p, double f) { @Override
double[] row = {p, p, p}; protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; return new Component[][]{
double[] col = {f, e}; nullValueBreakComponent
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak},
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col);
} }
} }

352
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -1,36 +1,39 @@
package com.fr.van.chart.designer.other; package com.fr.van.chart.designer.other;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.formula.TinyFormulaPane; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.LargeDataAttribute;
import com.fr.chartx.attr.LargeDataModeType;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.axis.type.AxisPlotType; import com.fr.plugin.chart.axis.type.AxisPlotType;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom; import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.StableUtils;
import com.fr.van.chart.custom.component.VanChartHyperLinkPane; import com.fr.van.chart.custom.component.VanChartHyperLinkPane;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -46,6 +49,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected UICheckBox fullScreenDisplay; protected UICheckBox fullScreenDisplay;
protected UIToggleButton collapse; protected UIToggleButton collapse;
protected VanChart chart;
private UIComboBox largeDataMode;
private UISpinner largeModeThresholdNumber;
protected UIButtonGroup isChartAnimation; protected UIButtonGroup isChartAnimation;
//坐标轴翻转属性 //坐标轴翻转属性
@ -53,22 +60,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private AutoRefreshPane autoRefreshPane; private AutoRefreshPane autoRefreshPane;
private UIButtonGroup zoomWidget; private ZoomPane zoomPane;
protected UIButtonGroup zoomGesture;//地图手势缩放
private UIButtonGroup zoomResize;
private TinyFormulaPane from;
private TinyFormulaPane to;
private UIButtonGroup<String> zoomType;
private JPanel changeEnablePane;
private JPanel zoomTypePane;
protected VanChartHyperLinkPane superLink; protected VanChartHyperLinkPane superLink;
private JPanel largeModeThresholdNumberPane;
protected Chart chart;
protected JPanel interactivePane; protected JPanel interactivePane;
/** /**
* 界面标题. * 界面标题.
*
* @return 返回标题. * @return 返回标题.
*/ */
@ -82,7 +82,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return new JPanel(); return new JPanel();
} }
private void reLayoutContentPane(VanChartPlot plot){ private void reLayoutContentPane(VanChartPlot plot) {
if (interactivePane != null) { if (interactivePane != null) {
interactivePane.removeAll(); interactivePane.removeAll();
} }
@ -90,121 +90,93 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
reloaPane(interactivePane); reloaPane(interactivePane);
} }
protected JPanel getInteractivePane(VanChartPlot plot){ protected JPanel getInteractivePane(VanChartPlot plot) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p,p,p,p,p,p}; double[] rowSize = {p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize),null}, new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null},
new Component[]{createAnimationPane(),null}, new Component[]{createLargeDataModePane(), null},
new Component[]{createAxisRotationPane(new double[]{p,p}, columnSize, plot),null}, new Component[]{createAnimationPane(), null},
new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null}, new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null},
new Component[]{createAutoRefreshPane(plot),null}, new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null},
new Component[]{createHyperlinkPane(),null} new Component[]{createAutoRefreshPane(plot), null},
new Component[]{createHyperlinkPane(), null}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) { private JPanel createLargeDataModePane() {
if (!plot.isSupportZoomDirection()) { if (!isCurrentChartSupportLargeDataMode()) {
return null; return null;
} }
zoomWidget = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD});
zoomResize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Change"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Non_Adjustment")}); largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber());
from = new TinyFormulaPane();
to = new TinyFormulaPane();
zoomType = new UIButtonGroup(getNameArray(), getValueArray());
zoomGesture = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget"), zoomWidget);
JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ZoomGesture"), zoomGesture);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Boundary")), zoomResize},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_From")), from},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_To")), to},
};
double f = TableLayout.FILL; largeDataMode.addActionListener(new ActionListener() {
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
changeEnablePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
changeEnablePane.setBorder(BorderFactory.createEmptyBorder(10,12,0,0));
zoomTypePane = getzoomTypePane(zoomType);
JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, changeEnablePane, zoomTypePane, plot);
zoomWidget.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkZoomPane(); checkLargeDataMode();
} }
}); });
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel);
} Component[][] comps1 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), largeDataMode}
};
Component[][] comps2 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Threshold_Number")), largeModeThresholdNumber}
};
double[] row = {TableLayout.PREFERRED}, col = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
protected JPanel getzoomTypePane(UIButtonGroup zoomType) { JPanel contentPane = new JPanel(new BorderLayout(0, 6));
return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType);
contentPane.add(TableLayout4VanChartHelper.createGapTableLayoutPane(comps1, row, col), BorderLayout.CENTER);
largeModeThresholdNumberPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps2, row, col);
contentPane.add(largeModeThresholdNumberPane, BorderLayout.SOUTH);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), contentPane);
}
protected boolean isCurrentChartSupportLargeDataMode() {
return false;
} }
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) { protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) {
JPanel panel = new JPanel(new BorderLayout(0, 4)); zoomPane = createZoomPane();
if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件 if (zoomPane == null) {
panel.add(zoomWidgetPane, BorderLayout.NORTH); return null;
panel.add(changeEnablePane, BorderLayout.CENTER);
} }
panel.add(zoomTypePane, BorderLayout.SOUTH); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane);
return panel; }
protected ZoomPane createZoomPane() {
return null;
} }
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot){ private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) {
if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)){ if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)) {
return null; return null;
} }
axisRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), axisRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
axisRotation.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkZoomEnabled();
}
});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,null}, new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")),axisRotation} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation}
}; };
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel);
} }
private void checkZoomEnabled() {
if (zoomWidget != null && axisRotation != null) {
if (axisRotation.getSelectedIndex() == 0) {
//只有开启坐标轴翻转,才需要将缩放控件强制关闭。
zoomWidget.setSelectedIndex(1);
}
checkZoomPane();
zoomWidget.setEnabled(axisRotation.getSelectedIndex() == 1);
}
}
protected String[] getNameArray() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_X_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Y_Axis")
,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_X, VanChartConstants.ZOOM_TYPE_Y
,VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
} protected JPanel createToolBarPane(double[] row, double[] col) {
protected JPanel createToolBarPane(double[] row, double[] col){
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort")); isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort"));
exportImages = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Export_Image")); exportImages = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Export_Image"));
fullScreenDisplay = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_FullScreen_Display")); fullScreenDisplay = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_FullScreen_Display"));
@ -216,17 +188,17 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel);
} }
protected double[] getToolBarRowSize () { protected double[] getToolBarRowSize() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
return new double[]{p,p,p,p,p}; return new double[]{p, p, p, p, p};
} }
protected Component[][] createToolBarComponents() { protected Component[][] createToolBarComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")),isSort}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort},
new Component[]{null, exportImages}, new Component[]{null, exportImages},
new Component[]{null, fullScreenDisplay}, new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),collapse}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse},
}; };
} }
@ -234,18 +206,18 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return new Component[][]{ return new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), exportImages}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), exportImages},
new Component[]{null, fullScreenDisplay}, new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),collapse} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse}
}; };
} }
protected JPanel createAnimationPane(){ protected JPanel createAnimationPane() {
isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"), isChartAnimation); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"), isChartAnimation);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel);
} }
protected JPanel createAutoRefreshPane(VanChartPlot plot){ protected JPanel createAutoRefreshPane(VanChartPlot plot) {
autoRefreshPane = getMoreLabelPane(plot); autoRefreshPane = getMoreLabelPane(plot);
@ -254,7 +226,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
boolean isLargeModel = largeModel(plot); boolean isLargeModel = largeModel(plot);
return new AutoRefreshPane((VanChart) chart, isLargeModel); return new AutoRefreshPane(chart, isLargeModel);
} }
protected JPanel createHyperlinkPane() { protected JPanel createHyperlinkPane() {
@ -262,11 +234,42 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink);
} }
private void checkLargeDataMode() {
largeModeThresholdNumberPane.setVisible(largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD);
resetAttr();
}
private void resetAttr() {
if (largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD) {
VanChartPlot plot = this.chart.getPlot();
AttrLabel attrLabel = plot.getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = plot.getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.setEnable(false);
resetCustomCondition(plot.getConditionCollection());
}
}
private void resetCustomCondition(ConditionCollection conditionCollection) {
for (int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++) {
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
conditionAttr.remove(ScatterAttrLabel.class);
conditionAttr.remove(AttrEffect.class);
conditionAttr.remove(AttrLineEffect.class);
private void checkZoomPane() { VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class);
boolean zoomWidgetEnabled = zoomWidget.getSelectedIndex() == 0; if (attrMarker != null && !attrMarker.isCommon()) {
changeEnablePane.setVisible(zoomWidgetEnabled); conditionAttr.remove(VanChartAttrMarker.class);
zoomType.setEnabled(!zoomWidgetEnabled); }
}
} }
@Override @Override
@ -274,29 +277,28 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
if (chart == null || chart.getPlot() == null) { if (chart == null || chart.getPlot() == null) {
return; return;
} }
this.chart = chart; this.chart = (VanChart) chart;
VanChartPlot plot = (VanChartPlot)chart.getPlot(); VanChartPlot plot = chart.getPlot();
if(interactivePane == null){ if (interactivePane == null) {
this.remove(leftcontentPane); this.remove(leftcontentPane);
reLayoutContentPane(plot); reLayoutContentPane(plot);
} }
if(plot.isSupportZoomDirection()){//支持缩放方向=方向+控件
populateChartZoom((VanChart)chart); if (zoomPane != null) {
checkZoomPane(); zoomPane.populateBean(this.chart.getZoomAttribute());
} }
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE){ if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
populateChartAxisRotation(plot); populateChartAxisRotation(plot);
} }
populateChartTools((VanChart) chart); populateChartTools(this.chart);
populateChartAnimate(chart, plot); populateLargeMode(plot);
populateAutoRefresh((VanChart)chart); populateChartAnimate(this.chart, plot);
populateAutoRefresh(this.chart);
populateHyperlink(plot); populateHyperlink(plot);
checkZoomEnabled();
} }
@ -312,25 +314,13 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
collapse.setSelected(vanChartTools.isHidden()); collapse.setSelected(vanChartTools.isHidden());
} }
private void populateChartZoom(VanChart chart) { private void populateLargeMode(Plot plot) {
VanChartZoom zoom = chart.getVanChartZoom(); if (largeDataMode != null) {
if(zoom == null){ LargeDataAttribute attribute = plot.getLargeDataAttribute();
zoom = new VanChartZoom();
} largeDataMode.setSelectedItem(attribute.getLargeDataModeType());
zoomWidget.setSelectedIndex(zoom.isZoomVisible() ? 0 : 1); largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber());
zoomGesture.setSelectedIndex(zoom.isZoomGesture() ? 0 : 1);
zoomResize.setSelectedIndex(zoom.isZoomResize() ? 0 : 1);
if (zoom.getFrom() instanceof BaseFormula) {
from.populateBean(((BaseFormula) zoom.getFrom()).getContent());
} else {
from.populateBean(Utils.objectToString(zoom.getFrom()));
}
if (zoom.getTo() instanceof BaseFormula) {
to.populateBean(((BaseFormula) zoom.getTo()).getContent());
} else {
to.populateBean(Utils.objectToString(zoom.getTo()));
} }
zoomType.setSelectedItem(zoom.getZoomType());
} }
private void populateChartAxisRotation(VanChartPlot plot) { private void populateChartAxisRotation(VanChartPlot plot) {
@ -338,7 +328,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
} }
private void populateChartAnimate(Chart chart, Plot plot) { private void populateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) { if (plot.isSupportAnimate()) {
isChartAnimation.setSelectedIndex(chart.isJSDraw() ? 0 : 1); isChartAnimation.setSelectedIndex(chart.isJSDraw() ? 0 : 1);
isChartAnimation.setEnabled(!largeModel(plot)); isChartAnimation.setEnabled(!largeModel(plot));
} }
@ -349,11 +339,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
} }
protected void populateAutoRefresh(VanChart chart) { protected void populateAutoRefresh(VanChart chart) {
VanChartPlot plot = (VanChartPlot)chart.getPlot(); VanChartPlot plot = chart.getPlot();
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel(); RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel();
if(refreshMoreLabel == null) { if (refreshMoreLabel == null) {
refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot)chart.getPlot()).getAutoAttrTooltip()); refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot) chart.getPlot()).getAutoAttrTooltip());
} }
autoRefreshPane.populateBean(refreshMoreLabel); autoRefreshPane.populateBean(refreshMoreLabel);
@ -366,21 +356,24 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return; return;
} }
VanChartPlot plot = (VanChartPlot)chart.getPlot(); VanChart vanChart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if(plot.isSupportZoomDirection()){ if (zoomPane != null) {
updateChartZoom((VanChart)chart); vanChart.setZoomAttribute(zoomPane.updateBean());
} }
if(plot.getAxisPlotType() == AxisPlotType.RECTANGLE){
updateChartAxisRotation((VanChart)chart); if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
updateChartAxisRotation(vanChart);
} }
updateChartTools((VanChart)chart); updateChartTools(vanChart);
updateChartAnimate(chart, plot); updateChartAnimate(vanChart, plot);
updateAutoRefresh((VanChart)chart); updateLargeData(plot);
updateAutoRefresh(vanChart);
updateHyperlink(plot); updateHyperlink(plot);
} }
protected void updateHyperlink(Plot plot){ protected void updateHyperlink(Plot plot) {
superLink.update(plot); superLink.update(plot);
} }
@ -393,37 +386,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
chart.setVanChartTools(vanChartTools); chart.setVanChartTools(vanChartTools);
} }
private void updateChartZoom(VanChart chart) {
VanChartZoom zoom = chart.getVanChartZoom();
if(zoom == null){
zoom = new VanChartZoom();
chart.setVanChartZoom(zoom);
}
zoom.setZoomVisible(zoomWidget.getSelectedIndex() == 0);
zoom.setZoomGesture(zoomGesture.getSelectedIndex() == 0);
zoom.setZoomResize(zoomResize.getSelectedIndex() == 0);
String fromString = from.updateBean();
Object fromObject;
if (StableUtils.maybeFormula(fromString)) {
fromObject = BaseFormula.createFormulaBuilder().build(fromString);
} else {
fromObject = fromString;
}
zoom.setFrom(fromObject);
String toString = to.updateBean();
Object toObject;
if (StableUtils.maybeFormula(toString)) {
toObject = BaseFormula.createFormulaBuilder().build(toString);
} else {
toObject = toString;
}
zoom.setTo(toObject);
zoom.setZoomType(zoomType.getSelectedItem());
}
private void updateChartAxisRotation(VanChart chart) { private void updateChartAxisRotation(VanChart chart) {
//坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的 //坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的
VanChartPlot plot = (VanChartPlot) chart.getPlot(); VanChartPlot plot = chart.getPlot();
plot.setAxisRotation(axisRotation.getSelectedIndex() == 0); plot.setAxisRotation(axisRotation.getSelectedIndex() == 0);
//同时更新坐标轴旋转属性 //同时更新坐标轴旋转属性
for (VanChartAxis axis : ((VanChartRectanglePlot) plot).getXAxisList()) { for (VanChartAxis axis : ((VanChartRectanglePlot) plot).getXAxisList()) {
@ -435,14 +400,23 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
} }
//更新数据表属性 //更新数据表属性
if (plot.isAxisRotation()){ if (plot.isAxisRotation()) {
plot.getDataSheet().setVisible(false); plot.getDataSheet().setVisible(false);
} }
} }
private void updateLargeData(Plot plot) {
if (largeDataMode != null) {
LargeDataAttribute attribute = new LargeDataAttribute();
attribute.setLargeDataModeType((LargeDataModeType) largeDataMode.getSelectedItem());
attribute.setLargeModeThresholdNumber(largeModeThresholdNumber.getValue());
plot.setLargeDataAttribute(attribute);
}
}
private void updateChartAnimate(Chart chart, Plot plot) { private void updateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) { if (plot.isSupportAnimate()) {
chart.setJSDraw(isChartAnimation.getSelectedIndex()==0); chart.setJSDraw(isChartAnimation.getSelectedIndex() == 0);
} }
} }
@ -450,15 +424,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private void updateAutoRefresh(VanChart chart) { private void updateAutoRefresh(VanChart chart) {
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel(); RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel();
if(refreshMoreLabel == null) { if (refreshMoreLabel == null) {
refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot)chart.getPlot()).getAutoAttrTooltip()); refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot) chart.getPlot()).getAutoAttrTooltip());
chart.setRefreshMoreLabel(refreshMoreLabel); chart.setRefreshMoreLabel(refreshMoreLabel);
} }
autoRefreshPane.updateBean(refreshMoreLabel); autoRefreshPane.updateBean(refreshMoreLabel);
} }
@Override @Override
public Chart updateBean() { public VanChart updateBean() {
return null; return null;
} }

14
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePaneWithMapZoom.java

@ -1,19 +1,15 @@
package com.fr.van.chart.designer.other; package com.fr.van.chart.designer.other;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.van.chart.designer.other.zoom.MapZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/** /**
* Created by mengao on 2017/4/7. * Created by mengao on 2017/4/7.
*/ */
public class VanChartInteractivePaneWithMapZoom extends VanChartInteractivePaneWithOutSort { public class VanChartInteractivePaneWithMapZoom extends VanChartInteractivePaneWithOutSort {
@Override @Override
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) { protected ZoomPane createZoomPane() {
JPanel panel = new JPanel(new BorderLayout(0, 4)); return new MapZoomPane();
panel.add(zoomWidgetPane, BorderLayout.NORTH);
panel.add(zoomGesturePane, BorderLayout.CENTER);
return panel;
} }
} }

47
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/MapZoomPane.java

@ -0,0 +1,47 @@
package com.fr.van.chart.designer.other.zoom;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
* Created by shine on 2019/08/28.
*/
public class MapZoomPane extends ZoomPane {
private UIButtonGroup<Boolean> mapZoomWidget;//地图缩放控件
private UIButtonGroup<Boolean> gestureZoomGroup;//地图手势缩放
@Override
protected Component[][] getSouthComps() {
mapZoomWidget = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open")
, Toolkit.i18nText("Fine-Design_Chart_Close")}, new Boolean[]{true, false});
gestureZoomGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open")
, Toolkit.i18nText("Fine-Design_Chart_Close")}, new Boolean[]{true, false});
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget")), mapZoomWidget},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture")), gestureZoomGroup}
};
}
@Override
public void populateBean(ZoomAttribute ob) {
super.populateBean(ob);
mapZoomWidget.setSelectedItem(ob.isMapZoomWidget());
gestureZoomGroup.setSelectedItem(ob.isGestureZoom());
}
@Override
public ZoomAttribute updateBean() {
ZoomAttribute zoomAttribute = super.updateBean();
zoomAttribute.setMapZoomWidget(mapZoomWidget.getSelectedItem());
zoomAttribute.setGestureZoom(gestureZoomGroup.getSelectedItem());
return zoomAttribute;
}
}

224
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPane.java

@ -0,0 +1,224 @@
package com.fr.van.chart.designer.other.zoom;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.attr.ZoomInitialDisplayType;
import com.fr.chartx.attr.ZoomModeType;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.extended.chart.StringFormula;
import com.fr.general.ComparatorUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
/**
* Created by shine on 2019/08/28.
*/
public class ZoomPane extends BasicBeanPane<ZoomAttribute> {
private UIButtonGroup<ZoomModeType> modeTypeButtonGroup;
private JPanel customModePane;
private UIComboBox initialDisplayTypeComboBox;
private JPanel initialDisplayCardPane;
private UISpinner topCategorySpinner;
private TinyFormulaPane leftFormulaPane;
private TinyFormulaPane rightFormulaPane;
private UIButtonGroup<Boolean> selectionZoomGroup;
public ZoomPane() {
initComponent();
}
private void initComponent() {
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double p = TableLayout.PREFERRED;
double[] columnSize = {f, e};
JPanel northPane = createNorthPane(f, p);
initCustomModePane(columnSize, p);
JPanel southPane = createSouthPane(f, p);
this.setLayout(new BorderLayout(0, 6));
if (northPane != null) {
this.add(northPane, BorderLayout.NORTH);
}
if (customModePane != null) {
this.add(customModePane, BorderLayout.CENTER);
}
if (southPane != null) {
this.add(southPane, BorderLayout.SOUTH);
}
}
protected JPanel createNorthPane(double f, double p) {
modeTypeButtonGroup = new UIButtonGroup<ZoomModeType>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"),
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom"),
Toolkit.i18nText("Fine-Design_Chart_Close")
}, new ZoomModeType[]{ZoomModeType.AUTO, ZoomModeType.CUSTOM, ZoomModeType.CLOSE});
modeTypeButtonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkCustomModePane();
}
});
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Mode_type")), modeTypeButtonGroup}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p}
, new double[]{f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH});
}
private JPanel createSouthPane(double f, double p) {
Component[][] components = getSouthComps();
double[] rows = new double[components.length];
Arrays.fill(rows, p);
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rows
, new double[]{f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH});
}
protected Component[][] getSouthComps() {
selectionZoomGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open")
, Toolkit.i18nText("Fine-Design_Chart_Close")}, new Boolean[]{true, false});
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Selection_Zoom")), selectionZoomGroup}
};
}
protected void initCustomModePane(double[] columnSize, double p) {
initialDisplayTypeComboBox = new UIComboBox(new ZoomInitialDisplayType[]{
ZoomInitialDisplayType.TOP_CATEGORY,
ZoomInitialDisplayType.LEFT_RIGHT_BOUNDARY});
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_InitialDisplay")), initialDisplayTypeComboBox}
};
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p}, columnSize);
initInitialDisplayCardPane(columnSize, p);
customModePane = new JPanel(new BorderLayout(0, 6));
customModePane.add(northPane, BorderLayout.NORTH);
customModePane.add(initialDisplayCardPane, BorderLayout.CENTER);
customModePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
}
private void initInitialDisplayCardPane(double[] columnSize, double p) {
topCategorySpinner = new UISpinner(1, Integer.MAX_VALUE, 1);
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Category_Number")), topCategorySpinner}
};
final JPanel topPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components1, new double[]{p}, columnSize);
leftFormulaPane = new TinyFormulaPane();
rightFormulaPane = new TinyFormulaPane();
Component[][] components2 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Left_Boundary")), leftFormulaPane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Right_Boundary")), rightFormulaPane}
};
final JPanel leftRightPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components2, new double[]{p, p}, columnSize);
initialDisplayCardPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
return initialDisplayTypeComboBox.getSelectedIndex() == 0 ? topPane.getPreferredSize() : leftRightPane.getPreferredSize();
}
};
initialDisplayCardPane.add(topPane, ZoomInitialDisplayType.TOP_CATEGORY.toString());
initialDisplayCardPane.add(leftRightPane, ZoomInitialDisplayType.LEFT_RIGHT_BOUNDARY.toString());
initialDisplayTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkInitialDisplayCardPane();
}
});
}
private void checkCustomModePane() {
customModePane.setVisible(modeTypeButtonGroup.getSelectedItem() == ZoomModeType.CUSTOM);
}
private void checkInitialDisplayCardPane() {
CardLayout cardLayout = (CardLayout) initialDisplayCardPane.getLayout();
if (ComparatorUtils.equals(initialDisplayTypeComboBox.getSelectedItem(), ZoomInitialDisplayType.TOP_CATEGORY)) {
cardLayout.show(initialDisplayCardPane, ZoomInitialDisplayType.TOP_CATEGORY.toString());
} else {
cardLayout.show(initialDisplayCardPane, ZoomInitialDisplayType.LEFT_RIGHT_BOUNDARY.toString());
}
}
@Override
public void populateBean(ZoomAttribute ob) {
modeTypeButtonGroup.setSelectedItem(ob.getModeType());
initialDisplayTypeComboBox.setSelectedItem(ob.getInitialDisplayType());
topCategorySpinner.setValue(ob.getTopCategory());
if (ob.getLeft() != null) {
leftFormulaPane.populateBean(ob.getLeft().getContent());
}
if (ob.getRight() != null) {
rightFormulaPane.populateBean(ob.getRight().getContent());
}
selectionZoomGroup.setSelectedItem(ob.isSelectionZoom());
checkInitialDisplayCardPane();
checkCustomModePane();
}
@Override
public ZoomAttribute updateBean() {
ZoomAttribute zoomAttribute = new ZoomAttribute();
zoomAttribute.setModeType(modeTypeButtonGroup.getSelectedItem());
zoomAttribute.setInitialDisplayType((ZoomInitialDisplayType) initialDisplayTypeComboBox.getSelectedItem());
zoomAttribute.setTopCategory((int) topCategorySpinner.getValue());
zoomAttribute.setLeft(new StringFormula(leftFormulaPane.updateBean()));
zoomAttribute.setRight(new StringFormula(rightFormulaPane.updateBean()));
zoomAttribute.setSelectionZoom(selectionZoomGroup.getSelectedItem());
return zoomAttribute;
}
@Override
protected String title4PopupWindow() {
return null;
}
}

17
designer-chart/src/main/java/com/fr/van/chart/designer/other/zoom/ZoomPaneWithOutMode.java

@ -0,0 +1,17 @@
package com.fr.van.chart.designer.other.zoom;
import javax.swing.JPanel;
/**
* Created by shine on 2019/08/28.
*/
public class ZoomPaneWithOutMode extends ZoomPane {
@Override
protected JPanel createNorthPane(double f, double p) {
return null;
}
@Override
protected void initCustomModePane(double[] columnSize, double p) {
}
}

48
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -8,12 +8,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -21,8 +20,8 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -55,11 +54,8 @@ public class VanChartPlotLegendPane extends BasicPane {
protected UIButtonGroup<Integer> location; protected UIButtonGroup<Integer> location;
protected UIToggleButton customFloatPositionButton; protected UIToggleButton customFloatPositionButton;
protected VanChartFloatPositionPane customFloatPositionPane; protected VanChartFloatPositionPane customFloatPositionPane;
protected UIButtonGroup<Integer> limitSize;
protected UISpinner maxProportion;
private UILabel limitSizeTitle;
private JPanel maxProportionPane;
private LimitPane limitPane;
//高亮显示的按钮 //高亮显示的按钮
protected UIButtonGroup<Boolean> highlightButton; protected UIButtonGroup<Boolean> highlightButton;
@ -232,25 +228,8 @@ public class VanChartPlotLegendPane extends BasicPane {
} }
protected JPanel createDisplayStrategy(){ protected JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30); limitPane = new LimitPane(false);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); return limitPane;
limitSizeTitle = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"));
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"),limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"),maxProportion,TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return panel;
} }
private JPanel createHighlightPane(){ private JPanel createHighlightPane(){
@ -276,15 +255,8 @@ public class VanChartPlotLegendPane extends BasicPane {
//检查显示策略界面是否可用 //检查显示策略界面是否可用
protected void checkDisplayStrategyUse() { protected void checkDisplayStrategyUse() {
limitSize.setEnabled(!customFloatPositionButton.isSelected()); GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
checkMaxProPortionUse(); limitPane.checkMaxProPortionUse();
}
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
} }
protected void checkBoxUse() { protected void checkBoxUse() {
@ -315,8 +287,7 @@ public class VanChartPlotLegendPane extends BasicPane {
legend.setPosition(-1); legend.setPosition(-1);
} }
legend.setFloating(customFloatPositionButton.isSelected()); legend.setFloating(customFloatPositionButton.isSelected());
legend.setLimitSize(limitSize.getSelectedIndex() == 0); legend.setLimitAttribute(limitPane.updateBean());
legend.setMaxHeight(maxProportion.getValue());
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
if(highlightButton != null && highlightButton.getSelectedItem() != null){ if(highlightButton != null && highlightButton.getSelectedItem() != null){
@ -336,8 +307,7 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton.setSelected(legend.isFloating()); customFloatPositionButton.setSelected(legend.isFloating());
customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY());
limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1); limitPane.populateBean(legend.getLimitAttribute());
maxProportion.setValue(legend.getMaxHeight());
if(highlightButton != null){ if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight()); highlightButton.setSelectedItem(legend.isHighlight());
} }

19
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java

@ -192,26 +192,13 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane {
public void populateBean(VanChartLegend legend) { public void populateBean(VanChartLegend legend) {
VanChartRangeLegend scatterLegend = (VanChartRangeLegend)legend; VanChartRangeLegend scatterLegend = (VanChartRangeLegend)legend;
if (scatterLegend != null) { if (scatterLegend != null) {
isLegendVisible.setSelected(scatterLegend.isLegendVisible());
textAttrPane.populate(scatterLegend.getFRFont()); super.populateBean(scatterLegend);
borderPane.populate(scatterLegend);
backgroundPane.populate(scatterLegend);
if(!scatterLegend.isFloating()){
location.setSelectedItem(scatterLegend.getPosition());
}
customFloatPositionButton.setSelected(scatterLegend.isFloating());
customFloatPositionPane.setFloatPosition_x(scatterLegend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(scatterLegend.getFloatPercentY());
limitSize.setSelectedIndex(scatterLegend.isLimitSize() ? 0 : 1);
maxProportion.setValue(scatterLegend.getMaxHeight());
//范围图例部分 //范围图例部分
legendTypeButton.setSelectedItem(scatterLegend.getLegendType()); legendTypeButton.setSelectedItem(scatterLegend.getLegendType());
gradualLegendPane.populate(scatterLegend.getGradualLegend()); gradualLegendPane.populate(scatterLegend.getGradualLegend());
sectionLegendPane.populate(scatterLegend.getSectionLegend()); sectionLegendPane.populate(scatterLegend.getSectionLegend());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
}
} }
checkAllUse(); checkAllUse();
this.checkHighlightVisible(); this.checkHighlightVisible();

45
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -11,12 +11,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle; import com.fr.plugin.chart.attr.VanChartTitle;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
@ -27,8 +26,8 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -60,9 +59,8 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private UIToggleButton useHtml; private UIToggleButton useHtml;
private UIToggleButton customFloatPositionButton; private UIToggleButton customFloatPositionButton;
private VanChartFloatPositionPane customFloatPositionPane; private VanChartFloatPositionPane customFloatPositionPane;
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion; private LimitPane limitPane;
private JPanel maxProportionPane;
protected VanChartStylePane parent; protected VanChartStylePane parent;
@ -171,24 +169,8 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
private JPanel createDisplayStrategy(){ private JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30); limitPane = new LimitPane();
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); return limitPane;
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"),limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"),maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
} }
private void initPositionListener(){ private void initPositionListener(){
@ -250,15 +232,10 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//检查显示策略界面是否可用 //检查显示策略界面是否可用
private void checkDisplayStrategyUse() { private void checkDisplayStrategyUse() {
limitSize.setEnabled(!customFloatPositionButton.isSelected()); GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
checkMaxProPortionUse(); limitPane.checkMaxProPortionUse();
} }
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
/** /**
* 弹出框的界面标题 * 弹出框的界面标题
@ -301,8 +278,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
customFloatPositionButton.setSelected(title.isFloating()); customFloatPositionButton.setSelected(title.isFloating());
customFloatPositionPane.setFloatPosition_x(title.getFloatPercentX()); customFloatPositionPane.setFloatPosition_x(title.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY()); customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY());
limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1); limitPane.populateBean(title.getLimitAttribute());
maxProportion.setValue(title.getMaxHeight());
checkAllUse(); checkAllUse();
} }
@ -335,8 +311,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
title.setUseHtml(useHtml.isSelected()); title.setUseHtml(useHtml.isSelected());
title.setFloating(customFloatPositionButton.isSelected()); title.setFloating(customFloatPositionButton.isSelected());
title.setLimitSize(limitSize.getSelectedIndex() == 0); title.setLimitAttribute(limitPane.updateBean());
title.setMaxHeight(maxProportion.getValue());
title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
textAttrPane.update(textAttr); textAttrPane.update(textAttr);

170
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -13,8 +13,8 @@ import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane; import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
@ -23,19 +23,24 @@ import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.OverlapHandleType;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.type.AxisTickLineType; import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
@ -58,10 +63,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup showLabel; protected UIButtonGroup showLabel;
protected ChartTextAttrPane labelTextAttrPane; protected ChartTextAttrPane labelTextAttrPane;
protected UINumberDragPane labelTextRotation; protected UINumberDragPane labelTextRotation;
private UIButtonGroup<OverlapHandleType> overlapHandleTypeGroup;
protected UIButtonGroup<Integer> labelGapStyle; protected UIButtonGroup<Integer> labelGapStyle;
protected UITextField labelGapValue; protected UISpinner labelGapValue;
protected JPanel labelPanel;
protected JPanel labelPanel;
private JPanel labelGapStylePane;
private JPanel labelGapValuePane;
protected LineComboBox axisLineStyle; protected LineComboBox axisLineStyle;
protected ColorSelectBox axisLineColor; protected ColorSelectBox axisLineColor;
@ -71,15 +80,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup<Integer> position; protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> reversed; protected UIButtonGroup<Boolean> reversed;
protected UIButtonGroup<Integer> axisLimitSize; private LimitPane limitPane;
protected UISpinner maxProportion;
protected JPanel maxProportionPane;
protected UIButtonGroup valueFormatStyle; protected UIButtonGroup valueFormatStyle;
protected FormatPane valueFormat; protected FormatPane valueFormat;
protected JPanel centerPane; protected JPanel centerPane;
private VanChartHtmlLabelPane htmlLabelPane; private VanChartHtmlLabelPane htmlLabelPane;
private JPanel labelGapValuePane;
public VanChartBaseAxisPane(){ public VanChartBaseAxisPane(){
this(true); this(true);
@ -166,32 +172,22 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
protected JPanel createLabelPane(double[] row, double[] col){ protected JPanel createLabelPane(double[] row, double[] col){
double p = TableLayout.PREFERRED;
showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")}); showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")});
labelTextAttrPane = getChartTextAttrPane(); labelTextAttrPane = getChartTextAttrPane();
labelTextRotation = new UINumberDragPane(-ROTATION_MAX,ROTATION_MAX); JPanel rotationPane = createLabelRotationPane(col);
labelGapStyle = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")}); JPanel overlapPane = createLabelOverlapPane();
labelGapValue = new UITextField();
Component[][] gapComponents = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col);
labelGapValuePane= TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText(""),labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
JPanel gapPanel = new JPanel(new BorderLayout());
gapPanel.add(panel, BorderLayout.CENTER);
gapPanel.add(labelGapValuePane, BorderLayout.SOUTH);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{labelTextAttrPane, null}, new Component[]{labelTextAttrPane, null},
new Component[]{gapPanel,null}, new Component[]{rotationPane, null},
new Component[]{overlapPane, null},
}; };
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel); JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel);
labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, col);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
showLabel.addActionListener(new ActionListener() { showLabel.addActionListener(new ActionListener() {
@Override @Override
@ -199,16 +195,61 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
checkLabelPane(); checkLabelPane();
} }
}); });
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(showLabelPane, BorderLayout.NORTH);
jPanel.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
}
private JPanel createLabelRotationPane(double[] col) {
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX);
Component[][] gapComponents = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation)
}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, new double[]{TableLayout.PREFERRED}, col);
}
private JPanel createLabelOverlapPane() {
labelGapStyle = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_Interval"), labelGapStyle, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
labelGapValue = new UISpinner(0, Integer.MAX_VALUE, 1, 1);
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(StringUtils.EMPTY, labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
JPanel panel = new JPanel(new BorderLayout(0, 0));
addOverlapGroupButton(panel);
panel.add(labelGapStylePane, BorderLayout.CENTER);
panel.add(labelGapValuePane, BorderLayout.SOUTH);
labelGapStyle.addActionListener(new ActionListener() { labelGapStyle.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkLabelGapValuePane(); checkLabelGapValuePane();
} }
}); });
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(showLabelPane, BorderLayout.NORTH); return panel;
jPanel.add(labelPanel, BorderLayout.CENTER); }
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
protected void addOverlapGroupButton(JPanel panel) {
overlapHandleTypeGroup = new UIButtonGroup<OverlapHandleType>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Label_OverlapAbbreviate"), Toolkit.i18nText("Fine-Design_Chart_Label_OverlapInterval")},
new OverlapHandleType[]{OverlapHandleType.ABBREVIATE, OverlapHandleType.INTERVAL});
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_WhenOverlap"), overlapHandleTypeGroup, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
panel.add(north, BorderLayout.NORTH);
overlapHandleTypeGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLabelGapAndStylePane();
}
});
} }
protected ChartTextAttrPane getChartTextAttrPane(){ protected ChartTextAttrPane getChartTextAttrPane(){
@ -286,24 +327,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
protected JPanel createDisplayStrategy(double[] row, double[] col){ protected JPanel createDisplayStrategy(double[] row, double[] col){
maxProportion = new UISpinner(0,100,1,30); limitPane = new LimitPane();
axisLimitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); return limitPane;
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"),axisLimitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"),maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
axisLimitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
} }
protected JPanel createValueStylePane(){ protected JPanel createValueStylePane(){
@ -360,7 +385,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkAllUse() { protected void checkAllUse() {
checkCardPane(); checkCardPane();
checkLabelPane(); checkLabelPane();
checkMaxProPortionUse();
} }
protected void checkCardPane() { protected void checkCardPane() {
@ -381,24 +405,31 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
labelPanel.setVisible(enabled); labelPanel.setVisible(enabled);
} }
if(enabled){ if(enabled){
checkLabelGapValuePane(); checkLabelGapAndStylePane();
} }
} }
} }
protected void checkLabelGapValuePane() { private void checkLabelGapAndStylePane() {
if(labelGapValuePane != null && labelGapStyle != null){ if (overlapHandleTypeGroup != null && labelGapStylePane != null) {
labelGapValuePane.setVisible(labelGapStyle.getSelectedIndex() == 1); boolean visible = overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
labelGapStylePane.setVisible(visible);
} }
checkLabelGapValuePane();
} }
//检查最大显示占比是否可用 protected void checkLabelGapValuePane() {
private void checkMaxProPortionUse() { if (labelGapValuePane != null && labelGapStyle != null) {
if(maxProportionPane != null && axisLimitSize != null){ boolean visible = labelGapStyle.getSelectedIndex() == 1;
maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled()); if (overlapHandleTypeGroup != null) {
visible = visible && overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
}
labelGapValuePane.setVisible(visible);
} }
} }
/** /**
* 是否是指定类型 * 是否是指定类型
* @param ob 对象 * @param ob 对象
@ -477,11 +508,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
if(labelTextRotation != null){ if(labelTextRotation != null){
labelTextRotation.populateBean((double)labelTextAttr.getRotation()); labelTextRotation.populateBean((double)labelTextAttr.getRotation());
} }
if (overlapHandleTypeGroup != null) {
overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType());
}
if(labelGapStyle != null){ if(labelGapStyle != null){
labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1); labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1);
} }
if(labelGapValue != null){ if(labelGapValue != null){
labelGapValue.setText(axis.getLabelNumber().getContent()); labelGapValue.setValue(axis.getIntervalNumber());
} }
} }
@ -516,13 +550,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略 //显示策略
private void populateDisplayStrategy(VanChartAxis axis) { private void populateDisplayStrategy(VanChartAxis axis) {
if(axisLimitSize != null){ if (limitPane != null) {
axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1); limitPane.populateBean(axis.getLimitAttribute());
} }
if(maxProportion != null){
maxProportion.setValue(axis.getMaxHeight());
}
} }
//格式 //格式
@ -597,15 +627,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
if(labelTextRotation != null){ if(labelTextRotation != null){
labelTextAttr.setRotation(labelTextRotation.updateBean().intValue()); labelTextAttr.setRotation(labelTextRotation.updateBean().intValue());
} }
if (overlapHandleTypeGroup != null) {
axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem());
}
if(labelGapStyle != null){ if(labelGapStyle != null){
axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0); axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0);
} }
if(labelGapValue != null){ if(labelGapValue != null){
if(axis.isAutoLabelGap()){ axis.setIntervalNumber((int) labelGapValue.getValue());
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build("1"));
} else {
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build(labelGapValue.getText()));
}
} }
} }
@ -637,11 +666,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略 //显示策略
private void updateDisplayStrategy(VanChartAxis axis){ private void updateDisplayStrategy(VanChartAxis axis){
if(axisLimitSize != null){ if (limitPane != null) {
axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0); axis.setLimitAttribute(limitPane.updateBean());
}
if(maxProportion != null){
axis.setMaxHeight(maxProportion.getValue());
} }
} }

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -17,7 +17,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
@ -80,6 +79,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
@Override
protected void addOverlapGroupButton(JPanel panel) {
}
private JPanel createValueDefinition(){ private JPanel createValueDefinition(){
timeMinMaxValuePane = new TimeMinMaxValuePane(); timeMinMaxValuePane = new TimeMinMaxValuePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane);

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java

@ -7,7 +7,6 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -61,6 +60,10 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
@Override
protected void addOverlapGroupButton(JPanel panel) {
}
protected JPanel createMinMaxValuePane(double[] row, double[] col){ protected JPanel createMinMaxValuePane(double[] row, double[] col){
JPanel panel = createCommenValuePane(row,col); JPanel panel = createCommenValuePane(row,col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel);

85
designer-chart/src/main/java/com/fr/van/chart/designer/style/component/LimitPane.java

@ -0,0 +1,85 @@
package com.fr.van.chart.designer.style.component;
import com.fr.chartx.attr.LimitAttribute;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by shine on 2019/08/28.
*/
public class LimitPane extends BasicBeanPane<LimitAttribute> {
private UIButtonGroup<Boolean> autoCustomTypeGroup;
private UISpinner maxProportion;
private JPanel maxProportionPane;
public LimitPane() {
this(true);
}
public LimitPane(boolean hasTitle) {
initComponent(hasTitle);
}
private void initComponent(boolean hasTitle) {
maxProportion = new UISpinner(0, 100, 1, 30);
autoCustomTypeGroup = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto")
, Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")}, new Boolean[]{true, false});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), autoCustomTypeGroup);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
autoCustomTypeGroup.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
this.setLayout(new BorderLayout());
if (hasTitle) {
JPanel contentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
this.add(contentPane);
} else {
this.add(panel);
}
}
//检查最大显示占比是否可用
public void checkMaxProPortionUse() {
maxProportion.setVisible(!autoCustomTypeGroup.getSelectedItem() && autoCustomTypeGroup.isEnabled());
maxProportionPane.setVisible(!autoCustomTypeGroup.getSelectedItem() && autoCustomTypeGroup.isEnabled());
}
@Override
public void populateBean(LimitAttribute ob) {
autoCustomTypeGroup.setSelectedItem(ob.isAuto());
maxProportion.setValue(ob.getMaxSize());
}
@Override
public LimitAttribute updateBean() {
LimitAttribute attribute = new LimitAttribute();
attribute.setAuto(autoCustomTypeGroup.getSelectedItem());
attribute.setMaxSize(maxProportion.getValue());
return attribute;
}
@Override
protected String title4PopupWindow() {
return null;
}
}

64
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -5,20 +5,23 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot;
import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.OverlapHandleType;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -38,7 +41,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected BasicBeanPane<AttrTooltipContent> dataLabelContentPane; protected BasicBeanPane<AttrTooltipContent> dataLabelContentPane;
protected UIButtonGroup<Integer> position; protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> autoAdjust;
private UIButtonGroup<Boolean> allowOverlap;
private UIComboBox overlapHandleType;
protected UIToggleButton tractionLine; protected UIToggleButton tractionLine;
protected UIButtonGroup<Integer> style; protected UIButtonGroup<Integer> style;
@ -118,8 +124,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
position = new UIButtonGroup<Integer>(names, values); position = new UIButtonGroup<Integer>(names, values);
autoAdjust = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
allowOverlap = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"),
Toolkit.i18nText("Fine-Design_Chart_NO")}, new Boolean[]{true, false});
overlapHandleType = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Chart_Label_OverlapHide"),
Toolkit.i18nText("Fine-Design_Chart_Label_OverlapAdjust")});
Component[][] comps = new Component[2][2]; Component[][] comps = new Component[2][2];
@ -134,13 +143,33 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
panel.add(tractionLinePane, BorderLayout.SOUTH); panel.add(tractionLinePane, BorderLayout.SOUTH);
initPositionListener(); initPositionListener();
} else if(PlotFactory.plotAutoAdjustLabelPosition(plot)){ } else if(PlotFactory.plotAutoAdjustLabelPosition(plot)){
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"),autoAdjust), BorderLayout.SOUTH); panel.add(createOverlapLabelPane(), BorderLayout.SOUTH);
} }
return panel; return panel;
} }
return new JPanel(); return new JPanel();
} }
private JPanel createOverlapLabelPane() {
allowOverlap.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkOverlap();
}
});
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_AllowOverlap"), allowOverlap);
JPanel center = new JPanel(new BorderLayout());
center.add(overlapHandleType, BorderLayout.CENTER);
center.setBorder(BorderFactory.createEmptyBorder(0, 78, 0, 0));
JPanel result = new JPanel(new BorderLayout(0, 6));
result.add(north, BorderLayout.NORTH);
result.add(center, BorderLayout.CENTER);
return result;
}
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col);
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel);
@ -208,11 +237,17 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private void checkAllUse() { private void checkAllUse() {
checkStyleUse(); checkStyleUse();
if(tractionLine == null){ checkOverlap();
return; if (tractionLine != null) {
}
checkPositionEnabled(); checkPositionEnabled();
} }
}
private void checkOverlap() {
if (overlapHandleType != null && allowOverlap != null) {
overlapHandleType.setVisible(!allowOverlap.getSelectedItem());
}
}
private void checkStyleUse() { private void checkStyleUse() {
textFontPane.setVisible(style.getSelectedIndex() == 1); textFontPane.setVisible(style.getSelectedIndex() == 1);
@ -235,8 +270,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
if(tractionLine != null){ if(tractionLine != null){
tractionLine.setSelected(detail.isShowGuidLine()); tractionLine.setSelected(detail.isShowGuidLine());
} }
if(autoAdjust != null){ if (allowOverlap != null) {
autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); allowOverlap.setSelectedItem(detail.isAllowOverlap());
}
if (overlapHandleType != null) {
overlapHandleType.setSelectedIndex(detail.getOverlapHandleType() == OverlapHandleType.HIDE ? 0 : 1);
} }
style.setSelectedIndex(detail.isCustom() ? 1 : 0); style.setSelectedIndex(detail.isCustom() ? 1 : 0);
textFontPane.populate(detail.getTextAttr()); textFontPane.populate(detail.getTextAttr());
@ -259,7 +297,13 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
position.setSelectedItem(detail.getPosition()); position.setSelectedItem(detail.getPosition());
} }
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); if (allowOverlap != null) {
detail.setAllowOverlap(allowOverlap.getSelectedItem());
}
if (overlapHandleType != null) {
detail.setOverlapHandleType(overlapHandleType.getSelectedIndex() == 0 ? OverlapHandleType.HIDE : OverlapHandleType.ADJUST);
}
if(tractionLine != null){ if(tractionLine != null){
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE);

197
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -1,8 +1,5 @@
package com.fr.van.chart.designer.style.series; package com.fr.van.chart.designer.style.series;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.base.chart.chartdata.model.LargeDataModel;
import com.fr.base.chart.chartdata.model.NormalDataModel;
import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
@ -10,11 +7,9 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -28,6 +23,7 @@ import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect; import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.van.chart.custom.style.VanChartCustomStylePane; import com.fr.van.chart.custom.style.VanChartCustomStylePane;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane; import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane;
import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartBeautyPane;
@ -41,8 +37,6 @@ import com.fr.van.chart.pie.RadiusCardLayoutPane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
/** /**
@ -73,11 +67,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
private RadiusCardLayoutPane radiusPane;//半径设置界面 private RadiusCardLayoutPane radiusPane;//半径设置界面
private JPanel radiusPaneWithTitle; private JPanel radiusPaneWithTitle;
private UIButtonGroup<DataProcessor> largeDataModelGroup;//大数据模式
protected JPanel contentPane; protected JPanel contentPane;
public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot){ public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot); super(parent, plot);
} }
@ -110,17 +102,17 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
} }
//获取颜色面板 //获取颜色面板
protected JPanel getColorPane () { protected JPanel getColorPane() {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
stylePane = createStylePane(); stylePane = createStylePane();
setColorPaneContent(panel); setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color"), panel); JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel.getComponentCount() == 0 ? null : colorPane; return panel.getComponentCount() == 0 ? null : colorPane;
} }
//设置色彩面板内容 //设置色彩面板内容
protected void setColorPaneContent (JPanel panel) { protected void setColorPaneContent(JPanel panel) {
if (stylePane != null) { if (stylePane != null) {
panel.add(stylePane, BorderLayout.CENTER); panel.add(stylePane, BorderLayout.CENTER);
} }
@ -165,80 +157,26 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected JPanel createRadiusPane() { protected JPanel createRadiusPane() {
radiusPane = initRadiusPane(); radiusPane = initRadiusPane();
radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set"), radiusPane); radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set"), radiusPane);
return ((VanChartPlot)plot).isInCustom() ? null : radiusPaneWithTitle; return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle;
}
protected JPanel createLargeDataModelPane() {
largeDataModelGroup = createLargeDataModelGroup();
largeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup);
return createLargeDataModelPane(panel);
}
protected void checkLarge() {
if(largeModel()) {
AttrLabel attrLabel = ((VanChartPlot) plot).getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = ((VanChartPlot) this.plot).getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
} }
attrLabel.setEnable(false);
resetCustomCondition(plot.getConditionCollection()); protected void checkCompsEnabledWithLarge(Plot plot) {
} if (markerPane != null) {
markerPane.checkLargePlot(largeModel(plot));
checkCompsEnabledWithLarge();
}
protected void checkCompsEnabledWithLarge() {
if(markerPane != null && largeDataModelGroup != null){
markerPane.checkLargePlot(largeModel());
} }
} }
protected void checkLinePane() { protected void checkLinePane() {
if(lineTypePane != null && largeDataModelGroup != null){ if (lineTypePane != null) {
lineTypePane.checkLarge(largeModel()); lineTypePane.checkLarge(largeModel(plot));
} }
} }
protected boolean largeModel() { protected boolean largeModel(Plot plot) {
return largeDataModelGroup != null && largeDataModelGroup.getSelectedIndex() == 0; return PlotFactory.largeDataModel(plot);
} }
protected void resetCustomCondition(ConditionCollection conditionCollection) {
for(int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++){
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
conditionAttr.remove(ScatterAttrLabel.class);
conditionAttr.remove(AttrEffect.class);
conditionAttr.remove(AttrLineEffect.class);
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class);
if(attrMarker != null && !attrMarker.isCommon()){
conditionAttr.remove(VanChartAttrMarker.class);
}
}
}
protected JPanel createLargeDataModelPane(JPanel jPanel) {
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel);
return panel;
}
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() {
String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")};
DataProcessor[] values = new DataProcessor[]{new LargeDataModel(), new NormalDataModel()};
return new UIButtonGroup<DataProcessor>(strings, values);
}
protected RadiusCardLayoutPane initRadiusPane() { protected RadiusCardLayoutPane initRadiusPane() {
return new RadiusCardLayoutPane(); return new RadiusCardLayoutPane();
@ -272,7 +210,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
* 更新Plot的属性到系列界面 * 更新Plot的属性到系列界面
*/ */
public void populateBean(Plot plot) { public void populateBean(Plot plot) {
if(plot == null) { if (plot == null) {
return; return;
} }
@ -280,24 +218,20 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
super.populateBean(plot);//配色 super.populateBean(plot);//配色
if(stylePane != null){//风格 if (stylePane != null) {//风格
stylePane.populateBean(plot.getPlotStyle()); stylePane.populateBean(plot.getPlotStyle());
} }
if(largeDataModelGroup != null){ if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
largeDataModelGroup.setSelectedItem(plot.getDataProcessor()); VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
} if (rectanglePlot.isCustomChart()) {
if(stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot){//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot;
if(rectanglePlot.isCustomChart()){
stackAndAxisEditPane.populate(rectanglePlot); stackAndAxisEditPane.populate(rectanglePlot);
} else { } else {
removeStackWholePane(); removeStackWholePane();
} }
} }
if(radiusPane != null && plot instanceof VanChartRadiusPlot){ if (radiusPane != null && plot instanceof VanChartRadiusPlot) {
radiusPane.populateBean(plot); radiusPane.populateBean(plot);
checkRadiusPane(plot); checkRadiusPane(plot);
} }
@ -306,17 +240,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
checkAreaSeriesFillColorPane(plot.getPlotStyle()); checkAreaSeriesFillColorPane(plot.getPlotStyle());
checkCompsEnabledWithLarge(); checkCompsEnabledWithLarge(plot);
} }
/** /**
* radius界面是否显示 * radius界面是否显示
*
* @param plot * @param plot
*/ */
private void checkRadiusPane(Plot plot) { private void checkRadiusPane(Plot plot) {
radiusPaneWithTitle.setVisible(true); radiusPaneWithTitle.setVisible(true);
if (plot instanceof VanChartPlot){ if (plot instanceof VanChartPlot) {
if (((VanChartPlot) plot).isInCustom()){ if (((VanChartPlot) plot).isInCustom()) {
radiusPaneWithTitle.setVisible(false); radiusPaneWithTitle.setVisible(false);
} }
} }
@ -326,7 +261,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
* 保存 系列界面的属性到Plot * 保存 系列界面的属性到Plot
*/ */
public void updateBean(Plot plot) { public void updateBean(Plot plot) {
if(plot == null) { if (plot == null) {
return; return;
} }
@ -335,22 +270,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
super.updateBean(plot);//配色 super.updateBean(plot);//配色
if(stylePane != null){//风格 if (stylePane != null) {//风格
plot.setPlotStyle(stylePane.updateBean()); plot.setPlotStyle(stylePane.updateBean());
} }
if(largeDataModelGroup != null){ if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
plot.setDataProcessor(largeDataModelGroup.getSelectedItem()); VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
} if (rectanglePlot.isCustomChart()) {
if(stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot){//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot;
if(rectanglePlot.isCustomChart()){
stackAndAxisEditPane.update(rectanglePlot); stackAndAxisEditPane.update(rectanglePlot);
} }
} }
if (radiusPane != null && plot instanceof VanChartRadiusPlot){ if (radiusPane != null && plot instanceof VanChartRadiusPlot) {
radiusPane.updateBean(plot); radiusPane.updateBean(plot);
checkRadiusPane(plot); checkRadiusPane(plot);
} }
@ -360,47 +291,47 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
checkAreaSeriesFillColorPane(plot.getPlotStyle()); checkAreaSeriesFillColorPane(plot.getPlotStyle());
} }
protected void checkoutMapType(Plot plot){ protected void checkoutMapType(Plot plot) {
} }
protected void checkAreaSeriesFillColorPane(int plotStyle){ protected void checkAreaSeriesFillColorPane(int plotStyle) {
if (areaSeriesFillColorPane != null) { if (areaSeriesFillColorPane != null) {
areaSeriesFillColorPane.checkoutAlpha(plotStyle == ChartConstants.STYLE_NONE); areaSeriesFillColorPane.checkoutAlpha(plotStyle == ChartConstants.STYLE_NONE);
} }
} }
protected void populateCondition(ConditionAttr defaultAttr){ protected void populateCondition(ConditionAttr defaultAttr) {
if(trendLinePane != null){//趋势线 if (trendLinePane != null) {//趋势线
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class); VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class);
trendLinePane.populate(attrTrendLine); trendLinePane.populate(attrTrendLine);
} }
if(lineTypePane != null){//线-线型、控制断开等 if (lineTypePane != null) {//线-线型、控制断开等
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class); VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class);
lineTypePane.populate(attrLine); lineTypePane.populate(attrLine);
} }
if(markerPane != null){//标记点 if (markerPane != null) {//标记点
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class); VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
markerPane.populate(attrMarker); markerPane.populate(attrMarker);
} }
if(areaSeriesFillColorPane != null){//填充颜色 if (areaSeriesFillColorPane != null) {//填充颜色
AttrAreaSeriesFillColorBackground seriesFillColorBackground = (AttrAreaSeriesFillColorBackground)defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class); AttrAreaSeriesFillColorBackground seriesFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
areaSeriesFillColorPane.populate(seriesFillColorBackground); areaSeriesFillColorPane.populate(seriesFillColorBackground);
} }
if(borderPane != null){//边框 if (borderPane != null) {//边框
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class); AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if(attrBorder != null){ if (attrBorder != null) {
borderPane.populate(attrBorder); borderPane.populate(attrBorder);
} }
} }
populateAlpha(defaultAttr); populateAlpha(defaultAttr);
} }
protected void populateAlpha(ConditionAttr defaultAttr){ protected void populateAlpha(ConditionAttr defaultAttr) {
if(transparent != null){//不透明度 if (transparent != null) {//不透明度
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class); AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class);
if(attrAlpha != null){ if (attrAlpha != null) {
transparent.populateBean(attrAlpha.getAlpha() * VanChartAttrHelper.PERCENT); transparent.populateBean(attrAlpha.getAlpha() * VanChartAttrHelper.PERCENT);
} else { } else {
//初始值为100 //初始值为100
@ -409,35 +340,35 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
} }
} }
protected void updateCondition(ConditionAttr defaultAttr){ protected void updateCondition(ConditionAttr defaultAttr) {
if(trendLinePane != null){ if (trendLinePane != null) {
VanChartAttrTrendLine newTrendLine = trendLinePane.update(); VanChartAttrTrendLine newTrendLine = trendLinePane.update();
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class); VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class);
defaultAttr.remove(attrTrendLine); defaultAttr.remove(attrTrendLine);
defaultAttr.addDataSeriesCondition(newTrendLine); defaultAttr.addDataSeriesCondition(newTrendLine);
} }
if(lineTypePane != null){ if (lineTypePane != null) {
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class); VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class);
defaultAttr.remove(attrLine); defaultAttr.remove(attrLine);
defaultAttr.addDataSeriesCondition(lineTypePane.update()); defaultAttr.addDataSeriesCondition(lineTypePane.update());
} }
if(markerPane != null){ if (markerPane != null) {
VanChartAttrMarker newMarker = markerPane.update(); VanChartAttrMarker newMarker = markerPane.update();
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class); VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
defaultAttr.remove(attrMarker); defaultAttr.remove(attrMarker);
defaultAttr.addDataSeriesCondition(newMarker); defaultAttr.addDataSeriesCondition(newMarker);
} }
if(areaSeriesFillColorPane != null){ if (areaSeriesFillColorPane != null) {
AttrAreaSeriesFillColorBackground newFillColorBackground = areaSeriesFillColorPane.update(); AttrAreaSeriesFillColorBackground newFillColorBackground = areaSeriesFillColorPane.update();
AttrAreaSeriesFillColorBackground oldFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class); AttrAreaSeriesFillColorBackground oldFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
if(oldFillColorBackground != null){ if (oldFillColorBackground != null) {
defaultAttr.remove(oldFillColorBackground); defaultAttr.remove(oldFillColorBackground);
} }
defaultAttr.addDataSeriesCondition(newFillColorBackground); defaultAttr.addDataSeriesCondition(newFillColorBackground);
} }
if(borderPane != null){ if (borderPane != null) {
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class); AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if(attrBorder == null){ if (attrBorder == null) {
attrBorder = new AttrBorder(); attrBorder = new AttrBorder();
defaultAttr.addDataSeriesCondition(attrBorder); defaultAttr.addDataSeriesCondition(attrBorder);
} }
@ -446,14 +377,14 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
updateAlpha(defaultAttr); updateAlpha(defaultAttr);
} }
protected void updateAlpha(ConditionAttr defaultAttr){ protected void updateAlpha(ConditionAttr defaultAttr) {
if(transparent != null){ if (transparent != null) {
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class); AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class);
if(attrAlpha == null){ if (attrAlpha == null) {
attrAlpha = new AttrAlpha(); attrAlpha = new AttrAlpha();
defaultAttr.addDataSeriesCondition(attrAlpha); defaultAttr.addDataSeriesCondition(attrAlpha);
} }
attrAlpha.setAlpha((float)(transparent.updateBean()/VanChartAttrHelper.PERCENT)); attrAlpha.setAlpha((float) (transparent.updateBean() / VanChartAttrHelper.PERCENT));
} }
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -7,6 +7,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet; import com.fr.chart.chartglyph.DataSheet;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.gui.ilable.MultilineLabel;
@ -17,7 +18,6 @@ import com.fr.js.NameJavaScriptGroup;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -116,7 +116,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
protected void resetChartAttr(Chart chart, Plot newPlot){ protected void resetChartAttr(Chart chart, Plot newPlot){
chart.setPlot(newPlot); chart.setPlot(newPlot);
if(newPlot.isSupportZoomDirection() && !newPlot.isSupportZoomCategoryAxis()){ if(newPlot.isSupportZoomDirection() && !newPlot.isSupportZoomCategoryAxis()){
((VanChart)chart).setVanChartZoom(new VanChartZoom()); ((VanChart) chart).setZoomAttribute(new ZoomAttribute());
} }
//重置工具栏选项 //重置工具栏选项
((VanChart)chart).setVanChartTools(createVanChartTools()); ((VanChart)chart).setVanChartTools(createVanChartTools());

38
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -6,9 +6,9 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow; import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom;
@ -32,31 +32,31 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
private JPanel drillPane; private JPanel drillPane;
@Override @Override
protected JPanel getInteractivePane(VanChartPlot plot){ protected JPanel getInteractivePane(VanChartPlot plot) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize),null}, new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null},
new Component[]{createAnimationPane(),null}, new Component[]{createAnimationPane(), null},
new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null}, new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null},
new Component[]{createDrillToolsPane(), null}, new Component[]{createDrillToolsPane(), null},
new Component[]{createAutoRefreshPane(plot),null}, new Component[]{createAutoRefreshPane(plot), null},
new Component[]{createHyperlinkPane(),null} new Component[]{createHyperlinkPane(), null}
}; };
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
private JPanel createDrillToolsPane() { private JPanel createDrillToolsPane() {
openOrClose = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); openOrClose = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel openOrClosePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill_Dir"), openOrClose); JPanel openOrClosePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill_Dir"), openOrClose);
textAttrPane = new ChartTextAttrPane(){ textAttrPane = new ChartTextAttrPane() {
@Override @Override
protected JPanel getContentPane (JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {e}; double[] columnSize = {e};
@ -80,7 +80,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p}; double[] rowSize = {p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null}, new Component[]{null},
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)},
@ -88,7 +88,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Color"), selectBackgroundPane)}, new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Color"), selectBackgroundPane)},
new Component[]{catalogSuperLink} new Component[]{catalogSuperLink}
}; };
drillPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); drillPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(openOrClosePane, BorderLayout.NORTH); panel.add(openOrClosePane, BorderLayout.NORTH);
@ -102,13 +102,13 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
}); });
JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill"), panel); JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel1; return panel1;
} }
private JPanel createTitlePane(String title, Component component) { private JPanel createTitlePane(String title, Component component) {
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, component, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, component, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
panel.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); panel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
return panel; return panel;
} }
@ -123,9 +123,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
if (chart == null || chart.getPlot() == null) { if (chart == null || chart.getPlot() == null) {
return; return;
} }
this.chart = chart; this.chart = (VanChart) chart;
VanChartPlot plot = (VanChartPlot)chart.getPlot(); VanChartPlot plot = chart.getPlot();
if(plot instanceof VanChartDrillMapPlot){ if (plot instanceof VanChartDrillMapPlot) {
DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools(); DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools();
openOrClose.setSelectedIndex(drillMapTools.isEnable() ? 0 : 1); openOrClose.setSelectedIndex(drillMapTools.isEnable() ? 0 : 1);
textAttrPane.populate(drillMapTools.getTextAttr()); textAttrPane.populate(drillMapTools.getTextAttr());
@ -145,9 +145,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
return; return;
} }
VanChartPlot plot = (VanChartPlot) chart.getPlot(); VanChartPlot plot = chart.getPlot();
if(plot instanceof VanChartDrillMapPlot){ if (plot instanceof VanChartDrillMapPlot) {
DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools(); DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools();
drillMapTools.setEnable(openOrClose.getSelectedIndex() == 0); drillMapTools.setEnable(openOrClose.getSelectedIndex() == 0);
drillMapTools.setTextAttr(textAttrPane.update()); drillMapTools.setTextAttr(textAttrPane.update());

18
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java

@ -57,27 +57,33 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI
} }
@Override @Override
protected boolean areaPlot(Plot plot){ protected boolean areaPlot(Plot plot) {
return false; return false;
} }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartHeatMapSeriesPane(parent, plot); return new VanChartHeatMapSeriesPane(parent, plot);
} }
public ConditionAttributesPane getPlotConditionPane(Plot plot){ public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartHeatMapConditionPane(plot); return new VanChartHeatMapConditionPane(plot);
} }
/** /**
* 图表的属性界面数组 * 图表的属性界面数组
*
* @return 属性界面 * @return 属性界面
*/ */
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartMapStylePane(listener); VanChartStylePane stylePane = new VanChartMapStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){ VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() { protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithMapZoom(); return new VanChartInteractivePaneWithMapZoom() {
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
} }
}; };
return new AbstractChartAttrPane[]{stylePane, otherPane}; return new AbstractChartAttrPane[]{stylePane, otherPane};

9
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java

@ -12,24 +12,23 @@ import java.awt.Component;
/** /**
* 折线图的系列界面 * 折线图的系列界面
*/ */
public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane{ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = 5595016643808487932L; private static final long serialVersionUID = 5595016643808487932L;
public VanChartLineSeriesPane(ChartStylePane parent, Plot plot){ public VanChartLineSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot); super(parent, plot);
} }
protected JPanel getContentInPlotType(){ protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p,p}; double[] row = {p, p, p, p, p, p, p, p};
double[] col = {f}; double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createLineTypePane()}, new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()}, new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()}, new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()}, new Component[]{createTrendLinePane()},
}; };

155
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -1,6 +1,5 @@
package com.fr.van.chart.map; package com.fr.van.chart.map;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
@ -12,7 +11,6 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.base.AttrBorderWithAlpha; import com.fr.plugin.chart.base.AttrBorderWithAlpha;
import com.fr.plugin.chart.base.AttrEffect; import com.fr.plugin.chart.base.AttrEffect;
@ -21,7 +19,6 @@ import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble; import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.attr.AttrMapLabel;
import com.fr.plugin.chart.map.line.condition.AttrCurve; import com.fr.plugin.chart.map.line.condition.AttrCurve;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect; import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.type.MapMarkerType; import com.fr.plugin.chart.type.MapMarkerType;
@ -79,7 +76,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
//line //line
private VanChartCurvePane curvePane; private VanChartCurvePane curvePane;
private VanChartLineMapEffectPane lineMapEffectPane; private VanChartLineMapEffectPane lineMapEffectPane;
private UIButtonGroup<DataProcessor> lineMapLargeDataModelGroup;//大数据模式
private MapType mapType = MapType.AREA; private MapType mapType = MapType.AREA;
@ -87,53 +83,20 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
super(parent, plot); super(parent, plot);
} }
@Override protected void checkCompsEnabledWithLarge(Plot plot) {
protected void checkLarge() { checkPointCompsEnabledWithLarge(plot);
if(largeModel()) { checkLineCompsEnabledWithLarge(plot);
if(plot instanceof VanChartMapPlot) {
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrMapLabel attrMapLabel = defaultAttr.getExisted(AttrMapLabel.class);
if(attrMapLabel == null){
attrMapLabel = new AttrMapLabel();
defaultAttr.addDataSeriesCondition(attrMapLabel);
} }
attrMapLabel.getPointLabel().setEnable(false);
resetCustomCondition(((VanChartMapPlot) plot).getPointConditionCollection()); private void checkPointCompsEnabledWithLarge(Plot plot) {
if (pointEffectPane != null) {
GUICoreUtils.setEnabled(pointEffectPane, !largeModel(plot));
} }
} }
checkPointCompsEnabledWithLarge(); private void checkLineCompsEnabledWithLarge(Plot plot) {
} if (lineMapEffectPane != null) {
GUICoreUtils.setEnabled(lineMapEffectPane, !largeModel(plot));
protected void checkCompsEnabledWithLarge() {
checkPointCompsEnabledWithLarge();
checkLineCompsEnabledWithLarge();
}
private void checkPointCompsEnabledWithLarge() {
if(pointEffectPane != null) {
GUICoreUtils.setEnabled(pointEffectPane, !largeModel());
}
}
private boolean lineMapLargeModel() {
return lineMapLargeDataModelGroup != null && lineMapLargeDataModelGroup.getSelectedIndex() == 0;
}
private void checkLineMapLarge() {
if(lineMapLargeModel()) {
if(plot instanceof VanChartMapPlot) {
resetCustomCondition(((VanChartMapPlot) plot).getLineConditionCollection());
}
}
checkLineCompsEnabledWithLarge();
}
private void checkLineCompsEnabledWithLarge() {
if(lineMapEffectPane != null) {
GUICoreUtils.setEnabled(lineMapEffectPane, !lineMapLargeModel());
} }
} }
@ -195,7 +158,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), createPointAlphaPane())}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), createPointAlphaPane())},
new Component[]{createMarkerComPane()}, new Component[]{createMarkerComPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createPointEffectPane()}, new Component[]{createPointEffectPane()},
}; };
@ -212,25 +174,12 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createCurvePane()}, new Component[]{createCurvePane()},
new Component[]{createLineMapLargeDataModelPane()},
new Component[]{createAnimationPane()} new Component[]{createAnimationPane()}
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col); return TableLayoutHelper.createTableLayoutPane(components, row, col);
} }
private JPanel createLineMapLargeDataModelPane() {
lineMapLargeDataModelGroup = createLargeDataModelGroup();
lineMapLargeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLineMapLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup);
return createLargeDataModelPane(panel);
}
private Component createCurvePane() { private Component createCurvePane() {
curvePane = new VanChartCurvePane(); curvePane = new VanChartCurvePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane);
@ -257,8 +206,8 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
commonMarkerPane = new VanChartMapScatterMarkerPane(); commonMarkerPane = new VanChartMapScatterMarkerPane();
commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);
bubblePane = new VanChartBubblePane(){ bubblePane = new VanChartBubblePane() {
protected JPanel getContentPane () { protected JPanel getContentPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
@ -313,7 +262,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
JPanel panel; JPanel panel;
if (ComparatorUtils.equals(plot.getClass(), VanChartDrillMapPlot.class)) { if (ComparatorUtils.equals(plot.getClass(), VanChartDrillMapPlot.class)) {
panel = createDrillMapCustomGroupPane(areaPane, pointPane); panel = createDrillMapCustomGroupPane(areaPane, pointPane);
}else { } else {
panel = createMapCustomGroupPane(areaPane, pointPane, linePane); panel = createMapCustomGroupPane(areaPane, pointPane, linePane);
} }
return panel; return panel;
@ -334,7 +283,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (areaPointAndLineGroup.getSelectedIndex() == 0) { if (areaPointAndLineGroup.getSelectedIndex() == 0) {
cardLayout.show(centerPane, AREA_STRING); cardLayout.show(centerPane, AREA_STRING);
} else if (areaPointAndLineGroup.getSelectedIndex() == 1){ } else if (areaPointAndLineGroup.getSelectedIndex() == 1) {
cardLayout.show(centerPane, POINT_STRING); cardLayout.show(centerPane, POINT_STRING);
} else { } else {
cardLayout.show(centerPane, LINE_STRING); cardLayout.show(centerPane, LINE_STRING);
@ -375,31 +324,25 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
} }
public void populateBean(Plot plot) { public void populateBean(Plot plot) {
if(plot != null && plot instanceof VanChartMapPlot){ if (plot != null && plot instanceof VanChartMapPlot) {
if(markerTypeCom != null){ if (markerTypeCom != null) {
markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString());
} }
if(nullValueColorBox != null){ if (nullValueColorBox != null) {
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
} }
if(lineMapLargeDataModelGroup != null){
lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor());
}
} }
super.populateBean(plot); super.populateBean(plot);
} }
public void updateBean(Plot plot) { public void updateBean(Plot plot) {
if(plot != null && plot instanceof VanChartMapPlot){ if (plot != null && plot instanceof VanChartMapPlot) {
if(markerTypeCom != null){ if (markerTypeCom != null) {
((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex())); ((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex()));
} }
if(nullValueColorBox != null){ if (nullValueColorBox != null) {
((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject()); ((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject());
} }
if(lineMapLargeDataModelGroup != null){
((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem());
}
} }
super.updateBean(plot); super.updateBean(plot);
} }
@ -427,50 +370,50 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
protected void populateArea(ConditionAttr defaultAttr) { protected void populateArea(ConditionAttr defaultAttr) {
populateAlpha(defaultAttr); populateAlpha(defaultAttr);
if (borderWithAlphaPane != null) { if (borderWithAlphaPane != null) {
AttrBorderWithAlpha attrBorderWithAlpha = (AttrBorderWithAlpha) defaultAttr.getExisted(AttrBorderWithAlpha.class); AttrBorderWithAlpha attrBorderWithAlpha = defaultAttr.getExisted(AttrBorderWithAlpha.class);
borderWithAlphaPane.populate(attrBorderWithAlpha); borderWithAlphaPane.populate(attrBorderWithAlpha);
} }
} }
private void populatePoint(ConditionAttr defaultAttr) { private void populatePoint(ConditionAttr defaultAttr) {
if(pointAlphaPane != null){ if (pointAlphaPane != null) {
AttrMarkerAlpha attrAlpha = (AttrMarkerAlpha)defaultAttr.getExisted(AttrMarkerAlpha.class); AttrMarkerAlpha attrAlpha = defaultAttr.getExisted(AttrMarkerAlpha.class);
double alpha = VanChartAttrHelper.PERCENT * (attrAlpha == null ? 1 : attrAlpha.getAlpha()); double alpha = VanChartAttrHelper.PERCENT * (attrAlpha == null ? 1 : attrAlpha.getAlpha());
pointAlphaPane.populateBean(alpha); pointAlphaPane.populateBean(alpha);
} }
if(pointEffectPane != null){ if (pointEffectPane != null) {
AttrEffect attrEffect = defaultAttr.getExisted(AttrEffect.class); AttrEffect attrEffect = defaultAttr.getExisted(AttrEffect.class);
if(attrEffect == null){//老的模板做界面上的兼容 if (attrEffect == null) {//老的模板做界面上的兼容
attrEffect = new AttrEffect(3.2); attrEffect = new AttrEffect(3.2);
attrEffect.setEnabled(false); attrEffect.setEnabled(false);
} }
pointEffectPane.populateBean(attrEffect); pointEffectPane.populateBean(attrEffect);
} }
VanChartAttrMarker attrMarker = (VanChartAttrMarker) defaultAttr.getExisted(VanChartAttrMarker.class); VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
if(commonMarkerPane != null) { if (commonMarkerPane != null) {
commonMarkerPane.populateBean(attrMarker); commonMarkerPane.populateBean(attrMarker);
} }
if(imageMarkerPane != null) { if (imageMarkerPane != null) {
imageMarkerPane.populateBean(attrMarker); imageMarkerPane.populateBean(attrMarker);
} }
if(bubblePane != null) { if (bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class); VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble); bubblePane.populateBean(attrBubble);
} }
} }
private void populateLine(ConditionAttr defaultAttr) { private void populateLine(ConditionAttr defaultAttr) {
if (curvePane != null){ if (curvePane != null) {
if (defaultAttr.getExisted(AttrCurve.class) == null){ if (defaultAttr.getExisted(AttrCurve.class) == null) {
defaultAttr.addDataSeriesCondition(new AttrCurve()); defaultAttr.addDataSeriesCondition(new AttrCurve());
} }
curvePane.populateBean((AttrCurve) defaultAttr.getExisted(AttrCurve.class)); curvePane.populateBean(defaultAttr.getExisted(AttrCurve.class));
} }
if (lineMapEffectPane != null){ if (lineMapEffectPane != null) {
if (defaultAttr.getExisted(AttrLineEffect.class) == null){ if (defaultAttr.getExisted(AttrLineEffect.class) == null) {
defaultAttr.addDataSeriesCondition(new AttrLineEffect()); defaultAttr.addDataSeriesCondition(new AttrLineEffect());
} }
AttrLineEffect attrLineEffect = defaultAttr.getExisted(AttrLineEffect.class); AttrLineEffect attrLineEffect = defaultAttr.getExisted(AttrLineEffect.class);
@ -498,40 +441,40 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
} }
} }
protected void checkoutMapType(Plot plot){ protected void checkoutMapType(Plot plot) {
this.mapType = ((VanChartMapPlot)plot).getMapType(); this.mapType = ((VanChartMapPlot) plot).getMapType();
} }
protected void updateArea(ConditionAttr defaultAttr) { protected void updateArea(ConditionAttr defaultAttr) {
updateAlpha(defaultAttr); updateAlpha(defaultAttr);
if (borderWithAlphaPane != null) { if (borderWithAlphaPane != null) {
AttrBorderWithAlpha attrBorderWithAlpha = (AttrBorderWithAlpha) defaultAttr.getExisted(AttrBorderWithAlpha.class); AttrBorderWithAlpha attrBorderWithAlpha = defaultAttr.getExisted(AttrBorderWithAlpha.class);
defaultAttr.remove(attrBorderWithAlpha); defaultAttr.remove(attrBorderWithAlpha);
defaultAttr.addDataSeriesCondition(borderWithAlphaPane.update()); defaultAttr.addDataSeriesCondition(borderWithAlphaPane.update());
} }
} }
private void updatePoint(ConditionAttr defaultAttr) { private void updatePoint(ConditionAttr defaultAttr) {
if(pointAlphaPane != null){ if (pointAlphaPane != null) {
AttrMarkerAlpha attrAlpha = (AttrMarkerAlpha)defaultAttr.getExisted(AttrMarkerAlpha.class); AttrMarkerAlpha attrAlpha = defaultAttr.getExisted(AttrMarkerAlpha.class);
if(attrAlpha == null){ if (attrAlpha == null) {
attrAlpha = new AttrMarkerAlpha(); attrAlpha = new AttrMarkerAlpha();
defaultAttr.addDataSeriesCondition(attrAlpha); defaultAttr.addDataSeriesCondition(attrAlpha);
} }
attrAlpha.setAlpha((float)(pointAlphaPane.updateBean()/VanChartAttrHelper.PERCENT)); attrAlpha.setAlpha((float) (pointAlphaPane.updateBean() / VanChartAttrHelper.PERCENT));
} }
if(pointEffectPane != null){ if (pointEffectPane != null) {
AttrEffect attrEffect = defaultAttr.getExisted(AttrEffect.class); AttrEffect attrEffect = defaultAttr.getExisted(AttrEffect.class);
defaultAttr.remove(attrEffect); defaultAttr.remove(attrEffect);
defaultAttr.addDataSeriesCondition(pointEffectPane.updateBean()); defaultAttr.addDataSeriesCondition(pointEffectPane.updateBean());
} }
VanChartAttrMarker attrMarker = (VanChartAttrMarker) defaultAttr.getExisted(VanChartAttrMarker.class); VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
defaultAttr.remove(attrMarker); defaultAttr.remove(attrMarker);
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class); VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
defaultAttr.remove(attrBubble); defaultAttr.remove(attrBubble);
if(markerTypeCom != null) { if (markerTypeCom != null) {
if (markerTypeCom.getSelectedIndex() == 1) { if (markerTypeCom.getSelectedIndex() == 1) {
defaultAttr.addDataSeriesCondition(commonMarkerPane.updateBean()); defaultAttr.addDataSeriesCondition(commonMarkerPane.updateBean());
} else if (markerTypeCom.getSelectedIndex() == 2) { } else if (markerTypeCom.getSelectedIndex() == 2) {
@ -543,17 +486,17 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
} }
private void updateLine(ConditionAttr defaultAttr) { private void updateLine(ConditionAttr defaultAttr) {
if(curvePane != null){ if (curvePane != null) {
AttrCurve attrCurve = defaultAttr.getExisted(AttrCurve.class); AttrCurve attrCurve = defaultAttr.getExisted(AttrCurve.class);
if(attrCurve != null){ if (attrCurve != null) {
defaultAttr.remove(AttrCurve.class); defaultAttr.remove(AttrCurve.class);
} }
attrCurve = curvePane.updateBean(); attrCurve = curvePane.updateBean();
defaultAttr.addDataSeriesCondition(attrCurve); defaultAttr.addDataSeriesCondition(attrCurve);
} }
if (lineMapEffectPane != null){ if (lineMapEffectPane != null) {
AttrLineEffect attrLineEffect = defaultAttr.getExisted(AttrLineEffect.class); AttrLineEffect attrLineEffect = defaultAttr.getExisted(AttrLineEffect.class);
if (attrLineEffect != null){ if (attrLineEffect != null) {
defaultAttr.remove(AttrLineEffect.class); defaultAttr.remove(AttrLineEffect.class);
} }
attrLineEffect = (AttrLineEffect) lineMapEffectPane.updateBean(); attrLineEffect = (AttrLineEffect) lineMapEffectPane.updateBean();

27
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java

@ -1,12 +1,9 @@
package com.fr.van.chart.map.designer.other; package com.fr.van.chart.map.designer.other;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.AutoRefreshPane; import com.fr.van.chart.designer.other.AutoRefreshPane;
import com.fr.van.chart.designer.other.AutoRefreshPaneWithoutTooltip; import com.fr.van.chart.designer.other.AutoRefreshPaneWithoutTooltip;
@ -20,11 +17,13 @@ import javax.swing.JPanel;
public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZoom { public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZoom {
private static final int HYPERLINK_LEFT_GAP = 36; private static final int HYPERLINK_LEFT_GAP = 36;
private VanChartMapHyperLinkPane hyperlinkPane; private VanChartMapHyperLinkPane hyperlinkPane;
@Override @Override
protected JPanel createHyperlinkPane() { protected JPanel createHyperlinkPane() {
hyperlinkPane = new VanChartMapHyperLinkPane(); hyperlinkPane = new VanChartMapHyperLinkPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperlinkPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperlinkPane);
} }
@Override @Override
protected void populateHyperlink(Plot plot) { protected void populateHyperlink(Plot plot) {
hyperlinkPane.populateBean(plot); hyperlinkPane.populateBean(plot);
@ -36,26 +35,22 @@ public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZo
} }
@Override @Override
protected boolean largeModel(Plot plot) { protected boolean isCurrentChartSupportLargeDataMode() {
if(plot instanceof VanChartMapPlot){ if (this.chart == null || this.chart.getPlot() == null) {
VanChartMapPlot mapPlot = (VanChartMapPlot)plot;
switch (mapPlot.getMapType()){
case LINE:
return PlotFactory.lineMapLargeModel(mapPlot);
default:
return PlotFactory.largeDataModel(mapPlot);
}
}
return false; return false;
} }
VanChartMapPlot mapPlot = this.chart.getPlot();
return mapPlot.getMapType() == MapType.POINT || mapPlot.getMapType() == MapType.LINE;
}
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
boolean isLargeModel = largeModel(plot); boolean isLargeModel = largeModel(plot);
VanChartMapPlot mapPlot = (VanChartMapPlot)plot; VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
if (mapPlot.getMapType().equals(MapType.LINE)) { if (mapPlot.getMapType().equals(MapType.LINE)) {
return new AutoRefreshPaneWithoutTooltip((VanChart) chart, isLargeModel); return new AutoRefreshPaneWithoutTooltip(chart, isLargeModel);
} }
return new AutoRefreshPane((VanChart) chart, isLargeModel); return new AutoRefreshPane(chart, isLargeModel);
} }
} }

3
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java

@ -46,7 +46,7 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this)); classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(AttrCurve.class, new VanChartCurveConditionPane(this)); classPaneMap.put(AttrCurve.class, new VanChartCurveConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartLineMapTooltipConditionPane(this, plot)); classPaneMap.put(AttrTooltip.class, new VanChartLineMapTooltipConditionPane(this, plot));
if(!PlotFactory.lineMapLargeModel(plot)){ if (!PlotFactory.largeDataModel(plot)) {
classPaneMap.put(AttrLineEffect.class, new VanChartLineEffectConditionPane(this, EffectHelper.getLineMapDefaultLineEffect())); classPaneMap.put(AttrLineEffect.class, new VanChartLineEffectConditionPane(this, EffectHelper.getLineMapDefaultLineEffect()));
} }
} }
@ -56,6 +56,7 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
/** /**
* 返回图表class对象 * 返回图表class对象
*
* @return class对象 * @return class对象
*/ */
public Class<? extends Plot> class4Correspond() { public Class<? extends Plot> class4Correspond() {

26
designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java

@ -16,6 +16,7 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.scatter.component.VanChartScatterStylePane; import com.fr.van.chart.scatter.component.VanChartScatterStylePane;
import com.fr.van.chart.scatter.data.VanChartScatterPlotTableDataContentPane; import com.fr.van.chart.scatter.data.VanChartScatterPlotTableDataContentPane;
@ -56,18 +57,19 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
public String getIconPath() { public String getIconPath() {
return "com/fr/design/images/form/toolbar/scatter.png"; return "com/fr/design/images/form/toolbar/scatter.png";
} }
@Override @Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartScatterSeriesPane(parent, plot); return new VanChartScatterSeriesPane(parent, plot);
} }
@Override @Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return new VanChartScatterPlotTableDataContentPane(parent); return new VanChartScatterPlotTableDataContentPane(parent);
} }
@Override @Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return new BubblePlotReportDataContentPane(parent); return new BubblePlotReportDataContentPane(parent);
} }
@ -76,19 +78,29 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
* 图表的属性界面数组 * 图表的属性界面数组
* @return 属性界面 * @return 属性界面
*/ */
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartScatterStylePane(listener); VanChartStylePane stylePane = new VanChartScatterStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){ VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override @Override
protected BasicBeanPane<Chart> createInteractivePane() { protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort(); return new VanChartInteractivePaneWithOutSort() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
} }
}; };
return new AbstractChartAttrPane[]{stylePane, otherPane}; return new AbstractChartAttrPane[]{stylePane, otherPane};
} }
public ConditionAttributesPane getPlotConditionPane(Plot plot){ public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartScatterConditionPane(plot); return new VanChartScatterConditionPane(plot);
} }
} }

20
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -5,7 +5,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane; import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane; import com.fr.van.chart.designer.component.VanChartLineTypePane;
@ -20,19 +19,19 @@ import java.awt.Component;
/** /**
* 散点图的系列界面 * 散点图的系列界面
*/ */
public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = 5595016643808487932L; private static final long serialVersionUID = 5595016643808487932L;
public VanChartScatterSeriesPane(ChartStylePane parent, Plot plot){ public VanChartScatterSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot); super(parent, plot);
} }
protected JPanel getContentInPlotType(){ protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p,p,p,p}; double[] row = {p, p, p, p, p, p, p, p, p, p};
double[] col = {f}; double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -40,7 +39,6 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
new Component[]{createLineTypePane()}, new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()}, new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()}, new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()}, new Component[]{createTrendLinePane()},
}; };
@ -49,21 +47,21 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
} }
//设置色彩面板内容 //设置色彩面板内容
protected void setColorPaneContent (JPanel panel) { protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.CENTER); panel.add(createAlphaPane(), BorderLayout.CENTER);
} }
@Override @Override
//堆积和坐标轴设置(自定义柱形图等用到) //堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() { protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(){ stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane() {
@Override @Override
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() { protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomAxisConditionPane.class; return VanChartCustomAxisConditionPane.class;
} }
@Override @Override
public String getPaneTitle(){ public String getPaneTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
} }
}; };
@ -77,8 +75,8 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
} }
@Override @Override
protected void checkCompsEnabledWithLarge() { protected void checkCompsEnabledWithLarge(Plot plot) {
super.checkCompsEnabledWithLarge(); super.checkCompsEnabledWithLarge(this.plot);
checkLinePane(); checkLinePane();
} }

22
designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java

@ -1,16 +1,11 @@
package com.fr.van.chart.scatter.component; package com.fr.van.chart.scatter.component;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle; import com.fr.plugin.chart.type.LineStyle;
import com.fr.stable.Constants; import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane; import com.fr.van.chart.designer.component.VanChartLineTypePane;
import javax.swing.JPanel;
import java.awt.Component; import java.awt.Component;
/** /**
@ -26,24 +21,17 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
} }
@Override @Override
protected JPanel createContentPane(double p, double f) { protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
double[] row = {p,p,p}; return new Component[][]{
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; lineStyleComponent
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col);
} }
@Override @Override
protected VanChartAttrLine initVanChartAttrLine() { protected VanChartAttrLine initVanChartAttrLine() {
VanChartAttrLine attrLine = new VanChartAttrLine(); VanChartAttrLine attrLine = new VanChartAttrLine();
//默认为无线型,且默認空值不斷開 //默认为无线型,且默認空值不斷開
attrLine.setLineWidth(Constants.LINE_NONE); attrLine.setLineType(LineType.NONE);
attrLine.setNullValueBreak(false); attrLine.setNullValueBreak(false);
return attrLine; return attrLine;
} }

31
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java → designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java

@ -3,6 +3,10 @@ package com.fr.van.chart.structure.desinger;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -12,9 +16,10 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPaneWithOutMode;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.structure.desinger.data.StructurePlotReportDataContentPane; import com.fr.van.chart.structure.desinger.data.StructurePlotReportDataContentPane;
import com.fr.van.chart.structure.desinger.data.StructurePlotTableDataContentPane; import com.fr.van.chart.structure.desinger.data.StructurePlotTableDataContentPane;
@ -26,7 +31,7 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
/** /**
* Created by shine on 2017/2/15. * Created by shine on 2017/2/15.
*/ */
public class StructureIndependentVanChartInterface extends AbstractIndependentVanChartUI { public class VanStructureChartTypeUI extends AbstractIndependentVanChartUI {
@Override @Override
public AbstractChartTypePane getPlotTypePane() { public AbstractChartTypePane getPlotTypePane() {
return new VanChartStructureTypePane(); return new VanChartStructureTypePane();
@ -84,16 +89,9 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartInteractivePaneWithOutSort(){ return new VanChartInteractivePaneWithOutSort(){
@Override @Override
protected String[] getNameArray() { protected ZoomPane createZoomPane() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}; return new ZoomPaneWithOutMode();
} }
@Override
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
}; };
} }
}; };
@ -105,8 +103,13 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartStructureConditionPane(plot); return new VanChartStructureConditionPane(plot);
} }
/* @Override @Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) { public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new StructureChartDataPane(listener); return new AbstractVanSingleDataPane(listener) {
}*/ @Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());
}
};
}
} }

42
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

@ -1,6 +1,10 @@
package com.fr.van.chart.vanchart; package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
@ -9,23 +13,51 @@ import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContent
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane; import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane;
import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane; import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
/** /**
* Created by mengao on 2017/7/6. * Created by mengao on 2017/7/6.
*/ */
public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependentVanChartUI { public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependentVanChartUI {
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
//自定义组合图特殊处理 //自定义组合图特殊处理
if (((VanChartPlot)plot).isInCustom() && ((VanChartPlot)plot).getCustomType().equals("CUSTOM")) { if (((VanChartPlot) plot).isInCustom() && ((VanChartPlot) plot).getCustomType().equals("CUSTOM")) {
return new CategoryPlotTableDataContentPane(parent); return new CategoryPlotTableDataContentPane(parent);
} }
return new VanChartMoreCateTableDataContentPane(parent); } return new VanChartMoreCateTableDataContentPane(parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
//自定义组合图特殊处理 //自定义组合图特殊处理
if (((VanChartPlot)plot).isInCustom() && ((VanChartPlot)plot).getCustomType().equals("CUSTOM")) { if (((VanChartPlot) plot).isInCustom() && ((VanChartPlot) plot).getCustomType().equals("CUSTOM")) {
return new CategoryPlotReportDataContentPane(parent); return new CategoryPlotReportDataContentPane(parent);
} }
return new VanChartMoreCateReportDataContentPane(parent); return new VanChartMoreCateReportDataContentPane(parent);
} }
@Override
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePane() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
} }

13
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

@ -10,9 +10,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPaneWithOutMode;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
import com.fr.van.chart.wordcloud.designer.other.VanChartWordCloudConditionPane; import com.fr.van.chart.wordcloud.designer.other.VanChartWordCloudConditionPane;
@ -83,14 +84,8 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa
return new VanChartInteractivePaneWithOutSort(){ return new VanChartInteractivePaneWithOutSort(){
@Override @Override
protected String[] getNameArray() { protected ZoomPane createZoomPane() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}; return new ZoomPaneWithOutMode();
}
@Override
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
} }
}; };
} }

3
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java

@ -92,6 +92,9 @@ public class XCardAddButton extends XButton {
if(cardLayout == null && tagLayout ==null ){ if(cardLayout == null && tagLayout ==null ){
initRelateLayout(); initRelateLayout();
} }
if (cardLayout == null) {
throw new IllegalArgumentException("cardLayout can not be null");
}
int index = cardLayout.toData().getWidgetCount(); int index = cardLayout.toData().getWidgetCount();
//添加新的tab,并将原来的设为未选中状态 //添加新的tab,并将原来的设为未选中状态

4
designer-form/src/main/java/com/fr/design/form/layout/FRTitleLayout.java

@ -126,15 +126,17 @@ public class FRTitleLayout implements FRLayoutManager, LayoutManager{
int titleH = title==null ? 0 : WTitleLayout.TITLE_HEIGHT; int titleH = title==null ? 0 : WTitleLayout.TITLE_HEIGHT;
for (int i=0; i< target.getComponentCount(); i++) { for (int i=0; i< target.getComponentCount(); i++) {
Component comp = target.getComponent(i); Component comp = target.getComponent(i);
if (comp != null) {
if (comp == title) { if (comp == title) {
comp.setBounds(0, 0, width, WTitleLayout.TITLE_HEIGHT); comp.setBounds(0, 0, width, WTitleLayout.TITLE_HEIGHT);
} else if (comp == body) { } else if (comp == body) {
int y = titleH+gap; int y = titleH + gap;
comp.setBounds(0, y, width, height-y); comp.setBounds(0, y, width, height-y);
} }
} }
} }
} }
}
public Object getConstraints(Component comp) { public Object getConstraints(Component comp) {
if (comp == null){ if (comp == null){

2
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -573,8 +573,8 @@ public class EditingMouseListener extends MouseInputAdapter {
GUICoreUtils.showPopupMenu(cellPopupMenu, designer, e.getX(), e.getY()); GUICoreUtils.showPopupMenu(cellPopupMenu, designer, e.getX(), e.getY());
} }
} }
}
creator.doLayout(); creator.doLayout();
}
LayoutUtils.layoutRootContainer(designer.getRootComponent()); LayoutUtils.layoutRootContainer(designer.getRootComponent());
} }

6
designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -16,6 +16,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.upm.event.CertificateEvent; import com.fr.design.upm.event.CertificateEvent;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -28,10 +29,8 @@ import com.fr.general.DateUtils;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Desktop; import java.awt.Desktop;
@ -142,7 +141,8 @@ public class UserInfoLabel extends UILabel {
@Override @Override
public void run() { public void run() {
// vito:最新mac10.12和javafx弹出框初始化时会有大几率卡死在native方法,这里先屏蔽一下。 // vito:最新mac10.12和javafx弹出框初始化时会有大几率卡死在native方法,这里先屏蔽一下。
if (!FRContext.isChineseEnv() || OperatingSystem.isMacOS()) { //ARM下暂时也不能用javafx
if (!SupportOSImpl.BBSDIALOG.support()) {
return; return;
} }
String lastBBSNewsTime = DesignerEnvManager.getEnvManager().getLastShowBBSNewsTime(); String lastBBSNewsTime = DesignerEnvManager.getEnvManager().getLastShowBBSNewsTime();

11
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -8,6 +8,7 @@ import com.fr.base.passport.FinePassportManager;
import com.fr.base.process.ProcessOperator; import com.fr.base.process.ProcessOperator;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.decision.update.backup.RecoverManager;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.NewFormAction; import com.fr.design.actions.NewFormAction;
@ -54,9 +55,11 @@ import com.fr.design.mainframe.form.FormReportComponentComposite;
import com.fr.design.mainframe.loghandler.DesignerLogAppender; import com.fr.design.mainframe.loghandler.DesignerLogAppender;
import com.fr.design.mainframe.socketio.DesignerSocketIO; import com.fr.design.mainframe.socketio.DesignerSocketIO;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.parameter.FormParameterReader; import com.fr.design.parameter.FormParameterReader;
import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.parameter.WorkBookParameterReader;
import com.fr.design.update.actions.RecoverForDesigner;
import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane;
import com.fr.form.stable.ElementCaseThumbnailProcessor; import com.fr.form.stable.ElementCaseThumbnailProcessor;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
@ -91,6 +94,8 @@ import com.fr.report.cell.painter.CellImagePainter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.stable.plugin.ExtraDesignClassManagerProvider; import com.fr.stable.plugin.ExtraDesignClassManagerProvider;
import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.script.CalculatorProviderContext;
import com.fr.stable.script.ValueConverter; import com.fr.stable.script.ValueConverter;
@ -125,9 +130,15 @@ public class DesignerActivator extends Activator {
designerModuleStart(); designerModuleStart();
loadLogAppender(); loadLogAppender();
DesignerSocketIO.update(); DesignerSocketIO.update();
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
UserInfoPane.getInstance().updateBBSUserInfo(); UserInfoPane.getInstance().updateBBSUserInfo();
}
}, SupportOSImpl.USERINFOPANE);
storePassport(); storePassport();
AlphaFineHelper.switchConfig4Locale(); AlphaFineHelper.switchConfig4Locale();
RecoverManager.register(new RecoverForDesigner());
} }
@Override @Override

Loading…
Cancel
Save