Class KLibraryExtensions
java.lang.Object
de.cau.cs.kieler.klighd.krendering.extensions.KLibraryExtensions
Extension that allow a convenient use of the
KRenderingLibrary mechanism.- Author:
- uru
- This class contains Xtend extension methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRenderingRef(KGraphElement kge, KRendering rendering) addToLibrary(KNode node, String id, KRendering rendering) Identifies the passedrenderingelement with the passedidwithin the KRendering library valid for the given node.addToLibrary(KRenderingLibrary library, String id, KRendering rendering) Identifies the passedrenderingelement with the passedidwithin the KRendering library.getFromLibrary(KNode node, String id) Retrieves the rendering element that has been identified with theidstring from the rendering library valid for the given node.getFromLibrary(KRenderingLibrary library, String id) Retrieves the rendering element that has been identified with theidstring from the given rendering library.getLibrary(KNode node) Retrieves the rendering library valid for the given node.
-
Constructor Details
-
KLibraryExtensions
public KLibraryExtensions()
-
-
Method Details
-
getLibrary
Retrieves the rendering library valid for the given node. The library must be located in the node's topmost ancestor. If that ancestor does not yet have a rendering library attached, one is generated.- Extension Category:
- library
- Code Example:
- val library = node.library
-
getFromLibrary
Retrieves the rendering element that has been identified with theidstring from the given rendering library.- Extension Category:
- library
- Code Example:
- val libJunction = edge.source.getFromLibrary("ren_junction")
-
getFromLibrary
Retrieves the rendering element that has been identified with theidstring from the rendering library valid for the given node.- Extension Category:
- library
- Code Example:
- val libJunction = edge.source.getFromLibrary("ren_junction")
-
addToLibrary
Identifies the passedrenderingelement with the passedidwithin the KRendering library. Afterwards the rendering can be retrieved from the library using thegetFromLibrarymethod.- Extension Category:
- library
- Code Example:
- edge.source.library.addToLibrary("ren_junction", createKRoundedRectangle => [ rr | rr.background = color rr.foreground = color rr.cornerWidth = 2 rr.cornerHeight = 2 rr.setPointPlacementData(LEFT, 0, 0, TOP, 0, 0, H_CENTRAL, V_CENTRAL, 0, 0, 10, 10) ] )
-
addToLibrary
Identifies the passedrenderingelement with the passedidwithin the KRendering library valid for the given node. Afterwards the rendering can be retrieved from the library using thegetFromLibrarymethod.- Extension Category:
- library
- Code Example:
- edge.source.addToLibrary("ren_junction", createKRoundedRectangle => [ rr | rr.background = color rr.foreground = color rr.cornerWidth = 2 rr.cornerHeight = 2 rr.setPointPlacementData(LEFT, 0, 0, TOP, 0, 0, H_CENTRAL, V_CENTRAL, 0, 0, 10, 10) ] )
-
addRenderingRef
-