From 2b1369200ffa7923007150fb8e58e0e7eaa9d42f Mon Sep 17 00:00:00 2001 From: RichieJi Date: Wed, 31 Jan 2018 14:19:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/bbs/BBSBrowserDialog.java | 93 ------------------- .../design/mainframe/bbs/DisplayThread.java | 46 --------- .../widget/component/BackgroundCompPane.java | 7 +- .../component/ButtonBackgroundPane.java | 6 +- .../component/TabFitLayoutBackgroundPane.java | 6 +- 5 files changed, 9 insertions(+), 149 deletions(-) delete mode 100644 designer/src/com/fr/design/mainframe/bbs/BBSBrowserDialog.java delete mode 100644 designer/src/com/fr/design/mainframe/bbs/DisplayThread.java diff --git a/designer/src/com/fr/design/mainframe/bbs/BBSBrowserDialog.java b/designer/src/com/fr/design/mainframe/bbs/BBSBrowserDialog.java deleted file mode 100644 index 718e4d24d0..0000000000 --- a/designer/src/com/fr/design/mainframe/bbs/BBSBrowserDialog.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.fr.design.mainframe.bbs; - -import java.awt.BorderLayout; -import java.awt.Canvas; -import java.awt.Frame; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.awt.SWT_AWT; -import org.eclipse.swt.browser.Browser; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -import com.fr.design.dialog.UIDialog; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.Inter; - -/** - * 封装浏览器的dialog - * - */ -public class BBSBrowserDialog extends UIDialog { - - private static final int WIDTH = 600; - private static final int HEIGHT = 400; - - private DisplayThread displayThread; - private Canvas canvas; - private String url; - - public BBSBrowserDialog(Frame parent) { - super(parent); - - this.displayThread = new DisplayThread(); - this.displayThread.start(); - this.canvas = new Canvas(); - setLayout(new BorderLayout()); - add(canvas, BorderLayout.CENTER); - - this.setSize(WIDTH, HEIGHT); - GUICoreUtils.centerWindow(this); - } - - @Override - public String getTitle() { - return Inter.getLocText("FR-Designer_Forum"); - } - - /** - * 通知组件可以显示了 - * - */ - public void addNotify() { - super.addNotify(); - Display dis = displayThread.getDisplay(); - dis.syncExec(new Runnable() { - - public void run() { - Shell shell = SWT_AWT.new_Shell(displayThread.getDisplay(), canvas); - shell.setLayout(new FillLayout()); - final Browser browser = new Browser(shell, SWT.NONE); - browser.setLayoutData(BorderLayout.CENTER); - browser.setUrl(url); - } - }); - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** - * 检测面板中内容合法性 - * - */ - public void checkValid() throws Exception { - } - - /** - * 在窗口中显示指定的url - * - * @param url 指定的url - * - */ - public void showWindow(String url){ - this.setUrl(url); - this.setVisible(true); - } -} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/bbs/DisplayThread.java b/designer/src/com/fr/design/mainframe/bbs/DisplayThread.java deleted file mode 100644 index c3b3ce6551..0000000000 --- a/designer/src/com/fr/design/mainframe/bbs/DisplayThread.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.fr.design.mainframe.bbs; - -import org.eclipse.swt.widgets.Display; - -public class DisplayThread extends Thread { - - private Display display; - Object sem = new Object(); - - /** - * 运行 - * - */ - public void run() { - synchronized (sem) { - display = Display.getDefault(); - sem.notifyAll(); - } - swtEventLoop(); - } - - private void swtEventLoop() { - while (true) { - try{ - if (!display.readAndDispatch()) { - display.sleep(); - } - }catch (Exception e) { - continue; - } - } - } - - public Display getDisplay() { - try { - synchronized (sem) { - while (display == null) { - sem.wait(); - } - return display; - } - } catch (Exception e) { - return null; - } - } -} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java b/designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java index e534521706..098d96b742 100644 --- a/designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java +++ b/designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java @@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleImgBackgroundEditor; import com.fr.form.ui.Widget; import com.fr.general.Inter; -import com.vividsolutions.jts.index.bintree.Interval; import javax.swing.*; import java.awt.*; @@ -20,7 +19,7 @@ import java.awt.*; */ public abstract class BackgroundCompPane extends BasicPane { protected UIButtonGroup backgroundHead; - protected AccessibleImgBackgroundEditor initalBackgroundEditor; + protected AccessibleImgBackgroundEditor initialBackgroundEditor; protected AccessibleImgBackgroundEditor overBackgroundEditor; protected AccessibleImgBackgroundEditor clickBackgroundEditor; private JPanel panel; @@ -32,7 +31,7 @@ public abstract class BackgroundCompPane extends BasicPane { public void initComponent() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); UILabel headLabel = createUILable(); - initalBackgroundEditor = new AccessibleImgBackgroundEditor(); + initialBackgroundEditor = new AccessibleImgBackgroundEditor(); overBackgroundEditor = new AccessibleImgBackgroundEditor(); clickBackgroundEditor = new AccessibleImgBackgroundEditor(); String [] titles = new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_Custom")}; @@ -43,7 +42,7 @@ public abstract class BackgroundCompPane extends BasicPane { double[] columnSize = {p, f}; int[][] rowCount = {{1, 1},{1, 1},{1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Initial")), initalBackgroundEditor}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Initial")), initialBackgroundEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Over")), overBackgroundEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Click")), clickBackgroundEditor}, }; diff --git a/designer_base/src/com/fr/design/widget/component/ButtonBackgroundPane.java b/designer_base/src/com/fr/design/widget/component/ButtonBackgroundPane.java index d1ebfe0b9a..c21ca429f8 100644 --- a/designer_base/src/com/fr/design/widget/component/ButtonBackgroundPane.java +++ b/designer_base/src/com/fr/design/widget/component/ButtonBackgroundPane.java @@ -21,7 +21,7 @@ public class ButtonBackgroundPane extends BackgroundCompPane { freeButton.setClickBackground(null); }else{ freeButton.setCustomStyle(true); - freeButton.setInitialBackground((Background) initalBackgroundEditor.getValue()); + freeButton.setInitialBackground((Background) initialBackgroundEditor.getValue()); freeButton.setOverBackground((Background) overBackgroundEditor.getValue()); freeButton.setClickBackground((Background)clickBackgroundEditor.getValue()); } @@ -31,12 +31,12 @@ public class ButtonBackgroundPane extends BackgroundCompPane { public void populate(FreeButton freeButton){ if(!freeButton.isCustomStyle()){ backgroundHead.setSelectedIndex(0); - initalBackgroundEditor.setValue(null); + initialBackgroundEditor.setValue(null); overBackgroundEditor.setValue(null); clickBackgroundEditor.setValue(null); }else{ backgroundHead.setSelectedIndex(1); - initalBackgroundEditor.setValue(freeButton.getInitialBackground()); + initialBackgroundEditor.setValue(freeButton.getInitialBackground()); overBackgroundEditor.setValue(freeButton.getOverBackground()); clickBackgroundEditor.setValue(freeButton.getClickBackground()); } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java index b2c79c9223..8eef29192a 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java @@ -24,7 +24,7 @@ public class TabFitLayoutBackgroundPane extends BackgroundCompPane