当前位置: 首页>>代码示例>>Java>>正文


Java JXHyperlink类代码示例

本文整理汇总了Java中org.jdesktop.swingx.JXHyperlink的典型用法代码示例。如果您正苦于以下问题:Java JXHyperlink类的具体用法?Java JXHyperlink怎么用?Java JXHyperlink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JXHyperlink类属于org.jdesktop.swingx包,在下文中一共展示了JXHyperlink类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testHyperlinkProviderForeground

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
/**
 * Issue #840-swingx: hyperlink foreground unreadable for dark selection colors.
 * 
 * Test that selected foreground is same as table. 
 * 
 */
@Test
public void testHyperlinkProviderForeground() {
    JXTable table = new JXTable(20, 2);
    HyperlinkProvider provider = new HyperlinkProvider();
    JXHyperlink hyperlink = provider.getRendererComponent(null);
    Color unclicked = hyperlink.getUnclickedColor();
    table.setDefaultRenderer(Object.class, new DefaultTableRenderer(provider));
    table.prepareRenderer(table.getCellRenderer(0, 0), 0, 0);
    assertEquals("hyperlink foreground set to unclicked", unclicked, hyperlink.getForeground());
    table.setRowSelectionInterval(0, 0);
    // JW: had been failing before because I forgot to re-prepare :-)
    table.prepareRenderer(table.getCellRenderer(0, 0), 0, 0);
    assertEquals("hyperlink foreground set to table's selection foreground", 
            table.getSelectionForeground(), hyperlink.getForeground());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:RenderingTest.java

示例2: testToolTipManagerHyperlinkProvider

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
/**
 * Issue #790-swingx: rendering comps must not be registered with the
 * tooltip manager.
 * 
 * Here: Hyperlink in provider
 */
@Test
public void testToolTipManagerHyperlinkProvider() {
    AbstractHyperlinkAction<?> linkAction = new AbstractHyperlinkAction<Object>() {

        public void actionPerformed(ActionEvent e) {
            // do nothing
        }

        @Override
        protected void installTarget() {
            super.installTarget();
            setShortDescription(getName());
        }

    };
    HyperlinkProvider provider = new HyperlinkProvider(linkAction,
            Object.class);
    CellContext context = new TableCellContext();
    context.replaceValue("dummy");
    JXHyperlink label = provider.getRendererComponent(context);
    assertEquals("sanity - tooltip is set to value", "dummy", label
            .getToolTipText());
    assertToolTipManagerNotRegistered(label);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:31,代码来源:RenderingTest.java

示例3: createTipOfTheDayDemo

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private void createTipOfTheDayDemo() {
    model = createTipOfTheDayModel();

    JXPanel panel = new JXPanel(new VerticalLayout());
    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);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:TipOfTheDayDemo.java

示例4: PluginActionComponent

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
public PluginActionComponent(PluginInfo pluginInfo, String update) {
	super(new BorderLayout());
	this.pluginInfo = pluginInfo;
	this.update = update;
	this.state = State.DOWNLOADABLE;
	this.error = null;
	
	this.linkInstall = new JXHyperlink(new DownloadAction());
	this.linkError = new JXHyperlink(new ErrorAction());
	this.panelDownload = new DownloadPanel();
	this.lblMessage = new JLabel();
	
	this.linkInstall.setHorizontalTextPosition(SwingConstants.CENTER);
	this.linkError.setHorizontalTextPosition(SwingConstants.CENTER);
	this.linkError.setForeground(Color.red);
	
	this.add(this.linkInstall, BorderLayout.CENTER);
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:19,代码来源:PluginActionComponent.java

示例5: buildPanel

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private JPanel buildPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(6, 2, 3, 3));
    panel.add(new JLabel(resourceManager.getString("company.name.label")));
    panel.add(new JLabel(resourceManager.getString("company.name")));
    panel.add(new JLabel(resourceManager.getString("company.web.site.label")));
    JXHyperlink link = new JXHyperlink();
    try {
        link.setURI(new URI(resourceManager.getString("company.web.site")));
        panel.add(link);
    } catch (URISyntaxException e) {
        panel.add(new JLabel(resourceManager.getString("company.web.site")));
    }
    panel.add(new JLabel(resourceManager.getString("app.version.label")));
    panel.add(new JLabel(resourceManager.getString("app.version")));
    panel.add(new JLabel(resourceManager.getString("java.version.label")));
    panel.add(new JLabel(System.getProperty("java.version")));
    panel.add(new JLabel(resourceManager.getString("os.label")));
    panel.add(new JLabel(System.getProperty("os.name")));
    panel.add(new JLabel(resourceManager.getString("memory.usage")));
    panel.add(new JLabel(getMemoryUsage()));
    return panel;
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:24,代码来源:InfoDialog.java

示例6: openSurveyNotes

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private void openSurveyNotes(File file) {
	if (file == null || !file.exists()) {
		JXHyperlink searchDirsLink = new JXHyperlink(editSurveyScanPathsAction);
		searchDirsLink.setText("search directories");

		JPanel message = new JPanel(new FlowLayout());
		message.add(new JLabel("Couldn't find the file '" + file + "' in any of your "));
		message.add(searchDirsLink);
		message.add(new JLabel("(note: Breakout only searches " + SCANNED_NOTES_SEARCH_DEPTH +
				" levels deep)."));

		JOptionPane.showMessageDialog(mainPanel, message, "Can't find file", JOptionPane.ERROR_MESSAGE);

		return;
	}
	try {
		Desktop.getDesktop().open(file);
	} catch (Exception e) {
		logger.log(Level.SEVERE, "Failed to open survey notes", e);
		JOptionPane.showMessageDialog(mainPanel, "Failed to open file '" + file + "': " + e,
				"Error", JOptionPane.ERROR_MESSAGE);
	}
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:24,代码来源:BreakoutMainView.java

示例7: init

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private void init() {
	messageLabel = new JLabel();
	downloadProgressBar = new JProgressBar();
	downloadProgressBar.setPreferredSize(new Dimension(75, 15));
	downloadProgressBar.setMinimumSize(downloadProgressBar.getPreferredSize());
	downloadHyperlink = new JXHyperlink();
	checkForUpdateHyperlink = new JXHyperlink();
	localizer.setText(checkForUpdateHyperlink, "checkForUpdateHyperlink.text");
	detailsHyperlink = new JXHyperlink();
	detailsHyperlink.setAction(new DetailsAction());
	localizer.setText(detailsHyperlink, "detailsHyperlink.text");
	cancelDownloadHyperlink = new JXHyperlink();
	localizer.setText(cancelDownloadHyperlink, "cancelDownloadHyperlink.text");
	installHyperlink = new JXHyperlink();
	localizer.setText(installHyperlink, "installHyperlink.text");

	GridBagWizard g = GridBagWizard.create(this);
	g.defaults().autoinsets(new DefaultAutoInsets(5, 2));
	g.put(messageLabel, downloadHyperlink, detailsHyperlink, checkForUpdateHyperlink,
			cancelDownloadHyperlink, installHyperlink, downloadProgressBar).intoRow();
	g.put(downloadProgressBar).fillx(1.0);

	infoIcon = IconScaler.rescale(UIManager.getIcon("OptionPane.informationIcon"), 1000, 20);
	errorIcon = IconScaler.rescale(UIManager.getIcon("OptionPane.errorIcon"), 1000, 20);
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:26,代码来源:UpdateStatusPanel.java

示例8: getResearchGroupPanel

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private static JPanel getResearchGroupPanel(ResearchGroup group) {
	final JPanel toret = new JPanel();
	toret.setLayout(new BoxLayout(toret, BoxLayout.Y_AXIS));
	toret.setAlignmentX(CENTER_ALIGNMENT);
	toret.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7));

	final JLabel lblLogo = new JLabel(
			group.getLogo(), SwingConstants.CENTER);
	final JXHyperlink link = new JXHyperlink(
			new URLLinkAction(group.getLink()));
	
	link.setHorizontalAlignment(SwingConstants.CENTER);
	link.setFocusable(false);
	
	fixSize(lblLogo, FRAME_WIDTH, IMAGE_HEIGHT);
	Stream.of(group.getDescription()).forEach(
			label -> fixSize(label, FRAME_WIDTH, LINE_HEIGHT));
	fixSize(link, FRAME_WIDTH, LINE_HEIGHT);
	
	toret.add(lblLogo);
	Stream.of(group.getDescription()).forEach(toret::add);
	toret.add(link);
	
	lblLogo.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			AboutFrame.openURL(group.getLink());
		}
	});
	return toret;
}
 
