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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Objectprotected HashMap<JComponent,org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement> Association between Swing components and graph elements.protected intThe size in PX of components.protected SquareShapeThe potential shadow.protected org.graphstream.ui.graphicGraph.stylesheet.ValuesThe size of components.protected intThe size in PX of components.Fields inherited from class org.graphstream.ui.swing.renderer.StyleRenderer
group, hadEvents -
Constructor Summary
ConstructorsConstructorDescriptionJComponentRenderer(org.graphstream.ui.graphicGraph.StyleGroup styleGroup, SwingGraphRenderer mainRenderer) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckStyle(org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement ce, boolean force) voidelementInvisible(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.voidendRenderingPass(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.ComponentElementgetOrEquipWithJComponent(org.graphstream.ui.graphicGraph.GraphicElement element) Get the pair (swing component, graph element) corresponding to the given element.voidpushDynStyle(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element) Called before the rendering of elements on dynamic styles.voidCalled before the rendering of bulk and event elements.voidrenderElement(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.voidrenderShadow(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.GraphicElement element) Render the shadow of the element.voidsetupRenderingPass(Backend bck, org.graphstream.ui.view.camera.DefaultCamera2D camera, boolean forShadow) Called before the whole rendering pass for all elements.voidunequipElement(org.graphstream.ui.graphicGraph.GraphicElement element) Methods inherited from class org.graphstream.ui.swing.renderer.StyleRenderer
apply, render, render, renderShadow
-
Field Details
-
size
protected org.graphstream.ui.graphicGraph.stylesheet.Values sizeThe size of components. -
width
protected int widthThe size in PX of components. -
height
protected int heightThe size in PX of components. -
compToElement
protected HashMap<JComponent,org.graphstream.ui.swing.renderer.JComponentRenderer.ComponentElement> compToElementAssociation between Swing components and graph elements. -
shadow
The potential shadow. -
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:StyleRendererCalled before the whole rendering pass for all elements.- Specified by:
setupRenderingPassin classStyleRenderer- 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:StyleRendererCalled before the rendering of bulk and event elements.- Specified by:
pushStylein classStyleRenderer- 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:StyleRendererCalled before the rendering of elements on dynamic styles. This must only change the style properties that can change dynamically.- Specified by:
pushDynStylein classStyleRenderer- 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:StyleRendererRender a single element knowing the style is already prepared. Elements that are not visible are not drawn.- Specified by:
renderElementin classStyleRenderer- 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:StyleRendererRender the shadow of the element.- Specified by:
renderShadowin classStyleRenderer- 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:StyleRendererCalled 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:
elementInvisiblein classStyleRenderer- 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:StyleRendererCalled at the end of the rendering pass.- Specified by:
endRenderingPassin classStyleRenderer- 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)
-