Browse Source

REPORT-44803 参数面板拖动组件大小右侧不能跟随显示大小--来源【客户需求 508884】

【问题原因】之前的frm缩放的改动——REPORT-37353,把当前的像素值给设置成了组件的x、y值,这样当拖动组件改变大小的时候,x、y不变,右侧也不会变动,因为没有加上组件宽高
【改动思路】为x、y加上当前组件的宽高值
bugfix/10.0
Yvan 4 years ago
parent
commit
7697ec5fa7
  1. 9
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 8
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  3. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  4. 16
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

9
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -51,7 +51,6 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.awt.Window;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -59,10 +58,10 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.HashSet;
import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.ERROR_MESSAGE;
import static javax.swing.JOptionPane.QUESTION_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE;
@ -412,12 +411,8 @@ public class EnvChangeEntrance {
} }
public void chooseEnv(final String envName) { public void chooseEnv(final String envName) {
chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()));
}
public void chooseEnv(final String envName, Window window) {
final EnvListPane envListPane = new EnvListPane(); final EnvListPane envListPane = new EnvListPane();
final BasicDialog envListDialog = envListPane.showWindow(window); final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()));
envListPane.populateEnvManager(envName); envListPane.populateEnvManager(envName);
envListDialog.addDialogActionListener(new DialogActionAdapter() { envListDialog.addDialogActionListener(new DialogActionAdapter() {

8
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -1774,12 +1774,4 @@ public class FILEChooserPane extends BasicPane {
} }
} }
} }
public boolean isDialogVisible() {
return dialog != null && dialog.isVisible();
}
public UIDialog getDialog() {
return dialog;
}
} }

4
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -183,12 +183,12 @@ public class FormDesignerUI extends ComponentUI {
x1 = 0; x1 = 0;
x2 = 6; x2 = 6;
y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height); y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height);
text = Utils.objectToString(bounds.y); text = Utils.objectToString(y1 + designer.getVerticalScaleValue());
} else { } else {
y1 = 0; y1 = 0;
y2 = 6; y2 = 6;
x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width); x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width);
text = Utils.objectToString(bounds.x); text = Utils.objectToString(x1 + designer.getHorizontalScaleValue());
} }
text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel"); text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel");
g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR); g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR);

16
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -12,7 +12,6 @@ import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.file.FILEChooserPane;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.RemoteDesignConstants; import com.fr.report.RemoteDesignConstants;
import com.fr.serialization.SerializerHelper; import com.fr.serialization.SerializerHelper;
@ -28,12 +27,12 @@ import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
import io.socket.emitter.Emitter; import io.socket.emitter.Emitter;
import java.awt.Window; import javax.swing.JOptionPane;
import java.util.Arrays; import javax.swing.UIManager;
import javax.swing.*;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
import java.util.Arrays;
public class DesignerSocketIO { public class DesignerSocketIO {
@ -177,18 +176,13 @@ public class DesignerSocketIO {
UIUtil.invokeAndWaitIfNeeded(new Runnable() { UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {
// 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断
boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible();
Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame();
FineJOptionPane.showMessageDialog( FineJOptionPane.showMessageDialog(
window, DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"),
UIManager.getString("OptionPane.messageDialogTitle"), UIManager.getString("OptionPane.messageDialogTitle"),
JOptionPane.ERROR_MESSAGE, JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")); UIManager.getIcon("OptionPane.errorIcon"));
// 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 EnvChangeEntrance.getInstance().chooseEnv();
Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame());
EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1);
} }
}); });
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save