Class PortLabelVertexView.PortLabelVertexRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
org.jgraph.graph.VertexRenderer
org.processmining.contexts.util.jgraph.PortLabelVertexView.PortLabelVertexRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, org.jgraph.graph.CellViewRenderer
Enclosing class:
PortLabelVertexView

public static class PortLabelVertexView.PortLabelVertexRenderer extends org.jgraph.graph.VertexRenderer
The renderer class for instance view.
See Also:
  • Field Details

    • ports

      protected org.jgraph.graph.CellView[] ports
    • fontMetrics

      protected FontMetrics fontMetrics
    • PORTLABELSPACING

      public static transient int PORTLABELSPACING
    • MINIMUMHORIZONTALSPACING

      public static transient int MINIMUMHORIZONTALSPACING
    • MINIMUMVERTICALSPACING

      public static transient int MINIMUMVERTICALSPACING
    • COLORHEIGHTBUFFER

      public static transient int COLORHEIGHTBUFFER
      The vertical distance added to the label height to make the color backdrop extend beyond the label text
    • MAXLABELWIDTH

      public static transient int MAXLABELWIDTH
      The maximum width of a label, any label more than this value in width
  • Constructor Details

    • PortLabelVertexRenderer

      public PortLabelVertexRenderer()
  • Method Details

    • paint

      public void paint(Graphics g)
      Description copied from class: org.jgraph.graph.VertexRenderer
      Paint the renderer. Overrides superclass paint to add specific painting.
      Overrides:
      paint in class org.jgraph.graph.VertexRenderer
    • getRendererComponent

      public Component getRendererComponent(org.jgraph.JGraph graph, org.jgraph.graph.CellView view, boolean sel, boolean focus, boolean preview)
      Description copied from class: org.jgraph.graph.VertexRenderer
      Configure and return the renderer component based on the passed in cell. The value is typically set from messaging the graph with convertValueToString. We recommend you check the value's class and throw an illegal argument exception if it's not correct.
      Specified by:
      getRendererComponent in interface org.jgraph.graph.CellViewRenderer
      Overrides:
      getRendererComponent in class org.jgraph.graph.VertexRenderer
      Parameters:
      graph - the graph that that defines the rendering context.
      view - the cell view that should be rendered.
      sel - whether the object is selected.
      focus - whether the object has the focus.
      preview - whether we are drawing a preview.
      Returns:
      the component used to render the value.
    • installAttributes

      protected void installAttributes(org.jgraph.graph.CellView view)
      Install the attributes of specified cell in this renderer instance. This means, retrieve every published key from the cells hashtable and set global variables or superclass properties accordingly.
      Overrides:
      installAttributes in class org.jgraph.graph.VertexRenderer
      Parameters:
      view - the cell view to retrieve the attribute values from.
    • drawPortLabel

      public static void drawPortLabel(Graphics g, String labelValue, double x, double y, Color background, boolean isLeftLabel)
      Draws a String. Its horizontal position x is given and its vertical position is centered on given y.
      Parameters:
      g - a Graphics2D to draw with
      label - a String to draw
      x - an offset to left edge of the bounding box of vertex
      y - an offset to center of the string
      background - the background color, if any, behind the text
      isLeftLabel - whether or not this label is on the left-hand side of the vertex
    • paintPortLabels

      public void paintPortLabels(Graphics g)
      Paints port labels the view.
      Parameters:
      g - a Graphics2D to draw with
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent