Browse Source

Pull request #14410: REPORT-127437 fix:隐藏 jtable 滚动条,调整一些布局

Merge in DESIGN/design from ~ZONGYU.WANG/design:newui to newui

* commit '2afd801e3094edd363f1b43d1b93faf971cad829':
  REPORT-127437 fix:隐藏 jtable 滚动条,调整一些布局
newui
Zongyu.Wang-王宗雨 4 months ago
parent
commit
ee7bd8118a
  1. 4
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
  2. 23
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java
  3. 4
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  4. 2
      designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java

4
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

@ -78,10 +78,6 @@ public class CustomSortPane extends JPanel {
bottom = new UIButton(new LazyIcon("to_bottom")); bottom = new UIButton(new LazyIcon("to_bottom"));
up = new UIButton(new LazyIcon("move_up")); up = new UIButton(new LazyIcon("move_up"));
down = new UIButton(new LazyIcon("move_down")); down = new UIButton(new LazyIcon("move_down"));
top.setDisabledIcon(new LazyIcon("to_top").disabled());
bottom.setDisabledIcon(new LazyIcon("to_bottom").disabled());
up.setDisabledIcon(new LazyIcon("move_up").disabled());
down.setDisabledIcon(new LazyIcon("move_down").disabled());
top.addActionListener(e -> { top.addActionListener(e -> {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, 0); sortItemPane.setComponentZOrder(selectedLabel, 0);

23
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

@ -28,6 +28,8 @@ import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
@ -50,6 +52,8 @@ public class UITableEditorPane<T> extends BasicPane {
protected UITableModelAdapter<T> tableModel; protected UITableModelAdapter<T> tableModel;
private String leftLabelName; private String leftLabelName;
private JPanel buttonPane; private JPanel buttonPane;
protected JScrollPane scrollPane;
protected JPanel verticalScrollBar;
public UITableEditorPane(UITableModelAdapter<T> model) { public UITableEditorPane(UITableModelAdapter<T> model) {
this.tableModel = model; this.tableModel = model;
@ -99,18 +103,25 @@ public class UITableEditorPane<T> extends BasicPane {
* @param scrollPane * @param scrollPane
* @return * @return
*/ */
protected Component buildScrollTablePane(JScrollPane scrollPane) { protected JPanel buildScrollTablePane(JScrollPane scrollPane) {
return row( verticalScrollBar = column(
cell(scrollPane).weight(1),
column(
cell(new UILabel()).with(it -> { cell(new UILabel()).with(it -> {
it.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 1, UIManager.getColor("defaultBorderColor"))); it.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
it.setPreferredSize(FineUIScale.scale(new Dimension(scrollPane.getVerticalScrollBar().getWidth(), (int) editTable.getTableHeader().getPreferredSize().getHeight()))); it.setPreferredSize(new Dimension(scrollPane.getVerticalScrollBar().getWidth(), (int) editTable.getTableHeader().getPreferredSize().getHeight()));
}), }),
cell(scrollPane.getVerticalScrollBar()).weight(1).with(it -> { cell(scrollPane.getVerticalScrollBar()).weight(1).with(it -> {
it.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, UIManager.getColor("defaultBorderColor"))); it.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
})) })
).getComponent(); ).getComponent();
scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
verticalScrollBar.setVisible(editTable.getHeight() > scrollPane.getViewport().getHeight());
verticalScrollBar.repaint();
}
});
return row(cell(scrollPane).weight(1), cell(verticalScrollBar)).getComponent();
} }
public UITableModelAdapter<T> getTableModel() { public UITableModelAdapter<T> getTableModel() {

4
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -79,7 +79,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
private UILabel uiLabel = new UILabel(); private UILabel uiLabel = new UILabel();
private final int FIRST_COL_WIDTH = 72; private final int FIRST_COL_WIDTH = 80;
private final int SECOND_COL_WIDTH = 68; private final int SECOND_COL_WIDTH = 68;
@ -490,7 +490,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
UILabel passwordLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Password")); UILabel passwordLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Password"));
passwordLabel.setHorizontalAlignment(SwingConstants.LEFT); passwordLabel.setHorizontalAlignment(SwingConstants.LEFT);
UILabel accountLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remotex_Env_Platform_Account")); UILabel accountLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Platform_Account"));
accountLabel.setHorizontalAlignment(SwingConstants.LEFT); accountLabel.setHorizontalAlignment(SwingConstants.LEFT);
//输入密码的时候检测下大写锁定 //输入密码的时候检测下大写锁定

2
designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java

@ -121,7 +121,7 @@ public class ReportColumnsPane extends BasicPane{
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont); int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont);
uiLabel.setPreferredSize(FineUIScale.scale(new Dimension(uiLabelWidth, 20))); uiLabel.setPreferredSize(new Dimension(uiLabelWidth, FineUIScale.scale(20)));
north.add(uiLabel,BorderLayout.WEST); north.add(uiLabel,BorderLayout.WEST);
JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11)); JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11));
buttonGroupPane.add(onOffButtonGroup); buttonGroupPane.add(onOffButtonGroup);

Loading…
Cancel
Save