Browse Source

Merge pull request #210 in BA/design from ~NEIL/design:release to master

* commit '973230757a1898070f1f579e0d699b37d71d5bf3': (39 commits)
  图标
  update
  今天要合到master代码,新功能来不及测试了,先回退
  bug
  rt
  update
  rt
  rt
  rt
  插件读取
  实例化manager对象
  表单增加图表类型增加行
  图标
  update
  聚合报表工具栏
  聚合报表工具栏
  聚合报表图标
  npe
  预览展示
  表单交互统一,漏传了一个文件
  ...
master
superman 9 years ago
parent
commit
04e967e515
  1. 6
      designer/src/com/fr/poly/PolyComponetsBar.java
  2. 1
      designer_base/src/com/fr/design/beans/BasicBeanPane.java
  3. 1
      designer_base/src/com/fr/design/fun/MenuHandler.java
  4. 39
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  5. 2
      designer_base/src/com/fr/design/module/DesignModuleFactory.java
  6. 19
      designer_base/src/com/fr/env/RemoteEnv.java
  7. 50
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  8. 5
      designer_chart/src/com/fr/design/chart/ChartTypePane.java
  9. 30
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  10. 29
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java
  11. 2
      designer_chart/src/com/fr/design/module/ChartDesignerModule.java
  12. 8
      designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java
  13. 6
      designer_form/src/com/fr/design/mainframe/JForm.java

6
designer/src/com/fr/poly/PolyComponetsBar.java

