Package org.apache.commons.collections15

Examples of org.apache.commons.collections15.OrderedMap


 
  /**
   * Creates an instance which generates a minimum spanning tree assuming constant edge weights.
   */
  public PrimMinimumSpanningTree(Factory<? extends Graph<V,E>> factory) {
    this(factory, new ConstantTransformer(1.0));
  }
View Full Code Here


            public void actionPerformed(ActionEvent ae) {
              Dimension d = new Dimension(600,600);
                if (switchLayout.getText().indexOf("Spring") > 0) {
                    switchLayout.setText("Switch to FRLayout");
                    layout = new SpringLayout<Number,Number>(g,
                        new ConstantTransformer(EDGE_LENGTH));
                    layout.setSize(d);
                    vv.getModel().setGraphLayout(layout, d);
                } else {
                    switchLayout.setText("Switch to SpringLayout");
                    layout = new FRLayout<Number,Number>(g, d);
View Full Code Here

            throw new IllegalArgumentException("Supplied Forest must be empty");
        }
        this.graph = graph;
        this.forest = forest;
        this.weights = LazyMap.decorate(new HashMap<E,Double>(),
                new ConstantTransformer(1.0));
        Set<E> unfinishedEdges = new HashSet<E>(graph.getEdges());
        if(graph.getVertices().contains(root)) {
            this.forest.addVertex(root);
        }
        updateForest(forest.getVertices(), unfinishedEdges);
View Full Code Here

        ewcs =
            new EdgeWeightStrokeFunction<Number>(edge_weight);
        vsh = new VertexStrokeHighlight<Integer,Number>(g, picked_state);
        vff = new VertexFontTransformer<Integer>();
        eff = new EdgeFontTransformer<Number>();
        vs_none = new ConstantTransformer(null);
        es_none = new ConstantTransformer(null);
        vssa = new VertexShapeSizeAspect<Integer,Number>(g, voltages);
        show_edge = new DirectionDisplayPredicate<Integer,Number>(true, true);
        show_arrow = new DirectionDisplayPredicate<Integer,Number>(true, false);
        show_vertex = new VertexDisplayPredicate<Integer,Number>(false);

        // uses a gradient edge if unpicked, otherwise uses picked selection
        edgeDrawPaint =
            new GradientPickedEdgePaintFunction<Integer,Number>(
                    new PickableEdgePaintTransformer<Number>(
                            vv.getPickedEdgeState(),Color.black,Color.cyan), vv);
        edgeFillPaint =
            new GradientPickedEdgePaintFunction<Integer,Number>(
                    new PickableEdgePaintTransformer<Number>(
                            vv.getPickedEdgeState(),Color.black,Color.cyan), vv);
       
        vv.getRenderContext().setVertexFillPaintTransformer(seedFillColor);
        vv.getRenderContext().setVertexDrawPaintTransformer(seedDrawColor);
        vv.getRenderContext().setVertexStrokeTransformer(vsh);
        vv.getRenderContext().setVertexLabelTransformer(vs_none);
        vv.getRenderContext().setVertexFontTransformer(vff);
        vv.getRenderContext().setVertexShapeTransformer(vssa);
        vv.getRenderContext().setVertexIncludePredicate(show_vertex);
       
        vv.getRenderContext().setEdgeDrawPaintTransformer( edgeDrawPaint );
        vv.getRenderContext().setEdgeLabelTransformer(es_none);
        vv.getRenderContext().setEdgeFontTransformer(eff);
        vv.getRenderContext().setEdgeStrokeTransformer(ewcs);
        vv.getRenderContext().setEdgeIncludePredicate(show_edge);
        vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer,Number>());
        vv.getRenderContext().setEdgeArrowPredicate(show_arrow);
       
        vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray));
        vv.getRenderContext().setArrowDrawPaintTransformer(new ConstantTransformer(Color.black));
        JPanel jp = new JPanel();
        jp.setLayout(new BorderLayout());
       
        vv.setBackground(Color.white);
        GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv);
View Full Code Here

        else if (source == fill_edges)
        {
          if(source.isSelected()) {
            vv.getRenderContext().setEdgeFillPaintTransformer( edgeFillPaint );
          } else {
            vv.getRenderContext().setEdgeFillPaintTransformer( new ConstantTransformer(null) );
          }
//            edgePaint.useFill(source.isSelected());
        }
        vv.repaint();
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  public AbstractVertexShapeTransformer()
    {
        this(new ConstantTransformer(DEFAULT_SIZE),
                new ConstantTransformer(DEFAULT_ASPECT_RATIO));
    }
View Full Code Here

            new GradientVertexRenderer<String,Number>(
                Color.white, Color.red,
                Color.white, Color.blue,
                vv.getPickedVertexState(),
                false));
        vv.getRenderContext().setEdgeDrawPaintTransformer(new ConstantTransformer(Color.lightGray));
        vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray));
        vv.getRenderContext().setArrowDrawPaintTransformer(new ConstantTransformer(Color.lightGray));
       
        vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
        vv.getRenderer().getVertexLabelRenderer().setPositioner(new InsidePositioner());
        vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.AUTO);
View Full Code Here

     * 10 and a constant aspect ratio of 1.
     */
    @SuppressWarnings("unchecked")
  public VertexShapeFactory()
    {
        this(new ConstantTransformer(10),
            new ConstantTransformer(1.0f));
    }
View Full Code Here

          TestGraphs.getDemoGraph();
       
        MinimumSpanningForest2<String,Number> prim =
          new MinimumSpanningForest2<String,Number>(graph,
            new DelegateForest<String,Number>(), DelegateTree.<String,Number>getFactory(),
            new ConstantTransformer(1.0));
       
        tree = prim.getForest();
       
        // create two layouts for the one graph, one layout for each model
        Layout<String,Number> layout0 = new KKLayout<String,Number>(graph);
View Full Code Here

        vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());
        vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
        vv.getRenderContext().setVertexShapeTransformer(new ClusterVertexShapeFunction());
        // add a listener for ToolTips
        vv.setVertexToolTipTransformer(new ToStringLabeller());
        vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray));
        rings = new Rings();

        Container content = getContentPane();
        final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
        content.add(panel);
View Full Code Here

TOP

Related Classes of org.apache.commons.collections15.OrderedMap

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.