本文整理汇总了Java中com.jidesoft.swing.JideButton类的典型用法代码示例。如果您正苦于以下问题:Java JideButton类的具体用法?Java JideButton怎么用?Java JideButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JideButton类属于com.jidesoft.swing包,在下文中一共展示了JideButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: BottomPanel
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
BottomPanel() {
// set basic layout
setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));
// set up button
JideButton dateButton = new JideButton("Today is " + dateFormat.format(new Date()));
// set the calendar component to the current date
dateButton.addActionListener(e -> {
changeDisplayMode(DisplayMode.DAYS);
setDate(new Date());
});
// add label to component
add(dateButton);
}
示例3: 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;
}
示例4: showToolbarItemText
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
/**
* Shows / hides the text of all toolbar items
* @param show true to show, false to hide the text
*/
private void showToolbarItemText(boolean show) {
if (((JideButton) toolBar.getComponent(0)).getHideActionText() == show) {
for (Component component : toolBar.getComponents()) {
if (component instanceof JideButton) {
((JideButton) component).setHideActionText(!show);
}
else if (component instanceof JLabel) {
component.setVisible(show);
}
}
toolBar.revalidate();
}
}
示例5: addToToolbar
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
/**
* Adds a new JideButton with the specified action at the specified index to the toolbar.
*
* @param action the action
* @param index the index
*/
public void addToToolbar(Action action, int index) {
JideButton button = new JideButton(action);
button.setVerticalTextPosition(SwingConstants.BOTTOM);
button.setHorizontalTextPosition(SwingConstants.CENTER);
toolBar.add(button, index);
}
示例6: DataSourceEditorController
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
/**
* Instantiates a new DataSourceEditorController.
*
* @param contentPane The window's content pane
* @param listener The property change listener
*/
public DataSourceEditorController(DataSourceEditor contentPane, PropertyChangeListener listener) {
this.listener = listener;
cloneAction = new CloneAction(listener);
deleteAction = new DeleteAction(listener);
this.contentPane = contentPane;
JideButton addButton = new JideButton(new NewAction(listener));
addButton.setHideActionText(true);
contentPane.getListButtonPane().add(addButton);
JideButton cloneButton = new JideButton(cloneAction);
cloneButton.setHideActionText(true);
contentPane.getListButtonPane().add(cloneButton);
JideButton deleteButton = new JideButton(deleteAction);
deleteButton.setHideActionText(true);
contentPane.getListButtonPane().add(deleteButton);
glyphRendererLabels.add(DataSource.GLYPH_BITMAP_RENDERER);
glyphRendererLabels.add(DataSource.GLYPH_VECTOR_RENDERER);
glyphRendererLabels.add(DataSource.GLYPH_SCALED_VECTOR_RENDERER);
contentPane.setFormEnabled(false);
for (String glyphRendererLabel : glyphRendererLabels) {
contentPane.getGlyphRendererCombo().addItem(glyphRendererLabel);
}
contentPane.getGlyphRendererCombo().setSelectedItem(null);
}
示例7: createCancelButton
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
public AbstractButton createCancelButton(){
IconSource iconSource = (IconSource)ApplicationServicesLocator.services().getService(IconSource.class);
MessageSource messageSource = (MessageSource)ApplicationServicesLocator.services().getService(MessageSource.class);
AbstractAction action = new AbstractAction(null, iconSource.getIcon(CANCEL_ICON)){
public void actionPerformed(ActionEvent event) {
CancelCallback callback = getCancelCallback();
if(callback != null){
callback.cancelPerformed();
}
}
};
AbstractButton button = new JideButton(action);
button.setToolTipText(messageSource.getMessage(CANCEL_TOOLTIP, new Object[]{}, Locale.getDefault()));
return button;
}
示例8: 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);
}
示例9: 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);
}
示例10: 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;
}
示例11: addButton
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
private void addButton(JideButton b) {
b.setFocusPainted(false);
add(b);
}
示例12: 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);
}
示例13: initialize
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
private void initialize() {
setBackground(new Color(240, 240, 240));
Color messageBG = new Color(230, 230, 230);
Font messageFont = FontManager.getFont(11);
setMinimumSize(new Dimension(200, 20));
setPreferredSize(new Dimension(800, 20));
JideBoxLayout layout = new JideBoxLayout(this, JideBoxLayout.X_AXIS);
layout.setGap(3);
setLayout(layout);
messageBox = createMessageField(messageBG, messageFont);
messageBox.setMinimumSize(new Dimension(135, 10));
messageBox.setPreferredSize(new Dimension(135, 20));
add(messageBox, JideBoxLayout.FIX);
if (Globals.isDevelopment()) {
cancelButton = new JideButton(IconFactory.getInstance().getIcon(IconFactory.IconID.CLOSE));
cancelButton.setMinimumSize(new Dimension(20, 10));
cancelButton.setPreferredSize(new Dimension(20, 20));
cancelButton.setBorder(BorderFactory.createLineBorder(Color.black));
add(cancelButton, JideBoxLayout.FIX);
}
messageBox2 = createMessageField(messageBG, messageFont);
messageBox2.setMinimumSize(new Dimension(150, 10));
messageBox2.setPreferredSize(new Dimension(150, 20));
add(messageBox2, JideBoxLayout.FIX);
messageBox3 = createMessageField(messageBG, messageFont);
messageBox3.setMinimumSize(new Dimension(165, 10));
messageBox3.setPreferredSize(new Dimension(165, 20));
add(messageBox3, JideBoxLayout.VARY);
memoryStatus = createMessageField(messageBG, messageFont);
memoryStatus.setPreferredSize(new Dimension(100, 20));
memoryStatus.setMinimumSize(new Dimension(100, 10));
memoryStatus.setBackground(messageBG);
add(memoryStatus, JideBoxLayout.FIX);
MemoryUpdateTask updateTask = new MemoryUpdateTask(memoryStatus);
timer = new java.util.Timer();
timer.schedule(updateTask, 0, 1000);
}
示例14: GoToPanel
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
public GoToPanel(SuperAdapter superAdapter) {
super();
this.hic = superAdapter.getHiC();
this.superAdapter = superAdapter;
JLabel goLabel = new JLabel("Goto");
goLabel.setHorizontalAlignment(SwingConstants.CENTER);
JPanel goLabelPanel = new JPanel();
goLabelPanel.setBackground(HiCGlobals.backgroundColor);
goLabelPanel.setLayout(new BorderLayout());
goLabelPanel.add(goLabel, BorderLayout.CENTER);
positionChrTop = initializeGoToTextField();
positionChrLeft = initializeGoToTextField();
JPanel goPositionPanel = new JPanel();
goPositionPanel.setLayout(new BorderLayout());
goPositionPanel.add(positionChrTop, BorderLayout.PAGE_START);
goPositionPanel.add(positionChrLeft, BorderLayout.PAGE_END);
goButton = new JideButton();
goButton.setEnabled(false);
goButton.setIcon(new ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Refresh24.gif")));
goButton.addActionListener(this);
JPanel goButtonPanel = new JPanel();
goButtonPanel.setBackground(HiCGlobals.diffGrayColor);
goButtonPanel.setLayout(new BoxLayout(goButtonPanel, BoxLayout.X_AXIS));
goButtonPanel.add(goPositionPanel, BorderLayout.PAGE_START);
goButtonPanel.add(goButton);
setBackground(HiCGlobals.diffGrayColor);
setBorder(LineBorder.createGrayLineBorder());
setLayout(new BorderLayout());
add(goLabelPanel, BorderLayout.PAGE_START);
add(goButtonPanel);
setMinimumSize(new Dimension(100, 70));
setPreferredSize(new Dimension(120, 70));
setMaximumSize(new Dimension(200, 70));
}
示例15: CategoryPanel
import com.jidesoft.swing.JideButton; //导入依赖的package包/类
public CategoryPanel(String name, List<ResourceLocator> locatorList, Set<String> loadedTrackNames) {
expanded = true;
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
setAlignmentX(LEFT_ALIGNMENT);
//setLayout(null);
labelBar = new JPanel();
//labelBar.setBackground(Color.blue);
labelBar.setLayout(new BoxLayout(labelBar, BoxLayout.X_AXIS));
labelBar.setBorder(BorderFactory.createRaisedBevelBorder()); // new LabelBorder(Color.black));
labelBar.setAlignmentX(LEFT_ALIGNMENT);
JideButton toggleButton = new JideButton(expanded ? " - " : " + ");
toggleButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
labelBar.add(toggleButton);
labelBar.add(new JLabel(name));
this.add(labelBar);
listPanel = new JPanel();
listPanel.setLayout(new GridLayout(0, 4));
for (ResourceLocator loc : locatorList) {
final String trackName = loc.getTrackName();
JCheckBox cb = new JCheckBox(trackName);
cb.setSelected(loadedTrackNames.contains(trackName));
listPanel.add(cb);
}
this.add(listPanel);
toggleButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
expanded = !expanded;
listPanel.setVisible(expanded);
}
});
labelBar.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent mouseEvent) {
expanded = !expanded;
listPanel.setVisible(expanded);
}
});
}