1 19 20 28 29 package org.netbeans.modules.xml.nbprefuse; 30 31 import java.awt.Color ; 32 import prefuse.Visualization; 33 import prefuse.action.assignment.ColorAction; 34 import prefuse.data.tuple.TupleSet; 35 import prefuse.visual.VisualItem; 36 37 41 public class NodeStrokeColorAction extends ColorAction { 42 43 public NodeStrokeColorAction() { 44 super(AnalysisConstants.GRAPH_GROUP_NODES, VisualItem.STROKECOLOR); 45 } 46 public int getColor(VisualItem item) { 47 Visualization vis = item.getVisualization(); 48 TupleSet ts = vis.getFocusGroup(Visualization.FOCUS_ITEMS); 49 if (ts.containsTuple(item)){ 50 item.setStroke(AnalysisConstants.SELECTED_STROKE); 51 } 52 else { 53 item.setStroke(AnalysisConstants.UNSELECTED_STROKE); 54 } 55 return Color.BLACK.getRGB(); 56 } 57 58 } 59 | Popular Tags |