1 /* 2 * Copyright (c) 2005, the JUNG Project and the Regents of the University of 3 * California All rights reserved. 4 * 5 * This software is open-source under the BSD license; see either "license.txt" 6 * or http://jung.sourceforge.net/license.txt for a description. 7 * 8 * Created on Apr 14, 2005 9 */ 10 11 package edu.uci.ics.jung.visualization.renderers; 12 13 import java.awt.Component; 14 import java.awt.Font; 15 16 import javax.swing.JComponent; 17 18 /** 19 * @author Tom Nelson 20 * 21 * 22 */ 23 public interface EdgeLabelRenderer { 24 /** 25 * Returns the component used for drawing the label. This method is 26 * used to configure the renderer appropriately before drawing. 27 * 28 * @param vv the <code>JComponent</code> that is asking the 29 * renderer to draw; can be <code>null</code> 30 * @param value the value of the cell to be rendered. It is 31 * up to the specific renderer to interpret 32 * and draw the value. For example, if 33 * <code>value</code> 34 * is the string "true", it could be rendered as a 35 * string or it could be rendered as a check 36 * box that is checked. <code>null</code> is a 37 * valid value 38 * @param vertex the vertex for the label being drawn. 39 */ 40 <T> Component getEdgeLabelRendererComponent(JComponent vv, Object value, 41 Font font, boolean isSelected, T edge); 42 43 boolean isRotateEdgeLabels(); 44 45 void setRotateEdgeLabels(boolean state); 46 }