Java Code Examples for com.alee.managers.tooltip.TooltipManager#setTooltip()

The following examples show how to use com.alee.managers.tooltip.TooltipManager#setTooltip() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ComponentUtils.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
void setStatus(boolean isEncrypted, boolean canEncrypt) {
    mEncryptionIcon.setIcon(isEncrypted ? ICON_SECURE : ICON_INSECURE);
    mEncryptionWarningIcon.setVisible(isEncrypted != canEncrypt);

    String text = "<html>" + (isEncrypted ?
                                      Tr.tr("Encryption enabled") :
                                      Tr.tr("Encryption disabled"));
    if (isEncrypted && !canEncrypt) {
        text += "<br>" + Tr.tr("The contact's public key is missing");
    } else if (!isEncrypted && canEncrypt) {
        text += "<br>" + Tr.tr("Encryption can be activated");
    }
    TooltipManager.setTooltip(this, text + "</html>");
}
 
Example 2
Source File: WebToggleButton.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, tooltip, tooltipWay, delay );
}
 
Example 3
Source File: WebToggleButton.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip )
{
    return TooltipManager.setTooltip ( this, tooltip );
}
 
Example 4
Source File: WebButton.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final String tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, tooltip, tooltipWay, delay );
}
 
Example 5
Source File: WebTristateCheckBox.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final String tooltip, final TooltipWay tooltipWay )
{
    return TooltipManager.setTooltip ( this, tooltip, tooltipWay );
}
 
Example 6
Source File: WebTristateCheckBox.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip )
{
    return TooltipManager.setTooltip ( this, icon, tooltip );
}
 
Example 7
Source File: WebMenuBar.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip, final TooltipWay tooltipWay )
{
    return TooltipManager.setTooltip ( this, tooltip, tooltipWay );
}
 
Example 8
Source File: WebTristateCheckBox.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip, final int delay )
{
    return TooltipManager.setTooltip ( this, tooltip, delay );
}
 
Example 9
Source File: WebCheckBox.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final String tooltip )
{
    return TooltipManager.setTooltip ( this, tooltip );
}
 
Example 10
Source File: WebSpinner.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, icon, tooltip, tooltipWay, delay );
}
 
Example 11
Source File: WebCheckBox.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, icon, tooltip, tooltipWay, delay );
}
 
Example 12
Source File: WebFormattedTextField.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, icon, tooltip, tooltipWay, delay );
}
 
Example 13
Source File: WebToggleButton.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip, final TooltipWay tooltipWay )
{
    return TooltipManager.setTooltip ( this, icon, tooltip, tooltipWay );
}
 
Example 14
Source File: WebProgressBar.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, tooltip, tooltipWay, delay );
}
 
Example 15
Source File: GuideWindow.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
public void init() {
		
		guideURL = getClass().getResource(Msg.getString("doc.guide")); //$NON-NLS-1$

		homeButton.setToolTipText(Msg.getString("GuideWindow.tooltip.home")); //$NON-NLS-1$
		homeButton.setSize(16, 16);
		homeButton.addActionListener(this);

		backButton.setToolTipText(Msg.getString("GuideWindow.tooltip.back")); //$NON-NLS-1$
		backButton.addActionListener(this);

		forwardButton.setToolTipText(Msg.getString("GuideWindow.tooltip.forward")); //$NON-NLS-1$
		forwardButton.addActionListener(this);

		// Create the main panel
		JPanel mainPane = new JPanel(new BorderLayout());
//		mainPane.setBorder(new MarsPanelBorder());
		setContentPane(mainPane);

		JPanel topPanel = new JPanel(new BorderLayout());
		mainPane.add(topPanel, BorderLayout.NORTH);
		
		// A toolbar to hold all our buttons
		JPanel homePanel = new JPanel(new FlowLayout(3, 3, FlowLayout.CENTER));
		topPanel.add(homePanel, BorderLayout.CENTER);
		
		homePanel.add(backButton);
		homePanel.add(homeButton);
		homePanel.add(forwardButton);
		
		JPanel linkPanel = new JPanel(new FlowLayout(3, 3, FlowLayout.TRAILING));
		topPanel.add(linkPanel, BorderLayout.EAST);
		
//		link = new WebLink(StyleId.linkShadow, new SvgIcon("github19"), WIKI_TEXT, new UrlLinkAction(WIKI_URL));
		link = new WebLink(StyleId.linkShadow, new UrlLinkAction(WIKI_URL));
//		link = new WebLink(StyleId.linkShadow, WIKI_TEXT, new UrlLinkAction(WIKI_URL));
		link.setAlignmentY(1f);
		link.setText(WIKI_TEXT);
//		link.setIcon(new SvgIcon("github.svg")); // github19
		TooltipManager.setTooltip(link, "Open mars-sim wiki in GitHub", TooltipWay.down);
		linkPanel.add(link);

		// Initialize the status bar
		mainPane.add(initializeStatusBar(),  BorderLayout.SOUTH);

		htmlPane = new HTMLContentPane();
		htmlPane.addHyperlinkListener(this);
		htmlPane.goToURL(guideURL);
		htmlPane.setContentType("text/html");
		htmlPane.setBackground(Color.lightGray);
		htmlPane.setBorder(new EmptyBorder(2, 2, 2, 2));

		JScrollPane scrollPane = new JScrollPane(htmlPane);
//		scrollPane.setBorder(new MarsPanelBorder());
		viewPort = (JViewport) scrollPane.getViewport();
//		viewPort.addComponentListener(this);
		viewPort.setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);
		
		mainPane.add(scrollPane,  BorderLayout.CENTER);
		
		updateButtons();
		
		setResizable(false);
		setMaximizable(true);
		setVisible(true);
	
		setSize(new Dimension(800, 600));
