Examples of JPowerGraphColor


Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

    }
    return new Pair<List <Node>, List<Edge>>(nodes, edges);
  }

  public void setPainters(JGraphPane theJGraphPane){
    JPowerGraphColor light_blue = new JPowerGraphColor(102, 204, 255);
    JPowerGraphColor dark_blue = new JPowerGraphColor(0, 153, 255);
    JPowerGraphColor light_red = new JPowerGraphColor(255, 102, 102);
    JPowerGraphColor dark_red = new JPowerGraphColor(204, 51, 51);
    JPowerGraphColor light_green = new JPowerGraphColor(153, 255, 102);
    JPowerGraphColor dark_green = new JPowerGraphColor(0, 204, 0);
    JPowerGraphColor black = new JPowerGraphColor(0, 0, 0);
    JPowerGraphColor gray = new JPowerGraphColor(128, 128, 128);

    //Nodes style
    theJGraphPane.setNodePainter(ConceptNode.class, new ShapeNodePainter(ShapeNodePainter.RECTANGLE, light_blue, dark_blue, black));
    theJGraphPane.setNodePainter(SubClassNode.class, new ShapeNodePainter(ShapeNodePainter.RECTANGLE, light_red, dark_red, black));        
    theJGraphPane.setNodePainter(SuperClassNode.class, new ShapeNodePainter(ShapeNodePainter.RECTANGLE, light_green, dark_green, black));
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

        }
        return new Pair<List <Node>, List<Edge>>(nodes, edges);
    }
   
    public void setPainters(JGraphPane theJGraphPane){
        JPowerGraphColor light_blue = new JPowerGraphColor(102, 204, 255);
        JPowerGraphColor dark_blue = new JPowerGraphColor(0, 153, 255);
        JPowerGraphColor light_red = new JPowerGraphColor(255, 102, 102);
        JPowerGraphColor dark_red = new JPowerGraphColor(204, 51, 51);
        JPowerGraphColor light_green = new JPowerGraphColor(153, 255, 102);
        JPowerGraphColor dark_green = new JPowerGraphColor(0, 204, 0);
        JPowerGraphColor black = new JPowerGraphColor(0, 0, 0);
        JPowerGraphColor gray = new JPowerGraphColor(128, 128, 128);
       
        theJGraphPane.setNodePainter(NodeType1.class, new ShapeNodePainter(ShapeNodePainter.RECTANGLE, light_blue, dark_blue, black));
        theJGraphPane.setNodePainter(NodeType2.class, new ShapeNodePainter(ShapeNodePainter.ELLIPSE, light_red, dark_red, black));
        theJGraphPane.setNodePainter(NodeType3.class, new ShapeNodePainter(ShapeNodePainter.TRIANGLE, light_green, dark_green, black));
        theJGraphPane.setNodePainter(NodeType4.class, new ClusterNodePainter(ShapeNodePainter.ELLIPSE, light_red, dark_red, black, true, new RowImageMap()));
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

        createDefaultPost(),
        createRelationWeight(lcform.getRelationsFile(),lcform.getDefaultValue()));
  }

  public static JPowerGraphColor randomColor(){   
        return new JPowerGraphColor(rand.nextInt(256),rand.nextInt(256),rand.nextInt(256));
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

        int imageX = thePoint.x;
        int imageY = thePoint.y;
        int textX = imageX + imageWidth + (padding * 3);
        int textY = imageY - 3; // SWING was + imageHeight and not - 3

        JPowerGraphColor bgColor = getBackgroundColor(new DefaultNode(), null, new DefaultSubGraphHighlighter());
        JPowerGraphColor boColor = getBorderColor(new DefaultNode(), null, new DefaultSubGraphHighlighter());
        JPowerGraphColor teColor = getTextColor(new DefaultNode(), null, new DefaultSubGraphHighlighter());

        JPowerGraphColor oldFGColor = g.getForeground();
        JPowerGraphColor oldBGColor = g.getBackground();
        if (shape == RECTANGLE) {
            g.setBackground(bgColor);
            g.fillRectangle(imageX, imageY, imageWidth, imageHeight);
            g.setForeground(boColor);
            g.drawRectangle(imageX, imageY, imageWidth, imageHeight);
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

    private DefaultNode dummyNode;
   
    public ClusterNodePainter(int theShape, JPowerGraphColor theBackgroundColor, JPowerGraphColor theBorderColor, JPowerGraphColor theTextColor, boolean theShowNodes, RowImageMap theRowImageMap) {
        this.nodePainter = new ShapeNodePainter(theShape, theBackgroundColor, theBorderColor, theTextColor);
       
        this.backgroundColor = new JPowerGraphColor(246, 246, 246);
        this.borderColor = new JPowerGraphColor(197, 197, 197);
        this.textColor = JPowerGraphColor.BLACK;
       
        this.notHighlightedBackgroundColor = new JPowerGraphColor(246, 246, 246);
        this.notHighlightedBorderColor = new JPowerGraphColor(197, 197, 197);
        this.notHighlightedTextColor = new JPowerGraphColor(197, 197, 197);
       
        this.showNodes = theShowNodes;
        this.rowImageMap = theRowImageMap;
       
        this.dummyNode = new DefaultNode();
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

            height = (int) Math.ceil(height * theScale);
        }
      
        int radius = Math.max(width, height);
       
        JPowerGraphColor oldBGColor = g.getBackground();
        JPowerGraphColor oldFGColor = g.getForeground();
        g.setBackground(getBackgroundColor(node, graphPane, theSubGraphHighlighter));
        g.fillOval(thePoint.x - radius / 2, thePoint.y - radius / 2, radius, radius);

        g.setForeground(getBorderColor(node, graphPane, theSubGraphHighlighter));
        g.drawOval(thePoint.x - radius / 2, thePoint.y - radius / 2, radius, radius);

        if (showNodes){
            JPowerGraphGraphics subG = g.getSubJPowerGraphGraphics(new JPowerGraphDimension(dummyRectangle.width, dummyRectangle.height));
            double scale = getInstanceScale(numInstances);
           
            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){
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

        int imageX = thePoint.x + (padding * 2);
        int imageY = thePoint.y;
        int textX = imageX + imageWidth + (padding * 6);
        int textY = imageY - 3;

        JPowerGraphColor bgColor = getBackgroundColor(new DefaultNode(), null, new DefaultSubGraphHighlighter());
        JPowerGraphColor boColor = getBorderColor(new DefaultNode(), null, new DefaultSubGraphHighlighter());
        JPowerGraphColor teColor = getTextColor(new DefaultNode(), null, new DefaultSubGraphHighlighter());

        JPowerGraphColor oldFGColor = g.getForeground();
        JPowerGraphColor oldBGColor = g.getBackground();

        g.setBackground(bgColor);
        g.fillOval(imageX, imageY, imageWidth, imageHeight);
        g.setForeground(boColor);
        g.drawOval(imageX, imageY, imageWidth, imageHeight);
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

            double xDiff = - stringWidth/2;
            double yDiff = -20;
            midpoint.setLocation(midpoint.getX() + xDiff, midpoint.getY() + yDiff);
        }
       
        JPowerGraphColor oldFGColor=g.getForeground();
        g.setForeground(getEdgeColor(edge, graphPane, false, theSubGraphHighlighter));
        g.drawString(text, (int) midpoint.getX(), (int) midpoint.getY(), 1);
        g.setForeground(oldFGColor);
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

        this.colourManager = theColourManager;
    }

    public JPowerGraphColor getBackground() {
        Color c = gc.getBackground();
        return new JPowerGraphColor(c.getRed(), c.getGreen(), c.getBlue());
    }
View Full Code Here

Examples of net.sourceforge.jpowergraph.swtswinginteraction.color.JPowerGraphColor

        return new JPowerGraphColor(c.getRed(), c.getGreen(), c.getBlue());
    }
   
    public JPowerGraphColor getForeground() {
        Color c = gc.getForeground();
        return new JPowerGraphColor(c.getRed(), c.getGreen(), c.getBlue());
    }
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.