/** * @see prefuse.visual.VisualItem#render(java.awt.Graphics2D) */ public void render(Graphics2D g) { getRenderer().render(g, this); }
/** * Returns the VisualItem located at the given point. * @param p the Point at which to look * @return the VisualItem located at the given point, if any */ public synchronized VisualItem findItem(Point p) { // transform mouse point from screen space to item space Point2D p2 = (m_itransform==null ? p : m_itransform.transform(p, m_tmpPoint)); // ensure that the picking queue has been z-sorted if ( !m_queue.psorted ) m_queue.sortPickingQueue(); // walk queue from front to back looking for hits for ( int i = m_queue.psize; --i >= 0; ) { VisualItem vi = m_queue.pitems[i]; if ( !vi.isValid() ) continue; // in case tuple went invalid Renderer r = vi.getRenderer(); if (r!=null && vi.isInteractive() && r.locatePoint(p2, vi)) { return vi; } } return null; }
/** * @see prefuse.visual.VisualItem#validateBounds() */ public Rectangle2D validateBounds() { if ( isValidated() ) return getBounds(); Visualization v = getVisualization(); // set the new bounds from the renderer and validate getRenderer().setBounds(this); setValidated(true); // report damage from the new bounds and return Rectangle2D bounds = getBounds(); v.damageReport(this, bounds); return bounds; }