|
|
@ -182,6 +182,14 @@ public class MoveUtils { |
|
|
|
px.palce = x2 - width; |
|
|
|
px.palce = x2 - width; |
|
|
|
px.direction = SwingConstants.RIGHT; |
|
|
|
px.direction = SwingConstants.RIGHT; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Math.abs(bounds.x + bounds.width / 2 - left) <= SORPTION_UNIT) { |
|
|
|
|
|
|
|
px.palce = bounds.x + bounds.width / 2; |
|
|
|
|
|
|
|
px.direction = SwingConstants.LEFT; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Math.abs(bounds.x + bounds.width / 2 - right) <= SORPTION_UNIT) { |
|
|
|
|
|
|
|
px.palce = bounds.x + bounds.width / 2 - width; |
|
|
|
|
|
|
|
px.direction = SwingConstants.RIGHT; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void findY(PlacePointing py, Rectangle bounds, int top, int bottom, int height) { |
|
|
|
private static void findY(PlacePointing py, Rectangle bounds, int top, int bottom, int height) { |
|
|
@ -211,6 +219,14 @@ public class MoveUtils { |
|
|
|
py.palce = y2 - height; |
|
|
|
py.palce = y2 - height; |
|
|
|
py.direction = SwingConstants.BOTTOM; |
|
|
|
py.direction = SwingConstants.BOTTOM; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Math.abs(bounds.y + bounds.height / 2 - top) <= SORPTION_UNIT) { |
|
|
|
|
|
|
|
py.palce = bounds.y + bounds.height / 2; |
|
|
|
|
|
|
|
py.direction = SwingConstants.TOP; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Math.abs(bounds.y + bounds.height / 2 - bottom) <= SORPTION_UNIT) { |
|
|
|
|
|
|
|
py.palce = bounds.y + bounds.height / 2 - height; |
|
|
|
|
|
|
|
py.direction = SwingConstants.BOTTOM; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void findEquidistantLine(Rectangle bounds, int left, int top, int height, int width) { |
|
|
|
private static void findEquidistantLine(Rectangle bounds, int left, int top, int height, int width) { |
|
|
|