开发者ID:sing-group,项目名称:la-images,代码行数:32,代码来源:AboutFrame.java

示例9: update

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
public void update() {
    removeAll();
    btn2win.clear();
    for (Iterator<Window> it = windows.iterator(); it.hasNext();) {
        Window window = it.next();
        JButton button = new JXHyperlink();
        button.setFocusable(false);
        button.setText(StringUtils.trimToEmpty(window.getCaption()));
        button.addActionListener(new ValidationAwareActionListener() {
            @Override
            public void actionPerformedAfterValidation(ActionEvent e) {
                JButton btn = (JButton) e.getSource();
                Window win = btn2win.get(btn);
                if (win != null) {
                    fireListeners(win);
                }
            }
        });

        btn2win.put(button, window);

        if (it.hasNext()) {
            add(button);
            JLabel separatorLab = new JLabel(">");
            add(separatorLab);
        } else {
            add(new JLabel(window.getCaption()));
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:31,代码来源:WindowBreadCrumbs.java

示例10: RowsCountComponent

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
public RowsCountComponent() {
    LC lc = new LC();
    lc.hideMode(2);
    lc.insetsAll("2");

    layout = new MigLayout(lc);
    if (LayoutAdapter.isDebug()) {
        lc.debug(1000);
    }
    setLayout(layout);

    firstButton = new JButton("<<");
    add(firstButton);
    firstButton.setPreferredSize(size);
    firstButton.setMinimumSize(size);

    prevButton = new JButton("<");
    add(prevButton);
    prevButton.setPreferredSize(size);
    prevButton.setMinimumSize(size);

    label = new JLabel();
    label.setMinimumSize(size);
    add(label);

    countButton = new JXHyperlink();
    countButton.setText("[?]");
    add(countButton);

    nextButton = new JButton(">");
    add(nextButton);
    nextButton.setPreferredSize(size);
    nextButton.setMinimumSize(size);

    lastButton = new JButton(">>");
    add(lastButton);
    lastButton.setPreferredSize(size);
    lastButton.setMinimumSize(size);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:40,代码来源:DesktopRowsCount.java

示例11: DesktopLink

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
public DesktopLink() {
    impl = new JXHyperlink();
    impl.setAction(new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            String targetUrl = DesktopLink.this.url;
            if (StringUtils.isNotEmpty(targetUrl)) {
                DesktopWindowManager wm = App.getInstance().getMainFrame().getWindowManager();
                wm.showWebPage(targetUrl, Collections.<String, Object>emptyMap());
            }
        }
    });
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:DesktopLink.java

示例12: createAction

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
@Override
public Component createAction(Action action) {
    JXHyperlink link = new JXHyperlink(action) {
        @Override
        public void updateUI() {
            super.updateUI();
            // ensure the ui of this link is correctly update on l&f changes
            configure(this);
        }
    };
    configure(link);
    return link;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:14,代码来源:BasicTaskPaneUI.java

示例13: configure

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
/**
 * Configures internally used hyperlink on new action creation and on every call to 
 * <code>updateUI()</code>.
 * @param link Configured hyperlink.
 */
protected void configure(JXHyperlink link) {
    link.setOpaque(false);
    link.setBorderPainted(false);
    link.setFocusPainted(true);
    link.setForeground(UIManager.getColor("TaskPane.titleForeground"));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:12,代码来源:BasicTaskPaneUI.java

示例14: createZoomLink

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private JXHyperlink createZoomLink() {
    JXHyperlink zoomOutLink = new JXHyperlink();
    Color textColor = new Color(16, 66, 104);
    zoomOutLink.setUnclickedColor(textColor);
    zoomOutLink.setClickedColor(textColor);
    zoomOutLink.setFocusable(false);
    return zoomOutLink;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:BasicCalendarHeaderHandler.java

示例15: createNavigationButton

import org.jdesktop.swingx.JXHyperlink; //导入依赖的package包/类
private AbstractButton createNavigationButton() {
    JXHyperlink b = new JXHyperlink();
    b.setContentAreaFilled(false);
    b.setBorder(BorderFactory.createEmptyBorder());
    b.setRolloverEnabled(true);
    b.setFocusable(false);
    return b;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:BasicCalendarHeaderHandler.java


注:本文中的org.jdesktop.swingx.JXHyperlink类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。