View Javadoc
1   /*
2    * Copyright (c) 2005, The JUNG Authors
3    * All rights reserved.
4    * 
5    * This software is open-source under the BSD license; see either "license.txt"
6    * or https://github.com/jrtom/jung/blob/master/LICENSE for a description.
7    * 
8    * Created on March 10, 2005
9    */
10  package edu.uci.ics.jung.visualization.decorators;
11  
12  import java.awt.Shape;
13  
14  import com.google.common.base.Function;
15  
16  import edu.uci.ics.jung.graph.util.EdgeIndexFunction;
17  
18  
19  /**
20   * An abstract class for edge-to-Shape functions that work with parallel edges.
21   *  
22   * @author Tom Nelson
23   */
24  public abstract class ParallelEdgeShapeTransformer<V,E> implements Function<E, Shape> {
25      /** Specifies the distance between control points for edges being drawn in parallel. */
26      protected float control_offset_increment = 20.f;
27      protected EdgeIndexFunction<V,E> edgeIndexFunction;
28      
29      public void setControlOffsetIncrement(float y) {
30          control_offset_increment = y;
31      }
32      
33      public void setEdgeIndexFunction(EdgeIndexFunction<V,E> edgeIndexFunction) {
34      	this.edgeIndexFunction = edgeIndexFunction;
35      }
36      
37      public EdgeIndexFunction<V,E> getEdgeIndexFunction() {
38      	return edgeIndexFunction;
39      }
40  }