use of org.cytoscape.property.PropertyUpdatedEvent in project cytoscape-impl by cytoscape.
the class PreferencesDialog method initGUI.
private void initGUI() throws Exception {
closeButton = new JButton(new AbstractAction("Close") {
@Override
public void actionPerformed(ActionEvent e) {
final CyEventHelper eventHelper = serviceRegistrar.getService(CyEventHelper.class);
for (String key : itemChangedMap.keySet()) {
if (itemChangedMap.get(key)) {
PropertyUpdatedEvent event = new PropertyUpdatedEvent(cyPropMap.get(key));
eventHelper.fireEvent(event);
itemChangedMap.put(key, false);
}
}
dispose();
}
});
propsTablePane.getViewport().add(prefsTable, null);
prefsTable.setPreferredScrollableViewportSize(new Dimension(400, 200));
final JPanel propsTablePanel = new JPanel();
propsTablePanel.setBorder(LookAndFeelUtil.createTitledBorder("Properties"));
{
final GroupLayout layout = new GroupLayout(propsTablePanel);
propsTablePanel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(true);
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true).addComponent(cmbPropCategories, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(propsTablePane, DEFAULT_SIZE, DEFAULT_SIZE, 460).addGroup(Alignment.CENTER, layout.createSequentialGroup().addComponent(addPropBtn).addComponent(modifyPropBtn).addComponent(deletePropBtn)));
layout.setVerticalGroup(layout.createSequentialGroup().addComponent(cmbPropCategories, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(propsTablePane, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGroup(layout.createParallelGroup(Alignment.CENTER, false).addComponent(addPropBtn).addComponent(modifyPropBtn).addComponent(deletePropBtn)));
}
final JPanel contentPane = new JPanel();
{
final GroupLayout layout = new GroupLayout(contentPane);
contentPane.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(true);
// #3534
final JPanel buttonPanel = LookAndFeelUtil.createOkCancelPanel(null, closeButton, "Linkout");
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.TRAILING, true).addComponent(propsTablePanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(buttonPanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createSequentialGroup().addComponent(propsTablePanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(buttonPanel));
}
setContentPane(contentPane);
LookAndFeelUtil.setDefaultOkCancelKeyStrokes(getRootPane(), closeButton.getAction(), closeButton.getAction());
getRootPane().setDefaultButton(closeButton);
}
use of org.cytoscape.property.PropertyUpdatedEvent in project cytoscape-impl by cytoscape.
the class TestProxySettings method run.
@Override
public void run(TaskMonitor tm) {
tm.setProgress(0.0);
final CyProperty<Properties> proxyProps = getProxyProperties();
final Properties props = proxyProps.getProperties();
storeProxySettings(props);
final CyEventHelper eventHelper = serviceRegistrar.getService(CyEventHelper.class);
for (String key : oldSettings.keySet()) {
if (!oldSettings.get(key).equals(props.get(key))) {
eventHelper.fireEvent(new PropertyUpdatedEvent(proxyProps));
break;
}
}
oldSettings.clear();
tm.setProgress(1.0);
}
Aggregations