public void sendEmail() {
   String email = person.getEmail();
   errorMessage.setForeground(Color.blue);
   String recipientEmail = person.getEmail();
   String recipientName = person.getName();
   person.getUsername();
   person.getId();
   String newPassword = "";
   char[] newChar = new char[10];
   for (int i = 0; i < 10; i++) {
     newChar[i] = getRandomString(10).charAt(i);
     newPassword = newPassword + newChar[i];
     try {
       // if you generate more than 1 time, you must
       // put the process to sleep for awhile
       // otherwise it will return the same random
       // string
       Thread.sleep(100);
     } catch (InterruptedException d) {
       d.printStackTrace();
     }
   }
   if (sendEmail(
       "*****@*****.**", "oopjpass", recipientEmail, recipientName, newPassword)) {
     errorMessage.setText(
         errorMessage.getText() + "A replacement password has been sent to \n" + recipientEmail);
   } else {
     errorMessage.setText(errorMessage.getText() + "Sending failed.");
   }
   DesEncryption encryption = new DesEncryption("Password");
   inputPassword = encryption.encrypt(newPassword);
 }
  private void setDataView(List<BlackboardArtifact> artifacts, int offset) {
    // change the cursor to "waiting cursor" for this operation
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    if (artifacts.isEmpty()) {
      setComponentsVisibility(false);
      this.setCursor(null);
      outputViewPane.setText("");
      return;
    }
    this.artifacts = artifacts;
    StringContent artifactString = new ArtifactStringContent(artifacts.get(offset - 1));
    String text = artifactString.getString();

    int pages = artifacts.size();

    nextPageButton.setEnabled(offset < pages);
    prevPageButton.setEnabled(offset > 1);

    currentPage = offset;

    totalPageLabel.setText(Integer.toString(pages));
    currentPageLabel.setText(Integer.toString(currentPage));
    outputViewPane.setText(text);
    setComponentsVisibility(true);
    outputViewPane.moveCaretPosition(0);
    this.setCursor(null);
  }
