Package com.powsybl.sld.model
Class AbstractBlock
- java.lang.Object
-
- com.powsybl.sld.model.AbstractBlock
-
- All Implemented Interfaces:
Block
- Direct Known Subclasses:
AbstractComposedBlock
,AbstractPrimaryBlock
public abstract class AbstractBlock extends Object implements Block
- Author:
- Benoit Jeanson
, Nicolas Duchene, Geoffroy Jamgotchian , Franck Lecuyer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.powsybl.sld.model.Block
Block.Extremity, Block.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected Block.Type
type
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
calculateCoord(LayoutParameters layoutParam)
Calculates all the blocks dimensions and find the order of the layout.block inside the cellvoid
calculateRootCoord(LayoutParameters layoutParam)
double
calculateRootHeight(LayoutParameters layoutParam)
int
getCardinality(Block.Extremity extremity)
int
getCardinality(Node node)
Cell
getCell()
Coord
getCoord()
Node
getEndingNode()
Optional<Block.Extremity>
getExtremity(Node node)
Orientation
getOrientation()
Block
getParentBlock()
Position
getPosition()
Node
getStartingNode()
Block.Type
getType()
void
setCardinality(Block.Extremity extremity, int i)
void
setCell(Cell cell)
void
setOrientation(Orientation orientation)
void
setOrientation(Orientation orientation, boolean recursively)
void
setParentBlock(Block parentBlock)
void
writeJson(com.fasterxml.jackson.core.JsonGenerator generator)
protected abstract void
writeJsonContent(com.fasterxml.jackson.core.JsonGenerator generator)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.powsybl.sld.model.Block
calculateHeight, coordHorizontalCase, coordVerticalCase, findBlockEmbeddingNode, getExtremityNode, getGraph, getOrder, isEmbeddingNodeType, reverseBlock, sizing
-
-
-
-
Field Detail
-
type
protected final Block.Type type
-
-
Method Detail
-
getStartingNode
public Node getStartingNode()
- Specified by:
getStartingNode
in interfaceBlock
-
getEndingNode
public Node getEndingNode()
- Specified by:
getEndingNode
in interfaceBlock
-
getExtremity
public Optional<Block.Extremity> getExtremity(Node node)
- Specified by:
getExtremity
in interfaceBlock
-
getCardinality
public int getCardinality(Node node)
- Specified by:
getCardinality
in interfaceBlock
-
getCardinality
public int getCardinality(Block.Extremity extremity)
- Specified by:
getCardinality
in interfaceBlock
-
setCardinality
public void setCardinality(Block.Extremity extremity, int i)
- Specified by:
setCardinality
in interfaceBlock
-
getParentBlock
public Block getParentBlock()
-
setParentBlock
public void setParentBlock(Block parentBlock)
- Specified by:
setParentBlock
in interfaceBlock
-
getPosition
public Position getPosition()
- Specified by:
getPosition
in interfaceBlock
-
setOrientation
public void setOrientation(Orientation orientation)
- Specified by:
setOrientation
in interfaceBlock
-
setOrientation
public void setOrientation(Orientation orientation, boolean recursively)
- Specified by:
setOrientation
in interfaceBlock
-
getOrientation
public Orientation getOrientation()
- Specified by:
getOrientation
in interfaceBlock
-
calculateCoord
public void calculateCoord(LayoutParameters layoutParam)
Description copied from interface:Block
Calculates all the blocks dimensions and find the order of the layout.block inside the cell- Specified by:
calculateCoord
in interfaceBlock
-
calculateRootCoord
public void calculateRootCoord(LayoutParameters layoutParam)
- Specified by:
calculateRootCoord
in interfaceBlock
-
calculateRootHeight
public double calculateRootHeight(LayoutParameters layoutParam)
- Specified by:
calculateRootHeight
in interfaceBlock
-
getType
public Block.Type getType()
-
writeJsonContent
protected abstract void writeJsonContent(com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
- Throws:
IOException
-
writeJson
public void writeJson(com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
- Specified by:
writeJson
in interfaceBlock
- Throws:
IOException
-
-