Search in sources :

Example 26 with JEditorPane

use of javax.swing.JEditorPane in project knime-core by knime.

the class OneSampleTTestNodeView method createMainPanel.

/**
 * The content of the view.
 */
private JPanel createMainPanel() {
    JPanel p = new JPanel(new GridBagLayout());
    GridBagConstraints c = createGridBagConstraints();
    c.gridwidth = 2;
    m_headerPane = new JEditorPane("text/html", "");
    m_headerPane.setEditable(false);
    p.add(m_headerPane, c);
    c.gridwidth = 1;
    c.gridy++;
    c.gridx = 0;
    c.gridwidth = 2;
    m_descrStatPane = new JEditorPane("text/html", "");
    m_descrStatPane.setEditable(false);
    p.add(m_descrStatPane, c);
    c.gridy++;
    c.gridx = 0;
    c.gridwidth = 2;
    m_statPane = new JEditorPane("text/html", "");
    m_statPane.setEditable(false);
    p.add(m_statPane, c);
    c.gridy++;
    c.weighty = 1;
    JPanel foo = new JPanel();
    foo.setBackground(Color.white);
    p.add(foo, c);
    return p;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JEditorPane(javax.swing.JEditorPane)

Example 27 with JEditorPane

use of javax.swing.JEditorPane in project knime-core by knime.

the class BitVectorGeneratorView method setTextArea.

private void setTextArea() {
    BitVectorGeneratorNodeModel model = getNodeModel();
    StringBuffer buffer = new StringBuffer("<html></body>");
    buffer.append("<h2>BitVector Generator Information:</h2>");
    buffer.append("<hr>");
    buffer.append("<table>");
    buffer.append("<tr><td>Number of processed rows: </td>" + "<td align=\"right\">" + model.getNumberOfProcessedRows() + " </td></tr>");
    buffer.append("<tr><td>Total number of 0s: </td>" + "<td align=\"right\">" + model.getTotalNrOf0s() + " </td></tr>");
    buffer.append("<tr><td>Total number of 1s: </td>" + "<td align=\"right\">" + model.getTotalNrOf1s() + "</td></tr>");
    double ratio = 0.0;
    if (model.getTotalNrOf0s() > 0) {
        ratio = (int) (((double) model.getTotalNrOf1s() / (double) model.getTotalNrOf0s()) * ROUNDING_CONSTANT);
        ratio = ratio / ROUNDING_CONSTANT;
    }
    buffer.append("<tr><td>Ratio of 1s to 0s: </td>" + "<td align=\"right\">" + ratio + "</td></tr></table>");
    buffer.append("</body></html>");
    m_pane = new JEditorPane("text/html", "");
    m_pane.setText(buffer.toString());
    m_pane.setEditable(false);
    setComponent(new JScrollPane(m_pane));
}
Also used : JScrollPane(javax.swing.JScrollPane) JEditorPane(javax.swing.JEditorPane)

Example 28 with JEditorPane

use of javax.swing.JEditorPane in project knime-core by knime.

the class CrosstabNodeView method createMainPanel.

/**
 * The content of the view.
 */
private JPanel createMainPanel() {
    JPanel p = new JPanel(new GridBagLayout());
    GridBagConstraints c = createGridBagConstraints();
    c.gridwidth = 2;
    m_headerPane = new JEditorPane("text/html", "");
    m_headerPane.setEditable(false);
    p.add(m_headerPane, c);
    c.gridwidth = 1;
    c.gridy++;
    c.weightx = 1;
    m_tablePane = new JEditorPane("text/html", "");
    m_tablePane.setEditable(false);
    p.add(m_tablePane, c);
    c.weightx = 0;
    c.gridx++;
    p.add(createControlsPanel(), c);
    c.gridy++;
    c.gridx = 0;
    c.gridwidth = 2;
    m_statPane = new JEditorPane("text/html", "");
    m_statPane.setEditable(false);
    p.add(m_statPane, c);
    c.gridy++;
    c.weighty = 1;
    JPanel foo = new JPanel();
    foo.setBackground(Color.white);
    p.add(foo, c);
    return p;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JEditorPane(javax.swing.JEditorPane)

Example 29 with JEditorPane

use of javax.swing.JEditorPane in project knime-core by knime.

the class CreateBitVectorView method setTextArea.

private void setTextArea() {
    CreateBitVectorNodeModel model = getNodeModel();
    StringBuffer buffer = new StringBuffer("<html></body>");
    buffer.append("<h2>Bit Vector Generator Information:</h2>");
    buffer.append("<hr>");
    buffer.append("<table>");
    buffer.append("<tr><td>Number of processed rows: </td>" + "<td align=\"right\">" + model.getNumberOfProcessedRows() + " </td></tr>");
    buffer.append("<tr><td>Total number of 0s: </td>" + "<td align=\"right\">" + model.getTotalNrOf0s() + " </td></tr>");
    buffer.append("<tr><td>Total number of 1s: </td>" + "<td align=\"right\">" + model.getTotalNrOf1s() + "</td></tr>");
    double ratio = 0.0;
    if (model.getTotalNrOf0s() > 0) {
        ratio = (int) (((double) model.getTotalNrOf1s() / (double) model.getTotalNrOf0s()) * ROUNDING_CONSTANT);
        ratio = ratio / ROUNDING_CONSTANT;
    }
    buffer.append("<tr><td>Ratio of 1s to 0s: </td>" + "<td align=\"right\">" + ratio + "</td></tr></table>");
    buffer.append("</body></html>");
    m_pane = new JEditorPane("text/html", "");
    m_pane.setText(buffer.toString());
    m_pane.setEditable(false);
    setComponent(new JScrollPane(m_pane));
}
Also used : JScrollPane(javax.swing.JScrollPane) JEditorPane(javax.swing.JEditorPane)

Example 30 with JEditorPane

use of javax.swing.JEditorPane in project knime-core by knime.

the class DBAggregationFunctionProvider method getDescriptionPane.

/**
 * {@inheritDoc}
 */
@Override
public JComponent getDescriptionPane() {
    final StringBuilder buf = getHTMLDescription();
    final JEditorPane editorPane = new JEditorPane("text/html", buf.toString());
    editorPane.setEditable(false);
    final JScrollPane scrollPane = new JScrollPane(editorPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    return scrollPane;
}
Also used : JScrollPane(javax.swing.JScrollPane) JEditorPane(javax.swing.JEditorPane)

Aggregations

JEditorPane (javax.swing.JEditorPane)60 JScrollPane (javax.swing.JScrollPane)22 Dimension (java.awt.Dimension)12 JPanel (javax.swing.JPanel)12 IOException (java.io.IOException)11 JButton (javax.swing.JButton)11 JLabel (javax.swing.JLabel)11 JFrame (javax.swing.JFrame)10 GridBagLayout (java.awt.GridBagLayout)9 GridBagConstraints (java.awt.GridBagConstraints)8 JDialog (javax.swing.JDialog)7 HyperlinkEvent (javax.swing.event.HyperlinkEvent)6 BorderLayout (java.awt.BorderLayout)5 JTextField (javax.swing.JTextField)5 HyperlinkListener (javax.swing.event.HyperlinkListener)5 StyledEditorKit (javax.swing.text.StyledEditorKit)5 JCheckBox (javax.swing.JCheckBox)4 JSplitPane (javax.swing.JSplitPane)4 JTree (javax.swing.JTree)4 Component (java.awt.Component)3