Browse Source

REPORT-76079【迭代】【起始页】交互问题

1-远程下只显示 ip
2-调整新建报表的按钮位置
feature/x
Harrison 2 years ago
parent
commit
06b0970362
  1. 8
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  2. 2
      designer-base/src/main/java/com/fr/start/common/DesignerOpenEmptyPanel.java
  3. 3
      designer-base/src/main/java/com/fr/startup/ui/StartupPageModel.java
  4. 21
      designer-base/src/main/java/com/fr/startup/ui/StartupPageUtil.java

8
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -153,7 +153,7 @@ public class FRGUIPaneFactory {
}
public static LayoutManager createCenterLayout(JComponent centerBody) {
return createCenterLayout(centerBody, 0.3d);
return createCenterLayout(centerBody, 0.5d, 0.3d);
}
/**
@ -162,7 +162,7 @@ public class FRGUIPaneFactory {
* @param centerBody 中心组件
* @return 布局方式
*/
public static LayoutManager createCenterLayout(JComponent centerBody, double factor) {
public static LayoutManager createCenterLayout(JComponent centerBody, double factorX, double factorY) {
return new LayoutManager() {
@ -188,8 +188,8 @@ public class FRGUIPaneFactory {
// 这个时候大小是不确定的
int bodyWidth = centerBody.getPreferredSize().width;
int bodyHeight = centerBody.getPreferredSize().height;
int labelX = (width - bodyWidth) / 2;
int labelY = (int) ((height - bodyHeight) * factor);
int labelX = (int) ((width - bodyWidth) * factorX);
int labelY = (int) ((height - bodyHeight) * factorY);
centerBody.setBounds(labelX, labelY, bodyWidth, bodyHeight);
}

2
designer-base/src/main/java/com/fr/start/common/DesignerOpenEmptyPanel.java

@ -70,7 +70,7 @@ public class DesignerOpenEmptyPanel extends JPanel {
this.body.add(createIcon, BorderLayout.NORTH);
this.body.add(createButtonPanel, BorderLayout.SOUTH);
setLayout(FRGUIPaneFactory.createCenterLayout(this.body, 0.4d));
setLayout(FRGUIPaneFactory.createCenterLayout(this.body, 0.4d, 0.4d));
ColorUtils.syncBackground(this, Color.WHITE);

3
designer-base/src/main/java/com/fr/startup/ui/StartupPageModel.java

@ -45,7 +45,8 @@ public class StartupPageModel {
DesignerWorkspaceInfo workspaceInfo = envManager.getWorkspaceInfo(e);
if (workspaceInfo.getType() == DesignerWorkspaceType.Remote) {
WorkspaceConnectionInfo connection = workspaceInfo.getConnection();
return new StartupWorkspaceBean(e, connection.getUrl(), workspaceInfo.getType());
String remoteAddress = StartupPageUtil.getRemoteAddress(connection.getUrl());
return new StartupWorkspaceBean(e, remoteAddress, workspaceInfo.getType());
} else {
return new StartupWorkspaceBean(e, workspaceInfo.getPath(), workspaceInfo.getType());
}

21
designer-base/src/main/java/com/fr/startup/ui/StartupPageUtil.java

@ -2,8 +2,10 @@ package com.fr.startup.ui;
import com.fr.base.svg.SVGIcon;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.log.FineLoggerFactory;
import javax.swing.Icon;
import java.net.URL;
/**
* created by Harrison on 2022/07/11
@ -37,4 +39,23 @@ public class StartupPageUtil {
}
return SVGIcon.readSVGIcon("/com/fr/design/startup/remote_server_background_28.svg", 28, 28);
}
/**
* 返回 ip : port
*
* @param urlStr 完整的 url 例如 https://localhost:3090/xxx
* @return localhost:3090
*/
public static String getRemoteAddress(String urlStr) {
try {
URL url = new URL(urlStr);
String host = url.getHost();
int port = url.getPort();
return host + ":" + port;
} catch (Exception e) {
FineLoggerFactory.getLogger().debug(e.getMessage(), e);
return urlStr;
}
}
}

Loading…
Cancel
Save