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 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 component the component that is asking the renderer to draw
29 * @param value the value of the cell to be rendered; the details of how to
30 * render the value are up to the renderer implementation. For example,
31 * if {@code value} is the string "true", it could be rendered as the
32 * string or as a checked checkbox.
33 * @param font the font to use in rendering the label
34 * @param isSelected whether the edge is currently selected
35 * @param edge the edge whose label is being drawn
36 * @param <E> the edge type
37 * @return the component used for drawing the label
38 */
39 <E> Component getEdgeLabelRendererComponent(JComponent component,
40 Object value, Font font, boolean isSelected, E edge);
41
42 boolean isRotateEdgeLabels();
43
44 void setRotateEdgeLabels(boolean state);
45 }