Examples of JPowerGraphPoint


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

     * @param graphPane             the graph pane
     * @param edge                  the edge
     * @param edgeScreenRectangle   the rectangle receiving the edge's coordinates
     */
    public void getEdgeScreenBounds(JGraphPane graphPane, T edge, JPowerGraphRectangle edgeScreenRectangle) {
        JPowerGraphPoint from=graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to=graphPane.getScreenPointForNode(edge.getTo());
        edgeScreenRectangle.x = Math.min(from.x,to.x);
        edgeScreenRectangle.y = Math.min(from.y,to.y);
        edgeScreenRectangle.width = Math.abs(to.x-from.x)+1;
        edgeScreenRectangle.height = Math.abs(to.y-from.y)+1;
    }
View Full Code Here

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

        edgeColor3 = normal;
        dashedLine = isDashedLine;
    }
   
    public void paintEdge(JGraphPane graphPane, JPowerGraphGraphics g, T edge, SubGraphHighlighter theSubGraphHighlighter) {
        JPowerGraphPoint from = graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to = graphPane.getScreenPointForNode(edge.getTo());
        JPowerGraphColor oldFGColor = g.getForeground();
        JPowerGraphColor oldBGColor = g.getBackground();
       
        g.setForeground(getEdgeColor(edge, graphPane, false, theSubGraphHighlighter));
        g.setBackground(getEdgeColor(edge, graphPane, false, theSubGraphHighlighter));
View Full Code Here

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

               
                g.setForeground(enabledButtonColor);
                g.drawLine(r.x, r.y + r.height/2, r.x + r.width, r.y + r.height/2);
                g.drawString(groupLegendItem.getDescription(), r.x + r.width + 5, r.y - 2, 1);
                if (groupLegendItem.isExpanded()){
                    JPowerGraphPoint subPoint = new JPowerGraphPoint(thePoint.x + indent, thePoint.y + Math.max(toggleHeight, g.getAscent() + g.getDescent() + 4));
                    for (LegendItem subLegendItem : groupLegendItem.getLegendItems()) {
                        JPowerGraphDimension subDimension = new JPowerGraphDimension(0, 0);
                        getLegendItemSize(graphPane, subLegendItem, theLegend, subDimension);
                        paintLegendItem(graphPane, g, subLegendItem, theLegend, subPoint, theLegendRectangle);
                        subPoint.y += subDimension.height;
View Full Code Here

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

        g.fillRoundRectangle(legendRectangle.x, legendRectangle.y, legendRectangle.width, legendRectangle.height, 10, 10);
        g.setForeground(black);
        g.drawRoundRectangle(legendRectangle.x, legendRectangle.y, legendRectangle.width, legendRectangle.height, 10, 10);
        g.setForeground(oldColor);
       
        JPowerGraphPoint point = new JPowerGraphPoint(legendRectangle.x + widthPad/2, legendRectangle.y + heightPad);
        for (LegendItem legendItem : theLegend.getRoot().getLegendItems()) {
            JPowerGraphDimension dimension = new JPowerGraphDimension(0, 0);
            painter.getLegendItemSize(graphPane, legendItem, theLegend, dimension);
            painter.paintLegendItem(graphPane, g, legendItem, theLegend, point, legendRectangle);
            point.y += dimension.height;
View Full Code Here

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

        }
        return dist/2;
    }
   
    public void getEdgeScreenBounds(JGraphPane graphPane, LoopEdge edge, JPowerGraphRectangle edgeScreenRectangle) {
        JPowerGraphPoint node = graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphRectangle rectangle = new  JPowerGraphRectangle(0, 0, 0, 0);
        graphPane.getNodeScreenBounds(edge.getFrom(), rectangle);
       
        edgeScreenRectangle.width = rectangle.width/2 + Math.max(widthpad, rectangle.width/10);
        edgeScreenRectangle.height = rectangle.height/2 + Math.max(heightpad, rectangle.height/10);
View Full Code Here

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

     * @return                      the distance of the point from the edge
     */
    public double screenDistanceFromEdge(JGraphPane graphPane, T edge, JPowerGraphPoint point) {
        double px=point.x;
        double py=point.y;
        JPowerGraphPoint from = graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to = graphPane.getScreenPointForNode(edge.getTo());
        double x1=from.x;
        double y1=from.y;
        double x2=to.x;
        double y2=to.y;
        if (px<Math.min(x1,x2)-8 || px>Math.max(x1,x2)+8 || py<Math.min(y1,y2)-8 || py>Math.max(y1,y2)+8)
View Full Code Here

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

     * @param graphPane             the graph pane
     * @param edge                  the edge
     * @param edgeScreenRectangle   the rectangle receiving the edge's coordinates
     */
    public void getEdgeScreenBounds(JGraphPane graphPane, T edge, JPowerGraphRectangle edgeScreenRectangle) {
        JPowerGraphPoint from=graphPane.getScreenPointForNode(edge.getFrom());
        JPowerGraphPoint to=graphPane.getScreenPointForNode(edge.getTo());
       
        edgeScreenRectangle.x = Math.min(from.x,to.x);
        edgeScreenRectangle.y = Math.min(from.y,to.y);
        edgeScreenRectangle.width = Math.abs(to.x-from.x)+1;
        edgeScreenRectangle.height = Math.abs(to.y-from.y)+1;
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.