Search in sources :

Example 56 with JEditorPane

use of javax.swing.JEditorPane in project vcell by virtualcell.

the class LoginPanel method getDtrpnUseThisLink.

private JEditorPane getDtrpnUseThisLink() {
    if (dtrpnUseThisLink == null) {
        dtrpnUseThisLink = new JEditorPane();
        dtrpnUseThisLink.setBorder(null);
        dtrpnUseThisLink.setBackground(getBackground());
        dtrpnUseThisLink.setFont(new Font("Arial", Font.BOLD, 14));
        dtrpnUseThisLink.setContentType("text/html");
        String s = "<html><body bgcolor=\"#" + Hex.toString(new byte[] { (byte) (getBackground().getRed() & 0xFF), (byte) (getBackground().getGreen() & 0xFF), (byte) (getBackground().getBlue() & 0xFF) }) + "\"><font size=5 face=Arial>Use <a href=\"http://vcell.org/vcell_models/how_submit_publication.html\">this link</a> for details on how to<br>acknowledge Virtual Cell in your<br>publication and how to share your<br>published research through<br>the VCell database.</font></body></html>";
        // System.out.println(s);
        dtrpnUseThisLink.setText(s);
        dtrpnUseThisLink.setEditable(false);
        dtrpnUseThisLink.addHyperlinkListener(new HyperlinkListener() {

            @Override
            public void hyperlinkUpdate(HyperlinkEvent e) {
                if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                    DialogUtils.browserLauncher(LoginPanel.this, e.getURL().toString(), "Please visit " + "http://vcell.org" + " for Online Help");
                }
            }
        });
    }
    return dtrpnUseThisLink;
}
Also used : HyperlinkEvent(javax.swing.event.HyperlinkEvent) HyperlinkListener(javax.swing.event.HyperlinkListener) JEditorPane(javax.swing.JEditorPane) Font(java.awt.Font)

Example 57 with JEditorPane

use of javax.swing.JEditorPane in project suite by stupidsing.

the class EditorController method format.

public void format() {
    JEditorPane editor = view.getEditor();
    Node node = Suite.parse(editor.getText());
    editor.setText(new PrettyPrinter().prettyPrint(node));
}
Also used : PrettyPrinter(suite.node.pp.PrettyPrinter) Node(suite.node.Node) JEditorPane(javax.swing.JEditorPane)

Example 58 with JEditorPane

use of javax.swing.JEditorPane in project suite by stupidsing.

the class EditorController method run.

private void run(Iterate<String> fun) {
    JEditorPane editor = view.getEditor();
    String selectedText = editor.getSelectedText();
    String text = selectedText != null ? selectedText : editor.getText();
    if (runThread == null || !runThread.isAlive())
        runThread = Thread_.startThread(() -> {
            view.showMessageRunning();
            view.showMessage(fun.apply(text));
            view.getEditor().requestFocusInWindow();
        });
    else
        JOptionPane.showMessageDialog(view.getFrame(), "Previous evaluation in progress");
}
Also used : JEditorPane(javax.swing.JEditorPane)

Example 59 with JEditorPane

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

the class OneWayANOVANodeView 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_leveneStatPane = new JEditorPane("text/html", "");
    m_leveneStatPane.setEditable(false);
    p.add(m_leveneStatPane, 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 60 with JEditorPane

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

the class TwoSampleTTestNodeView 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_leveneStatPane = new JEditorPane("text/html", "");
    m_leveneStatPane.setEditable(false);
    p.add(m_leveneStatPane, 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)

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