Author: clopes
Date: 2012-01-25 11:14:06 -0800 (Wed, 25 Jan 2012)
New Revision: 28102
Modified:
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/FilterApp.java
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/model/CompositeFilter.java
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/util/FilterUtil.java
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/view/FilterMainPanel.java
core3/impl/trunk/filter-impl/src/main/resources/default_filters.props
Log:
Fixes: a newly created filter should be automatically selected.
Some minor refactoring.
Modified:
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/FilterApp.java
===================================================================
---
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/FilterApp.java
2012-01-25 01:48:18 UTC (rev 28101)
+++
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/FilterApp.java
2012-01-25 19:14:06 UTC (rev 28102)
@@ -75,9 +75,6 @@
private final FilterWriter writer;
private final FilterModelLocator modelLocator;
- public static final String DYNAMIC_FILTER_THRESHOLD =
"dynamicFilterThreshold";
- public static final int DEFAULT_DYNAMIC_FILTER_THRESHOLD = 1000;
-
private static final Logger logger =
LoggerFactory.getLogger(FilterApp.class);
public FilterApp(final FilterReader reader, final FilterWriter writer,
final FilterModelLocator modelLocator) {
Modified:
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/model/CompositeFilter.java
===================================================================
---
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/model/CompositeFilter.java
2012-01-25 01:48:18 UTC (rev 28101)
+++
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/model/CompositeFilter.java
2012-01-25 19:14:06 UTC (rev 28102)
@@ -40,7 +40,6 @@
import java.util.List;
import org.cytoscape.application.CyApplicationManager;
-import org.cytoscape.filter.internal.filters.FilterApp;
import org.cytoscape.filter.internal.quickfind.util.QuickFind;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
@@ -65,7 +64,7 @@
protected Hashtable<CompositeFilter, Boolean> compositeNotTab = new
Hashtable<CompositeFilter, Boolean>();
protected CyApplicationManager applicationManager;
- private static Logger logger = LoggerFactory.getLogger(FilterApp.class);
+ private static Logger logger =
LoggerFactory.getLogger(CompositeFilter.class);
public CompositeFilter(CyApplicationManager applicationManager) {
advancedSetting = new AdvancedSetting();
@@ -232,7 +231,7 @@
}
if (negation) {
- edgeBits.flip(0, network.getEdgeCount());
+ edgeBits.flip(0, network.getEdgeCount());
}
}
@@ -466,9 +465,8 @@
*/
@Override
public Object clone() {
- logger.warn("CompositeFilter.clone() not implemented yet");
-
- return null;
+ // TODO
+ throw new RuntimeException("CompositeFilter.clone() not
implemented yet");
}
/**
Modified:
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/util/FilterUtil.java
===================================================================
---
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/util/FilterUtil.java
2012-01-25 01:48:18 UTC (rev 28101)
+++
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/util/FilterUtil.java
2012-01-25 19:14:06 UTC (rev 28102)
@@ -4,7 +4,6 @@
import java.util.List;
import org.cytoscape.application.CyApplicationManager;
-import org.cytoscape.filter.internal.filters.FilterApp;
import org.cytoscape.filter.internal.filters.model.CompositeFilter;
import org.cytoscape.filter.internal.quickfind.util.QuickFind;
import org.cytoscape.filter.internal.quickfind.util.QuickFindFactory;
@@ -20,6 +19,8 @@
public static final String FILTER_APP_NAME = "FilterApp";
public static final String DEFAULT_FILE_NAME = "default_filters.props";
public static final String SESSION_FILE_NAME = "session_filters.props";
+ public static final String DYNAMIC_FILTER_THRESHOLD =
"dynamicFilterThreshold";
+ public static final int DEFAULT_DYNAMIC_FILTER_THRESHOLD = 1000;
// do selection on given network
public static void doSelection(CompositeFilter pFilter,
CyApplicationManager applicationManager) {
@@ -149,9 +150,9 @@
int dynamicFilterThresholdValue = -1;
// // TODO: What do we do about CyInit*?
-// String dynamicFilterThreshold =
CytoscapeInit.getProperties().getProperty(FilterPlugin.DYNAMIC_FILTER_THRESHOLD);
+// String dynamicFilterThreshold =
CytoscapeInit.getProperties().getProperty(DYNAMIC_FILTER_THRESHOLD);
// if (dynamicFilterThreshold == null) { // threshold not defined,
use the default value
- dynamicFilterThresholdValue =
FilterApp.DEFAULT_DYNAMIC_FILTER_THRESHOLD;
+ dynamicFilterThresholdValue =
DEFAULT_DYNAMIC_FILTER_THRESHOLD;
// }
// else {
// dynamicFilterThresholdValue = (new
Integer(dynamicFilterThreshold)).intValue();
Modified:
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/view/FilterMainPanel.java
===================================================================
---
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/view/FilterMainPanel.java
2012-01-25 01:48:18 UTC (rev 28101)
+++
core3/impl/trunk/filter-impl/src/main/java/org/cytoscape/filter/internal/filters/view/FilterMainPanel.java
2012-01-25 19:14:06 UTC (rev 28102)
@@ -206,14 +206,8 @@
@Override
public void handleEvent(FiltersChangedEvent event) {
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
- updateCMBFilters();
- refreshAttributeCMB();
- }
- });
+ updateCMBFilters();
+ refreshAttributeCMB();
}
@Override
@@ -340,8 +334,7 @@
if ( n == null ) {
this.btnSelectAll.setEnabled(false);
this.btnDeSelect.setEnabled(false);
- }
- else {
+ } else {
this.btnSelectAll.setEnabled(true);
this.btnDeSelect.setEnabled(true);
}
@@ -392,12 +385,11 @@
*/
private List<Object> getCyAttributesList(CyNetwork network, String
pType) {
Vector<String> attributeList = new Vector<String>();
+ Collection<? extends CyTableEntry> entries = null;
- Collection<? extends CyTableEntry> entries;
if (pType.equalsIgnoreCase("node")) {
entries = network.getNodeList();
- }
- else if (pType.equalsIgnoreCase("edge")){
+ } else if (pType.equalsIgnoreCase("edge")){
entries = network.getEdgeList();
} else {
return Collections.emptyList();
@@ -409,6 +401,7 @@
CyTableEntry tableEntry = entries.iterator().next();
final Collection<CyColumn> columns =
network.getRow(tableEntry).getTable().getColumns();
+
for (final CyColumn column : columns) {
// Show all attributes, with type of String or Number
Class<?> type = column.getType();
@@ -432,7 +425,6 @@
return retList;
}
-
/*
* Hide the visible filterSettingPanel, if any, and show the new
FilterSettingPanel for
* the given filter.
@@ -449,7 +441,6 @@
// When the next panel exists and is the same as the current
one,
// we can exit now and avoid hiding and showing the same panel.
- //
if ((next != null) && (next == currentFilterSettingPanel)) {
return;
}
@@ -1113,7 +1104,7 @@
// Set newNodeInteractionFilterMenuItem on only if there are at
least one Edge Filter
if (hasEdgeFilter(allFilters)) {
newNodeInteractionFilterMenuItem.setEnabled(true);
- } else {
+ } else {
newNodeInteractionFilterMenuItem.setEnabled(false);
}
}
@@ -1384,8 +1375,7 @@
if (anObject != null) {
if (anObject instanceof CompositeFilter) {
rv =
((CompositeFilter)anObject).getLabel();
- }
- else {
+ } else {
rv = anObject.toString();
}
}
Modified: core3/impl/trunk/filter-impl/src/main/resources/default_filters.props
===================================================================
--- core3/impl/trunk/filter-impl/src/main/resources/default_filters.props
2012-01-25 01:48:18 UTC (rev 28101)
+++ core3/impl/trunk/filter-impl/src/main/resources/default_filters.props
2012-01-25 19:14:06 UTC (rev 28102)
@@ -3,7 +3,7 @@
name=Default
<AdvancedSetting>
scope.global=true
-scope.session=false
+scope.session=true
selection.node=false
selection.edge=false
edge.source=true
--
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.