Browse Source

Pull request #2953: REPORT-42237 组件使用过程优化

Merge in DESIGN/design from ~YUAN.WANG/design:feature/10.0 to feature/10.0

* commit '8da706423ca45aeb29d48e4793c56e659baa2aa0':
  REPORT-42237 代码修改
  REPORT-42237 组件使用过程优化
research/11.0
Yuan.Wang 4 years ago
parent
commit
3cd40cba87
  1. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  2. 16
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

4
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -14,6 +14,7 @@ import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.HelpDialogManager;
@ -266,6 +267,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
if (editingMouseListener.stopEditing()) {
if (this != (XCreator) designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
if (isEditing) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
}
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter);
}
}

16
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())
@ -728,15 +728,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