Author: oriol
Date: 2012-09-26 09:19:08 -0700 (Wed, 26 Sep 2012)
New Revision: 30489
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListMultipleHandler.java
Log:
Small change to avoid calling so often the getValue method
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListMultipleHandler.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListMultipleHandler.java
2012-09-26 16:08:06 UTC (rev 30488)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/ListMultipleHandler.java
2012-09-26 16:19:08 UTC (rev 30489)
@@ -138,25 +138,27 @@
boolean reloadSelection = false;
+ listMultipleSelection = getMultipleSelection();
+
//If the list of elements has changed, remove old elements and
add new ones
-
if(!Arrays.equals(listModel.toArray(),getMultipleSelection().getPossibleValues().toArray()))
+
if(!Arrays.equals(listModel.toArray(),listMultipleSelection.getPossibleValues().toArray()))
{
listModel.removeAllElements();
reloadSelection = true;
- for ( T value :
getMultipleSelection().getPossibleValues() )
+ for ( T value :
listMultipleSelection.getPossibleValues() )
listModel.addElement(value);
}
else
{
//if the list is the same but the selection has
changed, remove all selections and select new ones
-
if(!Arrays.equals(itemsContainerList.getSelectedValues(),getMultipleSelection().getSelectedValues().toArray()))
+
if(!Arrays.equals(itemsContainerList.getSelectedValues(),listMultipleSelection.getSelectedValues().toArray()))
reloadSelection = true;
}
if(reloadSelection )
{
// selected items
- final List<T> selectedVals =
getMultipleSelection().getSelectedValues();
- final List<T> allValues =
getMultipleSelection().getPossibleValues();
+ final List<T> selectedVals =
listMultipleSelection.getSelectedValues();
+ final List<T> allValues =
listMultipleSelection.getPossibleValues();
final int[] selectedIdx = new int[selectedVals.size()];
int index = 0;
--
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.