com.googlecode.blaisemath.graph.StaticGraphLayout Maven / Gradle / Ivy
Show all versions of blaise-graphtheory Show documentation
/*
* StaticGraphLayout.java
* Created May 13, 2010
*/
package com.googlecode.blaisemath.graph;
/*
* #%L
* BlaiseGraphTheory
* --
* Copyright (C) 2009 - 2016 Elisha Peterson
* --
* 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.
* #L%
*/
import com.google.common.collect.Maps;
import java.awt.geom.Point2D;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
*
* This interface provides methods necessary to layout a graph.
*
*
* @param object describing layout parameters
*
* @author Elisha Peterson
*/
public interface StaticGraphLayout
{
/**
* Return the object type for layout parameters
* @return object type
*/
Class
getParametersType();
/**
* Perform layout on given graph, and return result.
* @param g a graph written in terms of adjacencies
* @param ic initial conditions
* @param fixed nodes whose positions should be fixed
* @param parameters parameters for the layout, e.g. radius
* @return a mapping of points to vertices
* @param graph node type
*/
Map layout(Graph g, Map ic,
Set fixed, P parameters);
/**
* Puts vertices all at the origin.
*/
public static StaticGraphLayout ORIGIN = new StaticGraphLayout