Exemple #3
0
 private void jbInit() throws Exception {
   box1 = Box.createVerticalBox();
   this.getContentPane().setLayout(borderLayout1);
   close.setText("Close");
   close.addActionListener(new CellHelpWindow_close_actionAdapter(this));
   jLabel1.setText("Recommendation");
   jLabel2.setText("Description");
   jPanel1.setLayout(borderLayout2);
   jPanel2.setLayout(borderLayout3);
   description.setText("jTextPane1");
   description.setContentType("text/html");
   scp1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
   scp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
   scp1.setToolTipText("");
   recom.setText("");
   recom.setContentType("text/html");
   this.getContentPane().add(box1, BorderLayout.CENTER);
   box1.add(jPanel1, null);
   box1.add(jPanel2, null);
   this.getContentPane().add(jPanel3, BorderLayout.SOUTH);
   jPanel3.add(close, null);
   jPanel2.add(jLabel1, BorderLayout.NORTH);
   jPanel2.add(scp2, BorderLayout.CENTER);
   scp2.getViewport().add(recom, null);
   jPanel2.add(scp2, BorderLayout.CENTER);
   jPanel1.add(jLabel2, BorderLayout.NORTH);
   jPanel1.add(scp1, BorderLayout.CENTER);
   scp1.getViewport().add(description, null);
 }
 private void initFields(Student student) {
   if (student != null) {
     txtFaculty.setText(student.getGroup().getFaculty());
     txtNOG.setText(String.valueOf(student.getGroup().getNumberOfGroup()));
     txtName.setText(student.getNameOfStudent());
     txtDOE.setText(student.getDateOfEnrollment());
   }
 }
  /**
   * * Sets the current mapping to the input. Note, if the current mapping is set, this means that
   * this dialog is "updating" a mapping, and not creating a new one.
   */
  public void setMapping(OBDAMappingAxiom mapping) {
    this.mapping = mapping;

    cmdInsertMapping.setText("Update");
    txtMappingID.setText(mapping.getId());

    OBDASQLQuery sourceQuery = mapping.getSourceQuery();
    String srcQuery = SourceQueryRenderer.encode(sourceQuery);
    txtSourceQuery.setText(srcQuery);

    List<Function> targetQuery = mapping.getTargetQuery();
    String trgQuery = TargetQueryRenderer.encode(targetQuery, prefixManager);
    txtTargetQuery.setText(trgQuery);
  }
 /*
  * (non-Javadoc)
  *
  * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
  */
 @Override
 public void update(Observable o, Object arg) {
   if (o instanceof qcevolutionbackend) {
     if (null != backend.getCurrentse()) {
       backend.getCurrentse().addObserver(this);
     }
   } else if (o instanceof ProblemManager) {
     Set<String> probs = backend.getProbmanager().getAvailableProblems();
     String[] options = new String[probs.size() + 1];
     options[0] = "Please Select Problem";
     int index = 1;
     Iterator<String> iter = probs.iterator();
     while (iter.hasNext()) {
       options[index++] = iter.next();
     }
     selection_model = new DefaultComboBoxModel(options);
     if (backend.getQproblem() != null) {
       String key = backend.getQproblem().getName();
       selection_model.setSelectedItem(key);
       description.setText(backend.getProbmanager().getSearchEngineDesc(key));
     }
     selection.setModel(selection_model);
   } else {
     if (backend.getCurrentse() != null) {
       if (backend.getCurrentse().getState() == SearchEngineState.Searching) {
         selection.setEnabled(false);
       } else {
         selection.setEnabled(true);
       }
       validate();
     }
   }
 }
 public NewSemanticsInfoDialog(
     Frame owner, String title, SemanticsInfoListener controller, InputXMLDocument doc) {
   this(owner, title, controller);
   txtFieldName.setText(doc.getName());
   txtFieldCategory.setText(doc.getCategory());
   txtAreaComments.setText(doc.getComments());
 }
  /**
   * Shows the given error message.
   *
   * @param text the text of the error
   */
  private void showErrorMessage(String text) {
    errorPane.setText(text);

    if (errorPane.getParent() == null) add(errorPane, BorderLayout.NORTH);

    SwingUtilities.getWindowAncestor(CreateSip2SipAccountForm.this).pack();
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane additionalDependencyPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelRefinedActivity = new ProMSplitPane();
    splitPanelRefinedActivity.setBackground(null);

    ProMTable comp = additionalDependencyTableCreator(logs, firstOrg, secondOrg);
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    textField.setText(
        fontBlack6
            + "Additional Dependencies ("
            + comp.getTable().getRowCount()
            + ")</font><hr>"
            + fontBlack4
            + " This pattern is a special case of different dependencies where one set of activities includes the other and results with additional dependencies. In the list you can see additional dependency sets in two organizations as "
            + logs.organizationNames.get(firstOrg)
            + "(Selected) and "
            + logs.organizationNames.get(secondOrg)
            + "(Other).");
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelRefinedActivity.setLeftComponent(comp);
    splitPanelRefinedActivity.setRightComponent(scrollPane);
    return splitPanelRefinedActivity;
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane differentConditionsPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelRefinedActivity = new ProMSplitPane();
    splitPanelRefinedActivity.setBackground(null);

    ProMTable comp = differentConditionsTableCreator(logs, firstOrg, secondOrg);
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    textField.setText(
        fontBlack6
            + "Different Conditions for Occurrence ("
            + comp.getTable().getRowCount()
            + ")</font><hr>"
            + fontBlack4
            + "Set of dependencies are same for two processes; however, occurrence condition is different in organizations. In the list you can see different occurrence conditions in two organizations as "
            + logs.organizationNames.get(firstOrg)
            + "(Selected) and "
            + logs.organizationNames.get(secondOrg)
            + "(Other).");
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelRefinedActivity.setLeftComponent(comp);
    splitPanelRefinedActivity.setRightComponent(scrollPane);
    return splitPanelRefinedActivity;
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane refinedActivityPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelRefinedActivity = new ProMSplitPane();
    splitPanelRefinedActivity.setBackground(null);

    ProMTable comp = refinedActivityTableCreator(logs, firstOrg, secondOrg);
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    textField.setText(
        fontBlack6
            + "Refined Activities ("
            + comp.getTable().getRowCount()
            + ")</font><hr>"
            + fontBlack4
            + "An activity exists in one process but, as an equivalent, a collection of activitiesare existing in the other process to achieve the same task. In the list you can see the refined activity in "
            + logs.organizationNames.get(firstOrg)
            + " and a potential list of activities in "
            + logs.organizationNames.get(secondOrg)
            + ".");
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelRefinedActivity.setLeftComponent(comp);
    splitPanelRefinedActivity.setRightComponent(scrollPane);
    return splitPanelRefinedActivity;
  }
  private void updateEditorView() {
    editorPane.setText("");
    numParameters = 0;
    try {
      java.util.List elements = editableTemplate.getPrintfElements();
      for (Iterator it = elements.iterator(); it.hasNext(); ) {
        PrintfUtil.PrintfElement el = (PrintfUtil.PrintfElement) it.next();
        if (el.getFormat().equals(PrintfUtil.PrintfElement.FORMAT_NONE)) {
          appendText(el.getElement(), PLAIN_ATTR);
        } else {
          insertParameter(
              (ConfigParamDescr) paramKeys.get(el.getElement()),
              el.getFormat(),
              editorPane.getDocument().getLength());
        }
      }
    } catch (Exception ex) {
      JOptionPane.showMessageDialog(
          this,
          "Invalid Format: " + ex.getMessage(),
          "Invalid Printf Format",
          JOptionPane.ERROR_MESSAGE);

      selectedPane = 1;
      printfTabPane.setSelectedIndex(selectedPane);
      updatePane(selectedPane);
    }
  }
  private void setupPanels(@Nullable ProjectTemplate template) {

    restorePanel(myNamePathComponent, 4);
    restorePanel(myModulePanel, myWizardContext.isCreatingNewProject() ? 8 : 6);
    restorePanel(myExpertPanel, myWizardContext.isCreatingNewProject() ? 1 : 0);
    mySettingsStep = myModuleBuilder == null ? null : myModuleBuilder.modifySettingsStep(this);

    String description = null;
    if (template != null) {
      description = template.getDescription();
      if (StringUtil.isNotEmpty(description)) {
        StringBuilder sb = new StringBuilder("<html><body><font ");
        sb.append(SystemInfo.isMac ? "" : "face=\"Verdana\" size=\"-1\"").append('>');
        sb.append(description).append("</font></body></html>");
        description = sb.toString();
        myDescriptionPane.setText(description);
      }
    }

    myExpertPlaceholder.setVisible(
        !(myModuleBuilder instanceof TemplateModuleBuilder)
            && myExpertPanel.getComponentCount() > 0);
    for (int i = 0; i < 6; i++) {
      myModulePanel.getComponent(i).setVisible(!(myModuleBuilder instanceof EmptyModuleBuilder));
    }
    myDescriptionPanel.setVisible(StringUtil.isNotEmpty(description));

    mySettingsPanel.revalidate();
    mySettingsPanel.repaint();
  }
