Browse Source

Revert "设备节点锚点位置信息bug修复"

This reverts commit 4c8ed8cec2312b0046cee75c04ded3e41eb18aa2.
yucheng 2 years ago
parent
commit
d202b4916d

+ 1 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramDataLoader.java

@@ -70,7 +70,7 @@ public class DiagramDataLoader {
 				}
 
 				//设置anchorLocations
-				en.setAnchorLocations();
+				en.getAnchorLocations();
 			}
 
 			if(obj != null) {

+ 8 - 9
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/EquipmentNode.java

@@ -56,7 +56,7 @@ public class EquipmentNode extends DiagramNode implements IDataBind {
 			label.setLocation(new XY(10, 10)); //TODO
 		}
 
-		setAnchorLocations();
+		//TODO anchors
 	}
 
 	@Override
@@ -115,16 +115,15 @@ public class EquipmentNode extends DiagramNode implements IDataBind {
 		return legend;
 	}
 
-	public void setAnchorLocations() {
-		if (legend.getAnchors() != null) {
-			anchorLocations = new HashMap<>();
-			for (Anchor anchor : legend.getAnchors()) {
-				anchorLocations.put(anchor.getCode(), anchor.calcLocation(size));
+	public Map<String, XY> getAnchorLocations() {
+		if (anchorLocations == null) {
+			if (legend.getAnchors() != null) {
+				anchorLocations = new HashMap<>();
+				for (Anchor anchor : legend.getAnchors()) {
+					anchorLocations.put(anchor.getCode(), anchor.calcLocation(size));
+				}
 			}
 		}
-	}
-
-	public Map<String, XY> getAnchorLocations() {
 		return anchorLocations;
 	}