|
|
@ -42,7 +42,16 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png"; |
|
|
|
public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png"; |
|
|
|
private static final int DEPENDING_SCOPE = 3; |
|
|
|
private static final int DEPENDING_SCOPE = 3; |
|
|
|
private HoverPainter painter; |
|
|
|
private HoverPainter painter; |
|
|
|
|
|
|
|
//区分拖拽和编辑宽高
|
|
|
|
|
|
|
|
private boolean isEdit; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isEdit() { |
|
|
|
|
|
|
|
return isEdit; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setEdit(boolean edit) { |
|
|
|
|
|
|
|
isEdit = edit; |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构造函数 |
|
|
|
* 构造函数 |
|
|
|
* |
|
|
|
* |
|
|
@ -411,13 +420,15 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
|
|
|
|
|
|
|
|
// 根据需要依附的位置调整拖拽的坐标值
|
|
|
|
// 根据需要依附的位置调整拖拽的坐标值
|
|
|
|
private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { |
|
|
|
private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { |
|
|
|
for (int i = 0; i < coordinates.length; i++) { |
|
|
|
if(!isEdit) { |
|
|
|
if (coordinate == coordinates[i]) { |
|
|
|
for (int i = 0; i < coordinates.length; i++) { |
|
|
|
continue; |
|
|
|
if (coordinate == coordinates[i]) { |
|
|
|
} |
|
|
|
continue; |
|
|
|
if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) { |
|
|
|
} |
|
|
|
coordinate = coordinates[i]; |
|
|
|
if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) { |
|
|
|
break; |
|
|
|
coordinate = coordinates[i]; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return coordinate; |
|
|
|
return coordinate; |
|
|
@ -425,10 +436,12 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
|
|
|
|
|
|
|
|
// 根据需要依附的位置调整拖拽的距离
|
|
|
|
// 根据需要依附的位置调整拖拽的距离
|
|
|
|
private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { |
|
|
|
private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { |
|
|
|
for (int i = 0; i < coordinates.length; i++) { |
|
|
|
if(!isEdit) { |
|
|
|
if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { |
|
|
|
for (int i = 0; i < coordinates.length; i++) { |
|
|
|
diff = coordinates[i] - coordinate; |
|
|
|
if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { |
|
|
|
break; |
|
|
|
diff = coordinates[i] - coordinate; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return diff; |
|
|
|
return diff; |
|
|
|