Exemple #14
0
  private void initPanel() {
    masterPanel.add(initPanel, SELECTSARTYPE);

    initPanel.setBorder(new EmptyBorder(5, 5, 5, 5));

    initPanel.setLayout(null);

    JPanel panel = new JPanel();
    panel.setBorder(
        new TitledBorder(
            null,
            "Inititate New SAR Operation",
            TitledBorder.LEADING,
            TitledBorder.TOP,
            null,
            null));
    panel.setBounds(10, 11, 523, 340);
    initPanel.add(panel);
    panel.setLayout(null);

    typeSelectionComboBox = new JComboBox<String>();
    typeSelectionComboBox.setBounds(126, 21, 102, 20);
    panel.add(typeSelectionComboBox);
    typeSelectionComboBox.setModel(
        new DefaultComboBoxModel<String>(
            new String[] {
              "Simple SAR", "Rapid Response", "Datum Point", "Datum Line", "Back Track"
            }));

    typeSelectionComboBox.addActionListener(this);

    JLabel lblSelectSarType = new JLabel("Select SAR Type");
    lblSelectSarType.setBounds(10, 24, 140, 14);
    panel.add(lblSelectSarType);

    descriptiveText = new JTextPane();

    descriptiveText.setBounds(10, 52, 503, 112);
    panel.add(descriptiveText);
    // descriptiveText.setBackground(UIManager.getColor("Button.background"));
    descriptiveText.setOpaque(false);
    descriptiveText.setEditable(false);
    descriptiveText.setText(rapidresponseTxt);

    descriptiveImage = new JLabel(" ");
    descriptiveImage.setHorizontalAlignment(SwingConstants.CENTER);
    descriptiveImage.setBounds(20, 131, 493, 200);
    panel.add(descriptiveImage);
    descriptiveImage.setIcon(simpleSarIcon);

    lblOrImportSar = new JLabel("Or import SAR from external file:");
    lblOrImportSar.setBounds(238, 24, 176, 14);
    panel.add(lblOrImportSar);

    btnImport = new JButton("Import");
    btnImport.setBounds(408, 20, 89, 23);
    panel.add(btnImport);

    btnImport.addActionListener(this);
  }
  public void substarterEnd(String prefix, String userName, String input) {
    System.out.println("ending give");
    if (substarter.end(winNum)) {

      g_start.setEnabled(true);
      g_end.setEnabled(false);

      String winner = substarter.returnWinner(winNum);

      input = "Congrats to the new sub winner: " + winner + "!";
      prefix = "<b><font color=blue>[" + userName + "]:</font></b> ";

      registeredUserList.setText(winner + "\n");

    } else {
      g_start.setEnabled(true);
      g_end.setEnabled(false);

      prefix = "<b><font color=blue>[" + userName + "]:</font></b> ";
      input = "No one entered giveaway, ending giveaway.";
    }
    sock.outputToChannel(input, channelName);
    try {
      toChatScreen(prefix + input, false);
    } catch (IOException | BadLocationException ex) {
      Logger.getLogger(IRCBOT.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
  private JPanel createCentrePanel(YDataStateException exception) {
    JPanel centrePanel = new JPanel(new GridLayout(1, 2));

    JPanel msgPanel = new JPanel(new BorderLayout());
    msgPanel.setBackground(YAdminGUI._apiColour);
    msgPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(), "Schema for completing task"),
            BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    JTextPane msgTextPane = new JTextPane();
    msgTextPane.setContentType("text/plain");
    msgTextPane.setFont(new Font("courier", Font.PLAIN, 12));
    msgTextPane.setForeground(Color.RED);

    msgTextPane.setText(exception.getMessage());
    msgTextPane.setEditable(false);
    msgTextPane.setBackground(Color.LIGHT_GRAY);
    JPanel noWrapPanel = new JPanel();
    noWrapPanel.setLayout(new BorderLayout());
    noWrapPanel.add(msgTextPane);
    msgPanel.add(new JScrollPane(noWrapPanel));

    centrePanel.add(msgPanel, BorderLayout.NORTH);
    return centrePanel;
  }
  public SurrenderUI() {
    setType(Type.UTILITY);

    ExitB = new JButton("Exit");
    ExitB.setFont(new Font("Tahoma", Font.BOLD, 12));
    ExitB.setBackground(new Color(255, 215, 0));
    ExitB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            dispose();
            new HSmain();
          }
        });
    ExitB.setBounds(461, 427, 296, 60);

    setTitle("Surrendering a Pet");
    Container pane = getContentPane();
    getContentPane().setLayout(null);
    pane.add(ExitB);

    txtSurrender = new JTextField();
    txtSurrender.setEditable(false);
    txtSurrender.setForeground(new Color(0, 0, 0));
    txtSurrender.setBackground(new Color(255, 215, 0));
    txtSurrender.setBounds(10, 11, 764, 50);
    txtSurrender.setHorizontalAlignment(SwingConstants.CENTER);
    txtSurrender.setFont(new Font("Lucida Handwriting", Font.BOLD, 18));
    txtSurrender.setText("Surrendering a Pet");
    getContentPane().add(txtSurrender);
    txtSurrender.setColumns(10);

    BackB = new JButton("Back");
    BackB.setFont(new Font("Tahoma", Font.BOLD, 12));
    BackB.setBackground(new Color(255, 215, 0));
    BackB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            new AnimalServiceUI();
            dispose();
          }
        });
    BackB.setBounds(26, 427, 320, 60);
    getContentPane().add(BackB);

    scrollPane = new JScrollPane();
    scrollPane.setBounds(0, 72, 764, 329);
    getContentPane().add(scrollPane);

    JTextPane txtSurrenderInfo = new JTextPane();
    scrollPane.setViewportView(txtSurrenderInfo);
    txtSurrenderInfo.setForeground(new Color(0, 0, 0));
    txtSurrenderInfo.setEditable(false);
    txtSurrenderInfo.setFont(new Font("Times New Roman", Font.BOLD, 15));
    txtSurrenderInfo.setText(
        "\tThe Humane Society of Lamar cannot accept every animal brought to our shelter immediately. \r\nWe respect the difficult decision of owners to relinquish their pets, and the hard choices of those \r\ngood citizens who are trying to help a stray. We accept the surrender of pets as space allows. \r\nWe maintain a waiting list for all animals needing to be admitted to the shelter.\r\nAnimals are surrendered to our facility by appointment.\r\nWe admit at least 12 animals per week. We accept more animals as adoptions and space allow.\r\nNote that we cannot accept aggressive, sick or pregnant animals.\r\nPlease call 409-225-7981, and one of our adoption specialists will speak to you.\r\nAt times our waiting list will have up to 100 animals waiting for admission and it can take several weeks \r\nbefore we can admit your pet.\r\nPlease understand that our primary goal is to place as many animals in forever homes as possible, \r\ntherefore we must give every pet admitted to the shelter enough time to find a loving home. \r\nWe cannot guarantee placement of every animal admitted to the shelter.\r\n\t\r\n\tAdmission of any animal into the Humane Society of Lamar  is based on the animal\u2019s health, \r\nbehavior, and adoptability. When you bring your pets, please have:\r\n\r\n    *Any veterinary records\r\n    *Your pet\u2019s medications\r\n    *Special food or treats that your pet needs\r\n    *Your pet\u2019s bed, toys, leash and other belongings from home\r\n\r\nA staff member will evaluate the temperament of your pet. Once your pet has been screened, \r\nand the Humane Society of Lamar decides to accept your pet, we ask a donation to our shelter to be made. \r\nThis is not required, but will greatly help us care for your pet.");

    setSize(800, 553);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  }
  private void initComponents() {
    accountCombo = new AccountListComboBox();

    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("QifOne.txt"));

    /* Create the combo for date format selection */
    String[] formats = {QifUtils.US_FORMAT, QifUtils.EU_FORMAT};
    dateFormatCombo = new JComboBox<>(formats);

    dateFormatCombo.addActionListener(this);
    dateFormatCombo.setSelectedIndex(pref.getInt(DATE_FORMAT, 0));

    accountCombo.addActionListener(this);

    /* Try a set the combobox to the last selected account */
    String lastAccount = pref.get(LAST_ACCOUNT, "");

    Account last = EngineFactory.getEngine(EngineFactory.DEFAULT).getAccountByUuid(lastAccount);

    if (last != null) {
      setAccount(last);
    }
  }
 public ScrollableTextPane(String text) {
   super();
   _textPane = new JTextPane();
   _textPane.setText(text);
   _textPane.setEditable(false);
   this.setViewportView(_textPane);
 }