@ -28,6 +28,7 @@ public class PolyComponetsBar extends JToolBar {
private static Color FOLDER_PANE_BACKGROUND = new Color(214, 223, 247);
private BaseChartNameID[] typeName = BaseChartGetter.getStaticAllChartBaseNames();
private SerIcon[] serIcons;
private static final int MAX_BAR_NUM = 15;
public PolyComponetsBar() {
setOrientation(SwingConstants.VERTICAL);
@ -35,10 +36,11 @@ public class PolyComponetsBar extends JToolBar {
setFloatable(false);
setBackground(UIConstants.NORMAL_BACKGROUND);
setLayout(FRGUIPaneFactory.create1ColumnGridLayout());
serIcons = new SerIcon[typeName.length + 1];
int typeLen = typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM;
serIcons = new SerIcon[typeLen + 1];
serIcons[0] = new SerIcon(PolyECBlock.class, Inter.getLocText("Poly-Report_Block"), "Poly-Report_Block");
this.add(serIcons[0]);
for (int i = 0, len = typeName.length; i < len; i++) {
for (int i = 0; i < typeLen; i++) {
BaseChart[] rowChart = BaseChartGetter.getStaticChartTypes(typeName[i].getPlotID());
serIcons[i + 1] = new SerIcon(rowChart[0], Inter.getLocText(typeName[i].getName()), typeName[i].getName());
this.add(serIcons[i + 1]);

1
designer_base/src/com/fr/design/beans/BasicBeanPane.java

@ -7,6 +7,7 @@ import com.fr.design.dialog.BasicPane;
*/
public abstract class BasicBeanPane<T> extends BasicPane {
/**
* Populate.
*/

1
designer_base/src/com/fr/design/fun/MenuHandler.java

@ -25,6 +25,7 @@ public interface MenuHandler extends Mutable {
String TEMPLATE = "template";
String INSERT = "insert";
String CELL = "cell";
String BBS = "bbs";
/**
* 插入菜单的位置

39
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -8,31 +8,10 @@ import com.fr.base.FRContext;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.BBSAction;
import com.fr.design.actions.community.BugAction;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.UpAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef;
import com.fr.design.actions.file.OpenTemplateAction;
import com.fr.design.actions.file.PreferenceAction;
import com.fr.design.actions.file.SwitchExistEnv;
import com.fr.design.actions.help.AboutAction;
import com.fr.design.actions.help.FeedBackAction;
import com.fr.design.actions.help.ForumAction;
import com.fr.design.actions.help.SupportQQAction;
import com.fr.design.actions.help.TutorialAction;
import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.actions.server.FunctionManagerAction;
import com.fr.design.actions.server.GlobalParameterAction;
import com.fr.design.actions.server.GlobalTableDataAction;
import com.fr.design.actions.server.PlatformManagerAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.actions.community.*;
import com.fr.design.actions.file.*;
import com.fr.design.actions.help.*;
import com.fr.design.actions.server.*;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.TableDataPaneProcessor;
@ -55,7 +34,10 @@ import com.fr.stable.ProductConstants;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import java.util.Set;
/**
* @author richer
@ -151,10 +133,11 @@ public abstract class ToolBarMenuDock {
// 添加服务器菜单
menuList.add(createServerMenuDef(plus));
// 添加帮助菜单
menuList.add(createHelpMenuDef());
// 添加社区菜单
// 添加社区菜单
menuList.add(createCommunityMenuDef());
return menuList.toArray(new MenuDef[menuList.size()]);
}
@ -359,7 +342,7 @@ public abstract class ToolBarMenuDock {
for (ShortCut shortCut : otherCommunityShortCuts) {
menuDef.addShortCut(shortCut);
}
insertMenu(menuDef, MenuHandler.HELP);
insertMenu(menuDef, MenuHandler.BBS);
return menuDef;
}
/**

2
designer_base/src/com/fr/design/module/DesignModuleFactory.java

File diff suppressed because one or more lines are too long

19
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -847,7 +847,6 @@ public class RemoteEnv implements Env {
* @return 成功新建返回true
* @throws Exception
*/
@Override
public boolean createFile(String filePath) throws Exception {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
@ -864,6 +863,23 @@ public class RemoteEnv implements Env {
return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8));
}
public boolean renameFile(String newPath, String oldPath) throws Exception {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_rename_file");
para.put("newPath", newPath);
para.put("oldPath", oldPath);
HttpClient client = createHttpMethod(para);
InputStream input = execute4InputStream(client);
if (input == null) {
return false;
}
return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8));
}
/**
* 判断文件是否存在
*
@ -942,7 +958,6 @@ public class RemoteEnv implements Env {
public void stopUserCheckTimer() {
}
/**
* 删除文件
*

50
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -1,23 +1,30 @@
package com.fr.design;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.chartinterface.*;
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.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.module.DesignModuleFactory;
import com.fr.file.XMLFileManager;
import com.fr.form.ui.ChartEditor;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.PluginCollector;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginMessage;
@ -25,10 +32,12 @@ import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.Authorize;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.stable.plugin.PluginReadListener;
import com.fr.stable.plugin.PluginSimplify;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import javax.swing.*;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@ -49,7 +58,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
if (classManager == null) {
classManager = new ChartTypeInterfaceManager();
chartTypeInterfaces.clear();
classManager.readDefault();
classManager.readXMLFile();
}
return classManager;
@ -63,12 +71,40 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
});
}
static {
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
if (chartTypeInterfaces != null) {
readDefault();
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
}
}
});
}
public static WidgetOption[] initWidgetOption(){
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if(rowChart == null) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
private synchronized static void envChanged() {
classManager = null;
chartTypeInterfaces.clear();
}
private static void readDefault() {
chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface());
@ -86,12 +122,14 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
}
public String getIconPath(String plotID) {
return chartTypeInterfaces.get(plotID).getIconPath();
if (chartTypeInterfaces.get(plotID) != null) {
return chartTypeInterfaces.get(plotID).getIconPath();
}else {
return StringUtils.EMPTY;
}
}
/**

5
designer_chart/src/com/fr/design/chart/ChartTypePane.java

@ -31,8 +31,9 @@ public class ChartTypePane extends ChartCommonWizardPane {
charts4Icon = new Chart[this.typeName.length][];
for (int i = 0; i < this.typeName.length; i++) {
Chart[] rowCharts = ChartTypeManager.getInstance().getChartTypes(this.typeName[i].getPlotID());
charts4Icon[i] = new Chart[1];
for (int j = 0; j < 1; j++) {
int rowChartsCount = rowCharts.length;
charts4Icon[i] = new Chart[rowChartsCount];
for (int j = 0; j < rowChartsCount; j++) {
try {
charts4Icon[i][j] = (Chart) rowCharts[j].clone();
charts4Icon[i][j].setTitle(null);

30
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.ChartFactory;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.web.ChartHyperPoplink;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.gui.ChartComponent;
@ -16,6 +17,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartHyperEditPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import java.awt.*;
@ -41,9 +43,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(hyperEditPane, BorderLayout.CENTER);
ChartCollection cc = new ChartCollection();
cc.addChart(new Chart(new Bar2DPlot()));
ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension(220, 170));// 在单元格弹出时 需要调整保证属性表的大小.
@ -56,8 +56,25 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
hyperEditPane.useChartComponent(chartComponent);
}
protected int getChartParaType() {
private ChartCollection createChartCollection() {
ChartCollection cc = new ChartCollection();
Chart chart = ChartTypeManager.getFirstChart();
if (chart != null){
try {
cc.addChart((Chart)chart.clone());
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
}else {
cc.addChart(new Chart(new Bar2DPlot()));
}
return cc;
}
protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE;
}
@ -86,8 +103,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
BaseChartCollection cc = chartHyperlink.getChartCollection();
if (cc == null || cc.getChartCount() < 1) {
cc = new ChartCollection();
cc.addChart(new Chart(ChartFactory.createBar2DPlot()));
cc = createChartCollection();
chartHyperlink.setChartCollection(cc);
}

29
designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java

@ -1,32 +1,33 @@
package com.fr.design.mainframe.chart.gui.data;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.design.constants.UIConstants;
import com.fr.data.impl.NameTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.dialog.BasicPane;
import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class DatabaseTableDataPane extends BasicPane{
private static final long serialVersionUID = 5316016202202932242L;
private TableDataComboBox tableNameCombox;
private UIButton reviewButton;
private Object lastSelectObject;
public DatabaseTableDataPane(UILabel label) {
initTableCombox();
initReviewButton();
@ -74,9 +75,11 @@ public class DatabaseTableDataPane extends BasicPane{
tableNameCombox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.DESELECTED){
if(e.getStateChange() == ItemEvent.DESELECTED
|| (lastSelectObject == null && e.getStateChange() == ItemEvent.SELECTED)){
userEvent();
}
lastSelectObject = tableNameCombox.getSelectedItem();
}
});
}

2
designer_chart/src/com/fr/design/module/ChartDesignerModule.java

@ -1 +1 @@
package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** GeneralContext; GeneralContext; GeneralContext; GeneralContext; import com.fr.general.IOUtils; GeneralContext; import com.fr.general.Inter; GeneralContext; import com.fr.stable.bridge.StableFactory; GeneralContext; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; GeneralContext; import com.fr.stable.plugin.PluginReadListener; GeneralContext; GeneralContext; import javax.swing.*; GeneralContext; /** import com.fr.general.IOUtils; import com.fr.general.IOUtils; GeneralContext; import com.fr.general.IOUtils; import com.fr.general.IOUtils; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.IOUtils; import com.fr.stable.bridge.StableFactory; } import com.fr.general.IOUtils; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.IOUtils; import com.fr.stable.plugin.PluginReadListener; import com.fr.general.IOUtils; import com.fr.general.IOUtils; import javax.swing.*; import com.fr.general.IOUtils; /** import com.fr.general.Inter; import com.fr.general.Inter; GeneralContext; import com.fr.general.Inter; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.Inter; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.general.Inter; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import com.fr.stable.plugin.PluginReadListener; import com.fr.general.Inter; import com.fr.general.Inter; import javax.swing.*; } import com.fr.general.Inter; /** import com.fr.stable.bridge.StableFactory; } /** import com.fr.stable.bridge.StableFactory; import com.fr.general.IOUtils; import com.fr.stable.bridge.StableFactory; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.bridge.StableFactory; } import com.fr.stable.bridge.StableFactory; import javax.swing.*; > protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if(rowChart == null) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } }
package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.import com.fr.stable.bridge.StableFactory; /** import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; GeneralContext; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.IOUtils; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; /** import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; /** import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.PluginReadListener; GeneralContext; import com.fr.stable.plugin.PluginReadListener; import com.fr.general.IOUtils; import com.fr.stable.plugin.PluginReadListener; import com.fr.general.Inter; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; import com.fr.stable.plugin.PluginReadListener; /** GeneralContext; } import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import javax.swing.*; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.general.Inter; import javax.swing.*; ActionFactory.registerChartCollection(ChartCollection.class); } import javax.swing.*; import com.fr.general.IOUtils; import javax.swing.*; import com.fr.general.Inter; import javax.swing.*; import com.fr.stable.bridge.StableFactory; import javax.swing.*; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; return new App[0]; import javax.swing.*; /** > protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if(rowChart == null) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } }

8
designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java

@ -46,7 +46,7 @@ public class FormParaWidgetPane extends JPanel{
//预定义控件最多显示20行
private int preWidgetShowMaxRow = 20;
//显示8个图表组件
private int commonChartNum = 8;
private static final int commonChartNum = 8;
//显示10个普通控件
private int commonWidgetNum = 10;
private JSeparator jSeparatorPara;
@ -118,7 +118,6 @@ public class FormParaWidgetPane extends JPanel{
// 初始化的时候根据图表的总个数获得单行显示图表的个数
int totalChartNums = loadChartOptions().length;
if (totalChartNums > 0) {
commonChartNum = ++totalChartNums/2;
JPanel chartTypePane = new JPanel(new FlowLayout());
for (int i = 0;i < commonChartNum ;i++) {
chartTypePane.add( new ToolBarButton(loadChartOptions()[i]));
@ -209,11 +208,12 @@ public class FormParaWidgetPane extends JPanel{
public void mouseClicked(MouseEvent e) {
if(chartTypeWindow == null) {
JPanel componentsPara = new JPanel(new FlowLayout(FlowLayout.LEFT));
for (WidgetOption chartOption : loadChartOptions()) {
WidgetOption[] chartOptions = loadChartOptions();
for (WidgetOption chartOption : chartOptions) {
componentsPara.add( new ToolBarButton(chartOption));
}
int x = commonChartNum * (widgetButtonWidth + smallGAP);
int y = (int)Math.ceil(((double)loadWidgetOptions().length/(double)commonChartNum)) * (widgetButtonHeight + smallGAP);
int y = (int)Math.ceil(chartOptions.length/((double)commonChartNum)) * (widgetButtonHeight + smallGAP);
componentsPara.setPreferredSize(new Dimension(x,y));
chartTypeWindow = new PopUpWindow(componentsPara, Inter.getLocText("FR-Designer-Form-ToolBar_Chart"));
chartTypeWindow.setLocation((int)jSeparatorLayout.getLocationOnScreen().getX() + 1, (int)jSeparatorLayout.getLocationOnScreen().getY());

6
designer_form/src/com/fr/design/mainframe/JForm.java

@ -25,7 +25,10 @@ import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.*;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.file.FILE;
@ -752,4 +755,5 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
public boolean acceptToolbarItem(Class clazz) {
return WorkBookSupportable.class.isAssignableFrom(clazz);
}
}
Loading…
Cancel
Save