|
|
|
@ -177,8 +177,8 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
if (designer.isDrawLineMode()) { |
|
|
|
|
designer.updateDrawLineMode(e); |
|
|
|
|
} else { |
|
|
|
|
int relativeX = Math.max(0, designer.getRelativeX(e.getX())); |
|
|
|
|
int relativeY = Math.max(0, designer.getRelativeY(e.getY())); |
|
|
|
|
int relativeX = Math.max(0, e.getX()); |
|
|
|
|
int relativeY = Math.max(0, e.getY()); |
|
|
|
|
|
|
|
|
|
if (selectionModel.hasSelectionComponent() |
|
|
|
|
&& selectionModel.getSelection().getRelativeBounds().contains( |
|
|
|
@ -363,7 +363,7 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
|
|
|
|
} // component.getParent() 是报表块所在的XWTitleLayout
|
|
|
|
|
int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); |
|
|
|
|
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); |
|
|
|
|
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); |
|
|
|
|
if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { |
|
|
|
|
if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { |
|
|
|
|
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
|
|
|
@ -405,16 +405,7 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { |
|
|
|
|
if (xElementCase != null) { |
|
|
|
|
int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); |
|
|
|
|
int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); |
|
|
|
|
Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); |
|
|
|
|
if (rect.contains(e.getPoint())) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
xElementCase.displayCoverPane(false); |
|
|
|
|
} |
|
|
|
|
if (xChartEditor != null) { |
|
|
|
|
xChartEditor.displayCoverPane(false); |
|
|
|
|
} |
|
|
|
@ -425,6 +416,15 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
if (xTopLayoutContainer != null) { |
|
|
|
|
xTopLayoutContainer.setMouseEnter(false); |
|
|
|
|
} |
|
|
|
|
//不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后
|
|
|
|
|
if (xElementCase != null) { |
|
|
|
|
int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); |
|
|
|
|
int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); |
|
|
|
|
Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); |
|
|
|
|
if (!rect.contains(e.getPoint())) { |
|
|
|
|
xElementCase.displayCoverPane(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
designer.repaint(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -462,7 +462,7 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
|
|
|
|
} |
|
|
|
|
int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); |
|
|
|
|
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); |
|
|
|
|
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); |
|
|
|
|
if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { |
|
|
|
|
if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { |
|
|
|
|
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
|
|
|
@ -700,6 +700,7 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
currentXCreator.stopEditing(); |
|
|
|
|
currentXCreator = null; |
|
|
|
|
currentEditor = null; |
|
|
|
|
refreshTopXCreator(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
@ -727,4 +728,19 @@ public class EditingMouseListener extends MouseInputAdapter {
|
|
|
|
|
} |
|
|
|
|
currentEditor.getEditorTarget().setBounds(bounds); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新顶层组件 |
|
|
|
|
* */ |
|
|
|
|
public void refreshTopXCreator(boolean isEditing){ |
|
|
|
|
designer.refreshTopXCreator(isEditing); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新顶层组件 |
|
|
|
|
* */ |
|
|
|
|
public void refreshTopXCreator(){ |
|
|
|
|
refreshTopXCreator(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|