Exemple #20
0
  /** Displays the Spark error log. */
  private void showErrorLog() {
    final File logDir = new File(Spark.getLogDirectory(), "errors.log");

    // Read file and show
    final String errorLogs = URLFileSystem.getContents(logDir);

    final JFrame frame = new JFrame(Res.getString("title.client.logs"));
    frame.setLayout(new BorderLayout());
    frame.setIconImage(SparkManager.getApplicationImage().getImage());

    final JTextPane pane = new JTextPane();
    pane.setBackground(Color.white);
    pane.setFont(new Font("Dialog", Font.PLAIN, 12));
    pane.setEditable(false);
    pane.setText(errorLogs);

    frame.add(new JScrollPane(pane), BorderLayout.CENTER);

    final JButton copyButton = new JButton(Res.getString("button.copy.to.clipboard"));
    frame.add(copyButton, BorderLayout.SOUTH);

    copyButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            SparkManager.setClipboard(errorLogs);
            copyButton.setEnabled(false);
          }
        });

    frame.pack();
    frame.setSize(600, 400);

    GraphicUtils.centerWindowOnScreen(frame);
    frame.setVisible(true);
  }
 public static void explaindelln() {
   // 删除最后一行
   //		explain=explain.substring(0, explain.lastIndexOf("\n"));
   //		explain=explain.substring(0, explain.lastIndexOf("\n")+1);
   explain = explain.substring(explain.indexOf("\n") + 1, explain.length());
   textPane.setText(explain);
 }
