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


Java JideButton.setToolTipText方法代码示例

本文整理汇总了Java中com.jidesoft.swing.JideButton.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java JideButton.setToolTipText方法的具体用法?Java JideButton.setToolTipText怎么用?Java JideButton.setToolTipText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jidesoft.swing.JideButton的用法示例。


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

示例1: LevelsPanel

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
public LevelsPanel(ImageLayer layer) {
    double offset = layer.getGLImage().getBrightOffset();
    double scale = layer.getGLImage().getBrightScale();
    int high = (int) (100 * (offset + scale));

    slider = new RangeSlider(-101, 201, (int) (offset * 100), high);
    slider.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
                slider.setLowValue(0);
                slider.setHighValue(100);
            }
        }
    });
    slider.setRangeDraggable(true);
    label = new JLabel(format(slider.getLowValue(), slider.getHighValue()), JLabel.RIGHT);
    slider.addChangeListener(e -> {
        int lo = slider.getLowValue();
        int hi = slider.getHighValue();
        layer.getGLImage().setBrightness(lo / 100., (hi - lo) / 100.);
        label.setText(format(lo, hi));
        Displayer.display();
    });
    WheelSupport.installMouseWheelSupport(slider);

    autoButton = new JideButton(Buttons.brightness);
    autoButton.setToolTipText("Auto brightness");
    autoButton.addActionListener(e -> {
        slider.setLowValue(0);
        slider.setHighValue((int) (layer.getAutoBrightness() * 100));
    });

    buttonPanel = new JPanel(new BorderLayout());
    buttonPanel.add(label, BorderLayout.LINE_START);
    buttonPanel.add(autoButton, BorderLayout.LINE_END);
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:38,代码来源:LevelsPanel.java

示例2: getURLButton

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
/**
 * Create a button that opens a URL in a web browser when clicked.
 * @param buttonText Button text
 * @param baseURL URL linked from the button
 * @param appendToURL Append text to the URL
 * @param doEncode encode the text using the UTF-8
 * @return a JideButton that opens the URL in a web browser
 */
private JideButton getURLButton(String buttonText, final String baseURL, 
	final String appendToURL, final boolean doEncode) {
	
	final String URL_CHARSET = "UTF-8";
	
	JideButton urlButton= new JideButton(buttonText);
	urlButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
	urlButton.setForeground(Color.BLUE);
	urlButton.setToolTipText("Lookup " + buttonText + " on the web");
	urlButton.addActionListener(new ActionListener() 
	{
		@Override
		public void actionPerformed(ActionEvent ae) {
			try {
				URL url;
				if (doEncode)
					url = new URL(baseURL + URLEncoder.encode(appendToURL, URL_CHARSET));
				else
					url = new URL(baseURL + appendToURL);
				
				java.awt.Desktop.getDesktop().browse(url.toURI());
			} catch (Exception ex) {
				ClientMiscUtils.reportError("Problem launching website: %s", ex);
			}
		}
	});
	
	return urlButton;
}
 
开发者ID:BaderLab,项目名称:pharmacogenomics,代码行数:38,代码来源:PGXPanel.java

