Examples of JXHyperlink


Examples of org.jdesktop.swingx.JXHyperlink

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                removeAll();
                for (int i = 0; i < height; i++) {
                    JXHyperlink label = new JXHyperlink();
                    label.setText("Level " + i);
                    if (i == lvl) {
                        label.setFont(label.getFont().deriveFont(Font.BOLD));
                    }
                    label.putClientProperty(LABEL_KEY, new Integer(i));
                    label.addActionListener(LevelPanel.this);
                    add(label, "wrap");
                }
            }
        });
    }

Examples of org.jdesktop.swingx.JXHyperlink

    private void initAction() {
        openAction = new AbstractAction("", ImageUtilities.loadImageIcon("org/gephi/desktop/welcome/resources/gephifile20.png", false)) {

            public void actionPerformed(ActionEvent e) {
                JXHyperlink link = (JXHyperlink) e.getSource();
                File file = (File) link.getClientProperty(LINK_PATH);
                FileObject fileObject = FileUtil.toFileObject(file);
                if (fileObject.hasExt(GEPHI_EXTENSION)) {
                    ProjectControllerUI pc = Lookup.getDefault().lookup(ProjectControllerUI.class);
                    try {
                        pc.openProject(file);

Examples of org.jdesktop.swingx.JXHyperlink

        migLayout1.setColumnConstraints("[pref]");
        recentPanel.setLayout(migLayout1);

        MostRecentFiles mru = Lookup.getDefault().lookup(MostRecentFiles.class);
        for (String filePath : mru.getMRUFileList()) {
            JXHyperlink fileLink = new JXHyperlink(openAction);
            File file = new File(filePath);
            if (file.exists()) {
                fileLink.setText(file.getName());
                fileLink.putClientProperty(LINK_PATH, file);
                recentPanel.add(fileLink, "wrap");
            }
        }
    }

Examples of org.jdesktop.swingx.JXHyperlink

                String s = samplePath[i];
                String tooltip = sampleTooltip[i];
                final InputStream stream = WelcomeTopComponent.class.getResourceAsStream(s);
                String fileName = s.substring(s.lastIndexOf('/') + 1, s.length());
                final String importer = fileName.substring(fileName.lastIndexOf('.'), fileName.length());
                JXHyperlink fileLink = new JXHyperlink(new AbstractAction() {

                    public void actionPerformed(ActionEvent e) {
                        try {
                            stream.reset();
                        } catch (IOException ex) {
                            //Exceptions.printStackTrace(ex);
                        }
                        ImportControllerUI importController = Lookup.getDefault().lookup(ImportControllerUI.class);
                        importController.importStream(stream, importer);
                        WelcomeTopComponent.this.close();
                    }
                });
                fileLink.setText(fileName);
                fileLink.setToolTipText(tooltip);
                fileLink.putClientProperty(LINK_PATH, importer);
                samplesPanel.add(fileLink, "wrap");
            }
        } catch (Exception ex) {
            Exceptions.printStackTrace(ex);
        }

Examples of org.jdesktop.swingx.JXHyperlink

        graph.readUnlock();

        //Level links   
        for (int i = 0; i < levelSize.length; i++) {

            JXHyperlink link = new JXHyperlink();
            link.setClickedColor(new java.awt.Color(0, 51, 255));
            link.setText(levelStr + " " + i + " (" + levelSize[i] + " " + nodesStr + ")");
            link.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
            final int lvl = i;
            link.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
                    HierarchicalGraph graph = model.getHierarchicalGraphVisible();
                    graph.resetViewToLevel(lvl);
                }
            });
            GridBagConstraints gdc = new GridBagConstraints(0, i, 1, 1, 1, 0, GridBagConstraints.PAGE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 4, 0, 0), 0, 0);
            levelViewPanel.add(link, gdc);
        }

        //Leaves
        JXHyperlink link = new JXHyperlink();
        link.setClickedColor(new java.awt.Color(0, 51, 255));
        link.setText(leavesStr);
        link.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
        link.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
                HierarchicalGraph graph = model.getHierarchicalGraphVisible();
                graph.resetViewToLeaves();

Examples of org.jdesktop.swingx.JXHyperlink

    panelEast.add(new Label());
    panelEast.add(new Label("Stefan Laubenberger"));
    panelEast.add(new Label("Bullingerstrasse 53"));
    panelEast.add(new Label("CH-8004 Zürich"));
    panelEast.add(new Label());
    final JXHyperlink link = new JXHyperlink();
    final JXHyperlink mail = new JXHyperlink();
    try {
      link.setURI(new URI(HelperResource.URL));
      mail.setURI(new URI(HelperResource.MAIL));
    } catch (URISyntaxException ex) {
      //should never happen!
      log.error("Invalid URI", ex); //$NON-NLS-1$
    }
    panelEast.add(link);

Examples of org.jdesktop.swingx.JXHyperlink

    private void createHyperlinkDemo() {
        JXTitledSeparator simple = new JXTitledSeparator();
        simple.setName("simpleSeparator");
       
        plainBrowse = new JXHyperlink();
        plainBrowse.setName("plainBrowse");
       
        plainMail = new JXHyperlink();
        plainMail.setName("plainMail");
       
        customBrowse = new JXHyperlink();
        customBrowse.setName("customBrowse");
       
        JXTitledSeparator custom = new JXTitledSeparator();
        custom.setName("customSeparator");
        customLink = new JXHyperlink();
        customLink.setName("customLink");
       
        JComponent standaloneLinks = new JXPanel(new VerticalLayout(20));
        standaloneLinks.add(simple);
        standaloneLinks.add(plainBrowse);

Examples of org.jdesktop.swingx.JXHyperlink

        totd = new JXTipOfTheDay(model);
        totd.setName("totd");
        panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        panel.add(totd);

        nextTipLink = new JXHyperlink();
        nextTipLink.setName("nextTipLink");
        panel.add(nextTipLink, BorderLayout.SOUTH);
        add(panel);
       
        dialogLink = new JXHyperlink();
        dialogLink.setName("dialogLink");
        add(dialogLink, BorderLayout.SOUTH);
    }

Examples of org.jdesktop.swingx.JXHyperlink

   */
  private JXHyperlink createLink(String url, String toolTip){
   
    HtmlLinkAction action = new HtmlLinkAction(url);   
    //JXHyperlink is special Component offered by Swingx library
    JXHyperlink link = new JXHyperlink(action);
    link.setToolTipText(toolTip);
   
    return link;
  }

Examples of org.jdesktop.swingx.JXHyperlink

        public void actionPerformed(ActionEvent e) {
          SystemHelper.openUrl(content);
          setVisited(true);
        }
      };
      link = new JXHyperlink(linkAction);
    }
    element = link;
  }
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.