/** * Get the source data TupleSet backing the given visual tuple set. * @return the backing source data set, or null if there is no such * data set */ public TupleSet getSourceData(VisualTupleSet ts) { return (TupleSet)m_source.get(ts.getGroup()); }
@Override public ArrayList<Integer> pickAll(Rectangle2D hitBox, Rectangle2D bounds) { ArrayList<Integer> ids = new ArrayList<Integer>(); VisualTupleSet visTuples = (VisualTupleSet) vis.getVisualGroup(groupName); Iterator<?> it = visTuples.tuples(); while (it.hasNext()) { VisualItem item = (VisualItem) it.next(); if (hitBox.intersects(item.getBounds())) { ids.add(item.getRow()); } } return ids; }
/** * Create a new SearchQueryBinding over the given set and data field, * using the specified SearchTupleSet instance. Use this constructor to * choose the type of search engine used, and to potentially reuse the * same search set over multiple dynamic query bindings. * @param ts the TupleSet to query * @param field the data field (Table column) to query * @param set the {@link prefuse.data.search.SearchTupleSet} to use. */ public SearchQueryBinding(TupleSet ts, String field, SearchTupleSet set) { super(ts, field); m_listener = new Listener(); setPredicate(new SearchBindingPredicate()); m_set = set; m_set.index(ts.tuples(), field); m_set.addTupleSetListener(m_listener); if ( ts instanceof VisualTupleSet ) m_lock = ((VisualTupleSet)ts).getVisualization(); }