Class DefaultEdgeLabelRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
edu.uci.ics.jung.visualization.renderers.DefaultEdgeLabelRenderer
All Implemented Interfaces:
EdgeLabelRenderer, ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public class DefaultEdgeLabelRenderer extends JLabel implements EdgeLabelRenderer, Serializable
DefaultEdgeLabelRenderer is similar to the cell renderers used by the JTable and JTree jfc classes.
See Also:
  • Field Details

    • noFocusBorder

      protected static Border noFocusBorder
    • pickedEdgeLabelColor

      protected Color pickedEdgeLabelColor
    • rotateEdgeLabels

      protected boolean rotateEdgeLabels
  • Constructor Details

    • DefaultEdgeLabelRenderer

      public DefaultEdgeLabelRenderer(Color pickedEdgeLabelColor)
    • DefaultEdgeLabelRenderer

      public DefaultEdgeLabelRenderer(Color pickedEdgeLabelColor, boolean rotateEdgeLabels)
      Creates an instance with the specified properties.
      Parameters:
      pickedEdgeLabelColor - the color to use for rendering the labels of picked edges
      rotateEdgeLabels - whether the
  • Method Details

    • isRotateEdgeLabels

      public boolean isRotateEdgeLabels()
      Specified by:
      isRotateEdgeLabels in interface EdgeLabelRenderer
      Returns:
      Returns the rotateEdgeLabels.
    • setRotateEdgeLabels

      public void setRotateEdgeLabels(boolean rotateEdgeLabels)
      Specified by:
      setRotateEdgeLabels in interface EdgeLabelRenderer
      Parameters:
      rotateEdgeLabels - The rotateEdgeLabels to set.
    • setForeground

      public void setForeground(Color c)
      Overrides JComponent.setForeground to assign the unselected-foreground color to the specified color.
      Overrides:
      setForeground in class JComponent
      Parameters:
      c - set the foreground color to this value
    • setBackground

      public void setBackground(Color c)
      Overrides JComponent.setBackground to assign the unselected-background color to the specified color.
      Overrides:
      setBackground in class JComponent
      Parameters:
      c - set the background color to this value
    • updateUI

      public void updateUI()
      Notification from the UIManager that the look and feel has changed. Replaces the current UI object with the latest version from the UIManager.
      Overrides:
      updateUI in class JLabel
      See Also:
    • getEdgeLabelRendererComponent

      public <E> Component getEdgeLabelRendererComponent(JComponent vv, Object value, Font font, boolean isSelected, E edge)
      Returns the default label renderer for an Edge
      Specified by:
      getEdgeLabelRendererComponent in interface EdgeLabelRenderer
      Type Parameters:
      E - the edge type
      Parameters:
      vv - the VisualizationViewer to render on
      value - the value to assign to the label for Edge
      font - the font to use in rendering the label
      isSelected - whether the edge is currently selected
      edge - the Edge
      Returns:
      the default label renderer
    • isOpaque

      public boolean isOpaque()
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      isOpaque in class JComponent
    • validate

      public void validate()
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      validate in class Container
    • revalidate

      public void revalidate()
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      revalidate in class JComponent
    • repaint

      public void repaint(long tm, int x, int y, int width, int height)
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      repaint in class JComponent
    • repaint

      public void repaint(Rectangle r)
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      repaint in class JComponent
    • firePropertyChange

      protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      firePropertyChange in class Component
    • firePropertyChange

      public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
      Overridden for performance reasons. See the Implementation Note for more information.
      Overrides:
      firePropertyChange in class JComponent
    • setValue

      protected void setValue(Object value)
      Sets the String object for the cell being rendered to value.
      Parameters:
      value - the string value for this cell; if value is null it sets the text value to an empty string
      See Also: