端到端功能 节点一键展开与闭合代码阶段性提交 针对节点布局和连线还需继续优化
This commit is contained in:
parent
9a28bdf7c0
commit
6b00e2e46c
Binary file not shown.
@ -168,8 +168,8 @@ public class GraphNodeCloseHandle {
|
||||
}else if (x < eleProps.getDoubleValue("x")
|
||||
&& eleProps.getDoubleValue("x") < x + scope[2]
|
||||
&& y + scope[3] < eleProps.getDoubleValue("y")){
|
||||
eleProps.put("x", x);
|
||||
double xMoveDistance = x - eleProps.getDoubleValue("x");
|
||||
eleProps.put("x", x);
|
||||
if (scopeShapeMonitor.checkShapeIsScopeShape(key)){
|
||||
scopeShapeMonitor.updateMonitorXInfo(key, true, xMoveDistance);
|
||||
}
|
||||
|
||||
@ -71,5 +71,37 @@ public abstract class AbstractDefinitionHandle {
|
||||
*/
|
||||
public abstract double[] getShapeBounding(String key);
|
||||
|
||||
/**
|
||||
* 更新图形的坐标 x
|
||||
* @param shapeKey
|
||||
* @param x
|
||||
*/
|
||||
public abstract void updateShapeX(String shapeKey, double x);
|
||||
|
||||
/**
|
||||
* 更新图形的坐标 Y
|
||||
* @param shapeKey
|
||||
* @param y
|
||||
*/
|
||||
public abstract void updateShapeY(String shapeKey, double y);
|
||||
|
||||
/**
|
||||
* 更新图形的宽度 w
|
||||
* @param shapeKey
|
||||
* @param w
|
||||
*/
|
||||
public abstract void updateShapeW(String shapeKey, double w);
|
||||
|
||||
/**
|
||||
* 更新图形的高度 h
|
||||
* @param shapeKey
|
||||
* @param h
|
||||
*/
|
||||
public abstract void updateShapeH(String shapeKey, double h);
|
||||
|
||||
public abstract double getShapeX(String shapeKey);
|
||||
public abstract double getShapeY(String shapeKey);
|
||||
public abstract double getShapeW(String shapeKey);
|
||||
public abstract double getShapeH(String shapeKey);
|
||||
|
||||
}
|
||||
|
||||
@ -94,4 +94,88 @@ public class DefinitionThreadSafe extends AbstractDefinitionHandle {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeX(String shapeKey, double x) {
|
||||
lock.lock();
|
||||
try {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("x", x);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeY(String shapeKey, double y) {
|
||||
lock.lock();
|
||||
try {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("y", y);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeW(String shapeKey, double w) {
|
||||
lock.lock();
|
||||
try {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("w", w);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeH(String shapeKey, double h) {
|
||||
lock.lock();
|
||||
try {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("h", h);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeX(String shapeKey) {
|
||||
lock.lock();
|
||||
try {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("x");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeY(String shapeKey) {
|
||||
lock.lock();
|
||||
try {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("y");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeW(String shapeKey) {
|
||||
lock.lock();
|
||||
try {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("w");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeH(String shapeKey) {
|
||||
lock.lock();
|
||||
try {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("h");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,4 +54,48 @@ public class DefinitionThreadUnSafe extends AbstractDefinitionHandle {
|
||||
JSONObject props = getShapeByProps(key);
|
||||
return new double[]{props.getDoubleValue("x"), props.getDoubleValue("y"), props.getDoubleValue("w"), props.getDoubleValue("h")};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeX(String shapeKey, double x) {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("x", x);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeY(String shapeKey, double y) {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("y", y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeW(String shapeKey, double w) {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("w", w);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShapeH(String shapeKey, double h) {
|
||||
JSONObject props = getShapeByProps(shapeKey);
|
||||
props.put("h", h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeX(String shapeKey) {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("x");
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeY(String shapeKey) {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("y");
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeW(String shapeKey) {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("w");
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getShapeH(String shapeKey) {
|
||||
return getShapeByProps(shapeKey).getDoubleValue("h");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user