Author: rozagh
Date: 2012-03-12 13:00:35 -0700 (Mon, 12 Mar 2012)
New Revision: 28497
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListSingleHandler.java
Log:
Removed @ProvidesGUI from BitmapWriter and implemented the GUI using tunables.
Interactions between tunables implemented for BitmapWriter.
A test module developed for BitmapWriter.
work-api, work-swing-api and work-swing-impl updated. Most of the tunable
handlers have the update,getstate and event handler methods added.
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListSingleHandler.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListSingleHandler.java
2012-03-12 19:59:36 UTC (rev 28496)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListSingleHandler.java
2012-03-12 20:00:35 UTC (rev 28497)
@@ -9,6 +9,8 @@
import org.cytoscape.work.util.ListSingleSelection;
import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
/**
@@ -18,7 +20,7 @@
*
* @param <T> type of items the List contains
*/
-public class ListSingleHandler<T> extends AbstractGUITunableHandler {
+public class ListSingleHandler<T> extends AbstractGUITunableHandler implements
ActionListener {
private static final Font LABEL_FONT = new Font("SansSerif", Font.BOLD,
12);
private static final Font COMBOBOX_FONT = new Font("SansSerif",
Font.PLAIN, 12);
@@ -102,8 +104,19 @@
return;
final T selectedItem = (T) combobox.getSelectedItem();
- if (selectedItem != null)
+ if (selectedItem != null){
getSingleSelection().setSelectedValue(selectedItem);
+ try {
+ setValue(getSingleSelection());
+
+ } catch (final Exception e) {
+ combobox.setBackground(Color.red);
+ JOptionPane.showMessageDialog(null, "The value
entered cannot be set!", "Error", JOptionPane.ERROR_MESSAGE);
+ e.printStackTrace();
+ combobox.setBackground(Color.white);
+ return;
+ }
+ }
}
/**
@@ -120,4 +133,9 @@
getSingleSelection().setSelectedValue(selectedItem);
return selectedItem.toString();
}
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ handle();
+ }
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.