Examples of JPowerGraphPoint


Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

        nodeScreenRectangle.height = width;
    }
   
    private void getLabelScreenBounds(JGraphPane graphPane, ClusterNode node, JPowerGraphRectangle nodeScreenRectangle, JPowerGraphRectangle labelScreenRectangle) {
        if (node.showLabel() && !node.getLabel().equals("")){
            JPowerGraphPoint nodePoint = graphPane.getScreenPointForNode(node);
            int stringWidth = stringWidth(graphPane.getJPowerGraphGraphics(), node.getLabel());
            int stringHeight = graphPane.getJPowerGraphGraphics().getAscent() + graphPane.getJPowerGraphGraphics().getDescent();
            int numlines = countLines(node.getLabel());
            int textX = (nodePoint.x-stringWidth/2) + 1;
            int textY = nodePoint.y + (nodeScreenRectangle.width/2) + (stringHeight/2);
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

    }
   
    private JPowerGraphMouseEvent getJPowerGraphMouseEvent(MouseEvent e) {
        int button = getButton(e);
        ArrayList <Integer> modifiers = getModifiers(e);
        return new JPowerGraphMouseEvent(new JPowerGraphPoint(e.x, e.y), button, modifiers);
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

     * @param node
     *            the node whose on-screen position is required
     * @return the position of the node on screen
     */
    public JPowerGraphPoint getScreenPointForNode(Node node) {
        JPowerGraphPoint point = m_nodePositions.get(node);
        if (point == null) {
            point = new JPowerGraphPoint(0, 0);
            graphToScreenPoint(new Point2D.Double(node.getX(), node.getY()), point);
            m_nodePositions.put(node, point);
        }
        return point;
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

        synchronized (m_graph) {
            Point2D graphPoint = new Point2D.Double();
            Iterator nodes = m_graph.getVisibleNodes().iterator();
            while (nodes.hasNext()) {
                Node node = (Node) nodes.next();
                JPowerGraphPoint point = m_nodePositions.get(node);
                if (point == null) {
                    point = new JPowerGraphPoint(0, 0);
                    m_nodePositions.put(node, point);
                }
                graphPoint.setLocation(node.getX(), node.getY());
                graphToScreenPoint(graphPoint, point);
            }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

        ((SWTCursorChanger) cursorChanger).dispose();
    }

    public JPowerGraphPoint getScreenLocation() {
        Point e = toDisplay(0, 0);
        return new JPowerGraphPoint(e.x, e.y);
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

    public void paintEdge(JGraphPane graphPane, JPowerGraphGraphics g, T edge, SubGraphHighlighter theSubGraphHighlighter) {
        HighlightingManipulator highlightingManipulator=(HighlightingManipulator) graphPane.getManipulator(HighlightingManipulator.NAME);
        boolean isHighlighted=highlightingManipulator!=null && highlightingManipulator.getHighlightedEdge()==edge;
        DraggingManipulator draggingManipulator=(DraggingManipulator) graphPane.getManipulator(DraggingManipulator.NAME);
        boolean isDragging=draggingManipulator!=null && draggingManipulator.getDraggedEdge()==edge;
        JPowerGraphPoint from=graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to=graphPane.getScreenPointForNode(edge.getTo());
        JPowerGraphColor color=g.getBackground();
        g.setBackground(getEdgeColor(edge,isHighlighted,isDragging, theSubGraphHighlighter));
        paintArrow(g,from.x,from.y,to.x,to.y);
        g.setBackground(color);
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

   
    public void paintEdge(JGraphPane graphPane, JPowerGraphGraphics g, T edge, SubGraphHighlighter theSubGraphHighlighter) {
        super.paintEdge(graphPane, g, edge, theSubGraphHighlighter);
        String text = edge.getText();
       
        JPowerGraphPoint from = graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to = graphPane.getScreenPointForNode(edge.getTo());
        Point2D midpoint = new Point2D.Double((from.x + to.x)/2, ((from.y + to.y)/2));
       
        double slopeTop = from.y - to.y;
        double slopeBottom = from.x - to.x;
        double slope = Double.POSITIVE_INFINITY;
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

    }

    public void doRightClickPopup(JGraphPane theGraphPane, JPowerGraphMouseEvent e) {
        final SWTJGraphPane graphPane = (SWTJGraphPane) theGraphPane;

        JPowerGraphPoint point = e.getPoint();
        Legend legend = graphPane.getLegendAtPoint(point);
        Node node = graphPane.getNodeAtPoint(point);
        Edge edge = graphPane.getNearestEdge(point);

        closeRightClickIfNeeded(graphPane);
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

    }

    public void doToolTipPopup(JGraphPane theGraphPane, JPowerGraphMouseEvent e) {
        final SWTJGraphPane graphPane = (SWTJGraphPane) theGraphPane;
       
        JPowerGraphPoint point = e.getPoint();
        Node node = graphPane.getNodeAtPoint(point);

        if (node != null && node != lastNode) {
            closeToolTipIfNeeded(graphPane);
            if (toolTipListener != null) {
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphPoint

     * @param graphPane             the graph pane
     * @param g                     the graphics
     * @param edge                  the edge to paint
     */
    public void paintEdge(JGraphPane graphPane, JPowerGraphGraphics g, T edge, SubGraphHighlighter theSubGraphHighlighter) {
        JPowerGraphPoint from = graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to = graphPane.getScreenPointForNode(edge.getTo());
       
        JPowerGraphRectangle nodeRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
        graphPane.getNodeScreenBounds(edge.getTo(), nodeRectangle);
       
        JPowerGraphColor oldBGColor = g.getBackground();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.