Package prefuse

Examples of prefuse.Display


        {
            //==== If it is a tree node, then display the title and authors
            if (item.getGroup().equals("tree.nodes"))
            {
                Visualization v = item.getVisualization();
                Display d = v.getDisplay(0);
                String view_text = (((Node)v.getSourceTuple(item)).getString("hoverLabel"));
                d.setToolTipText(view_text);
            }
        }
View Full Code Here


        }
        public void itemExited(VisualItem item, MouseEvent e)
        {
          Visualization v = item.getVisualization();
          Display d = v.getDisplay(0);
          d.setToolTipText(null);
          //v.run("draw");
        }
View Full Code Here

            //==== Bring up menu on Right Click
            if (e.isPopupTrigger() || SwingUtilities.isRightMouseButton(e))
            {
                //==== Get the visualization and display objects associated with the node
                Visualization v = item.getVisualization();
                Display d = v.getDisplay(0);
           
                //==== Create the click menu panel and the custom tool tip               
                ClickMenu menu = new ClickMenu(v, item);      
                menuTool = new PrefuseTooltip(d, menu);
           
View Full Code Here

        // setup
        NodeItem root = getLayoutRoot();
        layout( root, 0, 0 );

        Rectangle2D bounds = root.getBounds();
        Display display = this.getVisualization().getDisplay( 0 );
        Dimension size = new Dimension( (int) bounds.getWidth(), (int) bounds.getHeight() );
        display.setSize( size );

        if( !display.isValid() )
        {
            display.validate();
        }
    }
View Full Code Here

        if ( m_bounds != null )
            return m_bounds;
       
        if ( m_vis != null && m_vis.getDisplayCount() > 0 )
        {
            Display d = m_vis.getDisplay(0);
            Insets i = m_margin ? m_insets : d.getInsets(m_insets);
            m_bpts[0] = i.left;
            m_bpts[1] = i.top;
            m_bpts[2] = d.getWidth()-i.right;
            m_bpts[3] = d.getHeight()-i.bottom;
            d.getInverseTransform().transform(m_bpts,0,m_bpts,0,2);
            m_tmpb.setRect(m_bpts[0],m_bpts[1],
                          m_bpts[2]-m_bpts[0],
                          m_bpts[3]-m_bpts[1]);
            return m_tmpb;
        } else {
View Full Code Here

        if ( m_anchor != null )
            return m_anchor;
       
        m_tmpa.setLocation(0,0);
        if ( m_vis != null ) {
            Display d = m_vis.getDisplay(0);
            m_tmpa.setLocation(d.getWidth()/2.0,d.getHeight()/2.0);
            d.getInverseTransform().transform(m_tmpa, m_tmpa);
        }
        return m_tmpa;
    }
View Full Code Here

        if ( m_anchor != null )
            return m_anchor;
       
        m_tmpa.setLocation(0,0);
        if ( m_vis != null ) {
            Display d = m_vis.getDisplay(0);
            Rectangle2D b = this.getLayoutBounds();
            switch ( m_orientation ) {
            case Constants.ORIENT_LEFT_RIGHT:
                m_tmpa.setLocation(m_offset, d.getHeight()/2.0);
                break;
            case Constants.ORIENT_RIGHT_LEFT:
                m_tmpa.setLocation(b.getMaxX()-m_offset, d.getHeight()/2.0);
                break;
            case Constants.ORIENT_TOP_BOTTOM:
                m_tmpa.setLocation(d.getWidth()/2.0, m_offset);
                break;
            case Constants.ORIENT_BOTTOM_TOP:
                m_tmpa.setLocation(d.getWidth()/2.0, b.getMaxY()-m_offset);
                break;
            }
            d.getInverseTransform().transform(m_tmpa, m_tmpa);
        }
        return m_tmpa;
    }
View Full Code Here

   
    /**
     * @see prefuse.controls.Control#itemEntered(prefuse.visual.VisualItem, java.awt.event.MouseEvent)
     */
    public void itemEntered(VisualItem item, MouseEvent e) {
        Display d = (Display)e.getSource();
        if ( label.length == 1 ) {
            // optimize the simple case
            if ( item.canGetString(label[0]) )
                d.setToolTipText(item.getString(label[0]));
        } else {
            sbuf.delete(0, sbuf.length());
            for ( int i=0; i<label.length; ++i ) {
                if ( item.canGetString(label[i]) ) {
                    if ( sbuf.length() > 0 )
                        sbuf.append("; ");
                    sbuf.append(item.getString(label[i]));
                }
            }
            d.setToolTipText(sbuf.toString());
        }
    }
View Full Code Here

   
    /**
     * @see prefuse.controls.Control#itemExited(prefuse.visual.VisualItem, java.awt.event.MouseEvent)
     */
    public void itemExited(VisualItem item, MouseEvent e) {
        Display d = (Display)e.getSource();
        d.setToolTipText(null);
    }
View Full Code Here

   
    /**
     * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent)
     */
    public void mouseWheelMoved(MouseWheelEvent e) {
        Display display = (Display)e.getComponent();
        m_point.x = display.getWidth()/2;
        m_point.y = display.getHeight()/2;
        zoom(display, m_point,
             1 + 0.1f * e.getWheelRotation(), false);
    }
View Full Code Here

TOP

Related Classes of prefuse.Display

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.