Class GraphLayoutManager
java.lang.Object
com.portingdeadmods.researchd.client.screens.research.graph.GraphLayoutManager
Handles layout calculations for research graphs with parents centered over children.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic it.unimi.dsi.fastutil.ints.Int2ObjectMap<List<ResearchNode>> static Map<ResearchNode, Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyLayout(ResearchGraph graph, int offsetX, int offsetY) Apply layout to a research graphstatic intcalculateDepth(ResearchNode node) static PointcenterOf2Nodes(ResearchNode node1, ResearchNode node2) static PointcenterOf2Nodes(List<ResearchNode> nodes) Utility method to stop the [0] and [size() - 1] spamstatic intwidthOf(List<ResearchNode> nodes)
-
Field Details
-
layerMap
-
nodeLayerMap
-
-
Constructor Details
-
GraphLayoutManager
public GraphLayoutManager()
-
-
Method Details
-
applyLayout
Apply layout to a research graph- Parameters:
graph- The research graph to layoutoffsetX- Top-left X coordinate for the layoutoffsetY- Top-left Y coordinate for the layout
-
calculateDepth
-
centerOf2Nodes
-
centerOf2Nodes
Utility method to stop the [0] and [size() - 1] spam- Parameters:
nodes-- Returns:
-
widthOf
-