Package net.sourceforge.jpowergraph.swtswinginteraction.geometry

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


    private boolean isDragging() {
        return m_grabPosition != null;
    }
   
    private void performDrag(JPowerGraphPoint position) {
        JPowerGraphRectangle rectangle = getGraphPane().getVisibleRectangle();
        rectangle.x += m_grabPosition.x-position.x;
        rectangle.y += m_grabPosition.y-position.y;
        getGraphPane().scrollRectToVisible(rectangle);
        m_grabPosition=position;
    }
View Full Code Here


        root = theRoot;
        if (root == null){
            root = new GroupLegendItem();
        }
        rectangleActionMap = new HashMap <JPowerGraphRectangle, Action> ();
        location = new JPowerGraphRectangle(0, 0, 0, 0);
        interactive  = isInteractive;
    }
View Full Code Here

        rectangleActionMap.put(theRectangle, theAction);
    }
   
    public Action getActionAtPoint(JPowerGraphPoint point) {
        for (Iterator i = rectangleActionMap.keySet().iterator(); i.hasNext();) {
            JPowerGraphRectangle rectangle = (JPowerGraphRectangle) i.next();
            if (rectangle.contains(point)){
                return rectangleActionMap.get(rectangle);
            }
        }
        return null;
    }
View Full Code Here

        }
        return textColor;
    }

    public boolean isInNode(JGraphPane graphPane, Node node, JPowerGraphPoint point, int size, double theScale) {
        JPowerGraphRectangle nodeScreenRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
        getNodeScreenBounds(graphPane, node, size, theScale, nodeScreenRectangle);
        return nodeScreenRectangle.contains(point);
    }
View Full Code Here

        int leftRightPad = 4;
        int hPadBetweenInstances = (int) (2 * getInstanceScale(numInstances));
        int vPadBetweenInstances = (int) (10 * getInstanceScale(numInstances)) - 1;
       
        JPowerGraphRectangle dummyRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
        nodePainter.getNodeScreenBounds(graphPane, dummyNode, ShapeNodePainter.SMALL, getInstanceScale(numInstances), dummyRectangle);
        dummyRectangle.width += 2;
        dummyRectangle.height += 2;
       
        if (theSubGraphHighlighter != null && theSubGraphHighlighter.isHighlightSubGraphs() && theSubGraphHighlighter.doesSubGraphContain(node)){
View Full Code Here

     * @param point
     *            the point
     * @return <code>true</code> if the point is in the node
     */
    public boolean isInNode(JGraphPane graphPane, ClusterNode node, JPowerGraphPoint point, int size, double theScale) {
        JPowerGraphRectangle nodeScreenRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
        getNodeScreenBounds(graphPane, node, size, theScale, nodeScreenRectangle);
       
        JPowerGraphRectangle labelScreenRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
        getLabelScreenBounds(graphPane, node, nodeScreenRectangle, labelScreenRectangle);
       
        return nodeScreenRectangle.contains(point) || labelScreenRectangle.contains(point);
    }
View Full Code Here

        int numInstances = node.size();

        int leftRightPad = 4;
        int hPadBetweenInstances = (int) (2 * getInstanceScale(numInstances));
       
        JPowerGraphRectangle dummyRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
        nodePainter.getNodeScreenBounds(graphPane, dummyNode, ShapeNodePainter.SMALL, getInstanceScale(numInstances), dummyRectangle);
        dummyRectangle.width += 2;
        dummyRectangle.height += 2;
       
        int numOuterCircles = countOuterCircles(numInstances);
View Full Code Here

            buffer.reset();
            buffer.fillRectangle(0, 0, getWidth(), getHeight());
        }
        buffer.setAntialias(antialias);
       
        JPowerGraphRectangle clipRectangle = buffer.getClipping();
        if (m_graph != null){
            synchronized (m_graph) {
                JPowerGraphRectangle bounds = new JPowerGraphRectangle(0, 0, 0, 0);
                Iterator iterator = m_graph.getVisibleEdges().iterator();
                while (iterator.hasNext()) {
                    Edge edge = (Edge) iterator.next();
                    getEdgeScreenBounds(edge, bounds);
                    if (clipRectangle.intersects(bounds)){
View Full Code Here

            }
        }
       
        legend.clearActionMap();
        if (drawLegend){
            JPowerGraphRectangle r = getDefaultLegendPainter().paintLegend(this, g, legend);
            legend.setLocation(r);
        }
        else{
            legend.setLocation(new JPowerGraphRectangle(0, 0, 0, 0));
        }
    }
View Full Code Here

     * @return the set of nodes in the region
     */
    public Set <Node> getNodesInRectangle(JPowerGraphRectangle rectangle) {
        synchronized (m_graph) {
            Set <Node> nodesInRectangle = new HashSet <Node> ();
            JPowerGraphRectangle nodeRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
            Iterator <Node> nodes = m_graph.getVisibleNodes().iterator();
            while (nodes.hasNext()) {
                Node node = nodes.next();
                getNodeScreenBounds(node, nodeRectangle);
                if (RectangleUtil.contains(rectangle, nodeRectangle)) {
View Full Code Here

TOP

Related Classes of net.sourceforge.jpowergraph.swtswinginteraction.geometry.JPowerGraphRectangle

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.