Browse Source

Pull request #4714: CHART-18787 design 对接扩展图表 & conflict

Merge in DESIGN/design from ~ZHENG/c-design:feature/big-screen to feature/big-screen

* commit '7ae9d5554d0f8af2d6ab26aa6506d6cdc895820a':
  merge
  merge:REPORT-49986 【10.0.16】性能优化之阻塞EDT线程时优化 fix
  merge:REPORT-51958 远程环境检测及同步
  merge:REPORT-53626 设计器启动异常
  merge:REPORT-53229 补上空格
  merge:REPORT-53229 设计器顶部版本号信息改为小版本信息
  merge:REPORT-51442 菜单栏和数据集面板灰化问题
  merge:先把我自己的改回去
  feat:对接扩展图表
feature/big-screen
zheng 3 years ago
parent
commit
31e11800c9
  1. 1
      designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java
  2. 391
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java
  4. 32
      designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java
  5. 1
      designer-chart/src/main/java/com/fr/design/chart/fun/IndependentChartUIProvider.java
  6. 58
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java
  7. 1
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  8. 38
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/DefaultChartTypePane.java
  9. 13
      designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractDataPane.java
  10. 5
      designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractOtherPane.java

1
designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

@ -246,6 +246,7 @@ public class CenterRegionContainerPane extends JPanel {
((UIToolbar ) toolbarComponent).refreshUIToolBar(); ((UIToolbar ) toolbarComponent).refreshUIToolBar();
} }
combineUp.refreshUIToolBar(); combineUp.refreshUIToolBar();
getToolBarMenuDock().updateEnable();
} }
} }

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

