Browse Source

REPORT-5402 代码规范

plough 8 years ago
parent
commit
7243c31244
  1. 6
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  2. 31
      designer/src/com/fr/start/CollectUserInformationDialog.java

6
designer/src/com/fr/design/webattr/WriteToolBarPane.java

@ -50,6 +50,10 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private UICheckBox isAutoStash;//自动暂存 private UICheckBox isAutoStash;//自动暂存
public WriteToolBarPane() { public WriteToolBarPane() {
init();
}
private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(allPanel, BorderLayout.CENTER); this.add(allPanel, BorderLayout.CENTER);
@ -106,7 +110,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
this.toolBarManagers = new ToolBarManager[]{toolBarManager}; this.toolBarManagers = new ToolBarManager[]{toolBarManager};
} }
private ActionListener editBtnListener = new ActionListener() { private ActionListener editBtnListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

31
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 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 String JP_LOGIN_HTML = "http://www.finereport.com/jp/products/frlogin";
private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; 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 UITextField keyTextField;
private DescriptionTextArea descriptionTextArea; private DescriptionTextArea descriptionTextArea;
@ -47,7 +56,7 @@ public class CollectUserInformationDialog extends UIDialog {
protected void initComponents() { protected void initComponents() {
JPanel defaultPane = (JPanel) this.getContentPane(); JPanel defaultPane = (JPanel) this.getContentPane();
defaultPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); 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.applyClosingAction();
//this.applyEscapeAction(); //this.applyEscapeAction();
JPanel centPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); 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)"), Inter.getLocText("Collect-Enter_your_user_information_code(It's_free_to_get_from_product's_official_website)"),
TitledBorder.LEADING, TitledBorder.TOP)); TitledBorder.LEADING, TitledBorder.TOP));
JPanel keyPane = new JPanel(new BorderLayout(4, 4)); 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); topPane.add(keyPane);
UILabel avctivenumberLabel = new UILabel(); UILabel avctivenumberLabel = new UILabel();
@ -78,7 +87,7 @@ public class CollectUserInformationDialog extends UIDialog {
getKeyButton.addActionListener(actionListener); getKeyButton.addActionListener(actionListener);
descriptionTextArea = new DescriptionTextArea(); descriptionTextArea = new DescriptionTextArea();
descriptionTextArea.setRows(5); descriptionTextArea.setRows(DESCRIPTION_ROWS);
descriptionTextArea.setBorder( descriptionTextArea.setBorder(
BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Collect_Information_Description"))); BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Collect_Information_Description")));
descriptionTextArea.setText(Inter.getLocText("Collect-User_Information_DES")); descriptionTextArea.setText(Inter.getLocText("Collect-User_Information_DES"));
@ -88,13 +97,13 @@ public class CollectUserInformationDialog extends UIDialog {
defaultPane.add(this.createControlButtonPane(), BorderLayout.SOUTH); defaultPane.add(this.createControlButtonPane(), BorderLayout.SOUTH);
this.setTitle(Inter.getLocText("Collect-Collect_User_Information")); this.setTitle(Inter.getLocText("Collect-Collect_User_Information"));
this.setSize(480, 300); this.setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
this.setModal(true); this.setModal(true);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }
private void macSystemHit(JPanel keyPane) { private void macSystemHit(JPanel keyPane) {
if(OperatingSystem.isMacOS()) { if (OperatingSystem.isMacOS()) {
UITextArea macHit = new UITextArea(); UITextArea macHit = new UITextArea();
macHit.setText(Inter.getLocText("FR-Designer-Collect_OSXTips")); macHit.setText(Inter.getLocText("FR-Designer-Collect_OSXTips"));
macHit.setEditable(false); macHit.setEditable(false);
@ -119,22 +128,19 @@ public class CollectUserInformationDialog extends UIDialog {
private void getKeyAction(){ private void getKeyAction(){
Locale locale = FRContext.getLocale(); Locale locale = FRContext.getLocale();
String url = EN_LOGIN_HTML; String url = EN_LOGIN_HTML;
if (ComparatorUtils.equals(locale, Locale.TAIWAN)) if (ComparatorUtils.equals(locale, Locale.TAIWAN)) {
{
url = TW_LOGIN_HTML; url = TW_LOGIN_HTML;
} }
if (ComparatorUtils.equals(locale, Locale.CHINA)) if (ComparatorUtils.equals(locale, Locale.CHINA)) {
{
url = CN_LOGIN_HTML; url = CN_LOGIN_HTML;
} }
if (ComparatorUtils.equals(locale, Locale.JAPAN)) if (ComparatorUtils.equals(locale, Locale.JAPAN)) {
{
url = JP_LOGIN_HTML; url = JP_LOGIN_HTML;
} }
try { try {
Desktop.getDesktop().browse(new URI(url)); Desktop.getDesktop().browse(new URI(url));
} catch (Exception ioe) { } catch (Exception ioe) {
// do nothing
} }
}; };
@ -189,5 +195,6 @@ public class CollectUserInformationDialog extends UIDialog {
* *
*/ */
public void checkValid() throws Exception { public void checkValid() throws Exception {
// do nothing
} }
} }
Loading…
Cancel
Save