Changeset 2409
- Timestamp:
- 08/15/08 16:24:01 (3 months ago)
- Files:
-
- trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/OSGI-INF/metatype/METADATA.XML (modified) (1 diff)
- trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/src/edu/iu/nwb/preprocessing/extractnodesandedges/extractnodes/abovebelow/ExtractNodesAboveBelowAlgorithm.java (modified) (4 diffs)
- trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/src/edu/iu/nwb/preprocessing/extractnodesandedges/extractnodes/abovebelow/ReverseOfNumericDecorationFilter.java (moved) (moved from trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/src/edu/iu/nwb/preprocessing/extractnodesandedges/extractnodes/abovebelow/InverseNumericDecorationFilter.java) (1 diff, 1 prop)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/OSGI-INF/metatype/METADATA.XML
r2408 r2409 14 14 description="Extract all nodes with an attribute above a certain number"> 15 15 <AD name="Extract from this number" id="fromThisNum" type="Double" description="Extracts all nodes above or below this attribute value" default="1"/> 16 <AD name=" Invert?" id="invert" type="Boolean" description="Extract nodes below or equal to this value instead?" default="false" />16 <AD name="Below?" id="belowInstead" type="Boolean" description="Extract nodes below this value instead of above?" default="false" /> 17 17 <AD name="Numeric Attribute" id="numericAttribute" type="String" description="The attribute which the nodes will be sorted by" default=""/> 18 18 </OCD> trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/src/edu/iu/nwb/preprocessing/extractnodesandedges/extractnodes/abovebelow/ExtractNodesAboveBelowAlgorithm.java
r2162 r2409 17 17 18 18 private Double fromThisNum; 19 private Boolean invert;19 private Boolean belowInstead; 20 20 private String numericAttribute; 21 21 … … 35 35 36 36 this.fromThisNum = (Double) parameters.get("fromThisNum"); 37 this. invert = (Boolean) parameters.get("invert");37 this.belowInstead = (Boolean) parameters.get("belowInstead"); 38 38 this.numericAttribute = (String) parameters.get("numericAttribute"); 39 39 } … … 58 58 private Graph filter(Graph originalGraph) { 59 59 NumericDecorationFilter filter = null; 60 if ( invert.booleanValue() == false) {60 if (belowInstead.booleanValue() == false) { 61 61 filter = new NumericDecorationFilter(); 62 62 } else { 63 filter = new InverseNumericDecorationFilter();63 filter = new ReverseOfNumericDecorationFilter(); 64 64 } 65 65 … … 73 73 StringBuilder label = new StringBuilder(); 74 74 label.append ("all nodes with " + this.numericAttribute); 75 if (this. invert.booleanValue() == false) {75 if (this.belowInstead.booleanValue() == false) { 76 76 label.append(" above "); 77 77 } else { trunk/plugins/preprocessing/edu.iu.nwb.preprocessing.extractnodesandedges/src/edu/iu/nwb/preprocessing/extractnodesandedges/extractnodes/abovebelow/ReverseOfNumericDecorationFilter.java
- Property svn:mergeinfo set
r2162 r2409 4 4 import edu.uci.ics.jung.graph.filters.impl.NumericDecorationFilter; 5 5 6 public class InverseNumericDecorationFilter extends NumericDecorationFilter { 6 /* 7 * Copyright (c) 2003, the JUNG Project and the Regents of the University 8 * of California 9 * All rights reserved. 10 * 11 * This software is open-source under the BSD license; see either 12 * "license.txt" or 13 * http://jung.sourceforge.net/license.txt for a description. 14 */ 7 15 8 public boolean acceptVertex(Vertex vertex) { 9 return ! super.acceptVertex(vertex); 10 } 16 //copied from jung source code, and switched the sign (now it's less than) 17 18 public class ReverseOfNumericDecorationFilter extends NumericDecorationFilter { 19 20 public boolean acceptVertex(Vertex vertex) { 21 Number n = (Number) vertex.getUserDatum(this.getDecorationKey()); 22 23 if (n.doubleValue() < this.getThreshold()) { 24 return true; 25 } 26 return false; 27 } 28 11 29 }