Exemple #22
0
  private void show(int _current) {
    OpenDefinitionsDocument doc = _docs.get(_current);

    String text = getTextFor(doc);

    _label.setText(_displayManager.getName(doc));
    _label.setIcon(_displayManager.getIcon(doc));

    if (text.length() > 0) {
      // as wide as the text area wants, but only 200px high
      _textpane.setText(text);
      _scroller.setPreferredSize(_textpane.getPreferredScrollableViewportSize());
      if (_scroller.getPreferredSize().getHeight() > 200)
        _scroller.setPreferredSize(
            new Dimension((int) _scroller.getPreferredSize().getWidth(), 200));

      _scroller.setVisible(_showSource);
    } else _scroller.setVisible(false);

    Dimension d = _label.getMinimumSize();
    d.setSize(d.getWidth() + _padding * 2, d.getHeight() + _padding * 2);
    _label.setPreferredSize(d);
    _label.setHorizontalAlignment(SwingConstants.CENTER);
    _label.setVerticalAlignment(SwingConstants.CENTER);
    pack();
    centerH();
  }
Exemple #23
0
  /**
   * Creates an evaluation overview of the built classifier.
   *
   * @return the panel to be displayed as result evaluation view for the current decision point
   */
  protected JPanel createEvaluationVisualization(Instances data) {
    // build text field to display evaluation statistics
    JTextPane statistic = new JTextPane();

    try {
      // build evaluation statistics
      Evaluation evaluation = new Evaluation(data);
      evaluation.evaluateModel(myClassifier, data);
      statistic.setText(
          evaluation.toSummaryString()
              + "\n\n"
              + evaluation.toClassDetailsString()
              + "\n\n"
              + evaluation.toMatrixString());

    } catch (Exception ex) {
      ex.printStackTrace();
      return createMessagePanel("Error while creating the decision tree evaluation view");
    }

    statistic.setFont(new Font("Courier", Font.PLAIN, 14));
    statistic.setEditable(false);
    statistic.setCaretPosition(0);

    JPanel resultViewPanel = new JPanel();
    resultViewPanel.setLayout(new BoxLayout(resultViewPanel, BoxLayout.PAGE_AXIS));
    resultViewPanel.add(new JScrollPane(statistic));

    return resultViewPanel;
  }
  /** @param singleFormatter */
  protected void fillWithObjFormatter(final DataObjDataFieldFormatIFace singleFormatter) {
    ignoreFmtChange = true;
    try {
      formatEditor.setText("");

      if (singleFormatter == null) {
        return;
      }

      Document doc = formatEditor.getDocument();
      DataObjDataField[] fields = singleFormatter.getFields();
      if (fields == null) {
        return;
      }

      for (DataObjDataField field : fields) {
        try {
          doc.insertString(doc.getLength(), field.getSep(), null);

          // System.err.println("["+field.getName()+"]["+field.getSep()+"]["+field.getFormat()+"]["+field.toString()+"]");
          insertFieldIntoTextEditor(new DataObjDataFieldWrapper(field));
        } catch (BadLocationException ble) {
        }
      }
    } finally {
      ignoreFmtChange = false;
    }
  }
  private void init() {
    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    setOpaque(false);

    JLabel label = new JLabel("Text");
    label.setAlignmentX(Component.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
    add(label);

    final JTextPane textPane = new JTextPane();
    JScrollPane scrollPane = new JScrollPane(textPane);
    scrollPane.setMaximumSize(new Dimension(250, 100));
    scrollPane.setPreferredSize(new Dimension(250, 100));
    scrollPane.setAlignmentX(Component.CENTER_ALIGNMENT);
    add(scrollPane);

    textPane.setText(customGraphics.getText());

    textPane.addFocusListener(
        new FocusAdapter() {
          @Override
          public void focusLost(FocusEvent e) {
            customGraphics.setText(textPane.getText());
          }
        });
  }
Exemple #26
0
 private void setOptions(String f) {
   String str = "<html><body>";
   switch (f) {
     case "pdf":
       str += getOptionsPdf();
       break;
     case "html":
       str += getOptionsHtml();
       break;
     case "csv":
       str += getOptionsCsv();
       break;
     case "txt":
       str += getOptionsTxt();
       break;
     case "odf":
       str += getOptionsOdf();
       break;
     case "xml":
       str += getOptionsXml();
       break;
   }
   str += "</body></html>";
   txOptions.setText(str);
 }
  @Override
  public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting()) {
      return;
    }
    configurationPanel.removeAll();
    ListSelectionModel m = (ListSelectionModel) e.getSource();
    // single selection, so max selection index is the only one selected.
    selectedIndex = m.getMaxSelectionIndex();

    JPanel panel = new DefaultReportConfigurationPanel();
    ReportModule module = modules.get(selectedIndex);
    boolean generalModuleSelected = false;
    if (module instanceof GeneralReportModule) {
      JPanel generalPanel = ((GeneralReportModule) module).getConfigurationPanel();
      panel = (generalPanel == null) ? new JPanel() : generalPanel;
      generalModuleSelected = true;
    }

    descriptionTextPane.setText(module.getDescription());
    configurationPanel.add(panel, BorderLayout.CENTER);
    configurationPanel.revalidate();

    wizPanel.setNext(!generalModuleSelected);
    wizPanel.setFinish(generalModuleSelected);
  }
  /**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMSplitPane skippedActivityPanelCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {
    ProMSplitPane splitPanelSkippedActivity = new ProMSplitPane();
    splitPanelSkippedActivity.setBackground(null);

    ProMTable comp = null;
    if (firstOrg == secondOrg) {
      comp = skippedActivityTableCreator(logs, firstOrg);
    } else {
      comp = skippedActivityTableCreator(logs, secondOrg);
    }
    if (comp == null) return null;

    JTextPane textField = new JTextPane();
    textField.setContentType("text/html");
    if (firstOrg == secondOrg) {
      textField.setText(
          fontBlack6
              + "Skipped Activities ("
              + comp.getTable().getRowCount()
              + ") </font><hr>"
              + fontBlack4
              + " An activity exists in one process but no equivalent activity is found in the other process. In the list you can see the skipped activities in "
              + logs.organizationNames.get(firstOrg)
              + ".");
    } else {
      textField.setText(
          fontBlack6
              + "Skipped Activities ("
              + comp.getTable().getRowCount()
              + ")</font><hr>"
              + fontBlack4
              + " An activity exists in one process but no equivalent activity is found in the other process. In the list you can see the skipped activities in "
              + logs.organizationNames.get(secondOrg)
              + " compared to "
              + logs.organizationNames.get(firstOrg)
              + ".");
    }
    textField.setEditable(false);
    textField.setBackground(new Color(192, 192, 192));
    JScrollPane scrollPane = new JScrollPane(textField);
    scrollPane.setPreferredSize(new Dimension(500, 0));

    splitPanelSkippedActivity.setLeftComponent(comp);
    splitPanelSkippedActivity.setRightComponent(scrollPane);
    return splitPanelSkippedActivity;
  }
 public void setDescription() {
   try {
     if (getFeature() instanceof GeopistaFeature
         && ((GeopistaFeature) getFeature()).getLayer() != null)
       _descriptionTextArea.setText(((GeopistaFeature) getFeature()).getLayer().getName());
   } catch (Exception e) {
   }
 }
  private void display_(String s) {
    String text = textDetails.getText();
    if (text.length() > 0) text += "\n";

    text += s;
    textDetails.setText(text);
    panelMessage.setVisible(true);
  }