Package com.powsybl.sld.library
Class ResourcesComponentLibrary
- java.lang.Object
-
- com.powsybl.sld.library.ResourcesComponentLibrary
-
- All Implemented Interfaces:
ComponentLibrary
- Direct Known Subclasses:
ConvergenceComponentLibrary
public class ResourcesComponentLibrary extends Object implements ComponentLibrary
Library of resources components, that is, the SVG image files representing the components, together with the styles associated to each component- Author:
- Benoit Jeanson
, Nicolas Duchene, Geoffroy Jamgotchian , Franck Lecuyer
-
-
Constructor Summary
Constructors Constructor Description ResourcesComponentLibrary(String name, String directory, String... additionalDirectories)
Constructs a new library containing the components in the given directories
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AnchorPoint>
getAnchorPoints(String type)
Map<String,ComponentSize>
getComponentsSize()
Optional<String>
getComponentStyleClass(String type)
List<String>
getCssFilenames()
List<URL>
getCssUrls()
protected List<Element>
getElements(Document doc)
String
getName()
ComponentSize
getSize(String type)
Optional<String>
getSubComponentStyleClass(String type, String subComponent)
Map<String,List<Element>>
getSvgElements(String type)
Map<Orientation,Component.Transformation>
getTransformations(String type)
-
-
-
Constructor Detail
-
ResourcesComponentLibrary
public ResourcesComponentLibrary(String name, String directory, String... additionalDirectories)
Constructs a new library containing the components in the given directories- Parameters:
name
- name of the librarydirectory
- main directory containing the resources components: SVG files, with associated components.json (containing the list of SVG files) and components.css (containing the style applied to each component)additionalDirectories
- directories for additional components (each directory containing SVG files, associated components.json and components.css).
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceComponentLibrary
-
getSvgElements
public Map<String,List<Element>> getSvgElements(String type)
- Specified by:
getSvgElements
in interfaceComponentLibrary
-
getAnchorPoints
public List<AnchorPoint> getAnchorPoints(String type)
- Specified by:
getAnchorPoints
in interfaceComponentLibrary
-
getSize
public ComponentSize getSize(String type)
- Specified by:
getSize
in interfaceComponentLibrary
-
getComponentsSize
public Map<String,ComponentSize> getComponentsSize()
- Specified by:
getComponentsSize
in interfaceComponentLibrary
-
getCssFilenames
public List<String> getCssFilenames()
- Specified by:
getCssFilenames
in interfaceComponentLibrary
-
getCssUrls
public List<URL> getCssUrls()
- Specified by:
getCssUrls
in interfaceComponentLibrary
-
getComponentStyleClass
public Optional<String> getComponentStyleClass(String type)
- Specified by:
getComponentStyleClass
in interfaceComponentLibrary
-
getSubComponentStyleClass
public Optional<String> getSubComponentStyleClass(String type, String subComponent)
- Specified by:
getSubComponentStyleClass
in interfaceComponentLibrary
-
getTransformations
public Map<Orientation,Component.Transformation> getTransformations(String type)
- Specified by:
getTransformations
in interfaceComponentLibrary
-
-