From d396dbd385e5793465c227a9f4ea07989a5aeb62 Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 21 Jun 2018 12:12:39 +0800 Subject: [PATCH 01/35] =?UTF-8?q?DEC-2558=20URL=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledata/tabledatapane/FileTableDataPane.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index 16d9966a11..a3e6efa5f1 100644 --- a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -61,6 +61,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -318,7 +320,13 @@ public class FileTableDataPane extends AbstractTableDataPane { } private boolean checkURL(String uri){ - return (uri.matches("https*://.+|\\$\\{.+\\}.*")); + try { + new URL(uri); + return true; + } catch (MalformedURLException e) { + return false; + } + // return (uri.matches("https*://.+|\\$\\{.+\\}.*")); } private JPanel textSetPanel(int width,int height) { From dc09e9eaac77e0e31c5a3d3897ba344c87059222 Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 21 Jun 2018 12:52:53 +0800 Subject: [PATCH 02/35] =?UTF-8?q?update=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/tabledata/tabledatapane/FileTableDataPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index a3e6efa5f1..93d4821399 100644 --- a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -207,7 +207,7 @@ public class FileTableDataPane extends AbstractTableDataPane { private ActionListener testConnectionListener = new ActionListener() { public void actionPerformed(ActionEvent arg0) { - String uri = urlText.getText(); + String uri = ParameterHelper.analyze4Templatee( urlText.getText(), params); if (!checkURL(uri)) { JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(FileTableDataPane.this), Inter.getLocText("FR-Designer_Add_JS_warning")); return; From d3ee0b749b8f90b28525c5fe1b68605a5b827742 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Thu, 21 Jun 2018 14:14:23 +0800 Subject: [PATCH 03/35] =?UTF-8?q?REPORT-8935=2010.0=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=20=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E6=B2=A1?= =?UTF-8?q?=E4=BA=86.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 11f61beb2a..cd684a6161 100644 --- a/designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -439,8 +439,7 @@ public abstract class ToolBarMenuDock { } private boolean shouldShowPlugin() { - - return !(WorkContext.getCurrent().isLocal()) && FRContext.isChineseEnv(); + return WorkContext.getCurrent().isLocal() && FRContext.isChineseEnv(); } /** From 69416f901c27f9671410dc1cb38a1d19c0049953 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 21 Jun 2018 15:59:46 +0800 Subject: [PATCH 04/35] =?UTF-8?q?REPORT-8813=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A2=9E=E5=8A=A0=E5=8A=A0=E8=BD=BD=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E7=9A=84loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/border/UIRoundedBorder.java | 17 +++- .../src/com/fr/design/gui/UIDefaultTheme.java | 3 + .../gui/iprogressbar/FRProgressMonitor.java | 39 ++++++++ .../iprogressbar/ModernUIProgressBarUI.java | 83 +++++++++++++++++ .../gui/iprogressbar/ProgressDialog.java | 80 ++++++++++++++++ .../gui/iprogressbar/UIProgressBarUI.java | 4 +- .../gui/iprogressbar/UIProgressBorder.java | 93 +++++++++++++++++++ .../fr/design/mainframe/DesignerFrame.java | 6 ++ .../toolbar/UpdateActionManager.java | 8 +- .../src/com/fr/start/BaseDesigner.java | 38 ++++++-- .../src/com/fr/start/Designer.java | 31 ++++++- .../com/fr/start/module/DesignerStartup.java | 19 +++- 12 files changed, 394 insertions(+), 27 deletions(-) create mode 100644 designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java create mode 100644 designer-base/src/com/fr/design/gui/iprogressbar/ModernUIProgressBarUI.java create mode 100644 designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java create mode 100644 designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java diff --git a/designer-base/src/com/fr/design/border/UIRoundedBorder.java b/designer-base/src/com/fr/design/border/UIRoundedBorder.java index 664d113f67..65652cbcd5 100644 --- a/designer-base/src/com/fr/design/border/UIRoundedBorder.java +++ b/designer-base/src/com/fr/design/border/UIRoundedBorder.java @@ -1,5 +1,8 @@ package com.fr.design.border; +import com.fr.base.GraphHelper; + +import javax.swing.border.LineBorder; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; @@ -7,10 +10,6 @@ import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.geom.RoundRectangle2D; -import javax.swing.border.LineBorder; - -import com.fr.base.GraphHelper; - public class UIRoundedBorder extends LineBorder { private static final long serialVersionUID = 1L; @@ -36,7 +35,15 @@ public class UIRoundedBorder extends LineBorder { this.lineStyle = lineStyle; this.roundedCorner = roundedCorners; } - + + public int getRoundedCorner() { + return roundedCorner; + } + + public int getLineStyle() { + return lineStyle; + } + public void paintBorder(Component c, Graphics g, int x, int y, int width, int height){ Color oldColor = g.getColor(); diff --git a/designer-base/src/com/fr/design/gui/UIDefaultTheme.java b/designer-base/src/com/fr/design/gui/UIDefaultTheme.java index 2537ddf92d..26030c47c9 100644 --- a/designer-base/src/com/fr/design/gui/UIDefaultTheme.java +++ b/designer-base/src/com/fr/design/gui/UIDefaultTheme.java @@ -1,6 +1,7 @@ package com.fr.design.gui; +import com.fr.design.constants.UIConstants; import com.fr.design.utils.ThemeUtils; import javax.swing.*; @@ -79,6 +80,8 @@ public class UIDefaultTheme extends DefaultMetalTheme { table.put("TableHeader.background", new ColorUIResource(229, 229, 229)); table.put("ProgressBar.foreground", ThemeUtils.PROCESS_COLOR); table.put("ProgressBar.background", ThemeUtils.TEXT_BG_COLOR); + table.put("ProgressBar.modern.foreground", new ColorUIResource(0x3497FF)); + table.put("ProgressBar.modern.background", UIConstants.PROPERTY_PANE_BACKGROUND); table.put("ProgressBar.selectionForeground", ThemeUtils.NORMAL_FOREGROUND); table.put("ProgressBar.selectionBackground", ThemeUtils.NORMAL_FOREGROUND); table.put("PopupMenu.background", ThemeUtils.NORMAL_BG); diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java b/designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java new file mode 100644 index 0000000000..7fcc2aa2ac --- /dev/null +++ b/designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java @@ -0,0 +1,39 @@ +package com.fr.design.gui.iprogressbar; + +import javax.swing.ProgressMonitor; +import java.awt.Component; + +/** + * Created by zack on 2018/6/20. + */ +public class FRProgressMonitor extends ProgressMonitor { + /** + * Constructs a graphic object that shows progress, typically by filling + * in a rectangular bar as the process nears completion. + * + * @param parentComponent the parent component for the dialog box + * @param message a descriptive message that will be shown + * to the user to indicate what operation is being monitored. + * This does not change as the operation progresses. + * See the message parameters to methods in + * {@link JOptionPane#message} + * for the range of values. + * @param note a short note describing the state of the + * operation. As the operation progresses, you can call + * setNote to change the note displayed. This is used, + * for example, in operations that iterate through a + * list of files to show the name of the file being processes. + * If note is initially null, there will be no note line + * in the dialog box and setNote will be ineffective + * @param min the lower bound of the range + * @param max the upper bound of the range + * @see JDialog + * @see JOptionPane + */ + public FRProgressMonitor(Component parentComponent, Object message, String note, int min, int max) { + super(parentComponent, message, note, min, max); + } + public void setUndecorated(){ + + } +} diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/ModernUIProgressBarUI.java b/designer-base/src/com/fr/design/gui/iprogressbar/ModernUIProgressBarUI.java new file mode 100644 index 0000000000..04ca657d16 --- /dev/null +++ b/designer-base/src/com/fr/design/gui/iprogressbar/ModernUIProgressBarUI.java @@ -0,0 +1,83 @@ +package com.fr.design.gui.iprogressbar; + +import com.fr.design.utils.ThemeUtils; + +import javax.swing.LookAndFeel; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.RoundRectangle2D; + +/** + * 新进度条UI(暂时只处理了非模糊场景) + * Created by zack on 2018/6/21. + */ +public class ModernUIProgressBarUI extends UIProgressBarUI { + // draw determinate + @Override + protected void drawXpHorzProgress(Graphics g, int x, int y, + int w, int h, int amountFull) { + Graphics2D g2d = (Graphics2D) g; + g2d.translate(x, y); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + if (!progressBar.isOpaque()) { + //绘制进度条背板 + g2d.setColor(progressBar.getBackground()); + RoundRectangle2D roundedRectangle = new RoundRectangle2D.Float(0, 0, w, h, 10, 10); + g2d.fill(roundedRectangle); + } + // + g2d.setColor(progressBar.getForeground()); + int mx = 0; + while (mx < amountFull) { + RoundRectangle2D roundedRectangle = new RoundRectangle2D.Float(0, 0, amountFull, h, 10, 10); + g2d.fill(roundedRectangle); + mx += 8; + } + g2d.translate(-x, -y); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + } + + + // draw determinate + @Override + protected void drawXpVertProgress(Graphics g, int x, int y, + int w, int h, int amountFull) { + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.translate(x, y); + // paint the track + if (!progressBar.isOpaque()) { + g.setColor(progressBar.getBackground()); + RoundRectangle2D roundedRectangle = new RoundRectangle2D.Float(0, 0, w, h, 10, 10); + g2d.fill(roundedRectangle); + } + // paints bottom to top... + int my = 0; + while (my < amountFull) { + RoundRectangle2D roundedRectangle = new RoundRectangle2D.Float(0, 0, w, amountFull, 10, 10); + g2d.fill(roundedRectangle); + my += 8; + } + g.translate(-x, -y); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + } + + @Override + protected Color getSelectionForeground() { + return ThemeUtils.PROCESS_SELECTED_FORECOLOR; + } + + @Override + protected Color getSelectionBackground() { + return ThemeUtils.PROCESS_SELECTED_BACKCOLOR; + } + + @Override + protected void installDefaults() { + LookAndFeel.installBorder(progressBar, "ProgressBar.border"); + LookAndFeel.installColorsAndFont(progressBar, + "ProgressBar.modern.background", "ProgressBar.modern.foreground", "ProgressBar.font"); + } +} diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java new file mode 100644 index 0000000000..0da3060563 --- /dev/null +++ b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -0,0 +1,80 @@ +package com.fr.design.gui.iprogressbar; + +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; +import com.fr.general.Inter; + +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.plaf.ColorUIResource; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; + +/** + * 加载进度弹窗 + */ +public class ProgressDialog extends UIDialog { + private JProgressBar progressBar; + private JDialog centerDialog; + private JLabel text; + + public ProgressDialog(Frame parent) { + super(parent); + setUndecorated(true); + setSize(parent.getSize()); + setLocationRelativeTo(null); + setOpacity(0.5f); + initComponent(); + } + + private void initComponent() { + + centerDialog = new JDialog(this); + centerDialog.setSize(new Dimension(482, 124)); + centerDialog.setUndecorated(true); + GUICoreUtils.centerWindow(centerDialog); + JPanel panel = new JPanel(); + panel.setBorder(new UIProgressBorder(3, UIConstants.DEFAULT_BG_RULER, 14, 46, 47, 37, 47)); + panel.setLayout(new BorderLayout(4, 15)); + progressBar = new JProgressBar(); + progressBar.setUI(new ModernUIProgressBarUI()); + progressBar.setBorderPainted(false); + progressBar.setOpaque(false); + progressBar.setBorder(null); + panel.add(progressBar, BorderLayout.CENTER); + text = new UILabel(Inter.getLocText("FR-Designer_Loading_Project"), JLabel.CENTER); + FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)); + text.setFont(font); + panel.add(text, BorderLayout.SOUTH); + centerDialog.getContentPane().add(panel); + + } + + @Override + public void checkValid() throws Exception { + + } + + @Override + public void setVisible(boolean b) { + super.setVisible(b); + centerDialog.setVisible(b); + centerDialog.setResizable(false); + } + + public void setProgressValue(int value) { + progressBar.setValue(value); + } + + @Override + public void dispose() { + centerDialog.dispose(); + super.dispose(); + } +} diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBarUI.java b/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBarUI.java index 4d9d34ba05..e48de9fcdb 100644 --- a/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBarUI.java +++ b/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBarUI.java @@ -74,7 +74,7 @@ public class UIProgressBarUI extends BasicProgressBarUI { } // draw determinate - private void drawXpHorzProgress(Graphics g, int x, int y, + protected void drawXpHorzProgress(Graphics g, int x, int y, int w, int h, int amountFull) { g.translate(x, y); if (!progressBar.isOpaque()) { @@ -124,7 +124,7 @@ public class UIProgressBarUI extends BasicProgressBarUI { // draw determinate - private void drawXpVertProgress(Graphics g, int x, int y, + protected void drawXpVertProgress(Graphics g, int x, int y, int w, int h, int amountFull) { g.translate(x, y); // paint the track diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java b/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java new file mode 100644 index 0000000000..fb0207078b --- /dev/null +++ b/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java @@ -0,0 +1,93 @@ +package com.fr.design.gui.iprogressbar; + +import com.fr.design.border.UIRoundedBorder; + +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.RenderingHints; +import java.awt.geom.RoundRectangle2D; + +/** + * 进度条带阴影的边框 + */ +public class UIProgressBorder extends UIRoundedBorder { + private int left; + private int right; + private int top; + private int bottom; + private static final long serialVersionUID = 1L; + + public UIProgressBorder(Color color) { + super(color); + } + + public UIProgressBorder(Color color, int thickness) { + super(color, thickness); + } + + public UIProgressBorder(Color color, int thickness, int roundedCorners) { + super(color, thickness, roundedCorners); + } + + public UIProgressBorder(int lineStyle, Color color, int roundedCorners) { + super(lineStyle, color, roundedCorners); + } + + public UIProgressBorder(int lineStyle, Color color, int roundedCorners, int top, int left, int bottom, int right) { + super(lineStyle, color, roundedCorners); + this.top = top; + this.right = right; + this.bottom = bottom; + this.left = left; + } + + @Override + public Insets getBorderInsets(Component c) { + Insets insets = new Insets(top, left, bottom, right); + return insets; + } + + @Override + public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { + Color oldColor = g.getColor(); + + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setColor(getLineColor()); + g2d.fill(new RoundRectangle2D.Double(x, y, width, height, 0, 0)); + g2d.setColor(oldColor); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + paintBorderShadow(g2d, 7, x, y, width, height); + + g2d.setColor(oldColor); + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1f)); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + } + + private void paintBorderShadow(Graphics2D g2, int shadowWidth, int x, int y, int width, int height) { + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + shadowWidth = Math.max(shadowWidth, 2); + int sw = shadowWidth; + for (int i = sw; i > 0; i--) { + float pct = (float) (sw - i) / (sw - 1); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.01f * i)); + g2.setColor(getMixedColor(Color.LIGHT_GRAY, 1.0f - pct, Color.WHITE, pct)); + g2.setStroke(new BasicStroke(i)); + g2.draw(new RoundRectangle2D.Double(x, y, width, height, getRoundedCorner(), getRoundedCorner())); + } + } + + private static Color getMixedColor(Color c1, float pct1, Color c2, float pct2) { + float[] clr1 = c1.getComponents(null); + float[] clr2 = c2.getComponents(null); + for (int i = 0; i < clr1.length; i++) { + clr1[i] = (clr1[i] * pct1) + (clr2[i] * pct2); + } + return new Color(clr1[0], clr1[1], clr1[2], clr1[3]); + } +} \ No newline at end of file diff --git a/designer-base/src/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/com/fr/design/mainframe/DesignerFrame.java index 23e2596dfd..f4766b798e 100644 --- a/designer-base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/com/fr/design/mainframe/DesignerFrame.java @@ -23,6 +23,7 @@ import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.TitlePlaceProcessor; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIMenuHighLight; +import com.fr.design.gui.iprogressbar.ProgressDialog; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; @@ -192,6 +193,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta closeButton.repaint(); } }; + private ProgressDialog progressDialog; public DesignerFrame(ToolBarMenuDock ad) { @@ -269,6 +271,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true)); closeMode = UIConstants.CLOSE_OF_AUTHORITY; initMenuPane(); + this.progressDialog = new ProgressDialog(this); } /** @@ -1049,4 +1052,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } + public ProgressDialog getProgressDialog() { + return progressDialog; + } } \ No newline at end of file diff --git a/designer-base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java b/designer-base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java index d5527b31c9..dcc053e126 100644 --- a/designer-base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java +++ b/designer-base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java @@ -9,7 +9,6 @@ import com.fr.stable.StableUtils; import javax.swing.JPanel; import java.util.List; -import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -20,9 +19,9 @@ import java.util.concurrent.TimeUnit; public class UpdateActionManager { private static UpdateActionManager updateActionManager = null; private List updateActions; - private ExecutorService threadPoolExecutor = new ThreadPoolExecutor( - 1, 1, - 0L, TimeUnit.MILLISECONDS, + private ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( + 1, 2, + 30000L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new ThreadFactoryBuilder().setNameFormat("alphafine-thread-%s").build());//目前测下来一个线程慢慢做处理总共大概也只要两秒,暂时就这样 @@ -57,6 +56,7 @@ public class UpdateActionManager { } public synchronized void dealWithSearchText(final String paneClass, final UpdateAction updateAction) { + threadPoolExecutor.allowCoreThreadTimeOut(true); threadPoolExecutor.execute(new Runnable() { @Override public void run() { diff --git a/designer-base/src/com/fr/start/BaseDesigner.java b/designer-base/src/com/fr/start/BaseDesigner.java index e374f25998..8bc56e33d9 100644 --- a/designer-base/src/com/fr/start/BaseDesigner.java +++ b/designer-base/src/com/fr/start/BaseDesigner.java @@ -11,6 +11,8 @@ import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerStartOpenFileProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.WestRegionContainerPane; import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.utils.DesignUtils; @@ -36,12 +38,12 @@ import java.util.concurrent.Executors; public abstract class BaseDesigner extends ToolBarMenuDock { private static final int LOAD_TREE_MAXNUM = 10; - + public BaseDesigner(String[] args) { - + init(args); } - + private void init(String[] args) { //初始化 EventDispatcher.fire(ModuleEvent.MajorModuleStarting, InterProviderFactory.getProvider().getLocText("FR-Designer_Initializing")); @@ -70,21 +72,37 @@ public abstract class BaseDesigner extends ToolBarMenuDock { HistoryTemplateListPane.getInstance(); } }); + service.submit(new Runnable() { + @Override + public void run() { + WestRegionContainerPane.getInstance(); + } + }); + service.submit(new Runnable() { + @Override + public void run() { + EastRegionContainerPane.getInstance(); + } + }); service.shutdown(); } public void show(final String[] args) { collectUserInformation(); + DesignerContext.getDesignerFrame().getProgressDialog().setProgressValue(10); showDesignerFrame(args, DesignerContext.getDesignerFrame(), false); + DesignerContext.getDesignerFrame().getProgressDialog().setProgressValue(60); DesignerContext.getDesignerFrame().refreshEnv(); + DesignerContext.getDesignerFrame().getProgressDialog().setProgressValue(90); for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) { TemplateTreePane.getInstance().getTemplateFileTree().refresh(); } + DesignerContext.getDesignerFrame().getProgressDialog().setProgressValue(100); } - - + + private void createDesignerFrame() { - + new DesignerFrame(this); } @@ -128,9 +146,9 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } } } - + private boolean openFile(final DesignerFrame df, boolean isException, FILE file) { - + //启动时打开指定文件的接口 DesignerStartOpenFileProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerStartOpenFileProcessor.XML_TAG); if (processor != null) { @@ -153,8 +171,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock { df.getSelectedJTemplate().requestGridFocus(); return isException; } - - + + /** * @param window */ diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index c6b9becbc4..3d4f027a97 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -21,7 +21,9 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itoolbar.UILargeToolbar; import com.fr.design.mainframe.ActiveKeyGenerator; +import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.InformationCollector; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JWorkBook; @@ -38,6 +40,7 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignerModule; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.general.SiteCenter; @@ -56,9 +59,14 @@ import com.fr.start.preload.ImagePreLoader; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.border.MatteBorder; -import java.awt.*; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -129,6 +137,25 @@ public class Designer extends BaseDesigner { TemplateInfoCollector.getInstance(); } }); + + service.submit(new Runnable() { + @Override + public void run() { + CellElementPropertyPane.getInstance(); + } + }); + service.submit(new Runnable() { + @Override + public void run() { + DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane + } + }); + service.submit(new Runnable() { + @Override + public void run() { + WidgetInfoConfig.getInstance(); + } + }); service.shutdown(); } diff --git a/designer-realize/src/com/fr/start/module/DesignerStartup.java b/designer-realize/src/com/fr/start/module/DesignerStartup.java index 850416a522..c78905c7e9 100644 --- a/designer-realize/src/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/com/fr/start/module/DesignerStartup.java @@ -11,6 +11,9 @@ import com.fr.startup.activators.BasicActivator; import com.fr.workspace.Workspace; import com.fr.workspace.WorkspaceEvent; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + /** * Created by juhaoyu on 2018/1/8. */ @@ -21,18 +24,26 @@ public class DesignerStartup extends Activator { startSub(PreStartActivator.class); //启动基础部分 startSub(BasicActivator.class); - String[] args = getModule().upFindSingleton(StartupArgs.class).get(); - Designer designer = new Designer(args); + final String[] args = getModule().upFindSingleton(StartupArgs.class).get(); + final Designer designer = new Designer(args); //启动env startSub(DesignerWorkspaceProvider.class); startSub(EnvBasedModule.class); getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv(); + ExecutorService service = Executors.newSingleThreadExecutor(); + service.submit(new Runnable() { + @Override + public void run() { + designer.show(args); + DesignerContext.getDesignerFrame().getProgressDialog().dispose(); + } + }); + service.shutdown(); registerEnvListener(); DesignerContext.getDesignerFrame().setVisible(true); //启动画面结束 SplashContext.getInstance().hide(); - //启动设计器界面 - designer.show(args); + DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); startSub(StartFinishActivator.class); } From c883719149dda44f63d5e488bae26308b8fdc041 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 21 Jun 2018 16:00:52 +0800 Subject: [PATCH 05/35] rt --- .../gui/iprogressbar/FRProgressMonitor.java | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java b/designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java deleted file mode 100644 index 7fcc2aa2ac..0000000000 --- a/designer-base/src/com/fr/design/gui/iprogressbar/FRProgressMonitor.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.fr.design.gui.iprogressbar; - -import javax.swing.ProgressMonitor; -import java.awt.Component; - -/** - * Created by zack on 2018/6/20. - */ -public class FRProgressMonitor extends ProgressMonitor { - /** - * Constructs a graphic object that shows progress, typically by filling - * in a rectangular bar as the process nears completion. - * - * @param parentComponent the parent component for the dialog box - * @param message a descriptive message that will be shown - * to the user to indicate what operation is being monitored. - * This does not change as the operation progresses. - * See the message parameters to methods in - * {@link JOptionPane#message} - * for the range of values. - * @param note a short note describing the state of the - * operation. As the operation progresses, you can call - * setNote to change the note displayed. This is used, - * for example, in operations that iterate through a - * list of files to show the name of the file being processes. - * If note is initially null, there will be no note line - * in the dialog box and setNote will be ineffective - * @param min the lower bound of the range - * @param max the upper bound of the range - * @see JDialog - * @see JOptionPane - */ - public FRProgressMonitor(Component parentComponent, Object message, String note, int min, int max) { - super(parentComponent, message, note, min, max); - } - public void setUndecorated(){ - - } -} From 12b5356c1251bf34a439930e50777d71532aea8d Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 21 Jun 2018 17:06:08 +0800 Subject: [PATCH 06/35] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/iprogressbar/ProgressDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java index 0da3060563..dab3a2e023 100644 --- a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -48,7 +48,7 @@ public class ProgressDialog extends UIDialog { progressBar.setOpaque(false); progressBar.setBorder(null); panel.add(progressBar, BorderLayout.CENTER); - text = new UILabel(Inter.getLocText("FR-Designer_Loading_Project"), JLabel.CENTER); + text = new UILabel(Inter.getLocText("Fine-Designer_Loading_Project"), JLabel.CENTER); FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)); text.setFont(font); panel.add(text, BorderLayout.SOUTH); From 261a4c83e6138fedad9bbe689ee3378d2ad73afb Mon Sep 17 00:00:00 2001 From: ju Date: Fri, 22 Jun 2018 09:24:53 +0800 Subject: [PATCH 07/35] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=20?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E8=AF=BB=E4=B8=8D=E5=88=B0build.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/com/fr/start/Designer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index 3d4f027a97..d80024ea40 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -98,8 +98,8 @@ public class Designer extends BaseDesigner { * @param args 参数 */ public static void main(String[] args) { - preloadResource(); BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); + preloadResource(); SplashContext.getInstance().registerSplash(createSplash()); SplashContext.getInstance().show(); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); From 63cba9dc76d70d76ce1d961767b01d8e3f4774da Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 22 Jun 2018 10:24:38 +0800 Subject: [PATCH 08/35] =?UTF-8?q?CORE-87=20=E4=BF=AE=E6=94=B9SiteCenter?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E8=B6=85=E6=97=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/community/BBSAction.java | 4 ++-- .../design/actions/community/BugAction.java | 4 ++-- .../design/actions/community/NeedAction.java | 4 ++-- .../actions/community/QuestionAction.java | 4 ++-- .../design/actions/community/SignAction.java | 4 ++-- .../fr/design/actions/community/UpAction.java | 4 ++-- .../design/actions/community/VideoAction.java | 6 +++--- .../com/fr/design/actions/help/AboutPane.java | 16 +++++++-------- .../fr/design/actions/help/ForumAction.java | 4 ++-- .../design/actions/help/TutorialAction.java | 7 ++----- .../com/fr/design/extra/LoginWebBridge.java | 10 +++++----- .../fr/design/extra/PluginOperateUtils.java | 4 ++-- .../src/com/fr/design/extra/PluginUtils.java | 6 +++--- .../com/fr/design/extra/PluginWebBridge.java | 8 ++++---- .../design/extra/PluginsReaderFromStore.java | 6 +++--- .../com/fr/design/extra/QQLoginWebPane.java | 2 +- .../com/fr/design/extra/WebViewDlgHelper.java | 4 ++-- .../exe/GetPluginCategoriesExecutor.java | 4 ++-- .../extra/exe/GetPluginFromStoreExecutor.java | 4 ++-- .../extra/exe/GetPluginPrefixExecutor.java | 4 ++-- .../extra/exe/SearchOnlineExecutor.java | 4 ++-- .../com/fr/design/extra/ucenter/Client.java | 6 +++--- .../templateinfo/TemplateInfoCollector.java | 6 +++--- .../chart/DownloadOnlineSourcesHelper.java | 6 +++--- .../mainframe/FormWidgetDetailPane.java | 4 ++-- .../design/mainframe/ActiveKeyGenerator.java | 4 ++-- .../mainframe/InformationCollector.java | 6 +++--- .../alphafine/AlphaFineConstants.java | 20 +++++++++---------- .../fr/design/mainframe/bbs/BBSConstants.java | 4 ++-- .../fr/design/mainframe/bbs/BBSDialog.java | 4 ++-- .../design/mainframe/bbs/BBSLoginDialog.java | 12 +++++------ .../design/mainframe/bbs/UserInfoLabel.java | 8 ++++---- .../errorinfo/ErrorInfoUploader.java | 8 ++++---- .../fr/design/report/share/ShareButton.java | 4 ++-- .../start/CollectUserInformationDialog.java | 10 +++++----- .../src/com/fr/start/Designer.java | 4 ++-- .../fr/start/module/PreStartActivator.java | 5 ++--- 37 files changed, 110 insertions(+), 114 deletions(-) diff --git a/designer-base/src/com/fr/design/actions/community/BBSAction.java b/designer-base/src/com/fr/design/actions/community/BBSAction.java index 01cdcee959..f9c6923af9 100644 --- a/designer-base/src/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/com/fr/design/actions/community/BBSAction.java @@ -5,7 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -36,7 +36,7 @@ public class BBSAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/community/BugAction.java b/designer-base/src/com/fr/design/actions/community/BugAction.java index 5d5e6893c4..7f6548ca4a 100644 --- a/designer-base/src/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/com/fr/design/actions/community/BugAction.java @@ -4,8 +4,8 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.general.CloudCenter; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -30,7 +30,7 @@ public class BugAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs.bugs"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.bugs"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/community/NeedAction.java b/designer-base/src/com/fr/design/actions/community/NeedAction.java index b353dcaa82..68ff2fde00 100644 --- a/designer-base/src/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/com/fr/design/actions/community/NeedAction.java @@ -4,8 +4,8 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.general.CloudCenter; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -31,7 +31,7 @@ public class NeedAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs.needs"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.needs"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/com/fr/design/actions/community/QuestionAction.java index 6cf5f479ce..d94a6e07c2 100644 --- a/designer-base/src/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/com/fr/design/actions/community/QuestionAction.java @@ -4,8 +4,8 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; +import com.fr.general.CloudCenter; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -30,7 +30,7 @@ public class QuestionAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs.questions"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.questions"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/community/SignAction.java b/designer-base/src/com/fr/design/actions/community/SignAction.java index 839d2b9d78..eaa1b2ef66 100644 --- a/designer-base/src/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/com/fr/design/actions/community/SignAction.java @@ -5,7 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -31,7 +31,7 @@ public class SignAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs.aut"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.aut"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/community/UpAction.java b/designer-base/src/com/fr/design/actions/community/UpAction.java index acbe2522b1..83041d888b 100644 --- a/designer-base/src/com/fr/design/actions/community/UpAction.java +++ b/designer-base/src/com/fr/design/actions/community/UpAction.java @@ -5,7 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -31,7 +31,7 @@ public class UpAction extends UpdateAction @Override public void actionPerformed(ActionEvent arg0) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs.update"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.update"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/community/VideoAction.java b/designer-base/src/com/fr/design/actions/community/VideoAction.java index cedbe6273a..4040c514f0 100644 --- a/designer-base/src/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/com/fr/design/actions/community/VideoAction.java @@ -5,7 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -34,9 +34,9 @@ public class VideoAction extends UpdateAction { String url; if (FRContext.getLocale().equals(Locale.US)) { - url = SiteCenter.getInstance().acquireUrlByKind("bbs.video.en"); + url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); } else { - url = SiteCenter.getInstance().acquireUrlByKind("bbs.video"); + url = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); } if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); diff --git a/designer-base/src/com/fr/design/actions/help/AboutPane.java b/designer-base/src/com/fr/design/actions/help/AboutPane.java index 14bcf98b28..40ee0902e8 100644 --- a/designer-base/src/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/com/fr/design/actions/help/AboutPane.java @@ -9,9 +9,9 @@ import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; @@ -33,7 +33,7 @@ public class AboutPane extends JPanel { private static final int DEFAULT_GAP = 12; private static final String COPYRIGHT_LABEL = "\u00A9 "; private static final String BUILD_PREFIX = " "; - private static final String COMPANY_TELEPHONE = SiteCenter.getInstance().acquireUrlByKind("company_telephone"); + private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("company_telephone"); public AboutPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -71,11 +71,11 @@ public class AboutPane extends JPanel { addPhoneAndQQPane(contentPane); // 官网 - JPanel urlActionPane = getURLActionPane(Inter.getLocText("FR-Designer_Official_Website"), SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL)); + JPanel urlActionPane = getURLActionPane(Inter.getLocText("FR-Designer_Official_Website"), CloudCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL)); // 支持邮箱 - String defaultEmail = SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL); - JPanel emailPane = getEmailActionPane(Inter.getLocText("FR-Designer_Support_Email"),SiteCenter.getInstance().acquireUrlByKind("support.email." + FRContext.getLocale(), defaultEmail)); + String defaultEmail = CloudCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL); + JPanel emailPane = getEmailActionPane(Inter.getLocText("FR-Designer_Support_Email"), CloudCenter.getInstance().acquireUrlByKind("support.email." + FRContext.getLocale(), defaultEmail)); contentPane.add(urlActionPane); contentPane.add(emailPane); @@ -90,13 +90,13 @@ public class AboutPane extends JPanel { if (FRContext.getLocale().equals(Locale.US)) { return; } - boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + SiteCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), COMPANY_TELEPHONE)); + boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + CloudCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), COMPANY_TELEPHONE)); contentPane.add(boxCenterAlignmentPane); // 繁体版不显示QQ if (FRContext.getLocale().equals(Locale.TAIWAN)) { return; } - boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + SiteCenter.getInstance().acquireUrlByKind("help.qq")); + boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + CloudCenter.getInstance().acquireUrlByKind("help.qq")); contentPane.add(boxCenterAlignmentPane); } @@ -133,7 +133,7 @@ public class AboutPane extends JPanel { private String getCopyRight() { return append(Inter.getLocText("FR-Designer_About_CopyRight"), COPYRIGHT_LABEL, - ProductConstants.HISTORY, StringUtils.BLANK, SiteCenter.getInstance().acquireUrlByKind("company.name", ProductConstants.COMPANY_NAME)); + ProductConstants.HISTORY, StringUtils.BLANK, CloudCenter.getInstance().acquireUrlByKind("company.name", ProductConstants.COMPANY_NAME)); } private String getBuildTitle() { diff --git a/designer-base/src/com/fr/design/actions/help/ForumAction.java b/designer-base/src/com/fr/design/actions/help/ForumAction.java index 292ad13f3b..c0684cb9cf 100644 --- a/designer-base/src/com/fr/design/actions/help/ForumAction.java +++ b/designer-base/src/com/fr/design/actions/help/ForumAction.java @@ -9,7 +9,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -40,7 +40,7 @@ public class ForumAction extends UpdateAction { * @param e 事件 */ public void actionPerformed(ActionEvent e) { - String url = SiteCenter.getInstance().acquireUrlByKind("bbs"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-base/src/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/com/fr/design/actions/help/TutorialAction.java index 35233430b1..f51ce77cb5 100644 --- a/designer-base/src/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/com/fr/design/actions/help/TutorialAction.java @@ -6,7 +6,6 @@ import java.awt.event.KeyEvent; import java.io.File; import java.io.IOException; import java.net.URI; -import java.util.Locale; import javax.swing.KeyStroke; @@ -15,12 +14,10 @@ import com.fr.base.FRContext; import com.fr.base.Utils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; -import com.fr.general.ComparatorUtils; +import com.fr.general.CloudCenter; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.stable.OperatingSystem; -import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; public class TutorialAction extends UpdateAction { @@ -59,7 +56,7 @@ public class TutorialAction extends UpdateAction { * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { - String helpURL = SiteCenter.getInstance().acquireUrlByKind("help." + FRContext.getLocale()); + String helpURL = CloudCenter.getInstance().acquireUrlByKind("help." + FRContext.getLocale()); if (helpURL != null) { HttpClient client = new HttpClient(helpURL); diff --git a/designer-base/src/com/fr/design/extra/LoginWebBridge.java b/designer-base/src/com/fr/design/extra/LoginWebBridge.java index 30f90d13c1..b22c5905a4 100644 --- a/designer-base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer-base/src/com/fr/design/extra/LoginWebBridge.java @@ -8,8 +8,8 @@ import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.ucenter.Client; import com.fr.design.extra.ucenter.XMLHelper; import com.fr.design.gui.ilable.UILabel; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONObject; import com.fr.stable.EncodeConstants; @@ -134,7 +134,7 @@ public class LoginWebBridge { * @return */ private boolean testConnection() { - HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.test")); + HttpClient client = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("bbs.test")); return client.isServerAlive(); } @@ -159,7 +159,7 @@ public class LoginWebBridge { */ public void registerHref() { try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.register"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); } catch (Exception e) { FRContext.getLogger().info(e.getMessage()); } @@ -170,7 +170,7 @@ public class LoginWebBridge { */ public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.reset"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); } catch (Exception e) { FRContext.getLogger().info(e.getMessage()); } @@ -300,7 +300,7 @@ public class LoginWebBridge { //账号没有QQ授权 closeQQWindow(); try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("QQ_binding"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("QQ_binding"))); } catch (Exception ignored) { // ignored } diff --git a/designer-base/src/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/com/fr/design/extra/PluginOperateUtils.java index d68d0cd861..6752526d92 100644 --- a/designer-base/src/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/com/fr/design/extra/PluginOperateUtils.java @@ -11,7 +11,7 @@ import com.fr.design.extra.exe.callback.UpdateFromDiskCallback; import com.fr.design.extra.exe.callback.UpdateOnlineCallback; import com.fr.design.gui.ilable.UILabel; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -108,7 +108,7 @@ public class PluginOperateUtils { } public static String getRecommendPlugins() { - String plistUrl = SiteCenter.getInstance().acquireUrlByKind("shop.plugin.feature"); + String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.feature"); JSONArray resultArray = JSONArray.create(); try { HttpClient httpClient = new HttpClient(plistUrl); diff --git a/designer-base/src/com/fr/design/extra/PluginUtils.java b/designer-base/src/com/fr/design/extra/PluginUtils.java index 781a7167a5..124ef323fb 100644 --- a/designer-base/src/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/com/fr/design/extra/PluginUtils.java @@ -1,8 +1,8 @@ package com.fr.design.extra; import com.fr.base.TemplateUtils; +import com.fr.general.CloudCenter; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -46,7 +46,7 @@ public class PluginUtils { public static JSONObject getLatestPluginInfo(String pluginID) throws Exception { String result = ""; - String plistUrl = SiteCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + String plistUrl = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); if (StringUtils.isNotEmpty(plistUrl)) { StringBuilder url = new StringBuilder(plistUrl); if (StringUtils.isNotBlank(pluginID)) { @@ -109,7 +109,7 @@ public class PluginUtils { private static String getDownloadPath(String id) throws Exception { HashMap map = new HashMap(); map.put("id", id); - HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.scripts_10")); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.scripts_10")); httpClient.asGet(); String resText = httpClient.getResponseText(); JSONObject resultJSONObject = new JSONObject(resText); diff --git a/designer-base/src/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/com/fr/design/extra/PluginWebBridge.java index d922ae37fb..767a3ea2cf 100644 --- a/designer-base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/com/fr/design/extra/PluginWebBridge.java @@ -15,7 +15,7 @@ import com.fr.design.extra.exe.callback.JSCallback; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; @@ -437,7 +437,7 @@ public class PluginWebBridge { */ public void getPriviteMessage() { try { - String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default"); + String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); Desktop.getDesktop().browse(new URI(loginUrl)); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); @@ -500,7 +500,7 @@ public class PluginWebBridge { */ public void registerHref() { try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.register"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } @@ -514,7 +514,7 @@ public class PluginWebBridge { */ public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.reset"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } diff --git a/designer-base/src/com/fr/design/extra/PluginsReaderFromStore.java b/designer-base/src/com/fr/design/extra/PluginsReaderFromStore.java index add9497967..06a2706d51 100644 --- a/designer-base/src/com/fr/design/extra/PluginsReaderFromStore.java +++ b/designer-base/src/com/fr/design/extra/PluginsReaderFromStore.java @@ -1,8 +1,8 @@ package com.fr.design.extra; +import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; @@ -32,7 +32,7 @@ public class PluginsReaderFromStore { public static List readPlugins() throws Exception { String resText; try { - HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.store")); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("plugin.store")); resText = httpClient.getResponseText(); String charSet = EncodeConstants.ENCODING_UTF_8; resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet); @@ -49,7 +49,7 @@ public class PluginsReaderFromStore { */ public static List readPluginsForUpdate() throws Exception { String resText = null; - String url = SiteCenter.getInstance().acquireUrlByKind("plugin.update"); + String url = CloudCenter.getInstance().acquireUrlByKind("plugin.update"); if (StringUtils.isNotEmpty(url)) { HashMap para = new HashMap(); para.put("plugins", PluginUtils.transPluginsToString(PluginManager.getContexts())); diff --git a/designer-base/src/com/fr/design/extra/QQLoginWebPane.java b/designer-base/src/com/fr/design/extra/QQLoginWebPane.java index f742196914..1d6b7c7a31 100644 --- a/designer-base/src/com/fr/design/extra/QQLoginWebPane.java +++ b/designer-base/src/com/fr/design/extra/QQLoginWebPane.java @@ -102,7 +102,7 @@ public class QQLoginWebPane extends JFXPanel { public void changed(ObservableValue observable, final String oldValue, String newValue) { disableLink(webEngine); // webView好像默认以手机版显示网页,浏览器里过滤掉这个跳转 - if (ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, SiteCenter.getInstance().acquireUrlByKind("bbs.mobile"))) { + if (ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, CloudCenter.getInstance().acquireUrlByKind("bbs.mobile"))) { return; } LoginWebBridge.getHelper().openUrlAtLocalWebBrowser(webEngine, newValue); diff --git a/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java index f273b6d90a..18afa06bbc 100644 --- a/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -10,7 +10,7 @@ import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; @@ -296,7 +296,7 @@ public class WebViewDlgHelper { new SwingWorker() { @Override protected Void doInBackground() throws Exception { - HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv_10") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.cv_10") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); httpClient.asGet(); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { String text = httpClient.getResponseText(); diff --git a/designer-base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java b/designer-base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java index f517d0b65a..0a3b76211d 100644 --- a/designer-base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java @@ -2,7 +2,7 @@ package com.fr.design.extra.exe; import com.fr.design.extra.PluginConstants; import com.fr.design.extra.Process; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; /** @@ -27,7 +27,7 @@ public class GetPluginCategoriesExecutor implements Executor { @Override public void run(Process process) { - String url = SiteCenter.getInstance().acquireUrlByKind("shop.plugin.category"); + String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category"); if (url != null) { HttpClient httpClient = new HttpClient(url); result = httpClient.getResponseText(); diff --git a/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java b/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java index c5a159a10f..884b115da0 100644 --- a/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java @@ -4,7 +4,7 @@ import com.fr.design.extra.PluginConstants; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; import com.fr.design.extra.Process; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor { @Override public void run(Process process) { - String plistUrl = SiteCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?"; + String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?"; boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope); if (getRecommend) { result = PluginOperateUtils.getRecommendPlugins(); diff --git a/designer-base/src/com/fr/design/extra/exe/GetPluginPrefixExecutor.java b/designer-base/src/com/fr/design/extra/exe/GetPluginPrefixExecutor.java index 31b4e2d3f4..7a7de6b12c 100644 --- a/designer-base/src/com/fr/design/extra/exe/GetPluginPrefixExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/GetPluginPrefixExecutor.java @@ -1,7 +1,7 @@ package com.fr.design.extra.exe; import com.fr.design.extra.Process; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.stable.StringUtils; /** @@ -26,7 +26,7 @@ public class GetPluginPrefixExecutor implements Executor { @Override public void run(Process process) { - result = SiteCenter.getInstance().acquireUrlByKind("plugin.url.prefix"); + result = CloudCenter.getInstance().acquireUrlByKind("plugin.url.prefix"); } } }; diff --git a/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java b/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java index 456b77dd15..a35d10588e 100644 --- a/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java @@ -3,7 +3,7 @@ package com.fr.design.extra.exe; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; import com.fr.design.extra.Process; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -42,7 +42,7 @@ public class SearchOnlineExecutor implements Executor { result = PluginOperateUtils.getRecommendPlugins(); return; } - HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword); httpClient.asGet(); String responseText = httpClient.getResponseText(); JSONObject jsonObject = new JSONObject(responseText); diff --git a/designer-base/src/com/fr/design/extra/ucenter/Client.java b/designer-base/src/com/fr/design/extra/ucenter/Client.java index cceba006d2..903286476e 100644 --- a/designer-base/src/com/fr/design/extra/ucenter/Client.java +++ b/designer-base/src/com/fr/design/extra/ucenter/Client.java @@ -1,7 +1,7 @@ package com.fr.design.extra.ucenter; import com.fr.base.FRContext; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import java.io.BufferedReader; import java.io.IOException; @@ -92,8 +92,8 @@ public class Client extends AbstractClient { sep = "&"; } String postData = ucApiRequestdata(module, action, str.toString(), ""); - UC_API = SiteCenter.getInstance().acquireUrlByKind("bbs.ucapi"); - UC_IP = SiteCenter.getInstance().acquireUrlByKind("bbs.ip"); + UC_API = CloudCenter.getInstance().acquireUrlByKind("bbs.ucapi"); + UC_IP = CloudCenter.getInstance().acquireUrlByKind("bbs.ip"); return ucFopen2(UC_API + "/index.php", 500000, postData, "", true, UC_IP, 20, true); } diff --git a/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index be286226cb..7eb5e7bfd3 100644 --- a/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -10,7 +10,7 @@ import com.fr.design.mainframe.SiteCenterToken; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; @@ -305,8 +305,8 @@ public class TemplateInfoCollector implements Serializable, */ public void sendTemplateInfo() { addDayCount(); - String consumingUrl = SiteCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; - String processUrl = SiteCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; + String consumingUrl = CloudCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; + String processUrl = CloudCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; ArrayList> completeTemplatesInfo = getCompleteTemplatesInfo(); for (HashMap templateInfo : completeTemplatesInfo) { String jsonConsumingMap = templateInfo.get(JSON_CONSUMING_MAP); diff --git a/designer-chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java b/designer-chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java index d90fb4d4bd..f7caf5d2cf 100644 --- a/designer-chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java +++ b/designer-chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java @@ -7,7 +7,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.plugin.chart.DownloadSourcesEvent; import com.fr.stable.StableUtils; @@ -68,7 +68,7 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { //本地有这个资源,不下载 return; } - httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(siteKind)); + httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind(siteKind)); if (httpClient.getResponseCode() != HttpURLConnection.HTTP_OK) { //服务器连不上,不下载 return; @@ -116,7 +116,7 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { for (int i = 0; i < list.size(); i++) { SiteInfo siteInfo = list.get(i); - httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(siteInfo.siteKind)); + httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind(siteInfo.siteKind)); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { InputStream reader = httpClient.getResponseStream(); String temp = StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE); diff --git a/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 1285b7115c..f94fe16649 100644 --- a/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -11,7 +11,7 @@ import com.fr.form.share.ShareLoader; import com.fr.form.ui.SharableWidgetBindInfo; import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.share.ShareConstants; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -298,7 +298,7 @@ public class FormWidgetDetailPane extends FormDockView{ downloadButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url"); + String url = CloudCenter.getInstance().acquireUrlByKind("reuse.url"); if (StringUtils.isEmpty(url)) { FRContext.getLogger().info("The URL is empty!"); return; diff --git a/designer-realize/src/com/fr/design/mainframe/ActiveKeyGenerator.java b/designer-realize/src/com/fr/design/mainframe/ActiveKeyGenerator.java index 959c32b9bc..8b6c3ce4ce 100644 --- a/designer-realize/src/com/fr/design/mainframe/ActiveKeyGenerator.java +++ b/designer-realize/src/com/fr/design/mainframe/ActiveKeyGenerator.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -102,7 +102,7 @@ public class ActiveKeyGenerator { para.put("uuid", envManager.getUUID()); para.put("key", key); para.put("username", MarketConfig.getInstance().getBbsUsername()); - HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("verify.code"), para); + HttpClient hc = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("verify.code"), para); if (timeout != -1) { hc.setTimeout(timeout); } diff --git a/designer-realize/src/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/com/fr/design/mainframe/InformationCollector.java index 8da7fe0128..6250179db2 100644 --- a/designer-realize/src/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/com/fr/design/mainframe/InformationCollector.java @@ -13,12 +13,12 @@ import com.fr.data.core.db.dml.Table; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.errorinfo.ErrorInfoUploader; import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.DesUtils; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; @@ -187,7 +187,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { return; } byte[] content = getJSONContentAsByte(); - HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("user.info")); + HttpClient hc = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("user.info")); hc.setContent(content); if (!hc.isServerAlive()) { return; @@ -230,7 +230,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { DBUtils.closeConnection(conn); } - HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("functions.info")); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("functions.info")); httpClient.setContent(content); httpClient.setTimeout(5000); diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer-realize/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java index 18ae549110..09de8e6ed8 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import java.awt.*; @@ -68,24 +68,24 @@ public class AlphaFineConstants { public static final String IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/"; - public static final String PLUGIN_SEARCH_URL = SiteCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); - public static final String PLUGIN_URL = SiteCenter.getInstance().acquireUrlByKind("af.pluginInfo"); + public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); - public static final String REUSE_URL = SiteCenter.getInstance().acquireUrlByKind("af.reuseInfo"); + public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); - public static final String DOCUMENT_DOC_URL = SiteCenter.getInstance().acquireUrlByKind("af.doc_view"); + public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); - public static final String DOCUMENT_SEARCH_URL = SiteCenter.getInstance().acquireUrlByKind("af.doc_search"); + public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); - public static final String DOCUMENT_INFORMATION_URL = SiteCenter.getInstance().acquireUrlByKind("af.doc_info"); + public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); - public static final String PLUGIN_IMAGE_URL = SiteCenter.getInstance().acquireUrlByKind("af.plugin_image"); + public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); - public static final String CLOUD_SERVER_URL = SiteCenter.getInstance().acquireUrlByKind("af.record"); + public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); - public static final String SEARCH_API = SiteCenter.getInstance().acquireUrlByKind("af.cloud_search"); + public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); diff --git a/designer-realize/src/com/fr/design/mainframe/bbs/BBSConstants.java b/designer-realize/src/com/fr/design/mainframe/bbs/BBSConstants.java index 1ecd74b86f..bb600b1cef 100644 --- a/designer-realize/src/com/fr/design/mainframe/bbs/BBSConstants.java +++ b/designer-realize/src/com/fr/design/mainframe/bbs/BBSConstants.java @@ -4,7 +4,7 @@ package com.fr.design.mainframe.bbs; import com.fr.general.IOUtils; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import com.fr.stable.StringUtils; import java.util.Properties; @@ -42,7 +42,7 @@ public class BBSConstants { //加载所有用户的信息, 用户名, 论坛连接 private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) { String[] allGuests = new String[0]; - String guest = SiteCenter.getInstance().acquireUrlByKind(key, defaultValue); + String guest = CloudCenter.getInstance().acquireUrlByKind(key, defaultValue); if (StringUtils.isNotEmpty(guest)) { allGuests = guest.split("\\|"); } diff --git a/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java b/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java index ef4633f5ab..dd3366273d 100644 --- a/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java +++ b/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java @@ -6,7 +6,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import com.fr.general.SiteCenter; +import com.fr.general.CloudCenter; import javafx.application.Platform; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; @@ -96,7 +96,7 @@ public class BBSDialog extends UIDialog { public void changed(ObservableValue observable, final String oldValue, String newValue) { disableLink(eng); // webView好像默认以手机版显示网页,浏览器里过滤掉这个跳转 - if (ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, SiteCenter.getInstance().acquireUrlByKind("bbs.mobile"))) { + if (ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, CloudCenter.getInstance().acquireUrlByKind("bbs.mobile"))) { return; } PluginWebBridge.getHelper().openUrlAtLocalWebBrowser(eng, newValue); diff --git a/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java b/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java index 6c0c8e6941..06343282f2 100644 --- a/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java +++ b/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java @@ -105,8 +105,8 @@ public class BBSLoginDialog extends UIDialog { nameField = new UITextField(); passField = new UIPassWordField(); loginButton = new UIButton(Inter.getLocText("FR-Designer-BBSLogin_Login")); - passwordReset = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("bbs.reset")); - registerLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("bbs.register")); + passwordReset = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.reset")); + registerLabel = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.register")); loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { @@ -163,7 +163,7 @@ public class BBSLoginDialog extends UIDialog { } private boolean testConnection() { - HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.test")); + HttpClient client = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("bbs.test")); return client.isServerAlive(); } @@ -283,8 +283,8 @@ public class BBSLoginDialog extends UIDialog { } catch (UnsupportedEncodingException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } - String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password; - String loginSuccessFlag = SiteCenter.getInstance().acquireUrlByKind("bbs"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password; + String loginSuccessFlag = CloudCenter.getInstance().acquireUrlByKind("bbs"); HttpClient client = new HttpClient(url); client.setTimeout(TIME_OUT); if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) { @@ -303,7 +303,7 @@ public class BBSLoginDialog extends UIDialog { private BoxCenterAligmentPane getURLActionLabel(final String url) { ActionLabel actionLabel = new ActionLabel(url); - if (ComparatorUtils.equals(url, SiteCenter.getInstance().acquireUrlByKind("bbs.reset"))) { + if (ComparatorUtils.equals(url, CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))) { actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Forgot-Password")); } else { actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Register-Account")); diff --git a/designer-realize/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index b4cde55008..e92e772241 100644 --- a/designer-realize/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -18,10 +18,10 @@ import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.stable.EncodeConstants; import com.fr.stable.OperatingSystem; @@ -93,7 +93,7 @@ public class UserInfoLabel extends UILabel { public void mousePressed(MouseEvent e) { if (StringUtils.isNotEmpty(userName)) { try { - String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default"); + String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); Desktop.getDesktop().browse(new URI(loginUrl)); } catch (Exception exp) { FRContext.getLogger().info(exp.getMessage()); @@ -151,7 +151,7 @@ public class UserInfoLabel extends UILabel { } catch (InterruptedException e) { FRContext.getLogger().error(e.getMessage()); } - HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); + HttpClient hc = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("bbs.popup")); if (!hc.isServerAlive()) { return; } @@ -164,7 +164,7 @@ public class UserInfoLabel extends UILabel { Constructor constructor = clazz.getConstructor(Frame.class); Object instance = constructor.newInstance(DesignerContext.getDesignerFrame()); Method showWindow = clazz.getMethod("showWindow", String.class); - showWindow.invoke(instance, SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); + showWindow.invoke(instance, CloudCenter.getInstance().acquireUrlByKind("bbs.popup")); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); } catch (Throwable ignored) { // ignored diff --git a/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java b/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java index e470745be4..4228f121e8 100644 --- a/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java +++ b/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java @@ -2,10 +2,10 @@ package com.fr.design.mainframe.errorinfo; import com.fr.base.FRContext; import com.fr.design.mainframe.SiteCenterToken; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; -import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -89,7 +89,7 @@ public class ErrorInfoUploader { private void downloadSolution(File localCacheZip) { try { - String downloadURL = SiteCenter.getInstance().acquireUrlByKind("solution.download", "http://cloud.fanruan.com/api/solution"); + String downloadURL = CloudCenter.getInstance().acquireUrlByKind("solution.download", "http://cloud.fanruan.com/api/solution"); downloadURL = String.format("%s?token=%s", downloadURL, SiteCenterToken.generateToken()); HttpClient hc = new HttpClient(downloadURL); hc.asGet(); @@ -110,7 +110,7 @@ public class ErrorInfoUploader { private boolean needUpdate(File localCacheZip) { if (localCacheZip.exists()) { // 判断本地文件大小. - String checkURL = SiteCenter.getInstance().acquireUrlByKind("solution.check", "http://cloud.fanruan.com/api/solution/cache/check"); + String checkURL = CloudCenter.getInstance().acquireUrlByKind("solution.check", "http://cloud.fanruan.com/api/solution/cache/check"); checkURL = String.format("%s?token=%s", checkURL, SiteCenterToken.generateToken()); HttpClient client = new HttpClient(checkURL); client.asGet(); @@ -156,7 +156,7 @@ public class ErrorInfoUploader { continue; } - String url = SiteCenter.getInstance().acquireUrlByKind("design.error"); + String url = CloudCenter.getInstance().acquireUrlByKind("design.error"); if (sendErroInfo(url, content)) { file.delete(); } diff --git a/designer-realize/src/com/fr/design/report/share/ShareButton.java b/designer-realize/src/com/fr/design/report/share/ShareButton.java index 40262abbd9..298a03518f 100644 --- a/designer-realize/src/com/fr/design/report/share/ShareButton.java +++ b/designer-realize/src/com/fr/design/report/share/ShareButton.java @@ -17,9 +17,9 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FILE; +import com.fr.general.CloudCenter; import com.fr.general.Inter; import com.fr.general.NameObject; -import com.fr.general.SiteCenter; import com.fr.io.exporter.ImageExporter; import com.fr.main.TemplateWorkBook; import com.fr.main.workbook.ResultWorkBook; @@ -66,7 +66,7 @@ public class ShareButton extends UIButton{ //打开论坛, url可在bbs.properties中配置 private void openBBS(){ try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.share"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.share"))); } catch (Exception e1) { FRContext.getLogger().error(e1.getMessage()); } diff --git a/designer-realize/src/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/com/fr/start/CollectUserInformationDialog.java index 9ed0928ffb..a46f9f73b6 100644 --- a/designer-realize/src/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/com/fr/start/CollectUserInformationDialog.java @@ -12,9 +12,9 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.stable.OperatingSystem; import javax.swing.BorderFactory; @@ -40,10 +40,10 @@ public class CollectUserInformationDialog extends UIDialog { private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; - private static final String CN_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.cn"); - private static final String EN_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.en"); - private static final String TW_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.tw"); - private static final String JP_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.jp"); + private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); + private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); + private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); + private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); private UITextField keyTextField; diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index 3d4f027a97..925795fff1 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -41,9 +41,9 @@ import com.fr.design.module.DesignerModule; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.WidgetInfoConfig; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; -import com.fr.general.SiteCenter; import com.fr.module.Module; import com.fr.module.ModuleContext; import com.fr.stable.BuildContext; @@ -119,7 +119,7 @@ public class Designer extends BaseDesigner { service.submit(new Runnable() { @Override public void run() { - SiteCenter.getInstance(); + CloudCenter.getInstance(); Cursor cursor = UIConstants.CELL_DEFAULT_CURSOR; } }); diff --git a/designer-realize/src/com/fr/start/module/PreStartActivator.java b/designer-realize/src/com/fr/start/module/PreStartActivator.java index e013a35519..85a9ff2ee2 100644 --- a/designer-realize/src/com/fr/start/module/PreStartActivator.java +++ b/designer-realize/src/com/fr/start/module/PreStartActivator.java @@ -4,10 +4,9 @@ import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.utils.DesignUtils; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; -import com.fr.general.SiteCenter; import com.fr.module.Activator; -import com.fr.stable.BuildContext; import com.fr.stable.ProductConstants; import java.io.File; @@ -25,7 +24,7 @@ public class PreStartActivator extends Activator { public void start() { RestartHelper.deleteRecordFilesWhenStart(); - SiteCenter.getInstance(); + CloudCenter.getInstance(); if (checkMultiStart()) { return; } From d893f272a84af06c1bf4e468533f5b475a42f127 Mon Sep 17 00:00:00 2001 From: ju Date: Fri, 22 Jun 2018 11:22:55 +0800 Subject: [PATCH 09/35] =?UTF-8?q?REPORT-8956=20=E6=99=AE=E9=80=9A=E9=A2=84?= =?UTF-8?q?=E8=A7=88-Web=E7=AB=AF=E5=B1=95=E7=A4=BA-=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=98=BE=E7=A4=BA=E5=B9=B3=E5=8F=B0=E7=9A=84?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/com/fr/design/utils/DesignUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/utils/DesignUtils.java b/designer-base/src/com/fr/design/utils/DesignUtils.java index 12871b1ede..4396cfc9ef 100644 --- a/designer-base/src/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/com/fr/design/utils/DesignUtils.java @@ -301,7 +301,7 @@ public class DesignUtils { if (!WorkContext.getCurrent().isLocal()) { try { String urlPath = getWebBrowserPath(); - Desktop.getDesktop().browse(new URI(urlPath + postfixOfUri)); + Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri)); } catch (Exception e) { FRContext.getLogger().error("cannot open the url Successful", e); } From 1b01ba03c61c4c48e096c84f6d0b5399da9bacba Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 22 Jun 2018 14:09:01 +0800 Subject: [PATCH 10/35] REPORT-8860 and REPORT-8989 --- .../com/fr/design/hyperlink/WebHyperNorthPane.java | 7 +++---- .../src/com/fr/start/module/DesignerStartup.java | 11 +++++++++++ .../fr/start/module/DesignerWorkspaceProvider.java | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java b/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java index a7a0a8077a..925be16ef7 100644 --- a/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java +++ b/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java @@ -3,6 +3,7 @@ package com.fr.design.hyperlink; import com.fr.config.ServerPreferenceConfig; import com.fr.design.constants.LayoutConstants; +import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; @@ -23,7 +24,7 @@ import java.awt.BorderLayout; public class WebHyperNorthPane extends AbstractHyperNorthPane { private UITextField itemNameTextField; private boolean needRenamePane = false; - private UITextField urlTextField; + private UITextArea urlTextField; public WebHyperNorthPane(boolean needRenamePane) { this.needRenamePane = needRenamePane; @@ -47,11 +48,9 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane { protected JPanel setHeaderPanel() { JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - urlTextField = new UITextField(43); + urlTextField = new UITextArea(1,headerPane.getWidth()); urlTextField.setText(ProductConstants.WEBSITE_URL); - - //UILabel label = new UILabel(Inter.getLocText(new String[]{"Example","Or"}, new String[]{":http://www.baidu.com","/main.jsp"})); JPanel urlWithHelp = GUICoreUtils.createNamedPane(urlTextField, "URL:"); if (this.needRenamePane) { diff --git a/designer-realize/src/com/fr/start/module/DesignerStartup.java b/designer-realize/src/com/fr/start/module/DesignerStartup.java index c78905c7e9..b5619df028 100644 --- a/designer-realize/src/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/com/fr/start/module/DesignerStartup.java @@ -1,11 +1,14 @@ package com.fr.start.module; +import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.Listener; +import com.fr.general.ComparatorUtils; import com.fr.module.Activator; import com.fr.start.Designer; import com.fr.start.EnvSwitcher; +import com.fr.start.ServerStarter; import com.fr.start.SplashContext; import com.fr.startup.activators.BasicActivator; import com.fr.workspace.Workspace; @@ -43,6 +46,14 @@ public class DesignerStartup extends Activator { DesignerContext.getDesignerFrame().setVisible(true); //启动画面结束 SplashContext.getInstance().hide(); + + //启动画面结束后,启动tip小窗口并打开决策页面 + for (String arg : args) { + if (ComparatorUtils.equals(arg, "demo")) { + ServerStarter.browserDemoURL(); + break; + } + } DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); startSub(StartFinishActivator.class); } diff --git a/designer-realize/src/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/com/fr/start/module/DesignerWorkspaceProvider.java index d95e00aed3..d9107109ac 100644 --- a/designer-realize/src/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/com/fr/start/module/DesignerWorkspaceProvider.java @@ -20,11 +20,12 @@ public class DesignerWorkspaceProvider extends Activator { for (String arg : args) { if (ComparatorUtils.equals(arg, "demo")) { DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); - ServerStarter.browserDemoURL(); + // ServerStarter.browserDemoURL(); break; } } } + getRoot().setSingleton(EnvSwitcher.class, new EnvSwitcher()); //设置好环境即可,具体跟环境有关的模块会自动调用 getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv(); From a0883aed7f16bddc40d113e268aafac2d4f3ae0b Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 22 Jun 2018 14:11:41 +0800 Subject: [PATCH 11/35] =?UTF-8?q?REPORT-8813=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A2=9E=E5=8A=A0=E5=8A=A0=E8=BD=BD=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E7=9A=84loading=20,=E5=8D=95=E4=BE=8B=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E8=A6=81=E6=94=BE=E5=88=B0=E5=9F=BA=E7=A1=80=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=B9=8B=E5=90=8E=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/iprogressbar/UIProgressBorder.java | 5 +- .../src/com/fr/start/Designer.java | 19 -------- .../com/fr/start/module/DesignerStartup.java | 46 +++++++++++++++---- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java b/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java index fb0207078b..c4df50e82a 100644 --- a/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java +++ b/designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java @@ -1,6 +1,7 @@ package com.fr.design.gui.iprogressbar; import com.fr.design.border.UIRoundedBorder; +import com.fr.stable.OperatingSystem; import java.awt.AlphaComposite; import java.awt.BasicStroke; @@ -62,7 +63,9 @@ public class UIProgressBorder extends UIRoundedBorder { g2d.fill(new RoundRectangle2D.Double(x, y, width, height, 0, 0)); g2d.setColor(oldColor); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - paintBorderShadow(g2d, 7, x, y, width, height); + if(OperatingSystem.isWindows()){//mac下自带阴影 + paintBorderShadow(g2d, 7, x, y, width, height); + } g2d.setColor(oldColor); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1f)); diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index a2ef7df4fb..553b580d76 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -137,25 +137,6 @@ public class Designer extends BaseDesigner { TemplateInfoCollector.getInstance(); } }); - - service.submit(new Runnable() { - @Override - public void run() { - CellElementPropertyPane.getInstance(); - } - }); - service.submit(new Runnable() { - @Override - public void run() { - DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane - } - }); - service.submit(new Runnable() { - @Override - public void run() { - WidgetInfoConfig.getInstance(); - } - }); service.shutdown(); } diff --git a/designer-realize/src/com/fr/start/module/DesignerStartup.java b/designer-realize/src/com/fr/start/module/DesignerStartup.java index c78905c7e9..5a2ed7faa1 100644 --- a/designer-realize/src/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/com/fr/start/module/DesignerStartup.java @@ -1,8 +1,11 @@ package com.fr.start.module; +import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.event.Event; import com.fr.event.Listener; +import com.fr.form.ui.WidgetInfoConfig; import com.fr.module.Activator; import com.fr.start.Designer; import com.fr.start.EnvSwitcher; @@ -26,6 +29,7 @@ public class DesignerStartup extends Activator { startSub(BasicActivator.class); final String[] args = getModule().upFindSingleton(StartupArgs.class).get(); final Designer designer = new Designer(args); + preLoadSomething(); //启动env startSub(DesignerWorkspaceProvider.class); startSub(EnvBasedModule.class); @@ -46,31 +50,57 @@ public class DesignerStartup extends Activator { DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); startSub(StartFinishActivator.class); } - + + /** + * 基础模块结束后可以提前加载一部分依赖基础模块(国际化,图标样式之类)的东西 + */ + private void preLoadSomething(){ + ExecutorService service = Executors.newCachedThreadPool(); + service.submit(new Runnable() { + @Override + public void run() { + CellElementPropertyPane.getInstance(); + } + }); + service.submit(new Runnable() { + @Override + public void run() { + DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane + } + }); + service.submit(new Runnable() { + @Override + public void run() { + WidgetInfoConfig.getInstance(); + } + }); + service.shutdown(); + } + /** * 切换环境时,重新启动所有相关模块 */ private void registerEnvListener() { - + listenEvent(WorkspaceEvent.BeforeSwitch, new Listener() { - + @Override public void on(Event event, Workspace param) { - + getSub(EnvBasedModule.class).stop(); } }); listenEvent(WorkspaceEvent.AfterSwitch, new Listener() { - + @Override public void on(Event event, Workspace param) { - + getSub(EnvBasedModule.class).start(); } }); } - - + + @Override public void stop() { From 39696b120717f50fa3a5f96c28ea3c30cbd3d226 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 22 Jun 2018 15:37:15 +0800 Subject: [PATCH 12/35] fix conflict --- .../src/com/fr/start/module/DesignerStartup.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/designer-realize/src/com/fr/start/module/DesignerStartup.java b/designer-realize/src/com/fr/start/module/DesignerStartup.java index b5619df028..68503079c3 100644 --- a/designer-realize/src/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/com/fr/start/module/DesignerStartup.java @@ -1,10 +1,8 @@ package com.fr.start.module; -import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.Listener; -import com.fr.general.ComparatorUtils; import com.fr.module.Activator; import com.fr.start.Designer; import com.fr.start.EnvSwitcher; @@ -47,13 +45,6 @@ public class DesignerStartup extends Activator { //启动画面结束 SplashContext.getInstance().hide(); - //启动画面结束后,启动tip小窗口并打开决策页面 - for (String arg : args) { - if (ComparatorUtils.equals(arg, "demo")) { - ServerStarter.browserDemoURL(); - break; - } - } DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); startSub(StartFinishActivator.class); } From 69fe19bec4befd685f62831069becd93f9d8e198 Mon Sep 17 00:00:00 2001 From: ju Date: Fri, 22 Jun 2018 16:06:40 +0800 Subject: [PATCH 13/35] =?UTF-8?q?CHART-2425=20=E3=80=90=E9=98=BB=E5=A1=9E?= =?UTF-8?q?=E3=80=91=E3=80=9010.0=E3=80=9110.0release=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E6=8B=96=E5=88=B0=E8=A1=A8=E5=8D=95=E9=87=8C?= =?UTF-8?q?=E9=83=BD=E4=B8=8D=E8=83=BD=E7=94=A8=20socketio=E5=85=88?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=EF=BC=8C=E6=97=A5=E5=BF=97=E7=9A=84=E5=86=8D?= =?UTF-8?q?=E6=83=B3=E6=96=B9=E6=A1=88=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/socketio/DesignerSocketIO.java | 92 ------------------- .../start/module/DesignerModuleActivator.java | 2 - 2 files changed, 94 deletions(-) delete mode 100644 designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java diff --git a/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java b/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java deleted file mode 100644 index 85f9911f20..0000000000 --- a/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.fr.design.mainframe.loghandler.socketio; - -import com.fr.design.mainframe.loghandler.DesignerLogHandler; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; -import com.fr.general.LogRecordTime; -import com.fr.general.LogUtils; -import com.fr.log.FineLoggerFactory; -import com.fr.third.guava.base.Optional; -import com.fr.workspace.WorkContext; -import com.fr.workspace.Workspace; -import com.fr.workspace.WorkspaceEvent; -import io.socket.client.Socket; -import io.socket.emitter.Emitter; - -import java.io.ByteArrayInputStream; - -public class DesignerSocketIO { - - private static Optional socketIO = Optional.absent(); - - private static final Emitter.Listener printLog = new Emitter.Listener() { - @Override - public void call(Object... objects) { - try { - LogRecordTime[] logRecordTimes = LogUtils.readXMLLogRecords(new ByteArrayInputStream((byte[]) objects[0])); - for (LogRecordTime logRecordTime : logRecordTimes) { - DesignerLogHandler.getInstance().printRemoteLog(logRecordTime); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - }; - - static { - EventDispatcher.listen(WorkspaceEvent.BeforeSwitch, new Listener() { - @Override - public void on(Event event, Workspace param) { - if (socketIO.isPresent()) { - socketIO.get().close(); - socketIO = Optional.absent(); - } - } - }); - EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener() { - @Override - public void on(Event event, Workspace param) { - updateSocket(); - } - }); - } - - public static void init() { - updateSocket(); - } - - private static void updateSocket() { - - if (WorkContext.getCurrent().isLocal()) { - return; - } - try { -// RemoteEnvConfig config = ((RemoteEnv)env).getEnvConfig(); -// String uri = String.format("http://%s:%s%s?%s=%s", -// config.getHost(), -// WebSocketConfig.getInstance().getPort(), -// EnvConstants.WS_NAMESPACE, -// DecisionServiceConstants.WEB_SOCKET_TOKEN_NAME, -// EnvContext.currentToken()); -// -// socketIO = Optional.of(IO.socket(new URI(uri))); -// socketIO.get().on(EnvConstants.WS_LOGRECORD, printLog); -// socketIO.get().on(EnvConstants.CONFIG, new Emitter.Listener() { -// @Override -// public void call(Object... objects) { -// if (objects == null || objects.length != 1) { -// throw new IllegalArgumentException("config should have only one param"); -// } -// Object param = objects[0]; -// if (param instanceof Class) { -// EventDispatcher.fire(ConfigEvent.EDIT, (Class) param); -// } -// } -// }); -// socketIO.get().connect(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } -} \ No newline at end of file diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index fde57bb3af..08c488df23 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -1,6 +1,5 @@ package com.fr.start.module; -import com.fr.design.mainframe.loghandler.socketio.DesignerSocketIO; import com.fr.design.module.ChartDesignerModule; import com.fr.design.module.DesignerModule; import com.fr.general.ModuleContext; @@ -19,7 +18,6 @@ public class DesignerModuleActivator extends Activator implements Prepare { public void start() { ModuleContext.startModule(DesignerModule.class.getName()); - DesignerSocketIO.init(); ChartDesignerModule.register(); } From 430d184c69c32fbfe65ae2f4de7c59f073246b75 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 22 Jun 2018 16:17:44 +0800 Subject: [PATCH 14/35] =?UTF-8?q?REPORT-8962=2010.0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E6=9B=B4=E6=96=B0=E4=B8=8B=E8=BD=BD=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=80=82=E9=85=8D=E5=92=8C=E8=84=9A=E6=9C=AC=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0(=E4=BF=AE=E6=94=B9url=E7=94=9F=E6=88=90=E6=96=B9?= =?UTF-8?q?=E5=BC=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/com/fr/design/extra/PluginUtils.java | 4 +++- designer-base/src/com/fr/design/extra/WebViewDlgHelper.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/com/fr/design/extra/PluginUtils.java b/designer-base/src/com/fr/design/extra/PluginUtils.java index 124ef323fb..a804ed820b 100644 --- a/designer-base/src/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/com/fr/design/extra/PluginUtils.java @@ -15,6 +15,7 @@ import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.view.PluginView; import com.fr.stable.EncodeConstants; +import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import java.io.File; @@ -35,6 +36,7 @@ import java.util.Map; public class PluginUtils { private static final String ERROR_CODE_I18N_PREFIX = "FR-Plugin_Error_"; + public static final String FR_VERSION = "fr_version"; public static PluginMarker createPluginMarker(String pluginInfo) { @@ -109,7 +111,7 @@ public class PluginUtils { private static String getDownloadPath(String id) throws Exception { HashMap map = new HashMap(); map.put("id", id); - HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.scripts_10")); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.script.download")+ "?" + FR_VERSION + "=" + ProductConstants.VERSION); httpClient.asGet(); String resText = httpClient.getResponseText(); JSONObject resultJSONObject = new JSONObject(resText); diff --git a/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java index 18afa06bbc..dfca29ea80 100644 --- a/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -296,7 +296,7 @@ public class WebViewDlgHelper { new SwingWorker() { @Override protected Void doInBackground() throws Exception { - HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.cv_10") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); + HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update") + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); httpClient.asGet(); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { String text = httpClient.getResponseText(); From 6c71ebed2b059e8295c0c26a69a48aa614a8419d Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 22 Jun 2018 16:50:41 +0800 Subject: [PATCH 15/35] =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/com/fr/design/extra/PluginWebBridge.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/com/fr/design/extra/PluginWebBridge.java index 767a3ea2cf..931f5d68a7 100644 --- a/designer-base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/com/fr/design/extra/PluginWebBridge.java @@ -559,7 +559,7 @@ public class PluginWebBridge { uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); } - public void updatePluginStore(final JSObject callback){ + public void getPackInfo(final JSObject callback){ JSCallback jsCallback = new JSCallback(webEngine, callback); jsCallback.execute(StringUtils.EMPTY); } From c74810869de027b39e32860ff13fc00ca4831bda Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 22 Jun 2018 18:14:06 +0800 Subject: [PATCH 16/35] =?UTF-8?q?REPORT-9019=20=E7=BB=9D=E5=AF=B9=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E9=80=82=E5=BA=94=E5=8C=BA=E5=9F=9F=EF=BC=8C=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E4=B8=8D=E5=90=8C=E5=88=86=E8=BE=A8=E7=8E=87=E4=B8=8B?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=9D=90=E6=A0=87=E7=9A=84=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XWAbsoluteLayout.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java index 0122fc971b..b66add8e63 100644 --- a/designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -248,10 +248,10 @@ public class XWAbsoluteLayout extends XLayoutContainer { for (int i = 0; i < this.getComponentCount(); i++) { XCreator creator = getXCreator(i); Rectangle rec = new Rectangle(creator.getBounds()); - rec.x = (int) (rec.x / prevContainerPercent * containerPercent); - rec.y = (int) (rec.y / prevContainerPercent * containerPercent); - rec.height = (int) (rec.height / prevContainerPercent * containerPercent); - rec.width = (int) (rec.width / prevContainerPercent * containerPercent); + rec.x = (int)Math.round (rec.x / prevContainerPercent * containerPercent); + rec.y = (int)Math.round (rec.y / prevContainerPercent * containerPercent); + rec.height = (int)Math.round (rec.height / prevContainerPercent * containerPercent); + rec.width = (int)Math.round (rec.width / prevContainerPercent * containerPercent); BoundsWidget wgt = (BoundsWidget) toData().getBoundsWidget(creator.toData()); wgt.setBounds(rec); creator.setBounds(rec); From 694b6e266aaf87d8b49a15e6b5066db5d0168c1b Mon Sep 17 00:00:00 2001 From: zheng Date: Sat, 23 Jun 2018 17:00:46 +0800 Subject: [PATCH 17/35] =?UTF-8?q?CHART-2426=20=E6=B3=A8=E5=86=8C=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/core/ActionFactory.java | 25 ++----------------- .../com/fr/design/module/DesignerModule.java | 7 +++--- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/designer-base/src/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/com/fr/design/actions/core/ActionFactory.java index 00824285c6..036b82a32c 100644 --- a/designer-base/src/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/com/fr/design/actions/core/ActionFactory.java @@ -9,7 +9,8 @@ import com.fr.design.menu.MenuKeySet; import com.fr.design.selection.QuickEditor; import com.fr.log.FineLoggerFactory; -import javax.swing.*; +import javax.swing.Action; +import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; @@ -139,28 +140,6 @@ public class ActionFactory { chartPreStyleAction = action; } - /** - * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollection和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. - * - * @param editorClass 悬浮元素图表编辑器类 - */ - public static void registerChartFloatEditorInEditor(Class editorClass) { - if (chartCollectionClass != null) { - registerFloatEditorClass(chartCollectionClass, editorClass); - } - } - - /** - * kunsnat: 图表注册 单元格元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. - * - * @param editorClass 单元格元素图表编辑器类 - */ - public static void registerChartCellEditorInEditor(Class editorClass) { - if (chartCollectionClass != null) { - registerCellEditorClass(chartCollectionClass, editorClass); - } - } - /** * 图表预定义样式Action * diff --git a/designer-realize/src/com/fr/design/module/DesignerModule.java b/designer-realize/src/com/fr/design/module/DesignerModule.java index 5b95d034fc..0b88782a25 100644 --- a/designer-realize/src/com/fr/design/module/DesignerModule.java +++ b/designer-realize/src/com/fr/design/module/DesignerModule.java @@ -13,6 +13,7 @@ import com.fr.base.frpx.exception.InvalidWorkBookException; import com.fr.base.io.XMLEncryptUtils; import com.fr.base.process.ProcessOperator; import com.fr.base.remote.RemoteDeziConstants; +import com.fr.chart.chartattr.ChartCollection; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -49,13 +50,13 @@ import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.ModuleContext; import com.fr.general.xml.GeneralXMLTools; import com.fr.io.importer.Excel2007ReportImporter; import com.fr.io.importer.ExcelReportImporter; import com.fr.io.utils.ResourceIOUtils; +import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBookAdapter; import com.fr.main.impl.WorkBookX; @@ -161,7 +162,7 @@ public class DesignerModule extends DesignModule { ActionFactory.registerCellEditor(BufferedImage.class, new CellImageQuickEditor()); ActionFactory.registerCellEditor(CellImagePainter.class, new CellImageQuickEditor()); //todo 图表编辑器populate没能实现刷新面板显示 - ActionFactory.registerChartCellEditorInEditor(BasicChartQuickEditor.class); + ActionFactory.registerCellEditorClass(ChartCollection.class, BasicChartQuickEditor.class); Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { @@ -191,7 +192,7 @@ public class DesignerModule extends DesignModule { ActionFactory.registerFloatEditor(BufferedImage.class, new FloatImageQuickEditor()); ActionFactory.registerFloatEditor(CellImagePainter.class, new FloatImageQuickEditor()); //todo 图表编辑器populate没能实现刷新面板显示 - ActionFactory.registerChartFloatEditorInEditor(FloatChartQuickEditor.class); + ActionFactory.registerFloatEditorClass(ChartCollection.class, FloatChartQuickEditor.class); } /** From 4f20da587e7dfa481149d14e142f76f03ee41f88 Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 25 Jun 2018 09:15:45 +0800 Subject: [PATCH 18/35] update --- .../com/fr/design/module/DesignerModule.java | 20 ++++++++++--------- .../start/module/DesignerModuleActivator.java | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/com/fr/design/module/DesignerModule.java b/designer-realize/src/com/fr/design/module/DesignerModule.java index 0b88782a25..08df15c2ca 100644 --- a/designer-realize/src/com/fr/design/module/DesignerModule.java +++ b/designer-realize/src/com/fr/design/module/DesignerModule.java @@ -131,25 +131,27 @@ public class DesignerModule extends DesignModule { GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); addAdapterForPlate(); - registerCellEditor(); - registerFloatEditor(); - registerData4Form(); - registerOtherPane(); - InformationCollector.getInstance().collectStartTime(); ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); } - private void registerOtherPane() { + public static void register() { + registerCellEditor(); + registerFloatEditor(); + registerData4Form(); + registerOtherPane(); + } + + private static void registerOtherPane() { StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); } /** * kunsnat:注册单元格选中Editor */ - private void registerCellEditor() { + private static void registerCellEditor() { ActionFactory.registerCellEditor(String.class, new CellStringQuickEditor()); ActionFactory.registerCellEditor(Number.class, new CellStringQuickEditor()); @@ -184,7 +186,7 @@ public class DesignerModule extends DesignModule { /** * kunnat: 注册悬浮选中Editor */ - private void registerFloatEditor() { + private static void registerFloatEditor() { ActionFactory.registerFloatEditor(String.class, new FloatStringQuickEditor()); ActionFactory.registerFloatEditor(Formula.class, new FloatStringQuickEditor()); @@ -494,7 +496,7 @@ public class DesignerModule extends DesignModule { } - private void registerData4Form() { + private static void registerData4Form() { StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index 08c488df23..e6b0e1ab0a 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -19,6 +19,7 @@ public class DesignerModuleActivator extends Activator implements Prepare { ModuleContext.startModule(DesignerModule.class.getName()); + DesignerModule.register(); ChartDesignerModule.register(); } From 36abb23817fc9fb6538507203bd43ea6e98aaf01 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 25 Jun 2018 09:17:09 +0800 Subject: [PATCH 19/35] =?UTF-8?q?REPORT-8754=20=E6=A8=A1=E6=9D=BF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8F=8C=E5=90=91=E8=87=AA=E9=80=82=E5=BA=94=E5=90=8E?= =?UTF-8?q?frm=E9=87=8C=E7=9A=84=E7=BD=91=E9=A1=B5=E6=A1=86=E9=87=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98(10.0?= =?UTF-8?q?=E4=BC=A0=E4=B8=80=E4=BB=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRBodyLayoutAdapter.java | 12 +-- .../fr/design/designer/creator/XCreator.java | 6 +- .../design/designer/creator/XWFitLayout.java | 3 +- .../cardlayout/XWCardMainBorderLayout.java | 88 +++++++++++-------- ...bsoluteBodyLayoutPropertiesGroupModel.java | 4 +- .../FRAbsoluteBodyLayoutDefinePane.java | 4 +- 6 files changed, 68 insertions(+), 49 deletions(-) diff --git a/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java b/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java index 75190ba3bf..05da6975c7 100644 --- a/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java +++ b/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java @@ -620,8 +620,8 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { } else { currentCreator.setLocation(finalX, finalY); currentCreator.setSize(finalW, finalH); - currentCreator.recalculateChildWidth(finalW); - currentCreator.recalculateChildHeight(finalH); + currentCreator.recalculateChildWidth(finalW, false); + currentCreator.recalculateChildHeight(finalH, false); child.setLocation(xL, yL); child.setSize(dim); } @@ -1078,7 +1078,7 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { int offset = comp.getHeight() - length; comp.setSize(comp.getWidth(), offset); XCreator creator = (XCreator) comp; - creator.recalculateChildHeight(offset); + creator.recalculateChildHeight(offset, false); } } @@ -1100,7 +1100,7 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { int offset = comp.getHeight() - length; comp.setSize(comp.getWidth(), offset); XCreator creator = (XCreator) comp; - creator.recalculateChildHeight(offset); + creator.recalculateChildHeight(offset, false); } } childY += actualVal; @@ -1134,7 +1134,7 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { int offset = comp.getWidth() - length; comp.setSize(offset, comp.getHeight()); XCreator creator = (XCreator) comp; - creator.recalculateChildWidth(offset); + creator.recalculateChildWidth(offset, false); } } childX += actualVal; @@ -1155,7 +1155,7 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { int offset = comp.getWidth() - length; comp.setSize(offset, comp.getHeight()); XCreator creator = (XCreator) comp; - creator.recalculateChildWidth(offset); + creator.recalculateChildWidth(offset, false); } } diff --git a/designer-form/src/com/fr/design/designer/creator/XCreator.java b/designer-form/src/com/fr/design/designer/creator/XCreator.java index 8aa2f215e3..d71f81387a 100644 --- a/designer-form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/com/fr/design/designer/creator/XCreator.java @@ -576,15 +576,17 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo /** * 重新调整子组件宽度 * @param width 宽度 + * @param actualSize 是否按照实际大小计算 */ - public void recalculateChildWidth(int width){ + public void recalculateChildWidth(int width, boolean actualSize){ return; } /** * 重新调整子组件高度 * @param height 高度 + * @param actualSize 是否按照实际大小计算 */ - public void recalculateChildHeight(int height){ + public void recalculateChildHeight(int height, boolean actualSize){ return; } diff --git a/designer-form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/com/fr/design/designer/creator/XWFitLayout.java index 722e866766..a5d4537ef3 100644 --- a/designer-form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -373,7 +373,7 @@ public class XWFitLayout extends XLayoutContainer { if (x == 0) { int width = notHasRightCreator(rec) ? this.getWidth() : rec.width+dw; creator.setBounds(0, rec.y, width, rec.height); - creator.recalculateChildWidth(width); + creator.recalculateChildWidth(width, true); } else { XCreator leftCreator = getCreatorAt(rec.x-1, rec.y); int posX = getPosX(leftCreator); @@ -502,6 +502,7 @@ public class XWFitLayout extends XLayoutContainer { if (y==0) { int height = notHasBottomCreator(rec) ? this.getHeight() : rec.height+dh; creator.setBounds(rec.x, 0, rec.width, height); + creator.recalculateChildHeight(height, true); } else { XCreator topCreator = getCreatorAt(rec.x, rec.y-1); int posY = getPosY(topCreator); diff --git a/designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 9a32c3987c..fa43b57fe3 100644 --- a/designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -260,74 +260,90 @@ public class XWCardMainBorderLayout extends XWBorderLayout { return tabLayoutList; } - /** - * 重新调整子组件的宽度 - * @param width 宽度 - */ - @Override - public void recalculateChildWidth(int width){ + /** + * 重新调整子组件的宽度 + * @param width 宽度 + * @param actualSize 是否按照实际大小计算 + */ + @Override + public void recalculateChildWidth(int width, boolean actualSize){ ArrayList childrenList = this.getTargetChildrenList(); int size = childrenList.size(); if (size > 0) { for (int j = 0; j < size; j++) { XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList .get(j); - tabLayout.setBackupBound(tabLayout.getBounds()); - int refSize = tabLayout.getWidth(); + + + Dimension d = new Dimension(tabLayout.toData().getContainerWidth(), tabLayout.toData().getContainerHeight()); + Rectangle rec = actualSize? new Rectangle(d): tabLayout.getBounds(); + // 容器大小改变时,设下backupBound为其之前的实际大小 + tabLayout.setBackupBound(rec); + int refSize = rec.width; int offest = width - refSize; double percent = (double) offest / refSize; if (percent < 0 && !tabLayout.canReduce(percent)) { return; } - tabLayout.setSize(tabLayout.getWidth() + offest, - tabLayout.getHeight()); - for (int m = 0; m < tabLayout.getComponentCount(); m++) { - XCreator childCreator = tabLayout.getXCreator(m); - BoundsWidget wgt = (BoundsWidget) tabLayout.toData() - .getBoundsWidget(childCreator.toData()); - wgt.setBounds(tabLayout.getComponent(m).getBounds()); + tabLayout.setSize(rec.width + offest, rec.height); + if(!actualSize){ + updateChildWidgetBounds(tabLayout); } tabLayout.adjustCreatorsWidth(percent); } } - } + } - /** - * 重新调整子组件的高度 - * @param height 高度 - */ - @Override - public void recalculateChildHeight(int height){ + /** + * 重新调整子组件的高度 + * @param height 高度 + * @param actualSize 是否按照实际大小计算 + */ + @Override + public void recalculateChildHeight(int height, boolean actualSize){ ArrayList childrenList = this.getTargetChildrenList(); int size = childrenList.size(); if (size > 0) { for (int j = 0; j < size; j++) { XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList .get(j); - tabLayout.setBackupBound(tabLayout.getBounds()); - int refSize = tabLayout.getHeight(); + Dimension d = new Dimension(tabLayout.toData().getContainerWidth(), tabLayout.toData().getContainerHeight()); + Rectangle rec = actualSize? new Rectangle(d): tabLayout.getBounds(); + // 容器大小改变时,设下backupBound为其之前的实际大小 + tabLayout.setBackupBound(rec); + int refSize = rec.height; int offset = height - refSize - WCardMainBorderLayout.TAB_HEIGHT; - if(offset < 0){ - // 缩放时需要备份原tab布局宽高 - tabLayout.setReferDim(new Dimension(tabLayout.getWidth(),tabLayout.getHeight())); - } + if(offset < 0){ + // 缩放时需要备份原tab布局宽高 + tabLayout.setReferDim(new Dimension(rec.width, rec.height)); + } double percent = (double) offset / refSize; if (percent < 0 && !tabLayout.canReduce(percent)) { return; } - tabLayout.setSize(tabLayout.getWidth(), - tabLayout.getHeight() + offset); - for (int m = 0; m < tabLayout.getComponentCount(); m++) { - XCreator childCreator = tabLayout.getXCreator(m); - BoundsWidget wgt = (BoundsWidget) tabLayout.toData() - .getBoundsWidget(childCreator.toData()); - wgt.setBounds(tabLayout.getComponent(m).getBounds()); + tabLayout.setSize(rec.width, rec.height + offset); + if(!actualSize){ + updateChildWidgetBounds(tabLayout); } tabLayout.adjustCreatorsHeight(percent); } } - } + } + + + /** + * 更新下子组件bounds + * @param tabLayout tabFit布局 + */ + private void updateChildWidgetBounds(XWTabFitLayout tabLayout){ + for (int m = 0; m < tabLayout.getComponentCount(); m++) { + XCreator childCreator = tabLayout.getXCreator(m); + BoundsWidget wgt = (BoundsWidget) tabLayout.toData() + .getBoundsWidget(childCreator.toData()); + wgt.setBounds(tabLayout.getComponent(m).getBounds()); + } + } @Override public void paint(Graphics g) { diff --git a/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index b6f3a41a66..8e0b76bece 100644 --- a/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -222,8 +222,8 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr } for (int i = 0;i < components.length;i++){ if (components[i] instanceof XWCardMainBorderLayout){ - ((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth()); - ((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight()); + ((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth(), false); + ((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight(), false); } xwFitLayout.dealDirections((XCreator)components[i], false); } diff --git a/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index f895118f16..53d6de6d9a 100644 --- a/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -232,8 +232,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { } for (int i = 0; i < components.length; i++) { if (components[i] instanceof XWCardMainBorderLayout) { - ((XWCardMainBorderLayout) components[i]).recalculateChildWidth(components[i].getWidth()); - ((XWCardMainBorderLayout) components[i]).recalculateChildHeight(components[i].getHeight()); + ((XWCardMainBorderLayout) components[i]).recalculateChildWidth(components[i].getWidth(), false); + ((XWCardMainBorderLayout) components[i]).recalculateChildHeight(components[i].getHeight(), false); } xwFitLayout.dealDirections((XCreator) components[i], false); } From 671ab85cf4d5cc6f9c9e2fd23f8bc53b6e2e8c68 Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 25 Jun 2018 11:31:46 +0800 Subject: [PATCH 20/35] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=9B=B8=E5=85=B3module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/module/DesignModule.java | 102 --- .../src/com/fr/start/BaseDesigner.java | 3 - .../fr/design/module/ChartDesignerModule.java | 90 --- .../fr/design/module/FormDesignerModule.java | 105 --- .../src/com/fr/start/Designer4Form.java | 36 - .../com/fr/design/module/DesignerModule.java | 504 -------------- .../src/com/fr/start/Designer.java | 9 - .../start/module/DesignerModuleActivator.java | 613 +++++++++++++++++- 8 files changed, 606 insertions(+), 856 deletions(-) delete mode 100644 designer-base/src/com/fr/design/module/DesignModule.java delete mode 100644 designer-chart/src/com/fr/design/module/ChartDesignerModule.java delete mode 100644 designer-form/src/com/fr/design/module/FormDesignerModule.java delete mode 100644 designer-form/src/com/fr/start/Designer4Form.java delete mode 100644 designer-realize/src/com/fr/design/module/DesignerModule.java diff --git a/designer-base/src/com/fr/design/module/DesignModule.java b/designer-base/src/com/fr/design/module/DesignModule.java deleted file mode 100644 index 34f149ab72..0000000000 --- a/designer-base/src/com/fr/design/module/DesignModule.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.fr.design.module; - -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.actions.core.ActionFactory; -import com.fr.design.fun.ElementUIProvider; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.hyperlink.ReportletHyperlinkPane; -import com.fr.design.hyperlink.WebHyperlinkPane; -import com.fr.design.javascript.EmailPane; -import com.fr.design.javascript.JavaScriptImplPane; -import com.fr.design.javascript.ParameterJavaScriptPane; -import com.fr.design.mainframe.App; -import com.fr.design.mainframe.DesignerFrame; -import com.fr.general.Inter; -import com.fr.general.ModuleContext; -import com.fr.js.EmailJavaScript; -import com.fr.js.JavaScriptImpl; -import com.fr.js.ParameterJavaScript; -import com.fr.js.ReportletHyperlink; -import com.fr.js.WebHyperlink; -import com.fr.module.TopModule; -import com.fr.stable.bridge.StableFactory; -import com.fr.stable.plugin.ExtraDesignClassManagerProvider; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-24 - * Time : 下午2:52 - * 所有设计器模块的父类 - */ -public abstract class DesignModule extends TopModule { - public static final String LOCALE_FILE_PATH = "com/fr/design/i18n/main"; - - public void start() { - super.start(); - App[] apps = apps4TemplateOpener(); - for (App app : apps) { - DesignerFrame.registApp(app); - } - ModuleContext.registerStartedModule(DesignModule.class.getName(), this); - StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); - ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); - ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); - DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); - } - - public boolean isStarted() { - return ModuleContext.isModuleStarted(DesignModule.class.getName()); - } - - /** - * 返回设计器能打开的模板类型的一个数组列表 - * - * @return 可以打开的模板类型的数组 - */ - public abstract App[] apps4TemplateOpener(); - - /** - * 国际化文件路径 - * - * @return 国际化文件路径 - */ - public String[] getLocaleFile() { - return new String[]{LOCALE_FILE_PATH}; - } - - public Class[] actionsForInsertCellElement() { - List> classes = new ArrayList<>(); - Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); - for (ElementUIProvider provider : providers) { - classes.add(provider.actionForInsertCellElement()); - } - return classes.toArray(new Class[classes.size()]); - } - - public Class[] actionsForInsertFloatElement() { - List> classes = new ArrayList<>(); - Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); - for (ElementUIProvider provider : providers) { - classes.add(provider.actionForInsertFloatElement()); - } - return classes.toArray(new Class[classes.size()]); - } - - public NameableCreator[] hyperlinkTypes() { - return new NameableCreator[]{ - new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class), - new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), - new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class), - new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class), - new NameObjectCreator(Inter.getLocText("FR-Designer_JavaScript"), JavaScriptImpl.class, JavaScriptImplPane.ChartNoRename.class) - }; - } - -} \ No newline at end of file diff --git a/designer-base/src/com/fr/start/BaseDesigner.java b/designer-base/src/com/fr/start/BaseDesigner.java index 8bc56e33d9..1e15cbff55 100644 --- a/designer-base/src/com/fr/start/BaseDesigner.java +++ b/designer-base/src/com/fr/start/BaseDesigner.java @@ -190,9 +190,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } } - - protected abstract String module2Start(); - // 收集用户信息码 protected void collectUserInformation() { diff --git a/designer-chart/src/com/fr/design/module/ChartDesignerModule.java b/designer-chart/src/com/fr/design/module/ChartDesignerModule.java deleted file mode 100644 index 3b086e2750..0000000000 --- a/designer-chart/src/com/fr/design/module/ChartDesignerModule.java +++ /dev/null @@ -1,90 +0,0 @@ -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.file.HistoryTemplateListPane; -import com.fr.design.gui.core.WidgetOption; -import com.fr.design.mainframe.App; -import com.fr.design.mainframe.ChartPropertyPane; -import com.fr.form.ui.ChartEditor; -import com.fr.general.IOUtils; -import com.fr.general.Inter; -import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; -import com.fr.stable.ArrayUtils; -import com.fr.stable.bridge.StableFactory; -import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; -import com.fr.van.chart.DownloadOnlineSourcesHelper; -import com.fr.van.chart.map.server.ChartMapEditorAction; - -import javax.swing.Icon; - -/** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 7.0.3 - * Date: 13-7-8 - * Time: 上午9:13 - */ -public class ChartDesignerModule extends DesignModule { - - public static void register(){ - StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); - StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); - - DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); - - DesignModuleFactory.registerChartEditorClass(ChartEditor.class); - DesignModuleFactory.registerChartComponentClass(ChartComponent.class); - - DesignModuleFactory.registerChartDialogClass(ChartDialog.class); - - DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); - - ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); - ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); - - ActionFactory.registerChartCollection(ChartCollection.class); - - DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); - - DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); - DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); - } - - /** - * 返回设计器能打开的模板类型的一个数组列表 - * - * @return 可以打开的模板类型的数组 - */ - public App[] apps4TemplateOpener() { - return new App[0]; - } - 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 (ArrayUtils.isEmpty(rowChart)) { - 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"); - } - - -} diff --git a/designer-form/src/com/fr/design/module/FormDesignerModule.java b/designer-form/src/com/fr/design/module/FormDesignerModule.java deleted file mode 100644 index 6482442009..0000000000 --- a/designer-form/src/com/fr/design/module/FormDesignerModule.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.fr.design.module; - -import com.fr.base.FRContext; -import com.fr.base.io.XMLEncryptUtils; -import com.fr.design.DesignerEnvManager; -import com.fr.design.bridge.DesignToolbarProvider; -import com.fr.design.form.parameter.FormParaDesigner; -import com.fr.design.mainframe.*; -import com.fr.design.mainframe.actions.NewFormAction; -import com.fr.design.parameter.FormParameterReader; -import com.fr.design.parameter.ParameterPropertyPane; -import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; -import com.fr.file.FILE; -import com.fr.form.main.Form; -import com.fr.form.stable.ElementCaseThumbnailProcessor; -import com.fr.general.Inter; -import com.fr.general.ModuleContext; -import com.fr.stable.Constants; -import com.fr.stable.bridge.StableFactory; - -import java.util.HashMap; - -/** - * Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-24 Time - * : 下午3:43 - */ -public class FormDesignerModule extends DesignModule { - - public void start() { - super.start(); - ModuleContext.startModule(CHART_DESIGNER_MODULE); - - StableFactory.registerMarkedObject(DesignToolbarProvider.STRING_MARKED, WidgetToolBarPane.getInstance()); - - DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); - DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class); - DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class); - DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class); - DesignModuleFactory.registerWidgetPropertyPaneClass(WidgetPropertyPane.class); - DesignModuleFactory.registerButtonDetailPaneClass(FormSubmitButtonDetailPane.class); - DesignModuleFactory.registerParameterReader(new FormParameterReader()); - - registerData4Designer(); - - StableFactory.registerMarkedObject(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail()); - } - - private void registerData4Designer(){ - StableFactory.registerMarkedClass(BaseJForm.XML_TAG, JForm.class); - } - - /** - *apps模板的Opener - * @return 返回app - */ - public App[] apps4TemplateOpener() { - return new App[]{new AbstractAppProvider
() { - - @Override - public String[] defaultExtensions() { - return new String[]{"frm", "form"}; - } - - @Override - public JTemplate openTemplate(FILE tplFile) { - HashMap classType = new HashMap(); - classType.put(Constants.ARG_0, Form.class); - classType.put(Constants.ARG_1, FILE.class); - - return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{asIOFile(tplFile), tplFile}, classType, BaseJForm.class); - } - - @Override - public Form asIOFile(FILE file) { - if (XMLEncryptUtils.isCptEncoded() && - !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { - if (!new DecodeDialog(file).isPwdRight()) { - FRContext.getLogger().error(Inter.getLocText("FR-Engine_ECP_error_pwd")); - return new Form(); - } - } - - - // peter:打开新报表. - Form tpl = new Form(); - // richer:打开报表通知 -// FRContext.getLogger().info(Inter.getLocText("LOG-Is_Being_Openned") + "\"" + file.getName() + "\"" + "," + Inter.getLocText("LOG-Please_Wait") + "..."); - FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, - new String[]{"\"" + file.getName() + "\"" + ",", "..."})); - try { - tpl.readStream(file.asInputStream()); - } catch (Exception exp) { - FRContext.getLogger().error("Failed to generate frm from " + file, exp); - return null; - } - return tpl; - } - }}; - } - - public String getInterNationalName() { - return Inter.getLocText("FR-Designer_formDesignerModule"); - } -} \ No newline at end of file diff --git a/designer-form/src/com/fr/start/Designer4Form.java b/designer-form/src/com/fr/start/Designer4Form.java deleted file mode 100644 index 276d450115..0000000000 --- a/designer-form/src/com/fr/start/Designer4Form.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.fr.start; - -import com.fr.design.mainframe.actions.NewFormAction; -import com.fr.design.menu.ShortCut; -import com.fr.design.module.FormDesignerModule; - - -public class Designer4Form extends BaseDesigner { - - /** - * 主函数 - * @param args 入口参数 - */ - public static void main(String[] args) { - new Designer4Form(args); - } - - public Designer4Form(String[] args) { - super(args); - } - - @Override - protected String module2Start() { - return FormDesignerModule.class.getName(); - } - - /** - * 创建新建文件菜单 - * @return 菜单 - */ - public ShortCut[] createNewFileShortCuts() { - return new ShortCut[]{ - new NewFormAction() - }; - } -} \ No newline at end of file diff --git a/designer-realize/src/com/fr/design/module/DesignerModule.java b/designer-realize/src/com/fr/design/module/DesignerModule.java deleted file mode 100644 index 08df15c2ca..0000000000 --- a/designer-realize/src/com/fr/design/module/DesignerModule.java +++ /dev/null @@ -1,504 +0,0 @@ -package com.fr.design.module; - -import com.fr.base.BaseFormula; -import com.fr.base.BaseUtils; -import com.fr.base.FRContext; -import com.fr.base.Formula; -import com.fr.base.MultiFieldParameter; -import com.fr.base.Style; -import com.fr.base.TempNameStyle; -import com.fr.base.extension.FileExtension; -import com.fr.base.frpx.exception.FRPackageRunTimeException; -import com.fr.base.frpx.exception.InvalidWorkBookException; -import com.fr.base.io.XMLEncryptUtils; -import com.fr.base.process.ProcessOperator; -import com.fr.base.remote.RemoteDeziConstants; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.config.ServerPreferenceConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.actions.core.ActionFactory; -import com.fr.design.actions.insert.cell.BiasCellAction; -import com.fr.design.actions.insert.cell.ChartCellAction; -import com.fr.design.actions.insert.cell.DSColumnCellAction; -import com.fr.design.actions.insert.cell.FormulaCellAction; -import com.fr.design.actions.insert.cell.GeneralCellAction; -import com.fr.design.actions.insert.cell.ImageCellAction; -import com.fr.design.actions.insert.cell.RichTextCellAction; -import com.fr.design.actions.insert.cell.SubReportCellAction; -import com.fr.design.actions.insert.flot.ChartFloatAction; -import com.fr.design.actions.insert.flot.FormulaFloatAction; -import com.fr.design.actions.insert.flot.ImageFloatAction; -import com.fr.design.actions.insert.flot.TextBoxFloatAction; -import com.fr.design.actions.server.StyleListAction; -import com.fr.design.fun.ElementUIProvider; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.javascript.ProcessTransitionAdapter; -import com.fr.design.mainframe.App; -import com.fr.design.mainframe.DecodeDialog; -import com.fr.design.mainframe.InformationCollector; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JWorkBook; -import com.fr.design.mainframe.bbs.BBSGuestPane; -import com.fr.design.mainframe.form.FormECCompositeProvider; -import com.fr.design.mainframe.form.FormECDesignerProvider; -import com.fr.design.mainframe.form.FormElementCaseDesigner; -import com.fr.design.mainframe.form.FormReportComponentComposite; -import com.fr.design.mainframe.loghandler.DesignerLogImpl; -import com.fr.design.parameter.WorkBookParameterReader; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.file.FILE; -import com.fr.general.ComparatorUtils; -import com.fr.general.Inter; -import com.fr.general.ModuleContext; -import com.fr.general.xml.GeneralXMLTools; -import com.fr.io.importer.Excel2007ReportImporter; -import com.fr.io.importer.ExcelReportImporter; -import com.fr.io.utils.ResourceIOUtils; -import com.fr.log.FineLoggerFactory; -import com.fr.main.impl.WorkBook; -import com.fr.main.impl.WorkBookAdapter; -import com.fr.main.impl.WorkBookX; -import com.fr.quickeditor.cellquick.CellBiasTextPainterEditor; -import com.fr.quickeditor.cellquick.CellDSColumnEditor; -import com.fr.quickeditor.cellquick.CellFormulaQuickEditor; -import com.fr.quickeditor.cellquick.CellImageQuickEditor; -import com.fr.quickeditor.cellquick.CellRichTextEditor; -import com.fr.quickeditor.cellquick.CellStringQuickEditor; -import com.fr.quickeditor.cellquick.CellSubReportEditor; -import com.fr.quickeditor.chartquick.BasicChartQuickEditor; -import com.fr.quickeditor.chartquick.FloatChartQuickEditor; -import com.fr.quickeditor.floatquick.FloatImageQuickEditor; -import com.fr.quickeditor.floatquick.FloatStringQuickEditor; -import com.fr.report.cell.CellElementValueConverter; -import com.fr.report.cell.cellattr.core.RichText; -import com.fr.report.cell.cellattr.core.SubReport; -import com.fr.report.cell.cellattr.core.group.DSColumn; -import com.fr.report.cell.painter.BiasTextPainter; -import com.fr.report.cell.painter.CellImagePainter; -import com.fr.stable.ArrayUtils; -import com.fr.stable.ParameterProvider; -import com.fr.stable.StringUtils; -import com.fr.stable.bridge.StableFactory; -import com.fr.stable.fun.LogProvider; -import com.fr.stable.script.CalculatorProviderContext; -import com.fr.stable.script.ValueConverter; -import com.fr.stable.web.ServletContext; -import com.fr.stable.web.ServletContextAdapter; -import com.fr.stable.xml.ObjectTokenizer; -import com.fr.stable.xml.ObjectXMLWriterFinder; -import com.fr.start.BBSGuestPaneProvider; -import com.fr.xml.ReportXMLUtils; - -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.image.BufferedImage; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Set; - -public class DesignerModule extends DesignModule { - - static { - ServletContext.addServletContextListener(new ServletContextAdapter() { - - @Override - public void onServletStart() { - ModuleContext.startModule(DesignerModule.class.getName()); - } - }); - } - - /** - * 启动设计器模块 - */ - @Override - public void start() { - super.start(); - - justStartModules4Engine(); - justStartModules4Designer(); - - CalculatorProviderContext.setValueConverter(valueConverter()); - GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); - GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); - addAdapterForPlate(); - - InformationCollector.getInstance().collectStartTime(); - - ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); - StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); - } - - public static void register() { - registerCellEditor(); - registerFloatEditor(); - registerData4Form(); - registerOtherPane(); - } - - private static void registerOtherPane() { - StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); - } - - /** - * kunsnat:注册单元格选中Editor - */ - private static void registerCellEditor() { - - ActionFactory.registerCellEditor(String.class, new CellStringQuickEditor()); - ActionFactory.registerCellEditor(Number.class, new CellStringQuickEditor()); - ActionFactory.registerCellEditor(BaseFormula.class, new CellFormulaQuickEditor()); - ActionFactory.registerCellEditor(SubReport.class, new CellSubReportEditor()); - ActionFactory.registerCellEditor(RichText.class, new CellRichTextEditor()); - ActionFactory.registerCellEditor(DSColumn.class, new CellDSColumnEditor()); - ActionFactory.registerCellEditor(Image.class, new CellImageQuickEditor()); - ActionFactory.registerCellEditor(BiasTextPainter.class, new CellBiasTextPainterEditor()); - ActionFactory.registerCellEditor(BufferedImage.class, new CellImageQuickEditor()); - ActionFactory.registerCellEditor(CellImagePainter.class, new CellImageQuickEditor()); - //todo 图表编辑器populate没能实现刷新面板显示 - ActionFactory.registerCellEditorClass(ChartCollection.class, BasicChartQuickEditor.class); - - Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); - for (ElementUIProvider provider : providers) { - try { - ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor().newInstance()); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - - - @Override - public String getInterNationalName() { - return Inter.getLocText("FR-Module_Designer"); - } - - - /** - * kunnat: 注册悬浮选中Editor - */ - private static void registerFloatEditor() { - - ActionFactory.registerFloatEditor(String.class, new FloatStringQuickEditor()); - ActionFactory.registerFloatEditor(Formula.class, new FloatStringQuickEditor()); - ActionFactory.registerFloatEditor(Image.class, new FloatImageQuickEditor()); - ActionFactory.registerFloatEditor(BufferedImage.class, new FloatImageQuickEditor()); - ActionFactory.registerFloatEditor(CellImagePainter.class, new FloatImageQuickEditor()); - //todo 图表编辑器populate没能实现刷新面板显示 - ActionFactory.registerFloatEditorClass(ChartCollection.class, FloatChartQuickEditor.class); - } - - /** - * kunsnat: 一些模块信息 必须跟随设计器启动, - * 比如 读取CC.XML, 设计器启动之后, 马上会读取XML, 需要Chart_Module中的注册信息 - */ - private void justStartModules4Engine() { - ModuleContext.startModule(ENGINE_MODULE); - } - - private void justStartModules4Designer() { - ModuleContext.startModule(CHART_DESIGNER_MODULE); - ModuleContext.startModule(FORM_DESIGNER_MODULE); - } - - /** - * CellElementValueConverter用来处理设计器格子里的值,将公式/数组/其他元素转换成对应的值。 - * - * @return 返回处理格子值的转换器 - */ - @Override - public ValueConverter valueConverter() { - return new CellElementValueConverter(); - } - - @Override - /* - * 针对不同的对象,在读取Object对象的xml的时候需要使用不同的对象生成器 - * @return 返回对象生成器 - */ - public ObjectTokenizer startXMLReadObjectTokenizer() { - return new ReportXMLUtils.ReportObjectTokenizer(); - } - - /** - * 针对不同的对象,在写对象的XML时需要使用不同的XML生成器 - * - * @return 返回xml生成器 - */ - @Override - public ObjectXMLWriterFinder startObjectXMLWriterFinder() { - return new ReportXMLUtils.ReportObjectXMLWriterFinder(); - } - - //wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加 - private void addAdapterForPlate() { - - ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() { - - @Override - protected String[] getTransitionNamesByBook(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getTransitionNamesByBook(book); - } - - @Override - protected String[] getParaNames(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParaNames(book); - } - - @Override - protected ParameterProvider[] getParas(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParas(book); - } - - @Override - protected MultiFieldParameter[] getAllMultiFieldParas(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getAllMultiFieldParas(book); - } - }); - } - - private static abstract class AbstractWorkBookApp implements App { - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public JTemplate openTemplate(FILE tplFile) { - return new JWorkBook(asIOFile(tplFile), tplFile); - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } - - @Override - public void process() { - - } - - @Override - public void undo() { - - } - } - - @Override - /* - * 返回设计器能打开的模板类型的一个数组列表 - * @return 可以打开的模板类型的数组 - */ - public App[] apps4TemplateOpener() { - return new App[]{getCptxApp(), getCptApp(), getXlsApp(), getXlsxApp()}; - } - - private AbstractWorkBookApp getXlsxApp() { - return new AbstractWorkBookApp() { - @Override - public String[] defaultExtensions() { - return new String[]{FileExtension.XLSX.getExtension()}; - } - - @Override - public WorkBook asIOFile(FILE tplFile) { - WorkBook workbook = null; - try { - workbook = new Excel2007ReportImporter().generateWorkBookByStream(tplFile.asInputStream()); - } catch (Exception exp) { - FRContext.getLogger().error("Failed to generate xlsx from " + tplFile, exp); - } - return workbook; - } - }; - } - - private AbstractWorkBookApp getXlsApp() { - return new AbstractWorkBookApp() { - @Override - public String[] defaultExtensions() { - return new String[]{FileExtension.XLS.getExtension()}; - } - - @Override - public WorkBook asIOFile(FILE tplFile) { - WorkBook workbook = null; - try { - workbook = new ExcelReportImporter().generateWorkBookByStream(tplFile.asInputStream()); - } catch (Exception exp) { - FRContext.getLogger().error("Failed to generate xls from " + tplFile, exp); - } - return workbook; - } - }; - } - - private AbstractWorkBookApp getCptApp() { - return new AbstractWorkBookApp() { - @Override - public String[] defaultExtensions() { - return new String[]{FileExtension.CPT.getExtension()}; - } - - @Override - public WorkBook asIOFile(FILE file) { - if (XMLEncryptUtils.isCptEncoded() && - !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { - if (!new DecodeDialog(file).isPwdRight()) { - FRContext.getLogger().error(Inter.getLocText("ECP-error_pwd")); - return new WorkBook(); - } - } - - WorkBook tpl = new WorkBook(); - // richer:打开报表通知 - FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); - TempNameStyle namestyle = TempNameStyle.getInstance(); - namestyle.clear(); - String checkStr = StringUtils.EMPTY; - try { - checkStr = ResourceIOUtils.inputStream2String(file.asInputStream()); - tpl.readStream(file.asInputStream()); - } catch (Exception exp) { - String errorMessage = StringUtils.EMPTY; - errorMessage = ComparatorUtils.equals(RemoteDeziConstants.INVALID_USER, checkStr) ? Inter.getLocText("FR-Designer_No-Privilege") - : Inter.getLocText("NS-exception_readError"); - FRContext.getLogger().error(errorMessage + file, exp); - } - checkNameStyle(namestyle); - return tpl; - } - }; - } - - private AbstractWorkBookApp getCptxApp() { - return new AbstractWorkBookApp() { - - @Override - public String[] defaultExtensions() { - return new String[]{FileExtension.CPTX.getExtension()}; - } - - @Override - public WorkBook asIOFile(FILE file) { - FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); - WorkBookX tpl; - InputStream inputStream; - try { - inputStream = file.asInputStream(); - long time = System.currentTimeMillis(); - tpl = new WorkBookX(inputStream); - FRContext.getLogger().error("cost: " + (System.currentTimeMillis() - time) + " ms"); - } catch (Exception exp) { - if (exp instanceof FRPackageRunTimeException) { - throw (FRPackageRunTimeException) exp; - } - throw new InvalidWorkBookException(file + ":" + exp.getMessage(), exp); - } - - - return new WorkBookAdapter(tpl); - } - }; - } - - private static void checkNameStyle(TempNameStyle namestyle) { - Iterator it = namestyle.getIterator(); - ArrayList al = new ArrayList(); - while (it.hasNext()) { - al.add((String) it.next()); - } - if (!al.isEmpty()) { - showConfirmDialog(al); - } - } - - private static void showConfirmDialog(final ArrayList namelist) { - - final JDialog jd = new JDialog(); - // 模态一下,因为可能会多个样式丢失 - // jd.setModal(true); - jd.setAlwaysOnTop(true); - jd.setSize(450, 150); - jd.setResizable(false); - jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); - String message = namelist.toString().replaceAll("\\[", "").replaceAll("\\]", ""); - UILabel jl = new UILabel(Inter.getLocText(new String[]{"Current_custom_global", "Has_been_gone"}, new String[]{message})); - jl.setHorizontalAlignment(SwingConstants.CENTER); - jd.add(jl, BorderLayout.CENTER); - JPanel jp = new JPanel(); - - // ”是“按钮,点击之后将生成一个全局样式,并写入xml - UIButton confirmButton = new UIButton(Inter.getLocText("FR-Designer_Yes")); - confirmButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - try { - for (int i = 0; i < namelist.size(); i++) { - ServerPreferenceConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); - } - } catch (Exception ex) { - FineLoggerFactory.getLogger().error(ex.getMessage()); - } - jd.dispose(); - new StyleListAction().actionPerformed(e);// 弹窗 - } - }); - - UIButton noButton = new UIButton(Inter.getLocText("FR-Designer_No")); - noButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - jd.dispose(); - } - }); - - jp.add(confirmButton); - jp.add(noButton); - jd.setTitle(Inter.getLocText("FR-Custom_styles_lost")); - jd.add(jp, BorderLayout.SOUTH); - GUICoreUtils.centerWindow(jd); - jd.setVisible(true); - } - - @Override - public Class[] actionsForInsertCellElement() { - return (Class[]) ArrayUtils.addAll(new Class[]{ - DSColumnCellAction.class, - GeneralCellAction.class, - RichTextCellAction.class, - FormulaCellAction.class, - ChartCellAction.class, - ImageCellAction.class, - BiasCellAction.class, - SubReportCellAction.class - }, super.actionsForInsertCellElement()); - } - - @Override - public Class[] actionsForInsertFloatElement() { - return (Class[]) ArrayUtils.addAll(new Class[]{ - TextBoxFloatAction.class, - FormulaFloatAction.class, - ChartFloatAction.class, - ImageFloatAction.class - }, super.actionsForInsertFloatElement()); - } - - - private static void registerData4Form() { - StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); - StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); - DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); - } -} \ No newline at end of file diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index 553b580d76..f164dcfa93 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -21,9 +21,7 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itoolbar.UILargeToolbar; import com.fr.design.mainframe.ActiveKeyGenerator; -import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.InformationCollector; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JWorkBook; @@ -37,10 +35,8 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; import com.fr.design.module.DesignModuleFactory; -import com.fr.design.module.DesignerModule; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; @@ -154,11 +150,6 @@ public class Designer extends BaseDesigner { super(args); } - @Override - protected String module2Start() { - return DesignerModule.class.getName(); - } - /** * 创建新建文件的快捷方式数组。 diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index e6b0e1ab0a..a6dc7b6fb3 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -1,11 +1,154 @@ package com.fr.start.module; -import com.fr.design.module.ChartDesignerModule; -import com.fr.design.module.DesignerModule; +import com.fr.base.BaseFormula; +import com.fr.base.BaseUtils; +import com.fr.base.FRContext; +import com.fr.base.Formula; +import com.fr.base.MultiFieldParameter; +import com.fr.base.Style; +import com.fr.base.TempNameStyle; +import com.fr.base.extension.FileExtension; +import com.fr.base.frpx.exception.FRPackageRunTimeException; +import com.fr.base.frpx.exception.InvalidWorkBookException; +import com.fr.base.io.XMLEncryptUtils; +import com.fr.base.process.ProcessOperator; +import com.fr.base.remote.RemoteDeziConstants; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.config.ServerPreferenceConfig; +import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.DesignerEnvManager; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.actions.core.ActionFactory; +import com.fr.design.actions.insert.cell.BiasCellAction; +import com.fr.design.actions.insert.cell.ChartCellAction; +import com.fr.design.actions.insert.cell.DSColumnCellAction; +import com.fr.design.actions.insert.cell.FormulaCellAction; +import com.fr.design.actions.insert.cell.GeneralCellAction; +import com.fr.design.actions.insert.cell.ImageCellAction; +import com.fr.design.actions.insert.cell.RichTextCellAction; +import com.fr.design.actions.insert.cell.SubReportCellAction; +import com.fr.design.actions.insert.flot.ChartFloatAction; +import com.fr.design.actions.insert.flot.FormulaFloatAction; +import com.fr.design.actions.insert.flot.ImageFloatAction; +import com.fr.design.actions.insert.flot.TextBoxFloatAction; +import com.fr.design.actions.server.StyleListAction; +import com.fr.design.bridge.DesignToolbarProvider; +import com.fr.design.chart.ChartDialog; +import com.fr.design.chart.gui.ChartComponent; +import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.form.parameter.FormParaDesigner; +import com.fr.design.fun.ElementUIProvider; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.hyperlink.ReportletHyperlinkPane; +import com.fr.design.hyperlink.WebHyperlinkPane; +import com.fr.design.javascript.EmailPane; +import com.fr.design.javascript.JavaScriptImplPane; +import com.fr.design.javascript.ParameterJavaScriptPane; +import com.fr.design.javascript.ProcessTransitionAdapter; +import com.fr.design.mainframe.App; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.ChartPropertyPane; +import com.fr.design.mainframe.DecodeDialog; +import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.ElementCaseThumbnail; +import com.fr.design.mainframe.FormHierarchyTreePane; +import com.fr.design.mainframe.InformationCollector; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.JWorkBook; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.WidgetToolBarPane; +import com.fr.design.mainframe.actions.NewFormAction; +import com.fr.design.mainframe.bbs.BBSGuestPane; +import com.fr.design.mainframe.form.FormECCompositeProvider; +import com.fr.design.mainframe.form.FormECDesignerProvider; +import com.fr.design.mainframe.form.FormElementCaseDesigner; +import com.fr.design.mainframe.form.FormReportComponentComposite; +import com.fr.design.mainframe.loghandler.DesignerLogImpl; +import com.fr.design.module.ChartHyperlinkGroup; +import com.fr.design.module.ChartPreStyleAction; +import com.fr.design.module.DesignModuleFactory; +import com.fr.design.parameter.FormParameterReader; +import com.fr.design.parameter.ParameterPropertyPane; +import com.fr.design.parameter.WorkBookParameterReader; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; +import com.fr.file.FILE; +import com.fr.form.stable.ElementCaseThumbnailProcessor; +import com.fr.form.ui.ChartEditor; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; import com.fr.general.ModuleContext; +import com.fr.general.xml.GeneralXMLTools; +import com.fr.io.importer.Excel2007ReportImporter; +import com.fr.io.importer.ExcelReportImporter; +import com.fr.io.utils.ResourceIOUtils; +import com.fr.js.EmailJavaScript; +import com.fr.js.JavaScriptImpl; +import com.fr.js.ParameterJavaScript; +import com.fr.js.ReportletHyperlink; +import com.fr.js.WebHyperlink; import com.fr.locale.InterMutableKey; +import com.fr.log.FineLoggerFactory; +import com.fr.main.impl.WorkBook; +import com.fr.main.impl.WorkBookAdapter; +import com.fr.main.impl.WorkBookX; import com.fr.module.Activator; import com.fr.module.extension.Prepare; +import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; +import com.fr.quickeditor.cellquick.CellBiasTextPainterEditor; +import com.fr.quickeditor.cellquick.CellDSColumnEditor; +import com.fr.quickeditor.cellquick.CellFormulaQuickEditor; +import com.fr.quickeditor.cellquick.CellImageQuickEditor; +import com.fr.quickeditor.cellquick.CellRichTextEditor; +import com.fr.quickeditor.cellquick.CellStringQuickEditor; +import com.fr.quickeditor.cellquick.CellSubReportEditor; +import com.fr.quickeditor.chartquick.BasicChartQuickEditor; +import com.fr.quickeditor.chartquick.FloatChartQuickEditor; +import com.fr.quickeditor.floatquick.FloatImageQuickEditor; +import com.fr.quickeditor.floatquick.FloatStringQuickEditor; +import com.fr.report.cell.CellElementValueConverter; +import com.fr.report.cell.cellattr.core.RichText; +import com.fr.report.cell.cellattr.core.SubReport; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.report.cell.painter.BiasTextPainter; +import com.fr.report.cell.painter.CellImagePainter; +import com.fr.stable.ArrayUtils; +import com.fr.stable.ParameterProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.fun.LogProvider; +import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.stable.plugin.ExtraDesignClassManagerProvider; +import com.fr.stable.script.CalculatorProviderContext; +import com.fr.stable.script.ValueConverter; +import com.fr.stable.web.ServletContext; +import com.fr.stable.web.ServletContextAdapter; +import com.fr.stable.xml.ObjectTokenizer; +import com.fr.stable.xml.ObjectXMLWriterFinder; +import com.fr.start.BBSGuestPaneProvider; +import com.fr.van.chart.DownloadOnlineSourcesHelper; +import com.fr.van.chart.map.server.ChartMapEditorAction; +import com.fr.xml.ReportXMLUtils; + +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Image; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import static com.fr.stable.module.Module.ENGINE_MODULE; /** * Created by juhaoyu on 2018/1/31. @@ -14,18 +157,474 @@ import com.fr.module.extension.Prepare; */ public class DesignerModuleActivator extends Activator implements Prepare { + static { + ServletContext.addServletContextListener(new ServletContextAdapter() { + + @Override + public void onServletStart() { + designerModuleStart(); + } + }); + } + @Override public void start() { - - ModuleContext.startModule(DesignerModule.class.getName()); + designerModuleStart(); + } + + private static void designerModuleStart() { + + if (com.fr.module.ModuleContext.getModule(DesignerModuleActivator.class).isRunning()) { + return; + } + + App[] apps = apps4TemplateOpener(); + for (App app : apps) { + DesignerFrame.registApp(app); + } + + StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); + ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); + ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); + DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); + + justStartModules4Engine(); + justStartModules4Designer(); + + CalculatorProviderContext.setValueConverter(valueConverter()); + GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); + GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); + addAdapterForPlate(); + + designerRegister(); + + InformationCollector.getInstance().collectStartTime(); + + ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); + StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); + + } + + private static Class[] actionsForInsertCellElement() { + List> classes = new ArrayList<>(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); + for (ElementUIProvider provider : providers) { + classes.add(provider.actionForInsertCellElement()); + } + + return ArrayUtils.addAll(new Class[]{ + DSColumnCellAction.class, + GeneralCellAction.class, + RichTextCellAction.class, + FormulaCellAction.class, + ChartCellAction.class, + ImageCellAction.class, + BiasCellAction.class, + SubReportCellAction.class + }, classes.toArray(new Class[classes.size()])); + } + + private static Class[] actionsForInsertFloatElement() { + List> classes = new ArrayList<>(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); + for (ElementUIProvider provider : providers) { + classes.add(provider.actionForInsertFloatElement()); + } + return ArrayUtils.addAll(new Class[]{ + TextBoxFloatAction.class, + FormulaFloatAction.class, + ChartFloatAction.class, + ImageFloatAction.class + }, classes.toArray(new Class[classes.size()])); + } + + private static NameableCreator[] hyperlinkTypes() { + return new NameableCreator[]{ + new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class), + new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), + new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class), + new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class), + new NameObjectCreator(Inter.getLocText("FR-Designer_JavaScript"), JavaScriptImpl.class, JavaScriptImplPane.ChartNoRename.class) + }; + } + + /** + * kunsnat: 一些模块信息 必须跟随设计器启动, + * 比如 读取CC.XML, 设计器启动之后, 马上会读取XML, 需要Chart_Module中的注册信息 + */ + private static void justStartModules4Engine() { + ModuleContext.startModule(ENGINE_MODULE); + } + + private static void justStartModules4Designer() { + chartDesignerRegister(); + formDesignerRegister(); + } + + /** + * CellElementValueConverter用来处理设计器格子里的值,将公式/数组/其他元素转换成对应的值。 + * + * @return 返回处理格子值的转换器 + */ + private static ValueConverter valueConverter() { + return new CellElementValueConverter(); + } + + /* + * 针对不同的对象,在读取Object对象的xml的时候需要使用不同的对象生成器 + * @return 返回对象生成器 + */ + private static ObjectTokenizer startXMLReadObjectTokenizer() { + return new ReportXMLUtils.ReportObjectTokenizer(); + } + + /** + * 针对不同的对象,在写对象的XML时需要使用不同的XML生成器 + * + * @return 返回xml生成器 + */ + private static ObjectXMLWriterFinder startObjectXMLWriterFinder() { + return new ReportXMLUtils.ReportObjectXMLWriterFinder(); + } + + + //wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加 + private static void addAdapterForPlate() { + + ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() { + + @Override + protected String[] getTransitionNamesByBook(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getTransitionNamesByBook(book); + } + + @Override + protected String[] getParaNames(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParaNames(book); + } + + @Override + protected ParameterProvider[] getParas(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParas(book); + } + + @Override + protected MultiFieldParameter[] getAllMultiFieldParas(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getAllMultiFieldParas(book); + } + }); + } + + private static abstract class AbstractWorkBookApp implements App { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public JTemplate openTemplate(FILE tplFile) { + return new JWorkBook(asIOFile(tplFile), tplFile); + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public void process() { + + } + + @Override + public void undo() { + + } + } + + /* + * 返回设计器能打开的模板类型的一个数组列表 + * @return 可以打开的模板类型的数组 + */ + private static App[] apps4TemplateOpener() { + return new App[]{getCptxApp(), getCptApp(), getXlsApp(), getXlsxApp()}; + } + + private static AbstractWorkBookApp getXlsxApp() { + return new AbstractWorkBookApp() { + @Override + public String[] defaultExtensions() { + return new String[]{FileExtension.XLSX.getExtension()}; + } + + @Override + public WorkBook asIOFile(FILE tplFile) { + WorkBook workbook = null; + try { + workbook = new Excel2007ReportImporter().generateWorkBookByStream(tplFile.asInputStream()); + } catch (Exception exp) { + FRContext.getLogger().error("Failed to generate xlsx from " + tplFile, exp); + } + return workbook; + } + }; + } + + private static AbstractWorkBookApp getXlsApp() { + return new AbstractWorkBookApp() { + @Override + public String[] defaultExtensions() { + return new String[]{FileExtension.XLS.getExtension()}; + } + + @Override + public WorkBook asIOFile(FILE tplFile) { + WorkBook workbook = null; + try { + workbook = new ExcelReportImporter().generateWorkBookByStream(tplFile.asInputStream()); + } catch (Exception exp) { + FRContext.getLogger().error("Failed to generate xls from " + tplFile, exp); + } + return workbook; + } + }; + } + + private static AbstractWorkBookApp getCptApp() { + return new AbstractWorkBookApp() { + @Override + public String[] defaultExtensions() { + return new String[]{FileExtension.CPT.getExtension()}; + } + + @Override + public WorkBook asIOFile(FILE file) { + if (XMLEncryptUtils.isCptEncoded() && + !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { + if (!new DecodeDialog(file).isPwdRight()) { + FRContext.getLogger().error(Inter.getLocText("ECP-error_pwd")); + return new WorkBook(); + } + } + + WorkBook tpl = new WorkBook(); + // richer:打开报表通知 + FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); + TempNameStyle namestyle = TempNameStyle.getInstance(); + namestyle.clear(); + String checkStr = StringUtils.EMPTY; + try { + checkStr = ResourceIOUtils.inputStream2String(file.asInputStream()); + tpl.readStream(file.asInputStream()); + } catch (Exception exp) { + String errorMessage = StringUtils.EMPTY; + errorMessage = ComparatorUtils.equals(RemoteDeziConstants.INVALID_USER, checkStr) ? Inter.getLocText("FR-Designer_No-Privilege") + : Inter.getLocText("NS-exception_readError"); + FRContext.getLogger().error(errorMessage + file, exp); + } + checkNameStyle(namestyle); + return tpl; + } + }; + } + + private static AbstractWorkBookApp getCptxApp() { + return new AbstractWorkBookApp() { + + @Override + public String[] defaultExtensions() { + return new String[]{FileExtension.CPTX.getExtension()}; + } + + @Override + public WorkBook asIOFile(FILE file) { + FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); + WorkBookX tpl; + InputStream inputStream; + try { + inputStream = file.asInputStream(); + long time = System.currentTimeMillis(); + tpl = new WorkBookX(inputStream); + FRContext.getLogger().error("cost: " + (System.currentTimeMillis() - time) + " ms"); + } catch (Exception exp) { + if (exp instanceof FRPackageRunTimeException) { + throw (FRPackageRunTimeException) exp; + } + throw new InvalidWorkBookException(file + ":" + exp.getMessage(), exp); + } + + + return new WorkBookAdapter(tpl); + } + }; + } + + + private static void checkNameStyle(TempNameStyle namestyle) { + Iterator it = namestyle.getIterator(); + ArrayList al = new ArrayList(); + while (it.hasNext()) { + al.add((String) it.next()); + } + if (!al.isEmpty()) { + showConfirmDialog(al); + } + } + + private static void showConfirmDialog(final ArrayList namelist) { + + final JDialog jd = new JDialog(); + // 模态一下,因为可能会多个样式丢失 + // jd.setModal(true); + jd.setAlwaysOnTop(true); + jd.setSize(450, 150); + jd.setResizable(false); + jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); + String message = namelist.toString().replaceAll("\\[", "").replaceAll("\\]", ""); + UILabel jl = new UILabel(Inter.getLocText(new String[]{"Current_custom_global", "Has_been_gone"}, new String[]{message})); + jl.setHorizontalAlignment(SwingConstants.CENTER); + jd.add(jl, BorderLayout.CENTER); + JPanel jp = new JPanel(); + + // ”是“按钮,点击之后将生成一个全局样式,并写入xml + UIButton confirmButton = new UIButton(Inter.getLocText("FR-Designer_Yes")); + confirmButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + for (int i = 0; i < namelist.size(); i++) { + ServerPreferenceConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); + } + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage()); + } + jd.dispose(); + new StyleListAction().actionPerformed(e);// 弹窗 + } + }); + + UIButton noButton = new UIButton(Inter.getLocText("FR-Designer_No")); + noButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + jd.dispose(); + } + }); + + jp.add(confirmButton); + jp.add(noButton); + jd.setTitle(Inter.getLocText("FR-Custom_styles_lost")); + jd.add(jp, BorderLayout.SOUTH); + GUICoreUtils.centerWindow(jd); + jd.setVisible(true); + } + + private static void designerRegister() { + registerCellEditor(); + registerFloatEditor(); + registerData4Form(); + registerOtherPane(); + } + + private static void registerOtherPane() { + StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); + } + + /** + * kunsnat:注册单元格选中Editor + */ + private static void registerCellEditor() { + + ActionFactory.registerCellEditor(String.class, new CellStringQuickEditor()); + ActionFactory.registerCellEditor(Number.class, new CellStringQuickEditor()); + ActionFactory.registerCellEditor(BaseFormula.class, new CellFormulaQuickEditor()); + ActionFactory.registerCellEditor(SubReport.class, new CellSubReportEditor()); + ActionFactory.registerCellEditor(RichText.class, new CellRichTextEditor()); + ActionFactory.registerCellEditor(DSColumn.class, new CellDSColumnEditor()); + ActionFactory.registerCellEditor(Image.class, new CellImageQuickEditor()); + ActionFactory.registerCellEditor(BiasTextPainter.class, new CellBiasTextPainterEditor()); + ActionFactory.registerCellEditor(BufferedImage.class, new CellImageQuickEditor()); + ActionFactory.registerCellEditor(CellImagePainter.class, new CellImageQuickEditor()); + //todo 图表编辑器populate没能实现刷新面板显示 + ActionFactory.registerCellEditorClass(ChartCollection.class, BasicChartQuickEditor.class); + + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); + for (ElementUIProvider provider : providers) { + try { + ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor().newInstance()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + + + /** + * kunnat: 注册悬浮选中Editor + */ + private static void registerFloatEditor() { + + ActionFactory.registerFloatEditor(String.class, new FloatStringQuickEditor()); + ActionFactory.registerFloatEditor(Formula.class, new FloatStringQuickEditor()); + ActionFactory.registerFloatEditor(Image.class, new FloatImageQuickEditor()); + ActionFactory.registerFloatEditor(BufferedImage.class, new FloatImageQuickEditor()); + ActionFactory.registerFloatEditor(CellImagePainter.class, new FloatImageQuickEditor()); + //todo 图表编辑器populate没能实现刷新面板显示 + ActionFactory.registerFloatEditorClass(ChartCollection.class, FloatChartQuickEditor.class); + } + + + private static void registerData4Form() { + StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); + StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); + DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); + } + + private static void chartDesignerRegister() { + + StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); + StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); + + DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); + + DesignModuleFactory.registerChartEditorClass(ChartEditor.class); + DesignModuleFactory.registerChartComponentClass(ChartComponent.class); + + DesignModuleFactory.registerChartDialogClass(ChartDialog.class); + + DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); + + ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); + ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); + + ActionFactory.registerChartCollection(ChartCollection.class); + + DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); + + DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); + DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + } + + private static void formDesignerRegister() { + + StableFactory.registerMarkedObject(DesignToolbarProvider.STRING_MARKED, WidgetToolBarPane.getInstance()); + + DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); + DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class); + DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class); + DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class); + DesignModuleFactory.registerWidgetPropertyPaneClass(WidgetPropertyPane.class); + DesignModuleFactory.registerButtonDetailPaneClass(FormSubmitButtonDetailPane.class); + DesignModuleFactory.registerParameterReader(new FormParameterReader()); + + StableFactory.registerMarkedClass(BaseJForm.XML_TAG, JForm.class); - DesignerModule.register(); - ChartDesignerModule.register(); + StableFactory.registerMarkedObject(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail()); } @Override public void stop() { - ModuleContext.stopModule(DesignerModule.class.getName()); } @Override From c8d7760c4e05aff02acf173cbfdf77859425a173 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 25 Jun 2018 13:45:56 +0800 Subject: [PATCH 21/35] =?UTF-8?q?REPORT-8608=20-=20=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=80=A7=E4=B9=8B=E6=B0=B4=E5=8D=B0=E4=BA=A4=E4=BA=92=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E9=97=AE=E9=A2=98=3D>=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/poly/PolyDesignUI.java | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/designer-realize/src/com/fr/poly/PolyDesignUI.java b/designer-realize/src/com/fr/poly/PolyDesignUI.java index f63252fd48..7b98269ea2 100644 --- a/designer-realize/src/com/fr/poly/PolyDesignUI.java +++ b/designer-realize/src/com/fr/poly/PolyDesignUI.java @@ -3,30 +3,23 @@ */ package com.fr.poly; -import java.awt.*; -import java.awt.geom.Rectangle2D; -import java.awt.image.BufferedImage; -import java.text.DecimalFormat; -import java.util.ArrayList; - -import javax.swing.JComponent; -import javax.swing.JScrollBar; -import javax.swing.plaf.ComponentUI; - import com.fr.base.GraphHelper; import com.fr.base.Margin; import com.fr.base.PaperSize; import com.fr.base.ScreenResolution; +import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.design.utils.ComponentUtils; import com.fr.general.Background; +import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.main.FineBook; import com.fr.page.PaperSettingProvider; import com.fr.page.ReportSettingsProvider; +import com.fr.page.WatermarkPainter; import com.fr.poly.creator.BlockCreator; -import com.fr.poly.creator.ECBlockCreator; -import com.fr.poly.creator.ECBlockEditor; import com.fr.poly.model.AddedData; import com.fr.poly.model.AddingData; +import com.fr.report.core.ReportUtils; import com.fr.report.report.Report; import com.fr.report.report.TemplateReport; import com.fr.report.stable.ReportConstants; @@ -34,6 +27,21 @@ import com.fr.stable.Constants; import com.fr.stable.CoreGraphHelper; import com.fr.stable.unit.UNIT; +import javax.swing.JComponent; +import javax.swing.JScrollBar; +import javax.swing.plaf.ComponentUI; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.text.DecimalFormat; +import java.util.ArrayList; + /** * @author richer * @since 6.5.3 聚合报表设计块的ui类 @@ -48,6 +56,7 @@ public class PolyDesignUI extends ComponentUI { private PolyDesigner designer; private int resolution; private float time; + private WatermarkPainter watermarkPainter; public PolyDesignUI(int resolution) { if (resolution == 0){ @@ -97,6 +106,18 @@ public class PolyDesignUI extends ComponentUI { paintAddingData(g2d, addData); } paintPaginateLine(g2d); + paintWatermark(g2d, designer.getTarget().getBook(), c.getWidth(), c.getHeight()); + } + + // 绘制水印 + private void paintWatermark(Graphics2D g2d, FineBook book, int width, int height) { + WatermarkAttr watermark = ReportUtils.getWatermarkFromAttrMarkFile(book); + + // 不要每次都 new 一个 WatermarkPainter + if (watermarkPainter == null || !ComparatorUtils.equals(watermarkPainter.getWatermark(), watermark)) { + watermarkPainter = new WatermarkPainter(watermark); + } + watermarkPainter.paint(g2d, width, height); } private void paintAddedData(Graphics g) { From f43bb44b748a11f48e97c7ba4def26baf23202c5 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 25 Jun 2018 09:03:07 +0800 Subject: [PATCH 22/35] =?UTF-8?q?REPORT-8960=20url=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E4=B8=AD=E6=96=87=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/start/server/FineEmbedServerActivator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/com/fr/start/server/FineEmbedServerActivator.java index 61fd249cb8..1d76fd3feb 100644 --- a/designer-base/src/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/com/fr/start/server/FineEmbedServerActivator.java @@ -5,6 +5,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; import com.fr.module.ModuleRole; +import com.fr.stable.EncodeConstants; import com.fr.startup.FineWebApplicationInitializer; import com.fr.third.springframework.web.SpringServletContainerInitializer; import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; @@ -12,6 +13,7 @@ import com.fr.workspace.WorkContext; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; import org.apache.catalina.Wrapper; +import org.apache.catalina.connector.Connector; import org.apache.catalina.loader.VirtualWebappLoader; import org.apache.catalina.startup.Tomcat; @@ -55,6 +57,8 @@ public class FineEmbedServerActivator extends Activator { 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); From 0d69f8a85837e4d04ab2d7287e5e468b60dbb4d2 Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 25 Jun 2018 15:53:05 +0800 Subject: [PATCH 23/35] =?UTF-8?q?CHART-2407=20=E5=9B=BE=E8=A1=A8=E9=85=8D?= =?UTF-8?q?=E8=89=B2=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartFillStylePane.java | 14 +++++++--- .../module/ChartPreStyleManagerPane.java | 28 ++++++++----------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java index 571380fd36..943cc57381 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.style; +import com.fr.base.ChartPreStyleConfig; import com.fr.base.ChartPreStyleManagerProvider; import com.fr.base.ChartPreStyleServerManager; import com.fr.base.Utils; @@ -16,8 +17,13 @@ import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.general.Inter; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +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; @@ -128,10 +134,10 @@ public class ChartFillStylePane extends BasicBeanPane{ } private String[] getNameObj() { - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); ArrayList nameArr = new ArrayList(); nameArr.add(Inter.getLocText("FR-Designer_DEFAULT")); - Iterator keys = manager.names(); + Iterator keys = config.names(); while (keys.hasNext()) { Object key = keys.next(); nameArr.add(Utils.objectToString(key)); diff --git a/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java b/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java index 10e041a639..64e68fff8b 100644 --- a/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java +++ b/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java @@ -1,7 +1,6 @@ package com.fr.design.module; -import com.fr.base.ChartPreStyleManagerProvider; -import com.fr.base.ChartPreStyleServerManager; +import com.fr.base.ChartPreStyleConfig; import com.fr.base.Utils; import com.fr.chart.base.ChartPreStyle; import com.fr.design.gui.controlpane.JListControlPane; @@ -42,14 +41,14 @@ public class ChartPreStyleManagerPane extends JListControlPane { } public void populateBean() { - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); ArrayList list = new ArrayList(); - Iterator keys = manager.names(); + Iterator keys = config.names(); while(keys.hasNext()) { Object key = keys.next(); - ChartPreStyle value = (ChartPreStyle)manager.getPreStyle(key); + ChartPreStyle value = (ChartPreStyle)config.getPreStyle(key); list.add(new NameObject(Utils.objectToString(key), value)); } @@ -57,26 +56,23 @@ public class ChartPreStyleManagerPane extends JListControlPane { Nameable[] values = (Nameable[])list.toArray(new Nameable[list.size()]); populate(values); - if(manager.containsName(manager.getCurrentStyle())) { - this.setSelectedName(manager.getCurrentStyle()); + if(config.containsName(config.getCurrentStyle())) { + this.setSelectedName(config.getCurrentStyle()); } } public void updateBean() { - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); - manager.clearPreStyles(); - + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + Nameable[] values = this.update(); - - manager.setCurrentStyle(getSelectedName()); + + config.setCurrentStyle(getSelectedName()); for(int i = 0; i < values.length; i++) { Nameable value = values[i]; - manager.putPreStyle(value.getName(), ((NameObject)value).getObject()); + config.putPreStyle(value.getName(), ((NameObject)value).getObject()); } - - manager.writerPreChartStyle(); - + // 通知报表整个刷新. DesignerFrame frame = DesignerContext.getDesignerFrame(); if(frame != null) { From 4cb8c67b3a10faaab6718776bff19741cc2bb0d5 Mon Sep 17 00:00:00 2001 From: vito Date: Mon, 25 Jun 2018 16:17:10 +0800 Subject: [PATCH 24/35] =?UTF-8?q?REPORT-9037=E3=80=90=E9=98=BB=E5=A1=9E?= =?UTF-8?q?=E3=80=91=E3=80=9010.0=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E3=80=91jdk1.7=E7=9A=84=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=B5=B7?= =?UTF-8?q?=E4=B8=8D=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/com/fr/start/fx/FastGifImage.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/designer-realize/src/com/fr/start/fx/FastGifImage.java b/designer-realize/src/com/fr/start/fx/FastGifImage.java index 9049850c36..69d74c8a4b 100644 --- a/designer-realize/src/com/fr/start/fx/FastGifImage.java +++ b/designer-realize/src/com/fr/start/fx/FastGifImage.java @@ -97,17 +97,7 @@ public class FastGifImage extends WritableImage { } } - - private void finishImage(Exception e) { - e.printStackTrace(); - } - private void finishImage(ImageLoader loader) { - final Exception loadingException = loader.getException(); - if (loadingException != null) { - finishImage(loadingException); - return; - } initializeAnimatedImage(loader); } From 0ff49aa15b2fe535f2fed37528b61890154e4a69 Mon Sep 17 00:00:00 2001 From: ju Date: Mon, 25 Jun 2018 17:21:05 +0800 Subject: [PATCH 25/35] =?UTF-8?q?REPORT-9087=20=E5=90=AF=E5=8A=A8=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=8E=E5=86=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=8E=AF=E5=A2=83=EF=BC=8C=E6=89=93=E4=B8=8D=E5=BC=80?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20=E5=BC=80=E4=B8=80=E4=B8=8Bchart=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E7=88=B6activator=EF=BC=8C=E5=90=8E=E7=BB=AD?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=20=E5=8F=96=E6=B6=88=E5=87=A0=E4=B8=AAchart?= =?UTF-8?q?=E7=9A=84=E7=8E=AF=E5=A2=83=E7=9B=91=E5=90=AC=E5=92=8Cservlet?= =?UTF-8?q?=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/com/fr/start/module/EnvBasedModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/com/fr/start/module/EnvBasedModule.java b/designer-realize/src/com/fr/start/module/EnvBasedModule.java index 286fbe663f..25ca8faaeb 100644 --- a/designer-realize/src/com/fr/start/module/EnvBasedModule.java +++ b/designer-realize/src/com/fr/start/module/EnvBasedModule.java @@ -1,5 +1,6 @@ package com.fr.start.module; +import com.fr.chart.activator.ChartBaseActivator; import com.fr.module.Activator; import com.fr.stable.CoreActivator; import com.fr.start.server.FineEmbedServer; @@ -14,6 +15,7 @@ public class EnvBasedModule extends Activator { public void start() { //core和设计器启动 startSub(CoreActivator.class); + startSub(ChartBaseActivator.class); getSub("designer").start(); //这里不启动tomcat,由客户手动触发 } @@ -24,6 +26,7 @@ public class EnvBasedModule extends Activator { FineEmbedServer.stop(); //倒叙关闭其他模块 getSub("designer").stop(); + stopSub(ChartBaseActivator.class); stopSub(CoreActivator.class); } } From 5abb4e68ff8655d172b5957eb79bdfba80b997ae Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 25 Jun 2018 19:13:54 +0800 Subject: [PATCH 26/35] =?UTF-8?q?REPORT-9005=20=E3=80=9010.0=E4=B8=80?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E8=A1=A8=E5=8D=95-?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97-=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-form/src/com/fr/design/mainframe/JForm.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/com/fr/design/mainframe/JForm.java b/designer-form/src/com/fr/design/mainframe/JForm.java index 23aeaa3550..5b06619515 100644 --- a/designer-form/src/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/com/fr/design/mainframe/JForm.java @@ -340,7 +340,6 @@ public class JForm extends JTemplate implements BaseJForm { } ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this); editingComponent = comp.createToolPane(this, formDesign); - EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); if (BaseUtils.isAuthorityEditing()) { EastRegionContainerPane.getInstance().replaceWidgetSettingsPane( ComparatorUtils.equals(editingComponent.getClass(), NoSupportAuthorityEdit.class) ? editingComponent : createAuthorityEditPane()); From ef1fcda833aca2fcc1b2a75e7c9fce313b6efb70 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Mon, 25 Jun 2018 19:34:57 +0800 Subject: [PATCH 27/35] REPORT-8968 REPORT-8950 REPORT-899999 --- .../com/fr/design/actions/file/WebPreviewUtils.java | 2 +- .../data/datapane/connect/DatabaseConnectionPane.java | 11 ++++++++++- .../data/datapane/preview/PreviewTablePane.java | 3 ++- .../tabledata/tabledatapane/FileTableDataPane.java | 3 ++- .../com/fr/design/hyperlink/WebHyperNorthPane.java | 4 ++-- .../src/com/fr/design/mainframe/TemplatePane.java | 6 ++++-- designer-base/src/com/fr/env/RemoteEnvPane.java | 8 ++++++-- .../actions/file/export/AbstractExportAction.java | 4 +++- designer-realize/src/com/fr/start/Designer.java | 7 +++++++ .../src/com/fr/start/module/PreStartActivator.java | 6 +----- 10 files changed, 38 insertions(+), 16 deletions(-) diff --git a/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java index 4dd6e412de..947fc67f68 100644 --- a/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java @@ -20,7 +20,7 @@ import java.util.Map; public final class WebPreviewUtils { public static void preview(JTemplate jt) { - preview(jt, null); + preview(jt, jt.getPreviewType()); } @SuppressWarnings("unchecked") diff --git a/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index c5666b81f5..e7e3ef820e 100644 --- a/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -36,6 +36,7 @@ public abstract class DatabaseConnectionPane { FRContext.getLogger().error(e.getMessage(), e); } if (in == null) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_failed")); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_failed"), + null, 0, UIManager.getIcon("OptionPane.errorIcon")); } else { JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_successfully")); try { diff --git a/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java b/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java index 925be16ef7..91608d1ce7 100644 --- a/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java +++ b/designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java @@ -24,7 +24,7 @@ import java.awt.BorderLayout; public class WebHyperNorthPane extends AbstractHyperNorthPane { private UITextField itemNameTextField; private boolean needRenamePane = false; - private UITextArea urlTextField; + private UITextField urlTextField; public WebHyperNorthPane(boolean needRenamePane) { this.needRenamePane = needRenamePane; @@ -48,7 +48,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane { protected JPanel setHeaderPanel() { JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - urlTextField = new UITextArea(1,headerPane.getWidth()); + urlTextField = new UITextField(headerPane.getWidth()); urlTextField.setText(ProductConstants.WEBSITE_URL); JPanel urlWithHelp = GUICoreUtils.createNamedPane(urlTextField, "URL:"); diff --git a/designer-base/src/com/fr/design/mainframe/TemplatePane.java b/designer-base/src/com/fr/design/mainframe/TemplatePane.java index fc165928b9..4107a0538e 100644 --- a/designer-base/src/com/fr/design/mainframe/TemplatePane.java +++ b/designer-base/src/com/fr/design/mainframe/TemplatePane.java @@ -137,7 +137,8 @@ public class TemplatePane extends JPanel implements MouseListener { @Override public void fail() { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"})); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}), + null, 0, UIManager.getIcon("OptionPane.errorIcon")); } @Override @@ -152,7 +153,8 @@ public class TemplatePane extends JPanel implements MouseListener { } setJLabel(selectedName); } catch (Exception e) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"})); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}), + null, 0, UIManager.getIcon("OptionPane.errorIcon")); return false; } TemplateTreePane.getInstance().refreshDockingView(); diff --git a/designer-base/src/com/fr/env/RemoteEnvPane.java b/designer-base/src/com/fr/env/RemoteEnvPane.java index 137db5ff6d..a07e9996c8 100644 --- a/designer-base/src/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/com/fr/env/RemoteEnvPane.java @@ -64,7 +64,7 @@ public class RemoteEnvPane extends BasicBeanPane { private UILabel message = new UILabel(); private UIButton okButton = new UIButton(Inter.getLocText("OK")); private UIButton cancelButton = new UIButton(Inter.getLocText("Cancel")); - ; + private UILabel uiLabel = new UILabel(); /** * 是否启用 https 勾选框 @@ -477,6 +477,7 @@ public class RemoteEnvPane extends BasicBeanPane { protected Boolean doInBackground() throws Exception { final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); + return WorkContext.getConnector().testConnection(remoteEnv.getConnection()); } @@ -486,11 +487,14 @@ public class RemoteEnvPane extends BasicBeanPane { try { if (get()) { message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful")); + uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); } else { message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed")); + uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); } } catch (InterruptedException | ExecutionException e) { message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed")); + uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); } } }; @@ -530,7 +534,7 @@ public class RemoteEnvPane extends BasicBeanPane { JPanel jp = new JPanel(); JPanel upPane = new JPanel(); JPanel downPane = new JPanel(); - UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); + uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.add(uiLabel); upPane.add(message); diff --git a/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java b/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java index 526a801524..22059c35c1 100644 --- a/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java +++ b/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java @@ -3,6 +3,7 @@ */ package com.fr.design.actions.file.export; +import com.fr.Message.ErrorMessage_; import com.fr.base.FRContext; import com.fr.base.Parameter; import com.fr.design.actions.JWorkBookAction; @@ -133,7 +134,8 @@ public abstract class AbstractExportAction extends JWorkBookAction { } catch (Exception exp) { this.setProgress(100); FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Export_failed") + "\n" + filePath); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Export_failed") + "\n" + filePath, + null, 0, UIManager.getIcon("OptionPane.errorIcon")); } return null; } diff --git a/designer-realize/src/com/fr/start/Designer.java b/designer-realize/src/com/fr/start/Designer.java index a2ef7df4fb..c674e6486b 100644 --- a/designer-realize/src/com/fr/start/Designer.java +++ b/designer-realize/src/com/fr/start/Designer.java @@ -38,6 +38,7 @@ import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignerModule; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.WidgetInfoConfig; @@ -101,6 +102,12 @@ public class Designer extends BaseDesigner { BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); preloadResource(); SplashContext.getInstance().registerSplash(createSplash()); + + // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 + if (DesignUtils.isStarted()) { + DesignUtils.clientSend(args); + return; + } SplashContext.getInstance().show(); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); //传递启动参数 diff --git a/designer-realize/src/com/fr/start/module/PreStartActivator.java b/designer-realize/src/com/fr/start/module/PreStartActivator.java index 85a9ff2ee2..36a993bff5 100644 --- a/designer-realize/src/com/fr/start/module/PreStartActivator.java +++ b/designer-realize/src/com/fr/start/module/PreStartActivator.java @@ -38,11 +38,7 @@ public class PreStartActivator extends Activator { } else { DesignUtils.setPort(getStartPort()); } - // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 - if (DesignUtils.isStarted()) { - DesignUtils.clientSend(getModule().upFindSingleton(StartupArgs.class).get()); - return true; - } + return false; } From 93fa504d7529cbbac28f85ee60e4cf6b1cb24985 Mon Sep 17 00:00:00 2001 From: ju Date: Mon, 25 Jun 2018 20:08:55 +0800 Subject: [PATCH 28/35] =?UTF-8?q?REPORT-9080=20frm=E6=89=93=E4=B8=8D?= =?UTF-8?q?=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../start/module/DesignerModuleActivator.java | 65 +++++++++++++++++-- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index a6dc7b6fb3..e544fb0ce4 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -48,6 +48,7 @@ import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; +import com.fr.design.mainframe.AbstractAppProvider; import com.fr.design.mainframe.App; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.ChartPropertyPane; @@ -77,6 +78,7 @@ import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import com.fr.file.FILE; +import com.fr.form.main.Form; import com.fr.form.stable.ElementCaseThumbnailProcessor; import com.fr.form.ui.ChartEditor; import com.fr.general.ComparatorUtils; @@ -117,6 +119,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.ArrayUtils; +import com.fr.stable.Constants; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; @@ -134,16 +137,14 @@ import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.map.server.ChartMapEditorAction; import com.fr.xml.ReportXMLUtils; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Image; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.io.InputStream; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -348,7 +349,8 @@ public class DesignerModuleActivator extends Activator implements Prepare { * @return 可以打开的模板类型的数组 */ private static App[] apps4TemplateOpener() { - return new App[]{getCptxApp(), getCptApp(), getXlsApp(), getXlsxApp()}; + + return new App[]{getCptxApp(), getCptApp(), getXlsApp(), getXlsxApp(), getFrmApp()}; } private static AbstractWorkBookApp getXlsxApp() { @@ -370,6 +372,57 @@ public class DesignerModuleActivator extends Activator implements Prepare { } }; } + + + private static AbstractAppProvider getFrmApp() { + + return new AbstractAppProvider() { + + @Override + public String[] defaultExtensions() { + + return new String[]{"frm", "form"}; + } + + @Override + public JTemplate openTemplate(FILE tplFile) { + + HashMap classType = new HashMap(); + classType.put(Constants.ARG_0, Form.class); + classType.put(Constants.ARG_1, FILE.class); + + return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, + new Object[]{asIOFile(tplFile), tplFile}, classType, BaseJForm.class); + } + + @Override + public Form asIOFile(FILE file) { + + if (XMLEncryptUtils.isCptEncoded() && + !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { + if (!new DecodeDialog(file).isPwdRight()) { + FRContext.getLogger().error(Inter.getLocText("FR-Engine_ECP_error_pwd")); + return new Form(); + } + } + + + // peter:打开新报表. + Form tpl = new Form(); + // richer:打开报表通知 +// FRContext.getLogger().info(Inter.getLocText("LOG-Is_Being_Openned") + "\"" + file.getName() + "\"" + "," + Inter.getLocText("LOG-Please_Wait") + "..."); + FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, + new String[]{"\"" + file.getName() + "\"" + ",", "..."})); + try { + tpl.readStream(file.asInputStream()); + } catch (Exception exp) { + FRContext.getLogger().error("Failed to generate frm from " + file, exp); + return null; + } + return tpl; + } + }; + } private static AbstractWorkBookApp getXlsApp() { return new AbstractWorkBookApp() { From 582770a5446d84bece9400c4a8920f29d15f26ed Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 25 Jun 2018 20:13:40 +0800 Subject: [PATCH 29/35] =?UTF-8?q?CHART-2451=20=E7=94=98=E7=89=B9=E5=9B=BE?= =?UTF-8?q?=E7=BB=86=E7=B2=92=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gantt/designer/style/axis/GanttTimeAxisPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java b/designer-chart/src/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java index 1a02c5f080..cadb9cb851 100644 --- a/designer-chart/src/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java +++ b/designer-chart/src/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java @@ -22,7 +22,9 @@ import java.awt.Component; public class GanttTimeAxisPane extends AbstractVanChartScrollPane { private static final ZoomLevel[] ZOOM_LEVELS = new ZoomLevel[]{ZoomLevel.AUTO, ZoomLevel.ZERO, ZoomLevel.ONE, ZoomLevel.TWO, ZoomLevel.THREE, ZoomLevel.FOUR, ZoomLevel.FIVE, ZoomLevel.SIX, ZoomLevel.SEVEN, - ZoomLevel.EIGHT, ZoomLevel.NINE, ZoomLevel.TEN, ZoomLevel.ELEVEN, ZoomLevel.TWELVE}; + ZoomLevel.EIGHT, ZoomLevel.NINE, ZoomLevel.TEN, ZoomLevel.ELEVEN, ZoomLevel.TWELVE, ZoomLevel.THIRTEEN, + ZoomLevel.FOURTEEN, ZoomLevel.FIFTEEN, ZoomLevel.SIXTEEN, ZoomLevel.SEVENTEEN, ZoomLevel.EIGHTEEN, + ZoomLevel.NINETEEN, ZoomLevel.TWENTY, ZoomLevel.TWENTY_ONE}; private UIButtonGroup timeZoom; private UIComboBox initialLevel; From c9ca6ed70dd2552c4f2bed6da0a004effa05e152 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 26 Jun 2018 10:37:32 +0800 Subject: [PATCH 30/35] =?UTF-8?q?REPORT-9077=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=8C=89=E9=92=AE=E6=B2=A1=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/com/fr/start/BaseDesigner.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-base/src/com/fr/start/BaseDesigner.java b/designer-base/src/com/fr/start/BaseDesigner.java index 1e15cbff55..15be19c0db 100644 --- a/designer-base/src/com/fr/start/BaseDesigner.java +++ b/designer-base/src/com/fr/start/BaseDesigner.java @@ -12,7 +12,6 @@ import com.fr.design.fun.DesignerStartOpenFileProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.EastRegionContainerPane; -import com.fr.design.mainframe.WestRegionContainerPane; import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.utils.DesignUtils; @@ -72,12 +71,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock { HistoryTemplateListPane.getInstance(); } }); - service.submit(new Runnable() { - @Override - public void run() { - WestRegionContainerPane.getInstance(); - } - }); service.submit(new Runnable() { @Override public void run() { From 04705691b40e86862c19241a3ee2b0ff51263b6e Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 26 Jun 2018 11:35:47 +0800 Subject: [PATCH 31/35] =?UTF-8?q?REPORT-9077=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/com/fr/start/module/DesignerStartup.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-realize/src/com/fr/start/module/DesignerStartup.java b/designer-realize/src/com/fr/start/module/DesignerStartup.java index 2b0fe4335f..c8a9d8e67b 100644 --- a/designer-realize/src/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/com/fr/start/module/DesignerStartup.java @@ -9,7 +9,6 @@ import com.fr.form.ui.WidgetInfoConfig; import com.fr.module.Activator; import com.fr.start.Designer; import com.fr.start.EnvSwitcher; -import com.fr.start.ServerStarter; import com.fr.start.SplashContext; import com.fr.startup.activators.BasicActivator; import com.fr.workspace.Workspace; @@ -36,6 +35,7 @@ public class DesignerStartup extends Activator { startSub(EnvBasedModule.class); getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv(); ExecutorService service = Executors.newSingleThreadExecutor(); + registerEnvListener(); service.submit(new Runnable() { @Override public void run() { @@ -44,7 +44,6 @@ public class DesignerStartup extends Activator { } }); service.shutdown(); - registerEnvListener(); DesignerContext.getDesignerFrame().setVisible(true); //启动画面结束 SplashContext.getInstance().hide(); From 154eb27a3c3255de37cc5ccd2a88558341f8e99c Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 26 Jun 2018 11:50:09 +0800 Subject: [PATCH 32/35] =?UTF-8?q?=E6=94=BE=E5=88=B0activitor=E9=87=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/start/BaseDesigner.java | 31 ---------- .../start/module/DesignerModuleActivator.java | 58 ++++++++++++++++++- .../com/fr/start/module/DesignerStartup.java | 30 ---------- 3 files changed, 56 insertions(+), 63 deletions(-) diff --git a/designer-base/src/com/fr/start/BaseDesigner.java b/designer-base/src/com/fr/start/BaseDesigner.java index 15be19c0db..87d87e7ba4 100644 --- a/designer-base/src/com/fr/start/BaseDesigner.java +++ b/designer-base/src/com/fr/start/BaseDesigner.java @@ -11,8 +11,6 @@ import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerStartOpenFileProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; -import com.fr.design.mainframe.EastRegionContainerPane; -import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.utils.DesignUtils; import com.fr.event.EventDispatcher; @@ -28,8 +26,6 @@ import com.fr.stable.OperatingSystem; import java.awt.Window; import java.io.File; import java.lang.reflect.Method; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; /** * The main class of Report Designer. @@ -48,38 +44,11 @@ public abstract class BaseDesigner extends ToolBarMenuDock { EventDispatcher.fire(ModuleEvent.MajorModuleStarting, InterProviderFactory.getProvider().getLocText("FR-Designer_Initializing")); // 初始化look and feel.这个在预加载之前执行是因为lookAndFeel里的东西,预加载时也要用到 DesignUtils.initLookAndFeel(); - // 预加载一些耗时的单例面板 - preLoadPane(); - // 初始化Log Handler DesignerEnvManager.loadLogSetting(); createDesignerFrame(); } - private void preLoadPane() { - ExecutorService service = Executors.newCachedThreadPool(); - service.submit(new Runnable() { - @Override - public void run() { - LogMessageBar.getInstance(); - } - }); - - service.submit(new Runnable() { - @Override - public void run() { - HistoryTemplateListPane.getInstance(); - } - }); - service.submit(new Runnable() { - @Override - public void run() { - EastRegionContainerPane.getInstance(); - } - }); - service.shutdown(); - } - public void show(final String[] args) { collectUserInformation(); DesignerContext.getDesignerFrame().getProgressDialog().setProgressValue(10); diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index e544fb0ce4..ecde873db6 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -51,9 +51,12 @@ import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.mainframe.AbstractAppProvider; import com.fr.design.mainframe.App; import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.design.mainframe.DecodeDialog; import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.DesignerFrameFileDealerPane; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCaseThumbnail; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.InformationCollector; @@ -69,6 +72,7 @@ import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.loghandler.DesignerLogImpl; +import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.module.ChartHyperlinkGroup; import com.fr.design.module.ChartPreStyleAction; import com.fr.design.module.DesignModuleFactory; @@ -81,6 +85,7 @@ import com.fr.file.FILE; import com.fr.form.main.Form; import com.fr.form.stable.ElementCaseThumbnailProcessor; import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.general.ModuleContext; @@ -137,8 +142,11 @@ import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.map.server.ChartMapEditorAction; import com.fr.xml.ReportXMLUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; @@ -148,6 +156,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import static com.fr.stable.module.Module.ENGINE_MODULE; @@ -204,6 +214,50 @@ public class DesignerModuleActivator extends Activator implements Prepare { ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); + preLoadPane(); + + } + private static void preLoadPane() { + ExecutorService service = Executors.newCachedThreadPool(); + service.submit(new Runnable() { + @Override + public void run() { + LogMessageBar.getInstance(); + } + }); + + service.submit(new Runnable() { + @Override + public void run() { + HistoryTemplateListPane.getInstance(); + } + }); + service.submit(new Runnable() { + @Override + public void run() { + WidgetInfoConfig.getInstance(); + } + }); + service.submit(new Runnable() { + @Override + public void run() { + CellElementPropertyPane.getInstance(); + } + }); + service.submit(new Runnable() { + @Override + public void run() { + DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane + } + }); + + service.submit(new Runnable() { + @Override + public void run() { + EastRegionContainerPane.getInstance(); + } + }); + service.shutdown(); } private static Class[] actionsForInsertCellElement() { diff --git a/designer-realize/src/com/fr/start/module/DesignerStartup.java b/designer-realize/src/com/fr/start/module/DesignerStartup.java index c8a9d8e67b..1936451f26 100644 --- a/designer-realize/src/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/com/fr/start/module/DesignerStartup.java @@ -1,11 +1,8 @@ package com.fr.start.module; -import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.event.Event; import com.fr.event.Listener; -import com.fr.form.ui.WidgetInfoConfig; import com.fr.module.Activator; import com.fr.start.Designer; import com.fr.start.EnvSwitcher; @@ -29,7 +26,6 @@ public class DesignerStartup extends Activator { startSub(BasicActivator.class); final String[] args = getModule().upFindSingleton(StartupArgs.class).get(); final Designer designer = new Designer(args); - preLoadSomething(); //启动env startSub(DesignerWorkspaceProvider.class); startSub(EnvBasedModule.class); @@ -52,32 +48,6 @@ public class DesignerStartup extends Activator { startSub(StartFinishActivator.class); } - /** - * 基础模块结束后可以提前加载一部分依赖基础模块(国际化,图标样式之类)的东西 - */ - private void preLoadSomething(){ - ExecutorService service = Executors.newCachedThreadPool(); - service.submit(new Runnable() { - @Override - public void run() { - CellElementPropertyPane.getInstance(); - } - }); - service.submit(new Runnable() { - @Override - public void run() { - DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane - } - }); - service.submit(new Runnable() { - @Override - public void run() { - WidgetInfoConfig.getInstance(); - } - }); - service.shutdown(); - } - /** * 切换环境时,重新启动所有相关模块 */ From c36843c67c77d0f61177d49092d463c3b3bdb572 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 26 Jun 2018 11:58:25 +0800 Subject: [PATCH 33/35] =?UTF-8?q?CHART-2398=20=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8E=BB=E6=8E=89=E8=80=81=E5=9B=BE=E8=A1=A8=E5=AD=97?= =?UTF-8?q?=E6=A0=B7=20=E5=8A=9F=E8=83=BD=E7=82=B9=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 50 +++++++------------ .../mainframe/chart/gui/ChartTypePane.java | 30 ++++++----- 2 files changed, 36 insertions(+), 44 deletions(-) diff --git a/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java index a2d06362a9..db01883af5 100644 --- a/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -275,26 +275,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr List priorityList = getPriorityInOrder(); for (Integer aPriorityList : priorityList) { String priority = String.valueOf(aPriorityList); - Iterator> chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); - while (chartUIIterator.hasNext()) { - Map.Entry chartUIEntry = chartUIIterator.next(); - IndependentChartUIProvider provider = chartUIEntry.getValue(); - AbstractChartTypePane pane = provider.getPlotTypePane(); - pane.setPlotID(chartUIEntry.getKey()); - paneList.add(pane); - } + addPlotTypePaneList(priority, paneList); } } - private static String getChartName(String plotID, IndependentChartUIProvider provider) { - String name = provider.getPlotTypeTitle4PopupWindow(); - if (StringUtils.isEmpty(name)) { - name = ChartTypeManager.getInstance().getChartName(plotID); - } - return name; - } - private void addTitles(String priority, List list) { + public void addPlotTypePaneList(String priority, List> paneList) { + if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) { Map chartUIList = chartTypeInterfaces.get(priority); @@ -305,30 +292,31 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr String plotID = entry.getKey(); if (enabledChart(plotID)) { - list.add(getChartName(plotID, entry.getValue())); + AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); + pane.setPlotID(plotID); + paneList.add(pane); } } } } - public String[] getTitle4PopupWindow() { - List priorityList = getPriorityInOrder(); - - List result = new ArrayList(); - for (Integer priority : priorityList) { - addTitles(String.valueOf(priority), result); + public void addPlotTypePaneList(List> paneList, + String priority, String plotID) { + if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) { + IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID); + AbstractChartTypePane pane = provider.getPlotTypePane(); + pane.setPlotID(plotID); + paneList.add(pane); } - - return result.toArray(new String[result.size()]); } - public String[] getTitle4PopupWindow(String priority) { - List list = new ArrayList(); - - addTitles(priority, list); - - return list.toArray(new String[list.size()]); + private static String getChartName(String plotID, IndependentChartUIProvider provider) { + String name = provider.getPlotTypeTitle4PopupWindow(); + if (StringUtils.isEmpty(name)) { + name = ChartTypeManager.getInstance().getChartName(plotID); + } + return name; } /** diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 961626ce3d..d5435cf02e 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -206,19 +206,30 @@ public class ChartTypePane extends AbstractChartAttrPane{ boolean enabledChart = ChartTypeManager.enabledChart(plotID); String item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority, plotID); - //第一步就是重构cardNames + //第一步就是重构cards + cards.clear(); if (enabledChart) { - cardNames = collection.getState() == SwitchState.DEFAULT - ? ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow() - : ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority); + if (collection.getState() == SwitchState.DEFAULT) { + ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(cards); + } else { + ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(priority, cards); + } } else { - cardNames = new String[]{item}; + ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(cards, priority, plotID); } //下拉框重构开始。为了防止重构是触发update ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.REACTOR); //重构下拉框选项 - reactorComboBox(); + cardNames = new String[cards.size()]; + cardPane.removeAll(); + jcb.removeAllItems(); + for (int i = 0; i < this.cards.size(); i++) { + String name = this.cards.get(i).title4PopupWindow();// Name从各自的pane里面获取 + cardNames[i] = name; + cardPane.add(this.cards.get(i), cardNames[i]); + addComboBoxItem(cards, i); + } //重新选择选中的下拉项 jcb.setSelectedItem(item); jcb.setEnabled(enabledChart); @@ -233,13 +244,6 @@ public class ChartTypePane extends AbstractChartAttrPane{ cl.show(cardPane, cardNames[jcb.getSelectedIndex()]); } - private void reactorComboBox() { - jcb.removeAllItems(); - for (int i = 0; i < this.cardNames.length; i++) { - jcb.addItem(cardNames[i]); - } - } - @Override public void populateBean(Chart ob) { for (int i = 0; i < this.cards.size(); i++) { From ed6a4965c0b3177b5769794913733ad48de50a0f Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 26 Jun 2018 14:10:43 +0800 Subject: [PATCH 34/35] =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/DesignerFrameFileDealerPane.java | 12 ++++++++---- .../fr/design/mainframe/EastRegionContainerPane.java | 12 ++++++++---- .../fr/design/mainframe/CellElementPropertyPane.java | 12 ++++++++---- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index c35e7e3591..fddf359c53 100644 --- a/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -53,7 +53,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private static final String FILE = "file"; - private static DesignerFrameFileDealerPane THIS; + private static volatile DesignerFrameFileDealerPane THIS; private CardLayout card; @@ -81,11 +81,15 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt selectedOperation.refresh(); } - + public static final DesignerFrameFileDealerPane getInstance() { - + if (THIS == null) { - THIS = new DesignerFrameFileDealerPane(); + synchronized (DesignerFrameFileDealerPane.class) { + if (THIS == null) { + THIS = new DesignerFrameFileDealerPane(); + } + } } return THIS; } diff --git a/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java index ef8729ddc3..0adf8785cd 100644 --- a/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.Set; public class EastRegionContainerPane extends UIEastResizableContainer { - private static EastRegionContainerPane THIS; + private static volatile EastRegionContainerPane THIS; private Map propertyItemMap; private CardLayout propertyCard; private JPanel leftPane; @@ -84,13 +84,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer { */ public static EastRegionContainerPane getInstance() { if (THIS == null) { - THIS = new EastRegionContainerPane(); - THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastEastRegionContainerWidth()); + synchronized (EastRegionContainerPane.class) { + if (THIS == null) { + THIS = new EastRegionContainerPane(); + THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastEastRegionContainerWidth()); + } + } } return THIS; } - public EastRegionContainerPane() { + private EastRegionContainerPane() { super(); initPropertyItemList(); defaultPane = getDefaultPane(Inter.getLocText("FR-Designer_No_Settings_Available")); diff --git a/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java index 68b1134f7b..f87ff4a838 100644 --- a/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -65,16 +65,20 @@ public class CellElementPropertyPane extends DockingView { } }); } - - + + public synchronized static CellElementPropertyPane getInstance() { if (singleton == null) { - singleton = new CellElementPropertyPane(); + synchronized (CellElementPropertyPane.class) { + if (singleton == null) { + singleton = new CellElementPropertyPane(); + } + } } return singleton; } - private static CellElementPropertyPane singleton; + private static volatile CellElementPropertyPane singleton; private CellElementEditPane cellElementEditPane; From a4767e2c42f3de8c3ad69666e87251070d992ae7 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 26 Jun 2018 14:14:28 +0800 Subject: [PATCH 35/35] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListPane.java | 10 ++++++--- .../gui/iprogressbar/ProgressDialog.java | 4 ++-- .../mainframe/loghandler/LogMessageBar.java | 22 ++++++++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java index 3fc3f1d72b..4974e53e4a 100644 --- a/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -43,18 +43,22 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C private JTemplate editingTemplate; private FileToolbarStateChangeListener toobarStateChangeListener; - private static HistoryTemplateListPane THIS; + private static volatile HistoryTemplateListPane THIS; private UIList list; public static final HistoryTemplateListPane getInstance() { if (THIS == null) { - THIS = new HistoryTemplateListPane(); + synchronized (HistoryTemplateListPane.class) { + if (THIS == null) { + THIS = new HistoryTemplateListPane(); + } + } } return THIS; } - public HistoryTemplateListPane() { + private HistoryTemplateListPane() { setLayout(new BorderLayout()); historyList = new ArrayList>(); list = new UIList(new HistoryListDataMode()) { diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java index dab3a2e023..f5a1c3c775 100644 --- a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -52,6 +52,7 @@ public class ProgressDialog extends UIDialog { FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)); text.setFont(font); panel.add(text, BorderLayout.SOUTH); + panel.setVisible(true); centerDialog.getContentPane().add(panel); } @@ -63,9 +64,8 @@ public class ProgressDialog extends UIDialog { @Override public void setVisible(boolean b) { - super.setVisible(b); centerDialog.setVisible(b); - centerDialog.setResizable(false); + super.setVisible(b); } public void setProgressValue(int value) { diff --git a/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java index 71a7a7e642..8f6034f776 100644 --- a/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -1,27 +1,29 @@ package com.fr.design.mainframe.loghandler; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.JFrame; - import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.general.Inter; +import javax.swing.JFrame; import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; public class LogMessageBar extends JPanel { private UILabel messageLabel; private int width = 600; - public static LogMessageBar THIS; + public static volatile LogMessageBar THIS; private JFrame dlg = new LogDetailPane().showDialog(); public static LogMessageBar getInstance() { if (THIS == null) { - THIS = new LogMessageBar(); + synchronized (LogMessageBar.class) { + if (THIS == null) { + THIS = new LogMessageBar(); + } + } } return THIS; } @@ -32,7 +34,7 @@ public class LogMessageBar extends JPanel { return bar; } - public LogMessageBar() { + private LogMessageBar() { messageLabel = new UILabel(); setLayout(new BorderLayout()); add(messageLabel, BorderLayout.CENTER);