diff --git a/designer/src/com/fr/design/webattr/WriteToolBarPane.java b/designer/src/com/fr/design/webattr/WriteToolBarPane.java index 264ad15f32..f9f5991775 100644 --- a/designer/src/com/fr/design/webattr/WriteToolBarPane.java +++ b/designer/src/com/fr/design/webattr/WriteToolBarPane.java @@ -50,6 +50,10 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { private UICheckBox isAutoStash;//自动暂存 public WriteToolBarPane() { + init(); + } + + private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.add(allPanel, BorderLayout.CENTER); @@ -106,7 +110,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); this.toolBarManagers = new ToolBarManager[]{toolBarManager}; } - + private ActionListener editBtnListener = new ActionListener() { public void actionPerformed(ActionEvent e) { diff --git a/designer/src/com/fr/start/CollectUserInformationDialog.java b/designer/src/com/fr/start/CollectUserInformationDialog.java index d8fbcaf78b..3eb0e45ae2 100644 --- a/designer/src/com/fr/start/CollectUserInformationDialog.java +++ b/designer/src/com/fr/start/CollectUserInformationDialog.java @@ -33,6 +33,15 @@ public class CollectUserInformationDialog extends UIDialog { private static final String TW_LOGIN_HTML = "http://www.finereport.com/tw/products/frlogin"; private static final String JP_LOGIN_HTML = "http://www.finereport.com/jp/products/frlogin"; private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; + private static final int DIALOG_WIDTH = 480; + private static final int DIALOG_HEIGHT = 300; + private static final int DESCRIPTION_ROWS = 5; + private static final int KEYPANE_PADDING_TOP = 32; + private static final int KEYPANE_PADDING_LEFT = 2; + private static final int KEYPANE_PADDING_DOWN = 32; + private static final int KEYPANE_PADDING_RIGHT = 2; + private static final int DEFAULTPANE_PADDING_TOP = 2; + private static final int DEFAULTPANE_PADDING = 4; private UITextField keyTextField; private DescriptionTextArea descriptionTextArea; @@ -47,7 +56,7 @@ public class CollectUserInformationDialog extends UIDialog { protected void initComponents() { JPanel defaultPane = (JPanel) this.getContentPane(); defaultPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - defaultPane.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4)); + defaultPane.setBorder(BorderFactory.createEmptyBorder(DEFAULTPANE_PADDING_TOP, DEFAULTPANE_PADDING, DEFAULTPANE_PADDING, DEFAULTPANE_PADDING)); this.applyClosingAction(); //this.applyEscapeAction(); JPanel centPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -60,7 +69,7 @@ public class CollectUserInformationDialog extends UIDialog { Inter.getLocText("Collect-Enter_your_user_information_code(It's_free_to_get_from_product's_official_website)"), TitledBorder.LEADING, TitledBorder.TOP)); JPanel keyPane = new JPanel(new BorderLayout(4, 4)); - keyPane.setBorder(BorderFactory.createEmptyBorder(32, 2, 32, 2)); + keyPane.setBorder(BorderFactory.createEmptyBorder(KEYPANE_PADDING_TOP, KEYPANE_PADDING_LEFT, KEYPANE_PADDING_DOWN, KEYPANE_PADDING_RIGHT)); topPane.add(keyPane); UILabel avctivenumberLabel = new UILabel(); @@ -78,7 +87,7 @@ public class CollectUserInformationDialog extends UIDialog { getKeyButton.addActionListener(actionListener); descriptionTextArea = new DescriptionTextArea(); - descriptionTextArea.setRows(5); + descriptionTextArea.setRows(DESCRIPTION_ROWS); descriptionTextArea.setBorder( BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Collect_Information_Description"))); descriptionTextArea.setText(Inter.getLocText("Collect-User_Information_DES")); @@ -88,13 +97,13 @@ public class CollectUserInformationDialog extends UIDialog { defaultPane.add(this.createControlButtonPane(), BorderLayout.SOUTH); this.setTitle(Inter.getLocText("Collect-Collect_User_Information")); - this.setSize(480, 300); + this.setSize(DIALOG_WIDTH, DIALOG_HEIGHT); this.setModal(true); GUICoreUtils.centerWindow(this); } private void macSystemHit(JPanel keyPane) { - if(OperatingSystem.isMacOS()) { + if (OperatingSystem.isMacOS()) { UITextArea macHit = new UITextArea(); macHit.setText(Inter.getLocText("FR-Designer-Collect_OSXTips")); macHit.setEditable(false); @@ -119,22 +128,19 @@ public class CollectUserInformationDialog extends UIDialog { private void getKeyAction(){ Locale locale = FRContext.getLocale(); String url = EN_LOGIN_HTML; - if (ComparatorUtils.equals(locale, Locale.TAIWAN)) - { + if (ComparatorUtils.equals(locale, Locale.TAIWAN)) { url = TW_LOGIN_HTML; } - if (ComparatorUtils.equals(locale, Locale.CHINA)) - { + if (ComparatorUtils.equals(locale, Locale.CHINA)) { url = CN_LOGIN_HTML; } - if (ComparatorUtils.equals(locale, Locale.JAPAN)) - { + if (ComparatorUtils.equals(locale, Locale.JAPAN)) { url = JP_LOGIN_HTML; } try { Desktop.getDesktop().browse(new URI(url)); } catch (Exception ioe) { - + // do nothing } }; @@ -189,5 +195,6 @@ public class CollectUserInformationDialog extends UIDialog { * */ public void checkValid() throws Exception { + // do nothing } } \ No newline at end of file