Browse Source

REPORT-42237 组件使用过程优化

research/11.0
Yuan.Wang 4 years ago
parent
commit
3a6bb94efe
  1. 17
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

17
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -194,7 +194,7 @@ public class EditingMouseListener extends MouseInputAdapter {
e.translatePoint(oldX - e.getX(), oldY - e.getY());
}
private void offsetEventPoint(MouseEvent e){
private void offsetEventPoint(MouseEvent e) {
int x = designer.getRelativeX(e.getX());
int y = designer.getRelativeY(e.getY());
e.translatePoint(x - e.getX(), y - e.getY());
@ -206,8 +206,8 @@ public class EditingMouseListener extends MouseInputAdapter {
* @param e 鼠标事件
*/
public void mouseReleased(MouseEvent e) {
MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
int oldX = e.getX();
int oldY = e.getY();
offsetEventPoint(e);
@ -240,7 +240,7 @@ public class EditingMouseListener extends MouseInputAdapter {
}
}
private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent ) {
private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent) {
offsetEventPoint(transEvent);
XCreator xCreator = designer.getComponentAt(transEvent);
return (pressX != clickEvent.getX() || pressY != clickEvent.getY())
@ -662,6 +662,7 @@ public class EditingMouseListener extends MouseInputAdapter {
*/
public void startEditing(XCreator creator, DesignerEditor<? extends JComponent> designerEditor, ComponentAdapter adapter) {
if (designerEditor != null) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
Rectangle rect = ComponentUtils.getRelativeBounds(creator);
currentEditor = designerEditor;
currentXCreator = creator;
@ -728,15 +729,15 @@ public class EditingMouseListener extends MouseInputAdapter {
/**
* 刷新顶层组件
* */
public void refreshTopXCreator(boolean isEditing){
*/
public void refreshTopXCreator(boolean isEditing) {
designer.refreshTopXCreator(isEditing);
}
/**
* 刷新顶层组件
* */
public void refreshTopXCreator(){
*/
public void refreshTopXCreator() {
refreshTopXCreator(false);
}

Loading…
Cancel
Save