From f82eb21d59c4124b37bfb5c697ea8f991438648a Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 18 Jul 2018 10:15:54 +0800 Subject: [PATCH 01/16] =?UTF-8?q?CHART-2521=20=E5=9B=BE=E8=A1=A8=E9=85=8D?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartFillStylePane.java | 9 +- .../gui/style/ChartPreFillStylePane.java | 187 ++++++++++++------ .../chart/gui/type/AbstractChartTypePane.java | 5 +- .../fr/design/module/ChartPreStyleAction.java | 4 - .../module/ChartPreStyleManagerPane.java | 31 ++- .../fr/design/module/ChartPreStylePane.java | 28 +-- 6 files changed, 174 insertions(+), 90 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java index f3a9b8a86..7ddd89d52 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java @@ -1,10 +1,11 @@ package com.fr.design.mainframe.chart.gui.style; +import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; import com.fr.base.Utils; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.ChartConstants; -import com.fr.chart.base.ChartPreStyle; +import com.fr.chart.base.ChartUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; @@ -199,9 +200,9 @@ public class ChartFillStylePane extends BasicBeanPane{ } else if(styleSelectBox.getSelectedIndex() < styleSelectBox.getItemCount() - 1){ ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); - if(preStyle instanceof ChartPreStyle) { - AttrFillStyle def = ((ChartPreStyle) preStyle).getAttrFillStyle(); - def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); + if (preStyle instanceof ChartColorMatching) { + AttrFillStyle def = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle); + def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); return def; }else{ condition.setColorStyle(ChartConstants.COLOR_DEFAULT); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java index 3e7fc1be0..3d29a56da 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java @@ -1,97 +1,170 @@ package com.fr.design.mainframe.chart.gui.style; -import java.awt.*; - -import com.fr.chart.base.AttrFillStyle; +import com.fr.base.ChartColorMatching; import com.fr.chart.base.ChartConstants; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.general.Inter; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + /** - * 预定义的图表配色界面, 其中和属性表中ChartFillStylePane 主要的不同就是标签的位置. + * 预定义的图表配色界面. * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-8-21 下午03:16:27 */ -public class ChartPreFillStylePane extends ChartFillStylePane { - - public ChartPreFillStylePane() { - - } - - protected void initLayout() {// 仅仅是服务器预定 风格界面布局, 和属性表 有所不同. - customPane.setPreferredSize(new Dimension(200, 200)); - colorGradient.setPreferredSize(new Dimension(120, 30)); - - double p = TableLayout.PREFERRED; - double[] columnSize = {p, p }; - double[] rowSize = { p, p, p}; +public class ChartPreFillStylePane extends BasicBeanPane { + + private JPanel changeColorSetPane; + private CardLayout cardLayout; + + private UIButton accButton; + private UIButton gradientButton; + + private ChartAccColorPane colorAcc; + private FixedGradientBar colorGradient; + + private ChartColorMatching chartColorMatching; + + public ChartPreFillStylePane() { + + initComponents(); + + initListener(); + } + + private void initComponents() { + + JPanel customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + + JPanel buttonPane = new JPanel(); + buttonPane.setLayout(new FlowLayout(FlowLayout.LEFT)); + buttonPane.add(accButton = new UIButton(Inter.getLocText("FR-Designer_Chart_Acc_Set"))); + buttonPane.add(gradientButton = new UIButton(Inter.getLocText("FR-Designer_Gradient-Color"))); + customPane.add(buttonPane, BorderLayout.NORTH); + + changeColorSetPane = new JPanel(cardLayout = new CardLayout()); + changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); + changeColorSetPane.add(colorAcc = new ChartAccColorPane(), "acc"); + cardLayout.show(changeColorSetPane, "acc"); + customPane.add(changeColorSetPane, BorderLayout.CENTER); + + accButton.setSelected(true); + + customPane.setPreferredSize(new Dimension(200, 200)); + colorGradient.setPreferredSize(new Dimension(120, 30)); + + double p = TableLayout.PREFERRED; + double[] columnSize = {p, p}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{new UILabel(" " + Inter.getLocText("ColorMatch")), null}, new Component[]{null, customPane}, }; - - this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST); - } - public void populateBean(AttrFillStyle condition) { - styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount()-1); + this.setLayout(new BorderLayout()); + this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST); + } - if(condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { - colorAcc.populateBean(ChartConstants.CHART_COLOR_ARRAY);// 新建时 保持默认样式 - accButton.setSelected(true); - gradientButton.setSelected(false); - cardLayout.show(changeColorSetPane, "acc"); + private void initListener() { - colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); - colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black);// 控件中的位置无效. - } else { - int colorStyle = condition.getColorStyle(); - gradientButton.setSelected(colorStyle == ChartConstants.COLOR_GRADIENT); - accButton.setSelected(colorStyle == ChartConstants.COLOR_ACC); + accButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + accButton.setSelected(true); + gradientButton.setSelected(false); + cardLayout.show(changeColorSetPane, "acc"); + } + }); - int colorSize = condition.getColorSize(); - if(colorSize == 2 && gradientButton.isSelected() ) { + gradientButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + gradientButton.setSelected(true); + accButton.setSelected(false); cardLayout.show(changeColorSetPane, "gradient"); + } + }); + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("ServerM-Predefined_Styles"); + } + + public void populateBean(ChartColorMatching condition) { + chartColorMatching = condition; + + colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); + colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black); + colorAcc.populateBean(ChartConstants.CHART_COLOR_ARRAY); + + if (condition == null) { + return; + } - Color endColor = condition.getColorIndex(1); - Color startColor = condition.getColorIndex(0); - colorGradient.getSelectColorPointBtnP1().setColorInner(startColor); - colorGradient.getSelectColorPointBtnP2().setColorInner(endColor); + boolean isGradient = condition.getGradient(); + List colorList = condition.getColorList(); + if (isGradient) { + gradientButton.setSelected(true); + accButton.setSelected(false); + cardLayout.show(changeColorSetPane, "gradient"); + + if (colorList.size() == 2) { + colorGradient.getSelectColorPointBtnP1().setColorInner(colorList.get(0)); + colorGradient.getSelectColorPointBtnP2().setColorInner(colorList.get(1)); colorGradient.repaint(); - } else if(colorSize > 2 && accButton.isSelected()){ - cardLayout.show(changeColorSetPane, "acc"); + } + } else { + accButton.setSelected(true); + gradientButton.setSelected(false); + cardLayout.show(changeColorSetPane, "acc"); - Color[] colors = new Color[colorSize]; - for(int i = 0; i < colorSize; i++) { - colors[i] = condition.getColorIndex(i); - } - colorAcc.populateBean(colors); + if (colorList.size() > 0) { + colorAcc.populateBean(colorList.toArray(new Color[colorList.size()])); } } } @Override - public AttrFillStyle updateBean() { - AttrFillStyle condition = new AttrFillStyle(); - condition.clearColors(); + public ChartColorMatching updateBean() { + chartColorMatching = chartColorMatching == null ? new ChartColorMatching() : chartColorMatching; + + List colorList = new ArrayList(); if(gradientButton.isSelected()) { - condition.setColorStyle(ChartConstants.COLOR_GRADIENT); + chartColorMatching.setGradient(true); + Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); Color end = colorGradient.getSelectColorPointBtnP2().getColorInner(); - condition.addFillColor(start); - condition.addFillColor(end); + colorList.add(start); + colorList.add(end); } else { - condition.setColorStyle(ChartConstants.COLOR_ACC); + chartColorMatching.setGradient(false); Color[] colors = colorAcc.updateBean(); - for(int i = 0, length = colors.length; i < length; i++) { - condition.addFillColor(colors[i]); - } + colorList = Arrays.asList(colors); } - return condition; + chartColorMatching.setColorList(colorList); + + return chartColorMatching; } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index 590190762..57a9dd143 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -1,12 +1,13 @@ package com.fr.design.mainframe.chart.gui.type; +import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; import com.fr.base.FRContext; import com.fr.base.background.ColorBackground; import com.fr.chart.base.AttrContents; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.ChartConstants; -import com.fr.chart.base.ChartPreStyle; +import com.fr.chart.base.ChartUtils; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.base.TextAttr; import com.fr.chart.chartattr.Axis; @@ -243,7 +244,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane{ if(preStyle == null){ plot.getPlotFillStyle().setColorStyle(ChartConstants.COLOR_DEFAULT); }else{ - AttrFillStyle fillStyle = ((ChartPreStyle)preStyle).getAttrFillStyle(); + AttrFillStyle fillStyle = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle); fillStyle.setFillStyleName(name); plot.setPlotFillStyle(fillStyle); } diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java index 70571338f..f964c4534 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java @@ -39,14 +39,10 @@ public class ChartPreStyleAction extends UpdateAction { @Override public void doOk() { pane.updateBean(); -// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); -// manager.setStyleEditing(null); } @Override public void doCancel() { -// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); -// manager.setStyleEditing(null); } }); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java index c25782c4e..573420983 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java @@ -1,8 +1,8 @@ package com.fr.design.module; +import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; import com.fr.base.Utils; -import com.fr.chart.base.ChartPreStyle; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; @@ -10,11 +10,11 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.general.Inter; import com.fr.general.NameObject; -import com.fr.stable.ListMap; import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.Iterator; +import java.util.LinkedHashMap; /** @@ -32,10 +32,18 @@ public class ChartPreStyleManagerPane extends JListControlPane { public NameableCreator[] createNameableCreators() { return new NameableCreator[]{ new NameObjectCreator(Inter.getLocText("FR-Designer_PreStyle"), - ChartPreStyle.class, ChartPreStylePane.class) + ChartColorMatching.class, ChartPreStylePane.class) }; } + @Override + public void addNameable(Nameable nameable, int index) { + super.addNameable(nameable, index); + if (!ChartPreStyleConfig.getInstance().containsName(nameable.getName())) { + ChartPreStyleConfig.getInstance().putPreStyle(nameable.getName(), ((NameObject) nameable).getObject()); + } + } + @Override protected String title4PopupWindow() { return Inter.getLocText("FR-Designer_Chart-PreStyle"); @@ -49,8 +57,8 @@ public class ChartPreStyleManagerPane extends JListControlPane { Iterator keys = config.names(); while(keys.hasNext()) { Object key = keys.next(); - ChartPreStyle value = (ChartPreStyle)config.getPreStyle(key); - + ChartColorMatching value = (ChartColorMatching) config.getPreStyle(key); + list.add(new NameObject(Utils.objectToString(key), value)); } @@ -65,15 +73,20 @@ public class ChartPreStyleManagerPane extends JListControlPane { public void updateBean() { ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); - config.setPreStyleMap(new ListMap()); + config.setCurrentStyle(getSelectedName()); Nameable[] values = this.update(); + config.setPreStyleMap(new LinkedHashMap()); - config.setCurrentStyle(getSelectedName()); - for(int i = 0; i < values.length; i++) { Nameable value = values[i]; - config.putPreStyle(value.getName(), ((NameObject)value).getObject()); + ChartColorMatching chartColorMatching = (ChartColorMatching) ((NameObject) value).getObject(); + try { + chartColorMatching = (ChartColorMatching) chartColorMatching.clone(); + } catch (CloneNotSupportedException e) { + //do nothing + } + config.putPreStyle(value.getName(), chartColorMatching); } // 通知报表整个刷新. diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java index d0f4d3136..e7f9111d5 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java @@ -1,9 +1,11 @@ package com.fr.design.module; -import com.fr.chart.base.ChartPreStyle; +import com.fr.base.ChartColorMatching; +import com.fr.chart.base.ChartUtils; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.event.UIObserver; @@ -25,8 +27,8 @@ import java.awt.FlowLayout; * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-8-20 下午05:02:00 */ -public class ChartPreStylePane extends BasicBeanPane{ - +public class ChartPreStylePane extends BasicBeanPane { + private ChartPreFillStylePane fillStylePane; private ChartComponent chartComponent; @@ -78,28 +80,26 @@ public class ChartPreStylePane extends BasicBeanPane{ } } } - - private void refreshWhenStyleChange(ChartPreStyle preStyle) { -// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); -// manager.setStyleEditing(preStyle); + + private void refreshWhenStyleChange(ChartColorMatching preStyle) { if(chartComponent != null) { + Plot plot = (Plot) chartComponent.getEditingChart().getBasePlot(); + plot.setPlotFillStyle(ChartUtils.chartColorMatching2AttrFillStyle(preStyle)); chartComponent.reset(); } } @Override - public void populateBean(ChartPreStyle preStyle) { + public void populateBean(ChartColorMatching preStyle) { + + fillStylePane.populateBean(preStyle); - fillStylePane.populateBean(preStyle.getAttrFillStyle()); - refreshWhenStyleChange(preStyle); } @Override - public ChartPreStyle updateBean() { - ChartPreStyle preStyle = new ChartPreStyle(); - preStyle.setAttrFillStyle(fillStylePane.updateBean()); - return preStyle; + public ChartColorMatching updateBean() { + return fillStylePane.updateBean(); } @Override From fb5086d5f13ae3708947a0c6ffc5f5c0e90f9ae2 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 18 Jul 2018 10:35:29 +0800 Subject: [PATCH 02/16] move designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java --- .../chart/gui/style => module}/ChartPreFillStylePane.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename designer-chart/src/main/java/com/fr/design/{mainframe/chart/gui/style => module}/ChartPreFillStylePane.java (100%) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java similarity index 100% rename from designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java rename to designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java From 6c1067c19b37802d72c66d7b6321c61ab3db7791 Mon Sep 17 00:00:00 2001 From: hzzz Date: Wed, 18 Jul 2018 17:16:31 +0800 Subject: [PATCH 03/16] =?UTF-8?q?REPORT-9565=20=E9=83=A8=E7=BD=B2=E9=9B=86?= =?UTF-8?q?=E6=88=90-=E8=BF=9C=E7=A8=8B-=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=8A=E6=96=B9=E8=B7=AF=E5=BE=84=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 487 +++++++++--------- 1 file changed, 252 insertions(+), 235 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 3636a18da..893f5a9ae 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -51,14 +51,30 @@ import com.fr.stable.CoreConstants; import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; +import com.fr.workspace.connect.WorkspaceConnection; -import javax.swing.*; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JLayeredPane; +import javax.swing.JMenuBar; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.WindowConstants; import javax.swing.border.MatteBorder; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; @@ -83,74 +99,74 @@ import java.util.Iterator; import java.util.List; public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { - + public static final String DESIGNER_FRAME_NAME = "designer_frame"; - + public static final Dimension MIN_SIZE = new Dimension(100, 100); - + private static final long serialVersionUID = -8732559571067484460L; - + private static final int LEFT_ALIGN_GAP = -5; - + private static final int MENU_HEIGHT = 26; - + private static final Integer SECOND_LAYER = new Integer(100); - + private static final Integer TOP_LAYER = new Integer((200)); - + private static java.util.List> appList = new java.util.ArrayList>(); - + private List designerOpenedListenerList = new ArrayList<>(); - + 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 = null; - + private Icon closeMode = UIConstants.CLOSE_OF_AUTHORITY; - + private JLayeredPane layeredPane = this.getLayeredPane(); - + private JPanel basePane = new JPanel(); - + // 上面的虚线 private DottedLine upDottedLine; - + // 下面的虚线 private DottedLine downDottedLine; - + // 左边的虚线 private DottedLine leftDottedLine; - + // 右边的虚线 private DottedLine rightDottedLine; - + private int contentWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - + private int contentHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight()); - + private WindowAdapter windowAdapter = new WindowAdapter() { - + public void windowOpened(WindowEvent e) { - + } - + @Override public void windowClosing(WindowEvent e) { - + SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true); // 只有一个文件未保存时 if (HistoryTemplateListPane.getInstance().getHistoryCount() == 1) { @@ -164,83 +180,83 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } } - + }; - + private JComponent closeButton = new JComponent() { - + protected void paintComponent(Graphics g) { - + g.setColor(UIConstants.NORMAL_BACKGROUND); g.fillArc(0, 0, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, - 0, 360); + 0, 360); closeMode.paintIcon(this, g, 0, 0); } }; - + private MouseListener closeMouseListener = new MouseAdapter() { - + public void mousePressed(MouseEvent e) { - + closeMode = UIConstants.CLOSE_PRESS_AUTHORITY; closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); closeButton.repaint(); } - + public void mouseExited(MouseEvent e) { - + closeMode = UIConstants.CLOSE_OF_AUTHORITY; closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); closeButton.repaint(); } - + public void mouseMoved(MouseEvent e) { - + closeMode = UIConstants.CLOSE_OVER_AUTHORITY; closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); closeButton.repaint(); } - + public void mouseReleased(MouseEvent e) { - + if (BaseUtils.isAuthorityEditing()) { BaseUtils.setAuthorityEditing(false); WestRegionContainerPane.getInstance().replaceDownPane( - TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); DesignerContext.getDesignerFrame().resetToolkitByPlus( - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus()); needToAddAuhtorityPaint(); refreshDottedLine(); fireAuthorityStateToNomal(); } } - + public void mouseEntered(MouseEvent e) { - + closeMode = UIConstants.CLOSE_OVER_AUTHORITY; closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); closeButton.repaint(); } }; - + private ProgressDialog progressDialog; - + public DesignerFrame(ToolBarMenuDock ad) { - + setName(DESIGNER_FRAME_NAME); this.ad = ad; this.initTitleIcon(); this.setTitle();// james:因为有默认的了 // set this to context. DesignerContext.setDesignerFrame(this); - + // the content pane basePane.setLayout(new BorderLayout()); toolbarPane = new JPanel() { - + public Dimension getPreferredSize() { - + Dimension dim = super.getPreferredSize(); // dim.height = TOOLBAR_HEIGHT; return dim; @@ -255,37 +271,37 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta 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(); basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); basePane.setBounds(0, 0, contentWidth, contentHeight); - + // 数值越小。越在底层 layeredPane.add(basePane); // 调整Window大小 modWindowBounds(); - - + + // p:检查所有按钮的可见性和是否可以编辑性. checkToolbarMenuEnable(); - + // window close listener. this.addWindowListeners(getFrameListeners()); - + this.addComponentListener(new ComponentAdapter() { - + public void componentResized(ComponentEvent e) { - + reCalculateFrameSize(); if (BaseUtils.isAuthorityEditing()) { doResize(); @@ -293,10 +309,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } }); this.addDesignerOpenedListener(new DesignerOpenedListener() { - + @Override public void designerOpened() { - + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setComposite(); reCalculateFrameSize(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().doResize(); @@ -310,61 +326,61 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta initMenuPane(); this.progressDialog = new ProgressDialog(this); } - + /** * 注册app. * * @param app 注册app. */ public static void registApp(App app) { - + if (app != null) { appList.add(app); } } - + public static void removeApp(App app) { - + if (app != null) { appList.remove(app); } } - + /** * 注册"设计器初始化完成"的监听 */ public void addDesignerOpenedListener(DesignerOpenedListener listener) { - + designerOpenedListenerList.add(listener); } - + /** * 触发"设计器初始化完成"事件 */ public void fireDesignerOpened() { - + for (DesignerOpenedListener listener : designerOpenedListenerList) { listener.designerOpened(); } } - + protected DesktopCardPane getCenterTemplateCardPane() { - + return centerTemplateCardPane; } - + /** * 初始menuPane的方法 方便OEM时修改该组件 */ protected void initMenuPane() { - + menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH); menuPane.add(initNorthEastPane(ad), BorderLayout.EAST); basePane.add(menuPane, BorderLayout.NORTH); this.resetToolkitByPlus(null); } - + /** * @param ad * @return @@ -393,9 +409,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta refreshNorthEastPane(northEastPane, ad); return northEastPane; } - + private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) { - + northEastPane.removeAll(); northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); northEastPane.add(LogMessageBar.getInstance()); @@ -409,43 +425,43 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } northEastPane.add(ad.createBBSLoginPane()); } - + public void initTitleIcon() { - + try { @SuppressWarnings("unchecked") List image = ICODecoder.read(DesignerFrame.class - .getResourceAsStream("/com/fr/base/images/oem/logo.ico")); + .getResourceAsStream("/com/fr/base/images/oem/logo.ico")); this.setIconImages(image); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); } } - + private void addWindowListeners(ArrayList listeners) { - + for (WindowListener listener : listeners) { this.addWindowListener(listener); } } - + protected ArrayList getFrameListeners() { - + ArrayList arrayList = new ArrayList(); arrayList.add(windowAdapter); return arrayList; } - - + + protected void laoyoutWestPane() { - + basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.WEST); } - + // 调整windows大小 private void reCalculateFrameSize() { - + contentHeight = layeredPane.getHeight(); contentWidth = layeredPane.getWidth(); layeredPane.remove(basePane); @@ -453,63 +469,63 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta layeredPane.add(basePane); layeredPane.repaint(); } - + /** * 更新 */ public void populateAuthorityArea() { - + int centerWidth = contentWidth - WestRegionContainerPane.getInstance().getContainerWidth() - - EastRegionContainerPane.getInstance().getContainerWidth(); + - EastRegionContainerPane.getInstance().getContainerWidth(); // 上面的虚线 upDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth); upDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT - 1, centerWidth, - 3); - + 3); + // 下面的虚线 downDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth); downDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), contentHeight - 3, centerWidth, 3); - + // 左边的虚线 leftDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT); leftDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT, 3, contentHeight - MENU_HEIGHT); - + rightDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT); rightDottedLine.setBounds(contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - 3, MENU_HEIGHT, 3, contentHeight - MENU_HEIGHT); - + } - + private void addDottedLine() { - + layeredPane.add(upDottedLine, SECOND_LAYER); layeredPane.add(downDottedLine, SECOND_LAYER); layeredPane.add(leftDottedLine, SECOND_LAYER); layeredPane.add(rightDottedLine, SECOND_LAYER); layeredPane.add(closeButton, TOP_LAYER); } - + private void removeDottedLine() { - + layeredPane.remove(upDottedLine); layeredPane.remove(downDottedLine); layeredPane.remove(leftDottedLine); layeredPane.remove(rightDottedLine); layeredPane.remove(closeButton); } - + public JLayeredPane getContentFrame() { - + return layeredPane; } - + /** * 刷新 */ public void refreshDottedLine() { - + if (BaseUtils.isAuthorityEditing()) { populateAuthorityArea(); populateCloseButton(); @@ -519,37 +535,37 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } layeredPane.repaint(); } - + /** * 刷新DottedLine */ public void doResize() { - + removeDottedLine(); populateAuthorityArea(); populateCloseButton(); addDottedLine(); } - + /** * 刷新CloseButton */ public void populateCloseButton() { - + closeButton.addMouseListener(closeMouseListener); closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); closeButton.setBorder(null); int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2; int y = MENU_HEIGHT - closeMode.getIconHeight() / 2; closeButton.setBounds(x, y, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, - UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH); + UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH); } - + /** * 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 */ private void fireAuthorityStateToNomal() { - + java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { // 如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 @@ -558,14 +574,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } } - + public void setCloseMode(Icon closeMode) { - + this.closeMode = closeMode; } - + private UIToolbar combineUpTooBar(JComponent[] toolbar4Form) { - + 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)); @@ -581,24 +597,24 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } } - + //添加分享按钮 addShareButton(); - + //添加插件中的按钮 addExtraButtons(); - + return combineUp; } - + private void addExtraButtons() { - + JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (jt == null) { return; } - - + + UIButton[] extraButtons = jt.createExtraButtons(); for (int i = 0; i < extraButtons.length; i++) { combineUp.add(extraButtons[i]); @@ -607,21 +623,21 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta combineUp.addSeparator(new Dimension(2, 16)); } } - + private void addShareButton() { - + JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (jt == null) { return; } - + combineUp.addSeparator(new Dimension(2, 16)); UIButton[] shareButtons = jt.createShareButton(); for (int i = 0; i < shareButtons.length; i++) { combineUp.add(shareButtons[i]); } } - + /** * 检查 * @@ -629,86 +645,86 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param al 组件名称 */ public void checkCombineUp(boolean flag, ArrayList al) { - + combineUp.checkComponentsByNames(flag, al); - + } - + /** * 刷新工具条. */ public void refreshToolbar() { - + this.ad.updateToolBarDef(); } - + /** * 重置相关的工具条. * * @param plus 工具条中相关信息 */ public void resetToolkitByPlus(ToolBarMenuDockPlus plus) { - + if (plus == null) { plus = ToolBarMenuDock.NULLAVOID; } - + DesignState designState = new DesignState(plus); MenuManager.getInstance().setMenus4Designer(designState); if (menuBar != null) { menuPane.remove(menuBar); } menuPane.add(menuBar = ad.createJMenuBar(plus), BorderLayout.CENTER); - + if (combineUp != null) { eastCenterPane.remove(combineUp); combineUp = null; } - + // 保存撤销那些按钮的面板 eastCenterPane.add(combineUp = combineUpTooBar(ad.resetUpToolBar(plus)), BorderLayout.NORTH); - + if (toolbarComponent != null) { toolbarPane.remove(toolbarComponent); } - + // 颜色,字体那些按钮的工具栏 toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); - + this.checkToolbarMenuEnable(); this.validate(); layeredPane.repaint(); } - + public JComponent getToolbarComponent() { - + return this.toolbarComponent; } - + /** * 判断是否在权限编辑状态,若是在权限编辑状态,则需要有虚线框和关闭突变 */ public void needToAddAuhtorityPaint() { - + newWorkBookPane.setButtonGray(BaseUtils.isAuthorityEditing()); } - + /** * 检查工具条. */ private void checkToolbarMenuEnable() { - + if (this.ad != null) { this.ad.updateMenuDef(); this.ad.updateToolBarDef(); } } - + /** * 设置标题 */ public void setTitle() { - + JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); StringBuilder defaultTitleSB = new StringBuilder(); defaultTitleSB.append(ProductConstants.PRODUCT_NAME); @@ -721,8 +737,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); String username = null; - if (info != null){ - username = info.getName(); + if (info != null) { + WorkspaceConnection connection = info.getConnection(); + username = connection == null ? StringUtils.EMPTY : connection.getUserName(); } defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]"); if (editingTemplate != null) { @@ -734,10 +751,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } defaultTitleSB.append(" " + path); } - + setTitle(defaultTitleSB.toString()); } - + /** * modify window bounds. */ @@ -748,14 +765,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (windowBounds != null) { int locX = windowBounds.x; int locY = windowBounds.y; - + if (!OperatingSystem.isWindows()) { locX = Math.max(1, locX); locY = Math.max(1, locY); } - + this.setLocation(new Point(locX, locY)); - + int width = windowBounds.width; int height = windowBounds.height; if (width > MIN_SIZE.width && height > MIN_SIZE.height) { @@ -767,13 +784,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta GUICoreUtils.setWindowFullScreen(this); } } - - + + /** * 报表运行环境改变时,需要刷新某些面板 */ public void refreshEnv() { - + this.setTitle(); DesignerFrameFileDealerPane.getInstance().refreshDockingView(); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); @@ -781,21 +798,21 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta DesignTableDataManager.clearGlobalDs(); EastRegionContainerPane.getInstance().refreshDownPane(); } - + /** * 返回选中的模板. */ public JTemplate getSelectedJTemplate() { - + return this.centerTemplateCardPane.getSelectedJTemplate(); } - + /** * 保存当前编辑的模板 */ - + public void saveCurrentEditingTemplate() { - + JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (editingTemplate == null) { return; @@ -808,33 +825,33 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta editingTemplate.stopEditing(); if (!editingTemplate.getEditingFILE().exists()) { int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), - Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + editingTemplate.getEditingFILE() - + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION, - JOptionPane.QUESTION_MESSAGE); + Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + editingTemplate.getEditingFILE() + + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) { editingTemplate.saveTemplate(); FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ - editingTemplate.getEditingFILE().getName(), "."})); + editingTemplate.getEditingFILE().getName(), "."})); } } else { if (editingTemplate.saveTemplate()) { editingTemplate.saveTemplate(); FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ - editingTemplate.getEditingFILE().getName(), "."})); + editingTemplate.getEditingFILE().getName(), "."})); } } } } - + /** * 添加新建模板, 并激活. */ public void addAndActivateJTemplate() { - + addAndActivateJTemplate(ad.createNewTemplate()); layeredPane.repaint(); } - + /** * 添加 模板, 并激活. * @@ -852,7 +869,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta setTitle(); layeredPane.repaint(); } - + /** * 激活已经存在的模板 * @@ -868,45 +885,45 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta setTitle(); layeredPane.repaint(); } - + /** * 对象侦听 * * @param e 事件 */ public void targetModified(TargetModifiedEvent e) { - + this.checkToolbarMenuEnable(); } - + /** * 模板关闭时 处理. * * @param jt 模板 */ public void templateClosed(JTemplate jt) { - + } - + /** * 模板打开时 处理. * * @param jt 模板 */ public void templateOpened(JTemplate jt) { - + } - + /** * 模板保存时 处理. * * @param jt 模板 */ public void templateSaved(JTemplate jt) { - + this.checkToolbarMenuEnable(); } - + /** * 打开模板文件,如果是已经打开的就激活此模板所对应的JInternalFrame * @@ -926,24 +943,24 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta // } catch (Exception e) { // FineLoggerFactory.getLogger().error(e.getMessage()); // } - + // p:判断一下,如何文件为空或者文件不存在,直接返回. if (tplFile == null || !tplFile.exists()) { JOptionPane.showMessageDialog(this, Inter.getLocText("Warning-Template_Do_Not_Exsit"), - ProductConstants.PRODUCT_NAME, JOptionPane.INFORMATION_MESSAGE); + ProductConstants.PRODUCT_NAME, JOptionPane.INFORMATION_MESSAGE); DesignerFrameFileDealerPane.getInstance().refresh(); return; } - + try { openFile(tplFile); } catch (Throwable t) { FineLoggerFactory.getLogger().error(t.getMessage(), t); addAndActivateJTemplate(); } - + } - + /** * 是否不合版本的设计器 * @@ -952,10 +969,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:30:37 */ private boolean inValidDesigner(JTemplate jt) { - + return jt.isOldDesigner() || (!jt.isJWorkBook() && jt.isNewDesigner()); } - + /** * 打开指定的文件 * @@ -963,7 +980,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:31:05 */ private void openFile(FILE tplFile) { - + String fileName = tplFile.getName(); int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); if (indexOfLastDot < 0) { @@ -978,7 +995,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (defaultAppExtentions[j].equalsIgnoreCase(fileExtention)) { // 不要catch JTemplate jt = app.openTemplate(tplFile); - + if (jt == null) { return; } @@ -986,7 +1003,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (inValidDesigner(jt)) { this.addAndActivateJTemplate(); MutilTempalteTabPane.getInstance().setTemTemplate( - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); } else { activeTemplate(tplFile, jt); } @@ -999,7 +1016,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } } - + /** * 激活指定的模板 * @@ -1026,88 +1043,88 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta this.addAndActivateJTemplate(jt); } } - + /** * Exit退出 */ public void exit() { - + Thread thread = new Thread() { - + @Override public void run() { - + DesignerEnvManager.doEndMapSaveWorkersIndesign(); } }; thread.start(); - + try { thread.join(); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error("Map Thread Error"); } - + DesignerEnvManager.getEnvManager().setLastOpenFile( - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); - + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); + DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( - WestRegionContainerPane.getInstance().getToolPaneY()); + WestRegionContainerPane.getInstance().getToolPaneY()); DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth( - WestRegionContainerPane.getInstance().getContainerWidth()); + WestRegionContainerPane.getInstance().getContainerWidth()); DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY( - EastRegionContainerPane.getInstance().getToolPaneY()); + EastRegionContainerPane.getInstance().getToolPaneY()); DesignerEnvManager.getEnvManager().setLastEastRegionContainerWidth( - EastRegionContainerPane.getInstance().getContainerWidth()); - + EastRegionContainerPane.getInstance().getContainerWidth()); + DesignerEnvManager.getEnvManager().saveXMLFile(); - + WorkContext.switchTo(null); - + this.setVisible(false); this.dispose(); - + this.ad.shutDown(); - + System.exit(0); } - + // harry:添加程序外拖拽文件进来打开的功能 class FileDropTargetListener implements DropTargetListener { - + @Override public void dragEnter(DropTargetDragEvent event) { - + } - + @Override public void dragExit(DropTargetEvent event) { - + } - + @Override public void dragOver(DropTargetDragEvent event) { - + } - + @Override public void dropActionChanged(DropTargetDragEvent event) { - + if (!isDragAcceptable(event)) { event.rejectDrag(); return; } } - + @SuppressWarnings("unchecked") @Override public void drop(DropTargetDropEvent event) { - + if (!isDropAcceptable(event)) { event.rejectDrop(); return; } - + event.acceptDrop(DnDConstants.ACTION_MOVE); Transferable transferable = event.getTransferable(); DataFlavor[] flavors = transferable.getTransferDataFlavors(); @@ -1128,20 +1145,20 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } event.dropComplete(true); } - + public boolean isDragAcceptable(DropTargetDragEvent event) { - + return (event.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) != 0; } - + public boolean isDropAcceptable(DropTargetDropEvent event) { - + return (event.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) != 0; } } - + public ProgressDialog getProgressDialog() { - + return progressDialog; } } \ No newline at end of file From db41d2f32e0d010850e4faf9edf7ba15bc49530c Mon Sep 17 00:00:00 2001 From: richie Date: Wed, 18 Jul 2018 17:21:23 +0800 Subject: [PATCH 04/16] =?UTF-8?q?CORE-113=20=E6=8F=90=E4=BE=9B=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89AOP=E6=B3=A8=E8=A7=A3=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=9C=A8=E5=90=84=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=87=AA=E8=A1=8C=E5=AE=9A=E4=B9=89=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=EF=BC=8C=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=A8=8D=E5=90=8E=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/Designer.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 1088f5fdc..880a7182b 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -42,7 +42,6 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.module.Module; import com.fr.module.ModuleContext; -import com.fr.record.analyzer.FineAnalyzer; import com.fr.stable.BuildContext; import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; @@ -56,14 +55,9 @@ import com.fr.start.preload.ImagePreLoader; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; -import javax.swing.JComponent; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.MatteBorder; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Insets; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -96,8 +90,6 @@ public class Designer extends BaseDesigner { */ public static void main(String[] args) { - FineAnalyzer.init(); - BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); @@ -197,7 +189,7 @@ public class Designer extends BaseDesigner { if (!BaseUtils.isAuthorityEditing()) { menuDef.addShortCut(SeparatorDef.DEFAULT); - + if (WorkContext.getCurrent().isRoot()) { menuDef.addShortCut(new ServerConfigManagerAction(), new StyleListAction(), new WidgetManagerAction()); if (ActionFactory.getChartPreStyleAction() != null) { From 57ff79348ff3c633a671a5322ecd4e887743bdfc Mon Sep 17 00:00:00 2001 From: "abel.chen" Date: Thu, 19 Jul 2018 09:35:39 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=8D=95=E8=8E=B7LifecycleFatalError=EF=BC=8C?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/start/Designer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 880a7182b..d0b1da68f 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -47,6 +47,7 @@ import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.lifecycle.LifecycleFatalError; import com.fr.stable.xml.XMLTools; import com.fr.start.fx.SplashFx; import com.fr.start.jni.SplashMac; @@ -107,7 +108,11 @@ public class Designer extends BaseDesigner { Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); //传递启动参数 designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); - designerRoot.start(); + try { + designerRoot.start(); + } catch (LifecycleFatalError fatal) { + System.exit(0); + } if (WorkContext.getCurrent().isLocal()) { //初始化一下serverTray From dba933367ed73010841f032723018b06f7dfe4eb Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 19 Jul 2018 09:54:37 +0800 Subject: [PATCH 06/16] =?UTF-8?q?CORE-116=20=E8=BF=9B=E4=B8=80=E6=AD=A5?= =?UTF-8?q?=E6=95=B4=E7=90=86Session=E7=AE=A1=E7=90=86=E9=97=AE=E9=A2=98&?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index 46efc1581..e3a953277 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java @@ -107,7 +107,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { return StringUtils.EMPTY; } - String bookPath = infor.getBookPath(); + String bookPath = infor.getRelativePath(); // 这个iofile只读一个templateid, 其他以后有需要再读. IOFile file = new IOFile() { @Override From b2be93d90d5c1bdce806c22028efce616f20f7a2 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 19 Jul 2018 11:20:34 +0800 Subject: [PATCH 07/16] . --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index a8d328e16..af9667919 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.socketio; import com.fr.config.RemoteConfigEvent; import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.TemplatePane; import com.fr.design.mainframe.loghandler.DesignerLogHandler; import com.fr.event.EventDispatcher; import com.fr.general.Inter; @@ -14,6 +15,7 @@ import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; +import com.fr.workspace.engine.connector.FineWorkspaceConnector; import com.fr.workspace.engine.server.rpc.netty.RemoteCallClient; import com.fr.workspace.server.socket.SocketInfoOperator; import io.socket.client.IO; @@ -81,6 +83,7 @@ public class DesignerSocketIO { if (status != Status.Disconnecting) { JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Disconnected"}), null, 0, UIManager.getIcon("OptionPane.errorIcon")); + TemplatePane.getInstance().editItems(); } status = Status.Disconnected; } From 1f10444b20ecfe83b53b0916dfa7730a3ebee0fa Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 19 Jul 2018 11:30:09 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E9=85=8D=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/module/ChartPreFillStylePane.java | 21 +++---- .../module/ChartPreStyleManagerPane.java | 55 +++++++++---------- .../fr/design/module/ChartPreStylePane.java | 1 - 3 files changed, 34 insertions(+), 43 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 3d29a56da..0d27409a4 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -1,13 +1,13 @@ -package com.fr.design.mainframe.chart.gui.style; +package com.fr.design.module; import com.fr.base.ChartColorMatching; -import com.fr.chart.base.ChartConstants; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.style.ChartAccColorPane; import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.general.Inter; @@ -21,7 +21,6 @@ import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; @@ -41,8 +40,6 @@ public class ChartPreFillStylePane extends BasicBeanPane { private ChartAccColorPane colorAcc; private FixedGradientBar colorGradient; - private ChartColorMatching chartColorMatching; - public ChartPreFillStylePane() { initComponents(); @@ -70,6 +67,8 @@ public class ChartPreFillStylePane extends BasicBeanPane { customPane.setPreferredSize(new Dimension(200, 200)); colorGradient.setPreferredSize(new Dimension(120, 30)); + colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); + colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black); double p = TableLayout.PREFERRED; double[] columnSize = {p, p}; @@ -110,12 +109,6 @@ public class ChartPreFillStylePane extends BasicBeanPane { } public void populateBean(ChartColorMatching condition) { - chartColorMatching = condition; - - colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); - colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black); - colorAcc.populateBean(ChartConstants.CHART_COLOR_ARRAY); - if (condition == null) { return; } @@ -145,7 +138,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { @Override public ChartColorMatching updateBean() { - chartColorMatching = chartColorMatching == null ? new ChartColorMatching() : chartColorMatching; + ChartColorMatching chartColorMatching = new ChartColorMatching(); List colorList = new ArrayList(); @@ -160,7 +153,9 @@ public class ChartPreFillStylePane extends BasicBeanPane { chartColorMatching.setGradient(false); Color[] colors = colorAcc.updateBean(); - colorList = Arrays.asList(colors); + for(Color color : colors) { + colorList.add(color); + } } chartColorMatching.setColorList(colorList); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java index 573420983..e77d17594 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java @@ -3,6 +3,7 @@ package com.fr.design.module; import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; import com.fr.base.Utils; +import com.fr.config.Configuration; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; @@ -11,10 +12,11 @@ import com.fr.design.mainframe.DesignerFrame; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.stable.Nameable; +import com.fr.transaction.Configurations; +import com.fr.transaction.Worker; import java.util.ArrayList; import java.util.Iterator; -import java.util.LinkedHashMap; /** @@ -36,22 +38,13 @@ public class ChartPreStyleManagerPane extends JListControlPane { }; } - @Override - public void addNameable(Nameable nameable, int index) { - super.addNameable(nameable, index); - if (!ChartPreStyleConfig.getInstance().containsName(nameable.getName())) { - ChartPreStyleConfig.getInstance().putPreStyle(nameable.getName(), ((NameObject) nameable).getObject()); - } - } - @Override protected String title4PopupWindow() { return Inter.getLocText("FR-Designer_Chart-PreStyle"); } public void populateBean() { - ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); - + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror(); ArrayList list = new ArrayList(); Iterator keys = config.names(); @@ -71,29 +64,33 @@ public class ChartPreStyleManagerPane extends JListControlPane { } public void updateBean() { - ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + Configurations.update(new Worker() { + @Override + public void run() { + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); - config.setCurrentStyle(getSelectedName()); + config.setCurrentStyle(getSelectedName()); - Nameable[] values = this.update(); - config.setPreStyleMap(new LinkedHashMap()); + Nameable[] values = update(); + config.clearAllPreStyle(); - for(int i = 0; i < values.length; i++) { - Nameable value = values[i]; - ChartColorMatching chartColorMatching = (ChartColorMatching) ((NameObject) value).getObject(); - try { - chartColorMatching = (ChartColorMatching) chartColorMatching.clone(); - } catch (CloneNotSupportedException e) { - //do nothing + for(Nameable value : values) { + config.putPreStyle(value.getName(), ((NameObject) value).getObject()); + } + + // 通知报表整个刷新. + DesignerFrame frame = DesignerContext.getDesignerFrame(); + if(frame != null) { + frame.repaint(); + } } - config.putPreStyle(value.getName(), chartColorMatching); - } - // 通知报表整个刷新. - DesignerFrame frame = DesignerContext.getDesignerFrame(); - if(frame != null) { - frame.repaint(); - } + @Override + public Class[] targets() { + return new Class[]{ChartPreStyleConfig.class}; + } + }); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java index e7f9111d5..1668afcc0 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java @@ -12,7 +12,6 @@ import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.chart.gui.style.ChartPreFillStylePane; import com.fr.general.Inter; import javax.swing.JPanel; From 9d5157989f480d9afa1810ec1e695cf9123828b8 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 19 Jul 2018 14:06:41 +0800 Subject: [PATCH 09/16] =?UTF-8?q?REPORT-9856=E3=80=9010.0=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E7=94=A8=E6=88=B7=E5=90=8D=E5=AF=86=E7=A0=81=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=B6=E6=8F=90=E7=A4=BA=E4=B8=8D=E6=98=8E=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/file/SwitchExistEnv.java | 2 +- .../java/com/fr/design/mainframe/TemplatePane.java | 2 +- .../src/main/java/com/fr/env/RemoteEnvPane.java | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index a3d940fc3..dcfb954d5 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -125,7 +125,7 @@ public class SwitchExistEnv extends MenuDef { } }); } catch (AuthException exception) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed"}), null, 0, UIManager.getIcon("OptionPane.errorIcon")); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java b/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java index e9bdce267..6da82863e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java @@ -153,7 +153,7 @@ public class TemplatePane extends JPanel implements MouseListener { } setJLabel(selectedName); } catch (AuthException e) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed"}), null, 0, UIManager.getIcon("OptionPane.errorIcon")); return false; } diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 68945319f..7087c9785 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -16,12 +16,14 @@ import com.fr.general.Inter; import com.fr.stable.StringUtils; import com.fr.third.guava.base.Strings; import com.fr.workspace.WorkContext; +import com.fr.workspace.connect.AuthException; import com.fr.workspace.connect.WorkspaceConnection; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JDialog; import javax.swing.JFileChooser; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextPane; import javax.swing.SwingConstants; @@ -488,8 +490,13 @@ public class RemoteEnvPane extends BasicBeanPane { WorkspaceConnection connection = remoteEnv.getConnection(); DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath()); DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey()); - - return WorkContext.getConnector().testConnection(connection); + try { + return WorkContext.getConnector().testConnection(connection); + } catch (AuthException e) { + message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Auth_Failed")); + uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); + return null; + } } @Override From 6892513e2aa2b1249d9a2424a29ff398f5233d16 Mon Sep 17 00:00:00 2001 From: hzzz Date: Fri, 20 Jul 2018 09:36:42 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/file/SwitchExistEnv.java | 2 +- .../src/main/java/com/fr/design/mainframe/TemplatePane.java | 2 +- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index dcfb954d5..9357ad7cd 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -125,7 +125,7 @@ public class SwitchExistEnv extends MenuDef { } }); } catch (AuthException exception) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed"}), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"), null, 0, UIManager.getIcon("OptionPane.errorIcon")); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java b/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java index 6da82863e..28af3e104 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java @@ -153,7 +153,7 @@ public class TemplatePane extends JPanel implements MouseListener { } setJLabel(selectedName); } catch (AuthException e) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed"}), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"), null, 0, UIManager.getIcon("OptionPane.errorIcon")); return false; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index af9667919..603d9ce5b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -81,7 +81,7 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { if (status != Status.Disconnecting) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Disconnected"}), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Fine-Designer_Basic_Remote_Disconnected"), null, 0, UIManager.getIcon("OptionPane.errorIcon")); TemplatePane.getInstance().editItems(); } From 2a0731adeb496c3e25c418f53c1d08be731dbf24 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 20 Jul 2018 12:54:20 +0800 Subject: [PATCH 11/16] =?UTF-8?q?CORE-113=20=E4=BF=AE=E6=94=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E7=82=B9=E8=AE=B0=E5=BD=95=E7=9A=84API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/actions/FormWidgetEditAction.java | 16 ---------------- .../mainframe/actions/FormMobileAttrAction.java | 10 +--------- .../AccessibleBodyWatermarkEditor.java | 12 ++---------- .../actions/report/ReportMobileAttrAction.java | 10 +--------- .../actions/report/ReportWatermarkAction.java | 8 -------- 5 files changed, 4 insertions(+), 52 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java index b22ac5f76..753dc812b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java @@ -3,12 +3,7 @@ package com.fr.design.designer.beans.actions; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.designer.beans.actions.behavior.UpdateBehavior; import com.fr.design.mainframe.FormDesigner; -import com.fr.general.Inter; -import com.fr.plugin.ExtraClassManager; -import com.fr.stable.ReportFunctionProcessor; -import com.fr.stable.fun.FunctionProcessor; -import javax.swing.*; import java.awt.event.ActionEvent; public abstract class FormWidgetEditAction extends TemplateComponentAction { @@ -32,17 +27,6 @@ public abstract class FormWidgetEditAction extends TemplateComponentAction { // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark()); } - // 记录功能点 - FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); - if (processor != null) { - processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_FRM); - } // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java index b6de59857..c5acb6114 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java @@ -7,12 +7,9 @@ import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.renderer.WatermarkRenderer; import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper; import com.fr.design.report.WatermarkPane; -import com.fr.plugin.ExtraClassManager; -import com.fr.stable.ReportFunctionProcessor; -import com.fr.stable.fun.FunctionProcessor; -import javax.swing.SwingUtilities; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; /** * Created by plough on 2018/5/15. @@ -43,11 +40,6 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor { public void doOk() { setValue(watermarkPane.update()); fireStateChanged(); - // 功能点 - FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); - if (processor != null) { - processor.recordFunction(ReportFunctionProcessor.WATERMARK); - } } }); watermarkPane.populate((WatermarkAttr) getValue()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index d718c92fe..f4032fa92 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -12,12 +12,9 @@ import com.fr.file.FILE; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.main.TemplateWorkBook; -import com.fr.plugin.ExtraClassManager; import com.fr.report.mobile.ElementCaseMobileAttr; -import com.fr.stable.ReportFunctionProcessor; -import com.fr.stable.fun.FunctionProcessor; -import javax.swing.KeyStroke; +import javax.swing.*; import java.awt.event.ActionEvent; /** @@ -67,11 +64,6 @@ public class ReportMobileAttrAction extends JWorkBookAction{ // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark()); } - // 记录功能点 - FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); - if (processor != null) { - processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_CPT); - } // 设置移动端属性并刷新界面 wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后 jwb.fireTargetModified(); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java index bec8fb217..db1d10f9d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java @@ -9,10 +9,7 @@ import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.report.WatermarkPane; import com.fr.main.impl.WorkBook; -import com.fr.plugin.ExtraClassManager; import com.fr.report.core.ReportUtils; -import com.fr.stable.ReportFunctionProcessor; -import com.fr.stable.fun.FunctionProcessor; import java.awt.event.ActionEvent; @@ -45,11 +42,6 @@ public class ReportWatermarkAction extends JWorkBookAction { public void doOk() { wbTpl.addAttrMark(watermarkPane.update()); jwb.fireTargetModified(); - // 功能点 - FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); - if (processor != null) { - processor.recordFunction(ReportFunctionProcessor.WATERMARK); - } } }).setVisible(true); } From e51bfb69a3499db0df18b75b25cb712a6e0aae20 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 20 Jul 2018 16:18:15 +0800 Subject: [PATCH 12/16] =?UTF-8?q?CORE-113=20=E5=8A=9F=E8=83=BD=E7=82=B9?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=EF=BC=8C=E5=85=A8=E9=83=A8=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=20@Focus=E6=9D=A5=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/ChartTypeButtonPane.java | 16 +++------------ .../designer/data/comp/DrillMapDataPane.java | 9 ++------- .../comp/EachLayerDataDefinitionPane.java | 9 ++------- .../mobile/ChartEditorDefinePane.java | 20 ++++--------------- 4 files changed, 11 insertions(+), 43 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 6690224c8..c29616d2c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -18,21 +18,12 @@ import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.GridLayout; -import java.awt.Image; -import java.awt.Rectangle; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -140,7 +131,6 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen try { Chart newChart = (Chart) chart.clone(); editingCollection.addNamedChart(name, newChart); - editingCollection.addFunctionRecord(newChart); } catch (CloneNotSupportedException e1) { FineLoggerFactory.getLogger().error("Error in Clone"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java index 0d7f07c06..44c314df5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.drillmap.designer.data.comp; -import com.fr.base.chart.BaseChart; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.beans.BasicBeanPane; @@ -13,7 +12,7 @@ import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; -import java.awt.BorderLayout; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -102,11 +101,7 @@ public class DrillMapDataPane extends BasicBeanPane { } if(dataDefinitionType.getSelectedIndex() == 0){ drillMapDefinition.setFromBottomData(true); - ChartCollection temp = new ChartCollection(new Chart()){ - @Override - public void addFunctionRecord(BaseChart chart) { - } - }; + ChartCollection temp = new ChartCollection(new Chart()); bottomDataDefinitionPane.updateBean(temp); drillMapDefinition.setBottomDataDefinition(temp.getSelectedChart().getFilterDefinition()); } else { diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java index 15256e82f..4c3c44329 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.drillmap.designer.data.comp; -import com.fr.base.chart.BaseChart; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; @@ -18,7 +17,7 @@ import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; import javax.swing.tree.DefaultMutableTreeNode; -import java.awt.CardLayout; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -116,11 +115,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane { List eachLayerDataDefinitionList = new ArrayList(); for(BasicPane basicPane : paneList){ if(basicPane instanceof SingleLayerDataDefinitionPane){ - ChartCollection temp = new ChartCollection(new Chart()){ - @Override - public void addFunctionRecord(BaseChart chart) { - } - }; + ChartCollection temp = new ChartCollection(new Chart()); ((SingleLayerDataDefinitionPane) basicPane).updateBean(temp); eachLayerDataDefinitionList.add(temp.getSelectedChart().getFilterDefinition()); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index fe299bfaa..67a5edd7a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -18,20 +18,12 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.form.FormFunctionProcessor; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.container.WFitLayout; import com.fr.general.Inter; -import com.fr.plugin.ExtraClassManager; -import com.fr.stable.fun.FunctionProcessor; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -175,11 +167,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { updateTipLabel(); ChartMobileFitAttrState selectedAttr = (ChartMobileFitAttrState)((Item)e.getItem()).getValue(); if (selectedAttr.getState() != ChartMobileFitAttrState.AUTO.getState()) { - // 功能埋点 - FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); - if (processor != null) { - processor.recordFunction(FormFunctionProcessor.MOBILE_CHART_ADAPTIVITY); - } + } } }); From 9a944e03a5ca4737b6ead3c6539fe94e152589da Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 20 Jul 2018 16:30:12 +0800 Subject: [PATCH 13/16] =?UTF-8?q?REPORT-9843=20=E3=80=9010.0=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91ie9=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E7=89=88=E6=9C=AC=EF=BC=8C=E9=A2=84=E8=A7=88=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0css=E6=A0=B7=E5=BC=8F=E7=9A=84=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E6=A0=B7=E5=BC=8F=E4=B8=8D=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/FineEmbedServerActivator.java | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 2292da99a..176db579a 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -12,8 +12,6 @@ import com.fr.third.springframework.web.context.support.AnnotationConfigWebAppli import com.fr.workspace.WorkContext; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; -import org.apache.catalina.Wrapper; - import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.startup.Tomcat; @@ -25,12 +23,12 @@ import java.util.Set; * Created by juhaoyu on 2018/6/5. */ public class FineEmbedServerActivator extends Activator { - + private Tomcat tomcat; - + @Override public synchronized void start() { - + try { //初始化tomcat initTomcat(); @@ -39,10 +37,10 @@ public class FineEmbedServerActivator extends Activator { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + @Override public synchronized void stop() { - + try { stopSpring(); stopServerActivator(); @@ -51,75 +49,62 @@ public class FineEmbedServerActivator extends Activator { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + private void initTomcat() { - + tomcat = new Tomcat(); - + tomcat.setPort(DesignerEnvManager.getEnvManager().getEmbedServerPort()); // 设置解码uri使用的字符编码 tomcat.getConnector().setURIEncoding(EncodeConstants.ENCODING_UTF_8); String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); String appName = "/" + FRContext.getCommonOperator().getAppName(); Context context = tomcat.addContext(appName, docBase); - addDefaultServlet(context); + Tomcat.initWebappDefaults(context); //覆盖tomcat的WebAppClassLoader context.setLoader(new FRTomcatLoader()); - + //直接指定initializer,tomcat就不用再扫描一遍了 SpringServletContainerInitializer initializer = new SpringServletContainerInitializer(); Set> classes = new HashSet>(); classes.add(FineWebApplicationInitializer.class); context.addServletContainerInitializer(initializer, classes); } - - private void addDefaultServlet(Context context) { - - Wrapper defaultServlet = context.createWrapper(); - defaultServlet.setName("default"); - defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet"); - defaultServlet.addInitParameter("debug", "0"); - defaultServlet.addInitParameter("listings", "false"); - defaultServlet.setLoadOnStartup(1); - defaultServlet.setOverridable(true); - context.addChild(defaultServlet); - context.addServletMapping("/","default"); - } - - + + private void stopServerActivator() { - + ModuleRole.ServerRoot.stop(); } - + private void stopSpring() { - + AnnotationConfigWebApplicationContext context = ModuleRole.ServerRoot.getSingleton(AnnotationConfigWebApplicationContext.class); if (context != null) { context.stop(); context.destroy(); } } - + private void stopTomcat() throws LifecycleException { - + tomcat.stop(); tomcat.destroy(); } - - + + /** * Created by juhaoyu on 2018/6/5. * 自定义的tomcat loader,主要用于防止内置服务器再加载一遍class */ private static class FRTomcatLoader extends WebappLoader { - + @Override public ClassLoader getClassLoader() { - + return this.getClass().getClassLoader(); } - + } - + } From bdceb6ababca43118a94f09ea99440b8e1195047 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:34:48 +0800 Subject: [PATCH 14/16] REPORT-9845 & REPORT-9849 & REPORT-9883 --- .../java/com/fr/design/file/HistoryTemplateListPane.java | 6 ++++-- .../main/java/com/fr/grid/selection/FloatSelection.java | 6 +++++- .../fr/quickeditor/floatquick/FloatStringQuickEditor.java | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index cff8675c4..22b9ab7c0 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -22,6 +22,7 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; @@ -246,8 +247,9 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C */ public int contains(String filename) { for (int i = 0; i < historyList.size(); i++) { - String historyPath = historyList.get(i).getPath(); - if (ComparatorUtils.equals(historyPath, filename)) { + String historyPath = historyList.get(i).getPath().replaceAll("/", "\\\\"); + //文件路径是全路径,历史路径是reportlets/模板名 + if (filename.endsWith(historyPath)) { return i; } } diff --git a/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java index d6d3f627f..15fc359eb 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java @@ -235,7 +235,11 @@ public class FloatSelection extends Selection { public QuickEditor getQuickEditor(TargetComponent tc) { ElementCasePane ePane = (ElementCasePane) tc; FloatElement selectedFloat = ePane.getEditingElementCase().getFloatElement(selectedFloatName); - Object value = selectedFloat.getValue(); + Object value = null; + //处理撤销时npe + if(selectedFloat != null) { + value = selectedFloat.getValue(); + } value = value == null ? "" : value; value = value instanceof Number ? value.toString() : value; QuickEditor editor = ActionFactory.getFloatEditor(value.getClass()); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java index eae3e81dc..3e3211259 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java @@ -90,7 +90,12 @@ public class FloatStringQuickEditor extends FloatQuickEditor { @Override protected void refreshDetails() { String str; - Object value = floatElement.getValue(); + Object value = null; + //处理撤销时npe + if (floatElement != null){ + value = floatElement.getValue(); + } + if (value == null) { str = StringUtils.EMPTY; } else if (value instanceof BaseFormula) { From 7675f2ad2775156c40488a0a3564fee773631e43 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:37:36 +0800 Subject: [PATCH 15/16] REPORT-9845 & REPORT-9849 & REPORT-9883 --- .../main/java/com/fr/design/file/HistoryTemplateListPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index 22b9ab7c0..7e2f34593 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -22,7 +22,6 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; From 091c2d4c96fdd6de93c50730e18bb557017de339 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 23 Jul 2018 11:40:17 +0800 Subject: [PATCH 16/16] =?UTF-8?q?REPORT-9113=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F-=E6=96=87=E4=BB=B6-=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E9=9C=80=E8=A6=81=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=20REPORT-9082=20=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A0=8F-=E6=96=87=E4=BB=B6-=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E4=B8=8B=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=9C=8D=E5=8A=A1=E5=99=A8=EF=BC=8C=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=B7=B2=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E7=9A=84=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/RemoteEnvPane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 7087c9785..c47c67444 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -279,6 +279,10 @@ public class RemoteEnvPane extends BasicBeanPane { this.certPathInput.setText(certPath); this.certSecretKeyInput.setText(certSecretKey); + } else { + this.remoteEnvURL = RemoteEnvURL.createDefaultURL(); + this.usernameInput.setText(StringUtils.EMPTY); + this.passwordInput.setText(StringUtils.EMPTY); } fillRemoteEnvURLField();