Browse Source

REPORT-64173 限定具体实现的最大占用布局,优化展示效果

feature/x
xiqiu 3 years ago
parent
commit
987923d5f8
  1. 20
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

20
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -14,6 +14,7 @@ import com.fr.data.solution.processor.SolutionProcessor;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -33,6 +34,7 @@ import javax.swing.JDialog;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.UIManager; import javax.swing.UIManager;
@ -59,6 +61,8 @@ import java.util.concurrent.ExecutionException;
* Database Connection pane. * Database Connection pane.
*/ */
public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connection> extends BasicBeanPane<com.fr.data.impl.Connection> { public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connection> extends BasicBeanPane<com.fr.data.impl.Connection> {
private static int MAX_MAIN_PANEL_HEIGHT = 430;
private static int MAX_MAIN_PANEL_WIDTH = 675;
private UILabel message; private UILabel message;
private UIButton okButton; private UIButton okButton;
@ -333,11 +337,11 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
// Center // Center
mainPanel = mainPanel(); mainPanel = mainPanel();
mainPanel.setPreferredSize(new Dimension(675, 280));
northPane.add(mainPanel, BorderLayout.CENTER);
JPanel advancedPanel = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Advanced")); JPanel advancedPanel = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Advanced"));
advancedPanel.setPreferredSize(new Dimension(675, 210));
if (mainPanel instanceof JDBCDefPane) { if (mainPanel instanceof JDBCDefPane) {
mainPanel.setPreferredSize(new Dimension(MAX_MAIN_PANEL_WIDTH, 280));
advancedPanel.setPreferredSize(new Dimension(MAX_MAIN_PANEL_WIDTH, 210));
northPane.add(mainPanel, BorderLayout.CENTER);
ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Advanced_More_Settings")); ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Advanced_More_Settings"));
actionLabel.addActionListener(new ActionListener() { actionLabel.addActionListener(new ActionListener() {
@Override @Override
@ -359,6 +363,16 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
} else { } else {
//非jdbc配置布局保持不变 //非jdbc配置布局保持不变
advancedPanel.setPreferredSize(new Dimension(MAX_MAIN_PANEL_WIDTH, 60));
if (mainPanel.getPreferredSize().height > MAX_MAIN_PANEL_HEIGHT || mainPanel.getPreferredSize().width > MAX_MAIN_PANEL_WIDTH) {
UIScrollPane jp = new
UIScrollPane(mainPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jp.setPreferredSize(new Dimension(MAX_MAIN_PANEL_WIDTH, MAX_MAIN_PANEL_HEIGHT));
northPane.add(jp, BorderLayout.CENTER);
} else {
mainPanel.setPreferredSize(new Dimension(MAX_MAIN_PANEL_WIDTH, MAX_MAIN_PANEL_HEIGHT));
northPane.add(mainPanel, BorderLayout.CENTER);
}
// ChartSet // ChartSet
String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")}; String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")};
charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY)); charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY));

Loading…
Cancel
Save