use of org.jivesoftware.spark.component.RolloverButton in project Spark by igniterealtime.
the class IncomingCallUI method addButtons.
private void addButtons() {
// Build Accept Button
acceptButton = new RolloverButton(" " + PhoneRes.getIString("phone.accept"), PhoneRes.getImageIcon("TOASTER_ACCEPT_BUTTON"));
acceptButton.setHorizontalTextPosition(JLabel.CENTER);
acceptButton.setFont(new Font("Dialog", Font.BOLD, 11));
acceptButton.setForeground(new Color(91, 175, 41));
acceptButton.setMargin(new Insets(0, 0, 0, 0));
// Build Reject Button
rejectButton = new RolloverButton(" " + PhoneRes.getIString("phone.reject"), PhoneRes.getImageIcon("TOASTER_REJECT_BUTTON"));
rejectButton.setHorizontalTextPosition(JLabel.CENTER);
rejectButton.setFont(new Font("Dialog", Font.BOLD, 11));
rejectButton.setForeground(new Color(153, 32, 10));
rejectButton.setMargin(new Insets(0, 0, 0, 0));
final JPanel panel = new JPanel(new GridBagLayout());
panel.setOpaque(false);
panel.add(acceptButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
panel.add(rejectButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(panel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
}
use of org.jivesoftware.spark.component.RolloverButton in project Spark by igniterealtime.
the class OutgoingCallUI method addButtons.
private void addButtons() {
// Build Reject Button
rejectButton = new RolloverButton(" " + PhoneRes.getIString("phone.hangup"), PhoneRes.getImageIcon("TOASTER_REJECT_BUTTON"));
rejectButton.setHorizontalTextPosition(JLabel.CENTER);
rejectButton.setFont(new Font("Dialog", Font.BOLD, 11));
rejectButton.setForeground(new Color(153, 32, 10));
rejectButton.setMargin(new Insets(0, 0, 0, 0));
final JPanel panel = new JPanel(new GridBagLayout());
panel.setOpaque(false);
panel.add(rejectButton, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(panel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
}
use of org.jivesoftware.spark.component.RolloverButton in project Spark by igniterealtime.
the class BookmarksUI method getServicePanel.
private JPanel getServicePanel() {
final JPanel servicePanel = new JPanel();
servicePanel.setOpaque(false);
servicePanel.setLayout(new GridBagLayout());
final JLabel serviceLabel = new JLabel();
final RolloverButton addButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE));
addButton.setToolTipText(Res.getString("message.add.conference.service"));
final JTextField serviceField = new JTextField();
servicePanel.add(serviceLabel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 2, 5), 0, 0));
servicePanel.add(serviceField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 2, 5), 0, 0));
servicePanel.add(addButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 2, 5), 0, 0));
// Add resource utils
ResourceUtils.resLabel(serviceLabel, serviceField, Res.getString("label.add.conference.service"));
final Action conferenceAction = new AbstractAction() {
private static final long serialVersionUID = 7973928300442518496L;
@Override
public void actionPerformed(ActionEvent e) {
final String conferenceService = serviceField.getText();
if (hasService(conferenceService)) {
UIManager.put("OptionPane.okButtonText", Res.getString("ok"));
JOptionPane.showMessageDialog(null, Res.getString("message.service.already.exists"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE);
serviceField.setText("");
} else {
final List<String> serviceList = new ArrayList<>();
serviceField.setText(Res.getString("message.searching.please.wait"));
serviceField.setEnabled(false);
addButton.setEnabled(false);
SwingWorker worker = new SwingWorker() {
DiscoverInfo discoInfo;
@Override
public Object construct() {
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(SparkManager.getConnection());
try {
discoInfo = discoManager.discoverInfo(conferenceService);
for (DiscoverInfo.Identity identity : discoInfo.getIdentities()) {
if ("conference".equals(identity.getCategory())) {
serviceList.add(conferenceService);
break;
} else if ("server".equals(identity.getCategory())) {
try {
Collection<String> services = getConferenceServices(conferenceService);
for (String service : services) {
serviceList.add(service);
}
} catch (Exception e1) {
Log.error("Unable to load conference services in server.", e1);
}
}
}
} catch (XMPPException | SmackException e1) {
Log.error("Error in disco discovery.", e1);
}
return true;
}
@Override
public void finished() {
if (discoInfo != null) {
for (String aServiceList : serviceList) {
if (!hasService(aServiceList)) {
addServiceToList(aServiceList);
}
}
serviceField.setText("");
serviceField.setEnabled(true);
addButton.setEnabled(true);
} else {
UIManager.put("OptionPane.okButtonText", Res.getString("ok"));
JOptionPane.showMessageDialog(SparkManager.getMainWindow(), Res.getString("message.conference.service.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE);
serviceField.setText("");
serviceField.setEnabled(true);
addButton.setEnabled(true);
}
}
};
worker.start();
}
}
};
addButton.addActionListener(conferenceAction);
serviceField.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyChar() == KeyEvent.VK_ENTER) {
conferenceAction.actionPerformed(null);
}
}
});
return servicePanel;
}
use of org.jivesoftware.spark.component.RolloverButton in project Spark by igniterealtime.
the class ButtonFactory method createSettingsButton.
public RolloverButton createSettingsButton() {
RolloverButton settings = new RolloverButton(SparkRes.getImageIcon(SparkRes.SETTINGS_IMAGE_16x16));
settings.setToolTipText(Res.getString("title.configure.room"));
return settings;
}
use of org.jivesoftware.spark.component.RolloverButton in project Spark by igniterealtime.
the class ButtonFactory method createAlwaysOnTop.
public RolloverButton createAlwaysOnTop(boolean isAlwaysOnTopActive) {
RolloverButton alwaysOnTopItem = new RolloverButton();
if (isAlwaysOnTopActive) {
alwaysOnTopItem.setIcon(SparkRes.getImageIcon("FRAME_ALWAYS_ON_TOP_ACTIVE"));
} else {
alwaysOnTopItem.setIcon(SparkRes.getImageIcon("FRAME_ALWAYS_ON_TOP_DEACTIVE"));
}
alwaysOnTopItem.setToolTipText(Res.getString("menuitem.always.on.top"));
return alwaysOnTopItem;
}
Aggregations