mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Visual Edit
This commit is contained in:
+24
-15
@@ -75,28 +75,17 @@ public abstract class FlowBaseOperation extends AbstractEditOperation {
|
||||
public void showFeedback() {
|
||||
createFeedback();
|
||||
|
||||
if (!getChildren().isEmpty()) {
|
||||
List<RadComponent> children = getChildren();
|
||||
if (!children.isEmpty()) {
|
||||
FeedbackLayer layer = myContext.getArea().getFeedbackLayer();
|
||||
Point location = myContext.getLocation();
|
||||
myChildTarget = null;
|
||||
|
||||
if (myHorizontal) {
|
||||
for (RadComponent child : getChildren()) {
|
||||
Rectangle childBounds = getBounds(child, layer);
|
||||
if (childBounds.x <= location.x && location.x <= childBounds.getMaxX()) {
|
||||
myChildTarget = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
handleHorizontal(children, layer, location);
|
||||
}
|
||||
else {
|
||||
for (RadComponent child : getChildren()) {
|
||||
Rectangle childBounds = getBounds(child, layer);
|
||||
if (childBounds.y <= location.y && location.y <= childBounds.getMaxY()) {
|
||||
myChildTarget = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
handleVertical(children, layer, location);
|
||||
}
|
||||
if (myChildTarget == null) {
|
||||
myChildTarget = getSideChildTarget();
|
||||
@@ -110,6 +99,26 @@ public abstract class FlowBaseOperation extends AbstractEditOperation {
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleHorizontal(List<RadComponent> children, FeedbackLayer layer, Point location) {
|
||||
for (RadComponent child : children) {
|
||||
Rectangle childBounds = getBounds(child, layer);
|
||||
if (childBounds.x <= location.x && location.x <= childBounds.getMaxX()) {
|
||||
myChildTarget = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleVertical(List<RadComponent> children, FeedbackLayer layer, Point location) {
|
||||
for (RadComponent child : children) {
|
||||
Rectangle childBounds = getBounds(child, layer);
|
||||
if (childBounds.y <= location.y && location.y <= childBounds.getMaxY()) {
|
||||
myChildTarget = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void setInsertFeedbackBounds(Rectangle targetBounds) {
|
||||
if (myHorizontal) {
|
||||
if (myInsertBefore) {
|
||||
|
||||
Reference in New Issue
Block a user