diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java index 13c0ee91da..5604e22dcf 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java @@ -12,10 +12,12 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.gui.UIComponentUtils; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import javax.swing.border.LineBorder; -import java.awt.*; +import java.awt.BorderLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; @@ -29,19 +31,24 @@ public class DatabaseTableDataPane extends BasicPane{ private Object lastSelectObject; public DatabaseTableDataPane(UILabel label) { + initComponents(label); + } + + private void initComponents(UILabel label) { initTableCombox(); initReviewButton(); + this.setLayout(new BorderLayout(0,0)); - if(label != null) { + if (label != null) { this.add(label, BorderLayout.WEST); } - JPanel pane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); - pane.add(tableNameCombox,BorderLayout.CENTER); + JPanel pane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); + pane.add(tableNameCombox,BorderLayout.CENTER); + pane.add(reviewButton,BorderLayout.EAST); - pane.add(reviewButton,BorderLayout.EAST); - this.add(pane,BorderLayout.CENTER); - setBorder (); + this.add(UIComponentUtils.wrapWithBorderLayoutPane(pane),BorderLayout.CENTER); + setBorder(); } protected void setBorder () { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 09d92c9780..780a70e57b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -13,6 +13,7 @@ import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; +import com.fr.design.utils.gui.UIComponentUtils; import javax.swing.BorderFactory; import java.awt.BorderLayout; @@ -21,6 +22,8 @@ import java.awt.Dimension; public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L; private static final int TOP = -5; + private static final int TABLE_DATA_LABEL_LINE_WRAP_WIDTH = 65; + private static final int TABLE_DATA_PANE_WIDTH = 246; private DatabaseTableDataPane tableDataPane; private AbstractTableDataContentPane dataContentPane; @@ -36,8 +39,9 @@ public class TableDataPane extends FurtherBasicBeanPane{ } private void initDataPane() { - UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData")) ; - label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); + UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData")); + UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH); + tableDataPane = new DatabaseTableDataPane(label) { @Override protected void userEvent() { @@ -46,7 +50,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } }; - tableDataPane.setPreferredSize(new Dimension(246 , 20)); + tableDataPane.setPreferredSize(new Dimension(TABLE_DATA_PANE_WIDTH , tableDataPane.getPreferredSize().height)); this.setBorder(BorderFactory.createEmptyBorder(TOP,0,0,0)); this.add(tableDataPane, BorderLayout.NORTH); }