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 VertexLabelRenderer {
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 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 vertex is currently selected
35 * @param vertex the edge whose label is being drawn
36 * @param <V> the vertex type
37 * @return the component used for drawing the label
38 */
39 <V> Component getVertexLabelRendererComponent(JComponent vv, Object value,
40 Font font, boolean isSelected, V vertex);
41 }