Examples of JPowerGraphPoint


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

    public void mouseDown(JPowerGraphMouseEvent e) {
        if (getGraphPane().isEnabled() && cursorLens.isArrow() && e.getButton() == JPowerGraphMouseEvent.LEFT && isStartDraggingEvent(e)) {
            m_draggedNode = getGraphPane().getNodeAtPoint(e.getPoint());
            if (m_draggedNode != null) {
                m_lastPosition = e.getPoint();
                JPowerGraphPoint nodeScreenPoint = getGraphPane().getScreenPointForNode(m_draggedNode);
                m_grabPoint1 = new JPowerGraphPoint(e.getPoint().x - nodeScreenPoint.x, e.getPoint().y - nodeScreenPoint.y);
                m_oldFixedState1 = m_draggedNode.isFixed();
                m_draggedNode.setFixed(true);
                cursorLens.setHand(true);
            }
            else {
                m_draggedEdge = getGraphPane().getNearestEdge(e.getPoint());
                if (m_draggedEdge != null) {
                    m_lastPosition = e.getPoint();
                    JPowerGraphPoint fromPoint = getGraphPane().getScreenPointForNode(m_draggedEdge.getFrom());
                    m_grabPoint1 = new JPowerGraphPoint(e.getPoint().x - fromPoint.x, e.getPoint().y - fromPoint.y);
                    JPowerGraphPoint toPoint = getGraphPane().getScreenPointForNode(m_draggedEdge.getTo());
                    m_grabPoint2 = new JPowerGraphPoint(e.getPoint().x - toPoint.x, e.getPoint().y - toPoint.y);
                    m_oldFixedState1 = m_draggedEdge.getFrom().isFixed();
                    m_oldFixedState1 = m_draggedEdge.getTo().isFixed();
                    m_draggedEdge.getFrom().setFixed(true);
                    m_draggedEdge.getTo().setFixed(true);
                    cursorLens.setHand(true);
View Full Code Here

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

        return m_draggedEdge;
    }
   
    protected void moveDraggedNode(JPowerGraphPoint point, boolean stillMoving) {
        if (!point.equals(m_lastPosition)) {
            JPowerGraphPoint tempLastPoint = new JPowerGraphPoint(point.x, point.y);
            point.x-=m_grabPoint1.x;
            point.y-=m_grabPoint1.y;
            Point2D graphPoint = new Point2D.Double();
            getGraphPane().screenToGraphPoint(point,graphPoint);
           
View Full Code Here

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

        }
    }
   
    protected void moveDraggedEdge(JPowerGraphPoint point, boolean stillMoving) {
        if (!point.equals(m_lastPosition)) {
            JPowerGraphPoint tempLastPoint = new JPowerGraphPoint(point.x, point.y);
            JPowerGraphPoint p1 = new JPowerGraphPoint(point.x-m_grabPoint1.x,point.y-m_grabPoint1.y);
            JPowerGraphPoint p2 = new JPowerGraphPoint(point.x-m_grabPoint2.x,point.y-m_grabPoint2.y);
           
            Point2D graphPoint1=new Point2D.Double();
            Point2D graphPoint2=new Point2D.Double();
            getGraphPane().screenToGraphPoint(p1, graphPoint1);
            getGraphPane().screenToGraphPoint(p2, graphPoint2);
View Full Code Here

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

            }
            else{
                cursorLens.setStop(false);
            }
           
            JPowerGraphPoint nodeScreenPoint = getGraphPane().getScreenPointForNode(m_draggedNode);
            draggingLine = new Line2D.Double(nodeScreenPoint.x, nodeScreenPoint.y, e.getPoint().x, e.getPoint().y);
            synchronized (getGraphPane()){
                getGraphPane().redraw();
            }
        }
View Full Code Here

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

        lastMouseEventScreenPoint=graphPane.getScreenLocation();
        lastMouseEventScreenPoint.x += e.getPoint().getX();
        lastMouseEventScreenPoint.y += e.getPoint().getY();
    }
    protected JPowerGraphPoint getLastMouseEventPoint() {
        JPowerGraphPoint point = graphPane.getScreenLocation();
        point.x += lastMouseEventScreenPoint.x - point.x;
        point.y += lastMouseEventScreenPoint.y - point.y;
        return point;
    }
View Full Code Here

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

        this.notHighlightedBorderColor = new JPowerGraphColor(197, 197, 197);
        this.notHighlightedTextColor = new JPowerGraphColor(197, 197, 197);
    }

    public void paintNode(JGraphPane graphPane, JPowerGraphGraphics g, Node node, int size, SubGraphHighlighter theSubGraphHighlighter) {
        JPowerGraphPoint nodePoint = graphPane.getScreenPointForNode(node);
        paintNode(graphPane, g, node, size, theSubGraphHighlighter, nodePoint);
    }
View Full Code Here

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

        getNodeScreenBounds(graphPane, node, size, theScale, nodeScreenRectangle);
        return nodeScreenRectangle.contains(point);
    }
   
    public void getNodeScreenBounds(JGraphPane graphPane, Node node, int size, double theScale, JPowerGraphRectangle nodeScreenRectangle) {
        JPowerGraphPoint nodePoint = graphPane.getScreenPointForNode(node);
        String label=node.getLabel();
       
        JPowerGraphGraphics g = graphPane.getJPowerGraphGraphics();
       
        if (size == NodePainter.LARGE){
View Full Code Here

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

     *            the graphics
     * @param node
     *            the node to paint
     */
    public void paintNode(JGraphPane graphPane, JPowerGraphGraphics g, ClusterNode node, int size, SubGraphHighlighter theSubGraphHighlighter) {
        JPowerGraphPoint nodePoint = graphPane.getScreenPointForNode(node);
        paintNode(graphPane, g, node, size, theSubGraphHighlighter, nodePoint);
    }
View Full Code Here

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

           
            subG.setBackground(g.getBackground());
            subG.setForeground(g.getForeground());
            subG.setAntialias(g.getAntialias());
            subG.fillRectangle(0, 0, dummyRectangle.width, dummyRectangle.height);
            nodePainter.paintNode(graphPane, subG, dummyNode, ShapeNodePainter.SMALL, theSubGraphHighlighter, new JPowerGraphPoint(dummyRectangle.width/2, dummyRectangle.height/2), scale);
            JPowerGraphColor nodeColor = nodePainter.getBackgroundColor(dummyNode, graphPane, theSubGraphHighlighter);
           
            for (int i = 0; i < rowSizes.length; i++) {
                int rowIndex = (((numRows - 1) / 2) - i) * -1;
                int normalisedRowIndex = rowIndex;
                if (normalisedRowIndex < 0){
                    normalisedRowIndex *= -1;
                }
   
                int rowdx = 0;
               
                int numFullNodes = 0;
                int numHalfNodes = 0;
                int numGaps = 0;
                if (i % 2 != 0) {
                    numFullNodes = (rowSizes[i] - 2);
                    numHalfNodes = 1;
                    numGaps = (rowSizes[i] - 1);
                }
                else{
                    numFullNodes = (rowSizes[i] - 1);
                    numHalfNodes = 0;
                    numGaps = (rowSizes[i] - 1);
                }
                rowdx = (numFullNodes * dummyRectangle.width) + (numHalfNodes * dummyRectangle.width) + (numGaps * hPadBetweenInstances) ;
                rowdx = rowdx / 2;
               
                JPowerGraphGraphics rowG = rowImageMap.retrieve(scale, rowSizes[i], g.getBackground(), nodeColor);
                if (rowG == null){
                    int rowWidth = (dummyRectangle.width + hPadBetweenInstances) * rowSizes[i] + 1;
                    rowG = g.getSubJPowerGraphGraphics(new JPowerGraphDimension(rowWidth, dummyRectangle.height));
                    rowG.setBackground(g.getBackground());
                    rowG.setForeground(g.getForeground());
                    rowG.setAntialias(g.getAntialias());
                    rowG.fillRectangle(0, 0, rowWidth, dummyRectangle.height);
                    for (int j = 0; j < rowSizes[i]; j++) {
                        int thisDx = (dummyRectangle.width + hPadBetweenInstances) * j;
                       
                        JPowerGraphPoint thisPoint = new JPowerGraphPoint(thisDx + dummyRectangle.width/2, dummyRectangle.height/2);
                        rowG.drawSubJPowerGraph(subG, thisPoint.x - dummyRectangle.width/2, thisPoint.y - dummyRectangle.height/2);
                    }
                    rowImageMap.register(scale, rowSizes[i], rowG, g.getBackground(), nodeColor);
                }
   
                int rowdy = rowIndex * (dummyRectangle.height + vPadBetweenInstances);
                JPowerGraphPoint thisPoint = new JPowerGraphPoint(thePoint.x - rowdx, thePoint.y + rowdy);
                g.drawSubJPowerGraph(rowG, thisPoint.x - dummyRectangle.width/2, thisPoint.y - dummyRectangle.height/2);
            }
            subG.dispose();
        }
        else{
View Full Code Here

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

     *            the node
     * @param nodeScreenRectangle
     *            the rectangle receiving the node's coordinates
     */
    public void getNodeScreenBounds(JGraphPane graphPane, ClusterNode node, int size, double theScale, JPowerGraphRectangle nodeScreenRectangle) {
        JPowerGraphPoint nodePoint = graphPane.getScreenPointForNode(node);

        int numInstances = node.size();

        int leftRightPad = 4;
        int hPadBetweenInstances = (int) (2 * getInstanceScale(numInstances));
 
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.