/** * Create a new horizontal range slider for interacting with the query. * @return a {@link prefuse.util.ui.JRangeSlider} bound to this dynamic * query. * @see prefuse.data.query.DynamicQueryBinding#createComponent() */ public JComponent createComponent() { return createHorizontalRangeSlider(); }
/** * Create a new vertical range slider for interacting with the query. * @return a {@link prefuse.util.ui.JRangeSlider} bound to this dynamic * query. */ public JRangeSlider createVerticalRangeSlider() { return createRangeSlider(JRangeSlider.VERTICAL, JRangeSlider.RIGHTLEFT_BOTTOMTOP); }
/** * Create a new RangeQueryBinding over the given set and data field, * optionally forcing an ordinal treatment of data. * @param ts the TupleSet to query * @param field the data field (Table column) to query * @param forceOrdinal if true, forces all items in the range to be * treated in strictly ordinal fashion. That means that if the data * is numerical, the quantitative nature of the data will be ignored * and only the relative ordering of the numbers will matter. In terms * of mechanism, this entails that a {@link ObjectRangeModel} and not * a {@link NumberRangeModel} will be used to represent the data. If * the argument is false, default inference mechanisms will be used. */ public RangeQueryBinding(TupleSet ts, String field, boolean forceOrdinal) { super(ts, field); m_type = DataLib.inferType(ts, field); m_ordinal = forceOrdinal; m_listener = new Listener(); initPredicate(); initModel(); }
/** * Create a new regular (non-range) slider for interacting with the query. * This allows you to select a single value at a time. * @return a {@link javax.swing.JSlider} bound to this dynamic query. */ public JSlider createSlider() { JSlider slider = new JSlider(m_model); slider.addFocusListener(getSliderAdjuster()); return slider; }
private void initPredicate() { // determine minimum and maximum values Object min = DataLib.min(m_tuples, m_field).get(m_field); Object max = DataLib.max(m_tuples, m_field).get(m_field); // set up predicate Literal left = Literal.getLiteral(min, m_type); Literal right = Literal.getLiteral(max, m_type); ColumnExpression ce = new ColumnExpression(m_field); RangePredicate rp = new RangePredicate(ce, left, right); setPredicate(rp); }
/** * Create a new horizontal range slider for interacting with the query. * @return a {@link prefuse.util.ui.JRangeSlider} bound to this dynamic * query. */ public JRangeSlider createHorizontalRangeSlider() { return createRangeSlider(JRangeSlider.HORIZONTAL, JRangeSlider.LEFTRIGHT_TOPBOTTOM); }