Package com.neptuny.xgrapher.cli.render

Source Code of com.neptuny.xgrapher.cli.render.DefaultRenderer

/*******************************************************************************
*   Copyright 2007 Neptuny s.r.l. - www.neptuny.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
*   Unless required by applicable law or agreed to in writing, software
*   distributed under the License is distributed on an "AS IS" BASIS,
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*   See the License for the specific language governing permissions and
*   limitations under the License.
*******************************************************************************/
package com.neptuny.xgrapher.cli.render;

import com.neptuny.xgrapher.cli.controller.GraphAttributeType;

import edu.uci.ics.jung.graph.decorators.UserDatumNumberVertexValue;
import edu.uci.ics.jung.visualization.PluggableRenderer;
import edu.uci.ics.jung.visualization.SpringLayout.LengthFunction;

/**
*
* @author battlehorse
*/
public class DefaultRenderer implements XGrapherRenderer {

    public void configureRenderer(PluggableRenderer pr) {
        pr.setVertexPaintFunction(new DefaultVertexPaintFunction());
        pr.setVertexStringer(new DefaultVertexValueStringer());
        pr.setVertexShapeFunction(new DefaultVertexShapeSizeAspect(new UserDatumNumberVertexValue(GraphAttributeType.SIZE)));
       
        pr.setEdgePaintFunction(new DefaultEdgePaintFunction());
        pr.setEdgeStrokeFunction(new DefaultEdgeStrokeFunction());
        pr.setEdgeStringer(new DefaultEdgeStringer());
    }

    public LengthFunction getLengthFunction() {
        return new DefaultLengthFunction();
    }
   
   


}
TOP

Related Classes of com.neptuny.xgrapher.cli.render.DefaultRenderer

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.