Example #1
0
 /**
  * 动作
  *
  * @param e 事件
  */
 public void actionPerformed(ActionEvent e) {
   DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
   Env selectedEnv = envManager.getEnv(this.getName());
   try {
     if (selectedEnv instanceof RemoteEnv && !((RemoteEnv) selectedEnv).testServerConnection()) {
       JOptionPane.showMessageDialog(
           DesignerContext.getDesignerFrame(),
           Inter.getLocText(new String[] {"M-SwitchWorkspace", "Failed"}));
       return;
     }
     String remoteVersion = selectedEnv.getDesignerVersion();
     if (StringUtils.isBlank(remoteVersion)
         || ComparatorUtils.compare(remoteVersion, ProductConstants.DESIGNER_VERSION) < 0) {
       String infor = Inter.getLocText("Server-version-tip");
       String moreInfo = Inter.getLocText("Server-version-tip-moreInfo");
       FRLogger.getLogger().log(Level.WARNING, infor);
       new InformationWarnPane(infor, moreInfo, Inter.getLocText("Tooltips")).show();
       return;
     }
     SignIn.signIn(selectedEnv);
     LicUtils.resetBytes();
     HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
     fireDSChanged();
   } catch (Exception em) {
     FRContext.getLogger().error(em.getMessage(), em);
     JOptionPane.showMessageDialog(
         DesignerContext.getDesignerFrame(),
         Inter.getLocText(new String[] {"M-SwitchWorkspace", "Failed"}));
     TemplatePane.getInstance().editItems();
   }
 }
Example #2
0
 public static JSONObject getJsonContent() throws Exception {
   String res = null;
   try {
     res = readVersionFromServer(TIME_OUT);
   } catch (IOException e) {
     FRLogger.getLogger().error(e.getMessage());
   }
   return new JSONObject(res);
 }
Example #3
0
  /** p:初始化look and feel, 把一切放到这个里面.可以让多个地方调用. */
  public static void initLookAndFeel() {
    // p:隐藏对话框的系统标题风格,用look and feel定义的标题风格.
    try {
      UIManager.setLookAndFeel(UILookAndFeel.class.getName());
    } catch (Exception e) {
      FRLogger.getLogger().log(Level.WARNING, "Substance Raven Graphite failed to initialize");
    }
    // 获取当前系统语言下设计器用的默认字体
    FRFont guiFRFont = getCurrentLocaleFont();
    // 指定UIManager中字体
    Enumeration keys = UIManager.getDefaults().keys();
    while (keys.hasMoreElements()) {
      String key = keys.nextElement().toString();

      if (key.endsWith(".font")) {
        UIManager.put(key, isTextField(key) ? getNamedFont("Dialog") : guiFRFont);
      }
    }
  }