//		setMinimumSize(new Dimension(320, 320));
//		setPreferredSize(new Dimension(800, 600));
//		setMaximumSize(new Dimension(1280, 600));
		
		Dimension desktopSize = desktop.getMainWindow().getFrame().getSize();
		Dimension windowSize = getSize();
//		System.out.println("desktopSize.width : " + desktopSize.width);
//		System.out.println("desktopSize.height : " + desktopSize.height);
		int width = (desktopSize.width - windowSize.width) / 2;
		int height = (desktopSize.height - windowSize.height - 100) / 2;
		setLocation(width, height);
		
		// Pack window.
		// WARNING: this will shrink the window to one line tall in swing mode
//		pack(); 

	}
 
Example 16
Source File: TabPanelSponsorship.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
public void initializeUI() {
		uiDone = true;
		
		// Create general label panel.
		JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		topContentPanel.add(labelPanel);

		// Prepare general label
		JLabel titleLabel = new JLabel(Msg.getString("TabPanelSponsorship.label"), JLabel.CENTER); //$NON-NLS-1$
		titleLabel.setFont(new Font("Serif", Font.BOLD, 16));
		labelPanel.add(titleLabel);

		// Prepare spring layout info panel.
		JPanel infoPanel = new JPanel(new SpringLayout());//GridLayout(2, 2, 0, 0));
//		infoPanel.setBorder(new MarsPanelBorder());
		centerContentPanel.add(infoPanel, BorderLayout.NORTH);

		// Prepare sponsor name label
		JLabel sponsorNameLabel = new JLabel(Msg.getString("TabPanelSponsorship.sponsor"), JLabel.RIGHT); //$NON-NLS-1$
		//sponsorNameLabel.setSize(2, 2);
		infoPanel.add(sponsorNameLabel);

		// Prepare sponsor label
		JTextField sponsorTF = new JTextField();
		ReportingAuthorityType sponsor = null;
		if (person.getReportingAuthority() != null) {
		    sponsor = person.getReportingAuthority().getOrg();
		    sponsorTF.setText(sponsor+""); // Conversion.capitalize(sponsor)
		}
		sponsorTF.setEditable(false);
		sponsorTF.setColumns(8);
		sponsorTF.setCaretPosition(0);
		if (person.getReportingAuthority() != null) {
			TooltipManager.setTooltip (sponsorTF, person.getReportingAuthority().getToolTipStr(), TooltipWay.down);
		}
		infoPanel.add(sponsorTF);


		// Prepare birth location name label
		JLabel objectiveNameLabel = new JLabel(Msg.getString("TabPanelSponsorship.objective"), JLabel.RIGHT); //$NON-NLS-1$
		//objectiveNameLabel.setSize(2, 2);
		infoPanel.add(objectiveNameLabel);

		// Prepare birth location label
		String objective = null;
		JTextField objectiveTF = new JTextField();
		if (person.getReportingAuthority() != null) {
			objective = person.getReportingAuthority().getMissionAgenda().getObjectiveName();
		}
		//JLabel objectiveLabel = new JLabel(objective, JLabel.RIGHT);
		objectiveTF.setText(Conversion.capitalize(objective));
		objectiveTF.setEditable(false);
		objectiveTF.setColumns(16);
		objectiveTF.setCaretPosition(0);
		infoPanel.add(objectiveTF);

		//Lay out the spring panel.
		SpringUtilities.makeCompactGrid(infoPanel,
		                                2, 2, //rows, cols
		                                20, 10,        //initX, initY
		                                10, 10);       //xPad, yPad
	}
 
Example 17
Source File: WebRadioButton.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, tooltip, tooltipWay, delay );
}
 
Example 18
Source File: WebSplitButton.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final JComponent tooltip, final int delay )
{
    return TooltipManager.setTooltip ( this, tooltip, delay );
}
 
Example 19
Source File: WebPanel.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip )
{
    return TooltipManager.setTooltip ( this, icon, tooltip );
}
 
Example 20
Source File: WebComponent.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
@Override
public WebCustomTooltip setToolTip ( final Icon icon, final String tooltip, final TooltipWay tooltipWay, final int delay )
{
    return TooltipManager.setTooltip ( this, icon, tooltip, tooltipWay, delay );
}