示例3: CameraOptionsPanel

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
public CameraOptionsPanel(JSONObject jo) {
    setLayout(new GridBagLayout());

    GridBagConstraints c = new GridBagConstraints();
    c.anchor = GridBagConstraints.CENTER;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;
    c.weighty = 1;
    c.gridx = 0;
    c.gridy = 0;

    JPanel radioPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
    radioPanel.add(new JLabel("View", JLabel.RIGHT));
    for (CameraMode mode : CameraMode.values()) {
        JRadioButton radio = mode.radio;
        if (mode == CameraMode.Observer)
            radio.setSelected(true);
        radio.addItemListener(e -> {
            if (radio.isSelected())
                changeCamera(mode);
        });
        radioPanel.add(radio);
        modeGroup.add(radio);
    }
    add(radioPanel, c);

    JideButton info = new JideButton(Buttons.info);
    info.setToolTipText("Show viewpoint info");
    info.addActionListener(e -> new TextDialog("Viewpoint options information", explanation, false).showDialog());

    c.gridx = 1;
    c.weightx = 0;
    add(info, c);

    // create panels before potential camera change
    JSONObject joExpert = null;
    JSONObject joEquatorial = null;
    if (jo != null) {
        joExpert = jo.optJSONObject("expert");
        joEquatorial = jo.optJSONObject("equatorial");
    }
    expertOptionPanel = new CameraOptionPanelExpert(joExpert, UpdateViewpoint.expert, "HEEQ", true);
    equatorialOptionPanel = new CameraOptionPanelExpert(joEquatorial, UpdateViewpoint.equatorial, "HEEQ", false);

    double fovMin = 0, fovMax = 180;
    if (jo != null) {
        fovAngle = MathUtils.clip(jo.optDouble("fovAngle", fovAngle), fovMin, fovMax);
        try {
            CameraMode.valueOf(jo.optString("mode")).radio.setSelected(true);
        } catch (Exception ignore) {
        }
        JSONObject jc = jo.optJSONObject("camera");
        if (jc != null)
            Displayer.getCamera().fromJson(jc);
    }

    JPanel fovPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
    fovPanel.add(new JLabel("FOV angle", JLabel.RIGHT));

    JSpinner fovSpinner = new JSpinner(new SpinnerNumberModel(Double.valueOf(fovAngle), Double.valueOf(fovMin), Double.valueOf(fovMax), Double.valueOf(0.01)));
    fovSpinner.setMaximumSize(new Dimension(6, 22));
    fovSpinner.addChangeListener(e -> {
        fovAngle = (Double) fovSpinner.getValue();
        Displayer.display();
    });

    JFormattedTextField f = ((JSpinner.DefaultEditor) fovSpinner.getEditor()).getTextField();
    f.setFormatterFactory(new TerminatedFormatterFactory("%.2f", "\u00B0", fovMin, fovMax));

    WheelSupport.installMouseWheelSupport(fovSpinner);
    fovPanel.add(fovSpinner);

    c.weightx = 1;
    c.gridx = 0;
    c.gridy = 1;
    add(fovPanel, c);

    ComponentUtils.smallVariant(this);
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:80,代码来源:CameraOptionsPanel.java

示例4: RunningDifferencePanel

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
public RunningDifferencePanel(ImageLayer layer) {
    ButtonGroup modeGroup = new ButtonGroup();
    for (GLImage.DifferenceMode mode : GLImage.DifferenceMode.values()) {
        JRadioButton item = new JRadioButton(mode.toString());
        if (mode == layer.getGLImage().getDifferenceMode())
            item.setSelected(true);
        item.addActionListener(e -> {
            layer.getGLImage().setDifferenceMode(mode);
            Displayer.display();
        });
        modeGroup.add(item);
        modePanel.add(item);
    }

    JideButton metaButton = new JideButton(Buttons.info);
    metaButton.setToolTipText("Show metadata of selected layer");
    metaButton.addActionListener(e -> {
        MetaDataDialog dialog = new MetaDataDialog(layer);
        dialog.showDialog();
    });

    downloadButton.setToolTipText("Download selected layer");
    downloadButton.addActionListener(e -> {
        if (downloadButton.isSelected()) {
            Insets margin = downloadButton.getMargin();
            if (margin == null) // satisfy coverity
                margin = new Insets(0, 0, 0, 0);
            Dimension size = downloadButton.getSize(null);
            progressBar.setPreferredSize(new Dimension(size.width - margin.left - margin.right, size.height - margin.top - margin.bottom));

            downloadButton.setText(null);
            downloadButton.add(progressBar);
            downloadButton.setToolTipText("Stop download");

            layer.startDownloadView();
        } else
            layer.stopDownloadView();
    });

    progressBar.setUI(new CircularProgressUI());
    progressBar.setForeground(downloadButton.getForeground());

    buttonPanel.add(metaButton);
    buttonPanel.add(downloadButton);
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:46,代码来源:RunningDifferencePanel.java

示例5: toolButton

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
private static JideButton toolButton(ButtonText text) {
    JideButton b = new JideButton(text.toString());
    b.setToolTipText(text.tip);
    return b;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:6,代码来源:TopToolBar.java

示例6: BandOptionPanel

import com.jidesoft.swing.JideButton; //导入方法依赖的package包/类
BandOptionPanel(Band band) {
    setLayout(new GridBagLayout());

    GridBagConstraints c = new GridBagConstraints();
    c.gridy = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.NONE;

    c.gridx = 0;
    c.anchor = GridBagConstraints.WEST;
    JButton pickColor = new JButton("Line color");
    pickColor.setMargin(new Insets(0, 0, 0, 0));
    pickColor.setToolTipText("Change the color of the current line");
    pickColor.addActionListener(e -> {
        Color newColor = JColorChooser.showDialog(ImageViewerGui.getMainFrame(), "Choose Line Color", band.getDataColor());
        if (newColor != null) {
            band.setDataColor(newColor);
        }
    });
    add(pickColor, c);

    c.gridx = 1;
    c.anchor = GridBagConstraints.EAST;
    JButton availabilityButton = new JButton("Available data");
    availabilityButton.addActionListener(e -> JHVGlobals.openURL(TimelineSettings.availabilityURL + '#' + band.getBandType().getName()));
    add(availabilityButton, c);

    c.gridx = 2;
    c.anchor = GridBagConstraints.EAST;
    JideButton downloadButton = new JideButton(Buttons.download);
    downloadButton.setToolTipText("Download selected layer");
    downloadButton.addActionListener(e -> {
        String fileName = JHVDirectory.REMOTEFILES.getPath() + band.getBandType().getName() + "__" + TimeUtils.formatFilename(System.currentTimeMillis()) + ".json";
        JSONObject jo = band.toJson();

        new Thread(() -> {
            try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(fileName), StandardCharsets.UTF_8)) {
                jo.write(writer);
                EventQueue.invokeLater(() -> JHVGlobals.displayNotification(fileName));
            } catch (Exception ex) {
                Log.error("Failed to write JSON: " + ex);
            }
        }).run();
    });
    add(downloadButton, c);

    ComponentUtils.smallVariant(this);
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:50,代码来源:BandOptionPanel.java


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