Class JComponentRenderer

java.lang.Object
org.graphstream.ui.swing.renderer.StyleRenderer
org.graphstream.ui.swing.renderer.JComponentRenderer
All Implemented Interfaces:
org.graphstream.ui.graphicGraph.GraphicElement.SwingElementRenderer

public class JComponentRenderer extends StyleRenderer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Object
     
    protected HashMap<JComponent,org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement>
    Association between Swing components and graph elements.
    protected int
    The size in PX of components.
    protected SquareShape
    The potential shadow.
    protected org.graphstream.ui.graphicGraph.stylesheet.Values
    The size of components.
    protected int
    The size in PX of components.

    Fields inherited from class org.graphstream.ui.swing.renderer.StyleRenderer

    group, hadEvents
  • Constructor Summary

    Constructors
    Constructor
    Description
    JComponentRenderer(org.graphstream.ui.graphicGraph.StyleGroup styleGroup, SwingGraphRenderer mainRenderer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkStyle(org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement ce, boolean force)
     
    void
    elementInvisible(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
    Called during rendering in place of #renderElement(Graphics2D, DefaultCamera2D, GraphicElement) to signal that the given element is not inside the view.
    void
    endRenderingPass(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow)
    Called at the end of the rendering pass.
    protected org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement
    getOrEquipWithJComponent(org.graphstream.ui.graphicGraph.GraphicElement element)
    Get the pair (swing component, graph element) corresponding to the given element.
    void
    pushDynStyle(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
    Called before the rendering of elements on dynamic styles.
    void
    pushStyle(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow)
    Called before the rendering of bulk and event elements.
    void
    renderElement(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
    Render a single element knowing the style is already prepared.
    void
    renderShadow(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
    Render the shadow of the element.
    void
    setupRenderingPass(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow)
    Called before the whole rendering pass for all elements.
    void
    unequipElement(org.graphstream.ui.graphicGraph.GraphicElement element)
     

    Methods inherited from class org.graphstream.ui.swing.renderer.StyleRenderer

    apply, render, render, renderShadow

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • size

      protected org.graphstream.ui.graphicGraph.stylesheet.Values size
      The size of components.
    • width

      protected int width
      The size in PX of components.
    • height

      protected int height
      The size in PX of components.
    • compToElement

      protected HashMap<JComponent,org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement> compToElement
      Association between Swing components and graph elements.
    • shadow

      protected SquareShape shadow
      The potential shadow.
    • antialiasSetting

      protected Object antialiasSetting
  • Constructor Details

    • JComponentRenderer

      public JComponentRenderer(org.graphstream.ui.graphicGraph.StyleGroup styleGroup, SwingGraphRenderer mainRenderer)
  • Method Details

    • setupRenderingPass

      public void setupRenderingPass(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow)
      Description copied from class: StyleRenderer
      Called before the whole rendering pass for all elements.
      Specified by:
      setupRenderingPass in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      forShadow - true if we are in the shadow rendering pass.
    • pushStyle

      public void pushStyle(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow)
      Description copied from class: StyleRenderer
      Called before the rendering of bulk and event elements.
      Specified by:
      pushStyle in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      forShadow - true if we are in the shadow rendering pass.
    • pushDynStyle

      public void pushDynStyle(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
      Description copied from class: StyleRenderer
      Called before the rendering of elements on dynamic styles. This must only change the style properties that can change dynamically.
      Specified by:
      pushDynStyle in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      element - The graphic element concerned by the dynamic style change.
    • renderElement

      public void renderElement(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
      Description copied from class: StyleRenderer
      Render a single element knowing the style is already prepared. Elements that are not visible are not drawn.
      Specified by:
      renderElement in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      element - The element to render.
    • renderShadow

      public void renderShadow(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
      Description copied from class: StyleRenderer
      Render the shadow of the element.
      Specified by:
      renderShadow in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      element - The element to render.
    • elementInvisible

      public void elementInvisible(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element)
      Description copied from class: StyleRenderer
      Called during rendering in place of #renderElement(Graphics2D, DefaultCamera2D, GraphicElement) to signal that the given element is not inside the view. The renderElement() method will be called as soon as the element becomes visible anew.
      Specified by:
      elementInvisible in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      element - The element to render.
    • endRenderingPass

      public void endRenderingPass(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow)
      Description copied from class: StyleRenderer
      Called at the end of the rendering pass.
      Specified by:
      endRenderingPass in class StyleRenderer
      Parameters:
      bck - The rendering back-end.
      camera - The camera.
      forShadow - true if we are in the shadow rendering pass.
    • unequipElement

      public void unequipElement(org.graphstream.ui.graphicGraph.GraphicElement element)
    • getOrEquipWithJComponent

      protected org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement getOrEquipWithJComponent(org.graphstream.ui.graphicGraph.GraphicElement element)
      Get the pair (swing component, graph element) corresponding to the given element. If the element is not yet associated with a Swing component, the binding is done.
    • checkStyle

      public void checkStyle(org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement ce, boolean force)