@ -4,9 +4,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.chart.exception.ChartNotFoundException;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
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.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
@ -22,24 +20,16 @@ import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.OemProcessor; import com.fr.design.fun.OemProcessor;
import com.fr.design.fun.TitlePlaceProcessor;
import com.fr.design.fun.impl.AbstractTemplateTreeShortCutProvider; import com.fr.design.fun.impl.AbstractTemplateTreeShortCutProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuHighLight;
import com.fr.design.gui.iprogressbar.ProgressDialog; import com.fr.design.gui.iprogressbar.ProgressDialog;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; 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.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.os.impl.MacOsAddListenerAction; import com.fr.design.os.impl.MacOsAddListenerAction;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
@ -51,47 +41,32 @@ import com.fr.file.FILE;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
import com.fr.file.FileFILE; import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
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.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter; 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;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JLayeredPane; import javax.swing.JLayeredPane;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.WindowConstants; import javax.swing.WindowConstants;
import javax.swing.border.MatteBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
@ -117,6 +92,7 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener {
@ -126,8 +102,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final long serialVersionUID = -8732559571067484460L; private static final long serialVersionUID = -8732559571067484460L;
private static final int LEFT_ALIGN_GAP = -5;
private static final int MENU_HEIGHT = 26; private static final int MENU_HEIGHT = 26;
private static final Integer SECOND_LAYER = 100; private static final Integer SECOND_LAYER = 100;
@ -138,22 +112,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private ToolBarMenuDock ad; private ToolBarMenuDock ad;
private DesktopCardPane centerTemplateCardPane;
private JPanel toolbarPane;
private JComponent toolbarComponent;
private JPanel menuPane;
private JMenuBar menuBar;
private JPanel eastCenterPane;
private UIToolbar combineUp;
private NewTemplatePane newWorkBookPane;
private Icon closeMode; private Icon closeMode;
private JLayeredPane layeredPane = this.getLayeredPane(); private JLayeredPane layeredPane = this.getLayeredPane();
@ -275,37 +233,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// the content pane // the content pane
basePane.setLayout(new BorderLayout()); basePane.setLayout(new BorderLayout());
toolbarPane = new JPanel() {
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); basePane.add(CenterRegionContainerPane.getInstance(), BorderLayout.CENTER);
// dim.height = TOOLBAR_HEIGHT;
return dim;
}
};
toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eastPane.add(ad.createLargeToolbar(), BorderLayout.WEST);
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
combineUpTooBar();
eastCenterPane.add(combineUp, BorderLayout.NORTH);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(newWorkBookPane = ad.getNewTemplatePane(), BorderLayout.WEST);
panel.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER);
eastCenterPane.add(panel, BorderLayout.CENTER);
eastPane.add(eastCenterPane, BorderLayout.CENTER);
toolbarPane.add(eastPane, BorderLayout.NORTH);
toolbarPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER);
centerPane.add(toolbarPane, BorderLayout.NORTH);
basePane.add(centerPane, BorderLayout.CENTER);
laoyoutWestPane(); laoyoutWestPane();
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST);
basePane.setBounds(0, 0, contentWidth, contentHeight); basePane.setBounds(0, 0, contentWidth, contentHeight);
@ -413,7 +342,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public DesktopCardPane getCenterTemplateCardPane() { public DesktopCardPane getCenterTemplateCardPane() {
return centerTemplateCardPane; return CenterRegionContainerPane.getInstance().getCenterTemplateCardPane();
}
public void refreshUIToolBar() {
CenterRegionContainerPane.getInstance().refreshUIToolBar();
} }
/** /**
@ -421,82 +354,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
protected void initMenuPane() { protected void initMenuPane() {
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); basePane.add(NorthRegionContainerPane.getInstance(), BorderLayout.NORTH);
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null); this.resetToolkitByPlus(null);
} }
/**
* @param ad 菜单栏
* @return panel
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (DesignerContext.getDesignerFrame() == null) {
return;
}
DesignerContext.getDesignerFrame().refresh();
DesignerContext.getDesignerFrame().repaint();
}
});
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
}
});
refreshNorthEastPane(northEastPane, ad);
return northEastPane;
}
private void refreshNorthEastPane(final JPanel northEastPane, final ToolBarMenuDock ad) {
northEastPane.removeAll();
northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
northEastPane.add(LogMessageBar.getInstance());
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor != null) {
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());
if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
ad.createAlphaFinePane().setVisible(false);
}
northEastPane.add(ad.createNotificationCenterPane());
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
northEastPane.add(ad.createBBSLoginPane());
}
}, SupportOSImpl.USERINFOPANE);
}
public void initTitleIcon() { public void initTitleIcon() {
try { try {
@ -673,94 +534,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.closeMode = closeMode; this.closeMode = closeMode;
} }
/**
* 创建上工具栏
*/
private void combineUpTooBar() {
combineUp = new UIToolbar(FlowLayout.LEFT);
combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR));
combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2));
setUpUpToolBar(null);
}
/**
* 重置上工具栏
*/
private void resetCombineUpTooBar(JComponent[] toolbar4Form) {
combineUp.removeAll();
setUpUpToolBar(toolbar4Form);
}
/**
* 填充上工具栏的中的工具
*
* @param toolbar4Form 目标组件
*/
private void setUpUpToolBar(@Nullable JComponent[] toolbar4Form) {
UIButton[] fixButtons = ad.createUp();
for (UIButton fixButton : fixButtons) {
combineUp.add(fixButton);
}
if (!DesignModeContext.isAuthorityEditing()) {
combineUp.addSeparator(new Dimension(2, 16));
if (toolbar4Form != null) {
for (JComponent jComponent : toolbar4Form) {
combineUp.add(jComponent);
}
}
//添加检测按钮
addCheckButton();
}
//添加分享按钮
addShareButton();
//添加插件中的按钮
addExtraButtons();
}
private void addExtraButtons() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
UIButton[] extraButtons = jt.createExtraButtons();
for (UIButton extraButton : extraButtons) {
combineUp.add(extraButton);
}
if (extraButtons.length > 0) {
combineUp.addSeparator(new Dimension(2, 16));
}
}
private void addCheckButton() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
combineUp.addSeparator(new Dimension(2, 16));
UIButton[] checkButtons = jt.createCheckButton();
for (UIButton checkButton : checkButtons) {
combineUp.add(checkButton);
}
}
private void addShareButton() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
combineUp.addSeparator(new Dimension(2, 16));
UIButton[] shareButtons = jt.createShareButton();
for (UIButton shareButton : shareButtons) {
combineUp.add(shareButton);
}
}
/** /**
* 检查 * 检查
* *
@ -768,17 +541,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param al 组件名称 * @param al 组件名称
*/ */
public void checkCombineUp(boolean flag, ArrayList<String> al) { public void checkCombineUp(boolean flag, ArrayList<String> al) {
//Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 CenterRegionContainerPane.getInstance().checkCombineUp(flag, al);
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
// 第一个条件满足后还需要添加一重判断,判断是编辑报表块还是参数面板,编辑报表块时则直接return
if (jTemplate.getMenuState() == DesignState.WORK_SHEET && !jTemplate.isUpMode()) {
return;
}
combineUp.checkComponentsByNames(flag, al);
}
} }
/** /**
* 刷新工具条. * 刷新工具条.
*/ */
@ -787,6 +553,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.ad.updateToolBarDef(); this.ad.updateToolBarDef();
} }
ToolBarMenuDock getToolBarMenuDock() {
return this.ad;
}
/** /**
* 重置相关的工具条. * 重置相关的工具条.
* *
@ -798,39 +568,18 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
plus = ToolBarMenuDock.NULLAVOID; plus = ToolBarMenuDock.NULLAVOID;
} }
DesignState designState = new DesignState(plus); NorthRegionContainerPane.getInstance().resetToolkitByPlus(plus, ad);
MenuManager.getInstance().setMenus4Designer(designState);
if (menuBar == null) {
menuPane.add(menuBar = ad.createJMenuBar(plus), BorderLayout.CENTER);
} else {
ad.resetJMenuBar(menuBar, plus);
}
resetCombineUpTooBar(ad.resetUpToolBar(plus));
if (toolbarComponent != null) {
toolbarPane.remove(toolbarComponent);
}
// 颜色,字体那些按钮的工具栏 CenterRegionContainerPane.getInstance().resetToolkitByPlus(plus, ad);
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
this.checkToolbarMenuEnable(); this.checkToolbarMenuEnable();
this.validate(); this.validate();
layeredPane.repaint(); layeredPane.repaint();
} }
public void refreshUIToolBar() {
if (toolbarComponent instanceof UIToolbar) {
((UIToolbar ) toolbarComponent).refreshUIToolBar();
}
combineUp.refreshUIToolBar();
this.ad.updateEnable();
}
public JComponent getToolbarComponent() { public JComponent getToolbarComponent() {
return this.toolbarComponent; return CenterRegionContainerPane.getInstance().getToolbarComponent();
} }
/** /**
@ -838,7 +587,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
public void needToAddAuhtorityPaint() { public void needToAddAuhtorityPaint() {
newWorkBookPane.setButtonGray(DesignModeContext.isAuthorityEditing()); CenterRegionContainerPane.getInstance().needToAddAuhtorityPaint();
// 进入或退出权限编辑模式,通知插件 // 进入或退出权限编辑模式,通知插件
Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts(); Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts();
@ -956,7 +705,43 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
public JTemplate<?, ?> getSelectedJTemplate() { public JTemplate<?, ?> getSelectedJTemplate() {
return this.centerTemplateCardPane.getSelectedJTemplate(); return getCenterTemplateCardPane().getSelectedJTemplate();
}
/**
* 保存当前编辑的模板
*/
public void saveCurrentEditingTemplate() {
JTemplate<?, ?> editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (editingTemplate == null) {
return;
}
if (editingTemplate.isSaved()) {// isSaved == true表示已经保存过,或者新建的一张模板
if (editingTemplate.getEditingFILE().exists()) {// 表示磁盘上的某一张已经保存过的模板,要添加到历史中
// HistoryTemplateListPane.getInstance().addHistory();
}
} else {
editingTemplate.stopEditing();
if (!editingTemplate.getEditingFILE().exists()) {
int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + editingTemplate.getEditingFILE()
+ "\" ?", Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) {
editingTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved",
editingTemplate.getEditingFILE().getName()));
}
} else {
if (editingTemplate.saveTemplate()) {
editingTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved",
editingTemplate.getEditingFILE().getName()));
}
}
}
} }
/** /**
@ -985,10 +770,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (jt == null || jt.getEditingFILE() == null) { if (jt == null || jt.getEditingFILE() == null) {
return; return;
} }
if (currentTemplateDeactivateFail()) {
return;
}
jt.addJTemplateActionListener(this); jt.addJTemplateActionListener(this);
jt.addTargetModifiedListener(this); jt.addTargetModifiedListener(this);
jt.addJTemplateActionListener(VcsHelper.getInstance()); jt.addJTemplateActionListener(VcsHelper.getInstance());
centerTemplateCardPane.showJTemplate(jt); getCenterTemplateCardPane().showJTemplate(jt);
refreshBaseContentPane(jt);
setTitle(); setTitle();
layeredPane.repaint(); layeredPane.repaint();
} }
@ -1006,11 +795,57 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (jt == null || jt.getEditingFILE() == null) { if (jt == null || jt.getEditingFILE() == null) {
return; return;
} }
centerTemplateCardPane.showJTemplate(jt); if (currentTemplateDeactivateFail()) {
return;
}
getCenterTemplateCardPane().showJTemplate(jt);
refreshBaseContentPane(jt);
setTitle(); setTitle();
layeredPane.repaint(); layeredPane.repaint();
} }
/**
* 当前模板 停用失败
*
* @return 是否停用失败
*/
private boolean currentTemplateDeactivateFail() {
JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
return currentEditingTemplate != null && !currentEditingTemplate.deactivateTemplate();
}
/**
* 根据模板刷新 设计器整个界面
*
* @param jTemplate 当前模板
*/
private void refreshBaseContentPane(JTemplate jTemplate) {
JComponent north = jTemplate.north4DesignerFrame(),
center = jTemplate.center4DesignerFrame(),
west = jTemplate.west4DesignerFrame(),
east = jTemplate.east4DesignerFrame();
basePane.removeAll();
if (north != null) {
basePane.add(north, BorderLayout.NORTH);
}
if (center != null) {
basePane.add(center, BorderLayout.CENTER);
}
if (west != null) {
basePane.add(west, BorderLayout.WEST);
}
if (east != null) {
basePane.add(east, BorderLayout.EAST);
}
layeredPane.repaint();
layeredPane.revalidate();
}
/** /**
* 对象侦听 * 对象侦听
* *
@ -1082,16 +917,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
JOptionPane.WARNING_MESSAGE, JOptionPane.WARNING_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon") UIManager.getIcon("OptionPane.errorIcon")
); );
if (this.getSelectedJTemplate() == null) {
addAndActivateJTemplate();
}
} catch (ChartNotFoundException e) {
FineJOptionPane.showMessageDialog(this,
Toolkit.i18nText("Fine-Design_Chart_Not_Found_Exception"),
Toolkit.i18nText("Fine-Design_Basic_Error"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon"));
if (this.getSelectedJTemplate() == null) { if (this.getSelectedJTemplate() == null) {
addAndActivateJTemplate(); addAndActivateJTemplate();
} }
@ -1314,4 +1139,4 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
return designerOpened; return designerOpened;
} }
} }

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

@ -116,6 +116,8 @@ public class NorthRegionContainerPane extends JPanel {
if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
ad.createAlphaFinePane().setVisible(false); ad.createAlphaFinePane().setVisible(false);
} }
northEastPane.add(ad.createNotificationCenterPane());
OSSupportCenter.buildAction(new OSBasedAction() { OSSupportCenter.buildAction(new OSBasedAction() {
@Override @Override
public void execute(Object... objects) { public void execute(Object... objects) {

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

@ -89,7 +89,9 @@ public interface ChartTypeUIProvider extends Level {
//todo:把下面这些接口删除 //todo:把下面这些接口删除
@Deprecated @Deprecated
boolean needChartChangePane(); default boolean needChartChangePane() {
return false;
}
/** /**
* 数据集数据源的界面 * 数据集数据源的界面
@ -97,7 +99,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 数据集数据源的界面 * @return 数据集数据源的界面
*/ */
@Deprecated @Deprecated
AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent); default AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
/** /**
@ -106,7 +110,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 单元格数据源的界面 * @return 单元格数据源的界面
*/ */
@Deprecated @Deprecated
AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent); default AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
/** /**
* 条件属性界面 * 条件属性界面
@ -114,7 +120,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 条件属性界面 * @return 条件属性界面
*/ */
@Deprecated @Deprecated
ConditionAttributesPane getPlotConditionPane(Plot plot); default ConditionAttributesPane getPlotConditionPane(Plot plot) {
return null;
}
/** /**
* 系列界面 * 系列界面
@ -122,7 +130,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 系列界面 * @return 系列界面
*/ */
@Deprecated @Deprecated
BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot); default BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return null;
}
/** /**
* 是否使用默认的界面为了避免界面来回切换 * 是否使用默认的界面为了避免界面来回切换
@ -130,12 +140,18 @@ public interface ChartTypeUIProvider extends Level {
* @return 是否使用默认的界面 * @return 是否使用默认的界面
*/ */
@Deprecated @Deprecated
boolean isUseDefaultPane(); default boolean isUseDefaultPane() {
return false;
}
@Deprecated @Deprecated
ChartEditPane getChartEditPane(String plotID); default ChartEditPane getChartEditPane(String plotID) {
return new ChartEditPane();
}
@Deprecated @Deprecated
ChartsConfigPane getChartConfigPane(String plotID); default ChartsConfigPane getChartConfigPane(String plotID) {
return null;
}
} }

1
designer-chart/src/main/java/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -6,6 +6,7 @@ import com.fr.common.annotations.Compatible;
* Created by shine on 2019/09/05. * Created by shine on 2019/09/05.
*/ */
@Compatible @Compatible
@Deprecated
public interface IndependentChartUIProvider extends ChartTypeUIProvider { public interface IndependentChartUIProvider extends ChartTypeUIProvider {
} }

58
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

@ -1,18 +1,9 @@
package com.fr.design.chart.fun.impl; package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider; import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chartx.impl.AbstractDataPane; import com.fr.design.chartx.impl.AbstractDataPane;
import com.fr.design.chartx.impl.AbstractOtherPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
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.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.API;
@ -24,13 +15,15 @@ import com.fr.stable.fun.mark.API;
public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider { public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider {
@Override @Override
public abstract AbstractChartTypePane getPlotTypePane(); public AbstractChartTypePane getPlotTypePane() {
return new DefaultChartTypePane();
}
@Override @Override
public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener); public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener);
@Override @Override
public abstract AbstractOtherPane[] getAttrPaneArray(AttributeChangeListener listener); public abstract AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener);
@Override @Override
public String[] getSubName() { public String[] getSubName() {
@ -46,45 +39,4 @@ public abstract class AbstractChartTypeUI extends AbstractProvider implements Ch
public String mark4Provider() { public String mark4Provider() {
return getClass().getName(); return getClass().getName();
} }
@Override
public boolean needChartChangePane() {
return false;
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
@Override
public boolean isUseDefaultPane() {
return false;
}
@Override
public ChartEditPane getChartEditPane(String plotID) {
return new ChartEditPane();
}
@Override
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return null;
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return null;
}
@Override
public ChartsConfigPane getChartConfigPane(String plotID) {
return null;
}
} }

1
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -17,6 +17,7 @@ import com.fr.stable.StableUtils;
/** /**
* Created by Mitisky on 16/3/7. * Created by Mitisky on 16/3/7.
*/ */
@Deprecated
public abstract class AbstractIndependentChartUIWithAPILevel implements ChartTypeUIProvider { public abstract class AbstractIndependentChartUIWithAPILevel implements ChartTypeUIProvider {
//这个不能改,是做兼容用的 //这个不能改,是做兼容用的
//2016.10.14-11.24号的8.0jar因为改了这个为3,不会提示5.26号之前的插件更新 //2016.10.14-11.24号的8.0jar因为改了这个为3,不会提示5.26号之前的插件更新

38
designer-chart/src/main/java/com/fr/design/chart/fun/impl/DefaultChartTypePane.java

@ -0,0 +1,38 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
/**
* @author shine
* @version 10.0
* Created by shine on 2020/7/8
*/
public class DefaultChartTypePane<T extends ChartProvider> extends AbstractChartTypePane<T> {
@Override
protected String[] getTypeIconPath() {
return ChartTypeInterfaceManager.getInstance().getDemoImagePath(this.getPlotID());
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(this.getPlotID());
}
public ChartProvider getDefaultChart() {
return ChartTypeManager.getInstance().getChartTypes(this.getPlotID())[0];
}
public String title4PopupWindow() {
return ChartTypeInterfaceManager.getInstance().getName(this.getPlotID());
}
@Override
public void populateBean(T ob) {
}
}

13
designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractDataPane.java

@ -45,12 +45,16 @@ public abstract class AbstractDataPane extends ChartDataPane {
ChartDataDefinitionProvider dataDefinition = chart.getChartDataDefinition(); ChartDataDefinitionProvider dataDefinition = chart.getChartDataDefinition();
singleDataPane.populateBean((AbstractDataDefinition) dataDefinition); populate(dataDefinition);
this.initAllListeners(); this.initAllListeners();
this.validate(); this.validate();
} }
protected void populate(ChartDataDefinitionProvider dataDefinition) {
singleDataPane.populateBean((AbstractDataDefinition) dataDefinition);
}
@Override @Override
public void update(ChartCollection collection) { public void update(ChartCollection collection) {
@ -62,6 +66,11 @@ public abstract class AbstractDataPane extends ChartDataPane {
return; return;
} }
chart.setChartDataDefinition(singleDataPane.updateBean()); chart.setChartDataDefinition(update());
} }
protected ChartDataDefinitionProvider update() {
return singleDataPane.updateBean();
}
} }

5
designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractOtherPane.java

@ -3,6 +3,7 @@ package com.fr.design.chartx.impl;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.impl.AbstractChartWithData; import com.fr.chart.impl.AbstractChartWithData;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
/** /**
* Created by shine on 2019/09/04. * Created by shine on 2019/09/04.
@ -13,6 +14,10 @@ public abstract class AbstractOtherPane<T extends AbstractChartWithData> extends
protected abstract void update(T chart); protected abstract void update(T chart);
public String title4PopupWindow() {
return PaneTitleConstants.CHART_OTHER_TITLE;
}
@Override @Override
public void populate(ChartCollection collection) { public void populate(ChartCollection collection) {
if (collection == null) { if (collection == null) {

Loading…
Cancel
Save