Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~qinghui.liu/design into release/10.0

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
0a18c249ee
  1. 6
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 28
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java
  3. 18
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  4. 33
      designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java

6
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -256,7 +256,7 @@ public class PreferencePane extends BasicPane {
} }
private void createVcsSettingPane(JPanel generalPane) { private void createVcsSettingPane(JPanel generalPane) {
JPanel vcsPane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); JPanel vcsPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title"));
generalPane.add(vcsPane); generalPane.add(vcsPane);
remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind")); remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind"));
remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit()); remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit());
@ -449,10 +449,6 @@ public class PreferencePane extends BasicPane {
JPanel colorSettingPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Setting_Colors")); JPanel colorSettingPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Setting_Colors"));
generalPane.add(colorSettingPane); generalPane.add(colorSettingPane);
new UILabel(i18nText("Fine-Design_Basic_Preference_Grid_Line_Color"));
new UILabel(i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color"));
gridLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); gridLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
gridLineColorTBButton.setEnabled(this.isEnabled()); gridLineColorTBButton.setEnabled(this.isEnabled());

28
designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java

@ -71,28 +71,42 @@ public class TableDataCreatorProducer {
} }
public TableDataNameObjectCreator[] createServerTableDataCreator() { public TableDataNameObjectCreator[] createServerTableDataCreator() {
TableDataNameObjectCreator dataBase = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Database_Query"), "/com/fr/design/images/data/dock/serverdatabase.png", DBTableData.class, TableDataNameObjectCreator dataBase = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Database_Query"),
"ds",
"/com/fr/design/images/data/dock/serverdatabase.png", DBTableData.class,
DBTableDataPane.class); DBTableDataPane.class);
TableDataNameObjectCreator ds_Class = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Class"), "/com/fr/design/images/data/dock/serverclasstabledata.png", ClassTableData.class, TableDataNameObjectCreator ds_Class = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Class"),
"Class",
"/com/fr/design/images/data/dock/serverclasstabledata.png", ClassTableData.class,
ClassTableDataPane.class); ClassTableDataPane.class);
TableDataNameObjectCreator table = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Embedded"), "/com/fr/design/images/data/dock/serverdatatable.png", EmbeddedTableData.class, TableDataNameObjectCreator table = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Embedded"),
"Embedded",
"/com/fr/design/images/data/dock/serverdatatable.png", EmbeddedTableData.class,
EmbeddedTableDataPane.class); EmbeddedTableDataPane.class);
TableDataNameObjectCreator fileTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_File"), "/com/fr/design/images/data/file.png", FileTableData.class, TableDataNameObjectCreator fileTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_File"),
"File",
"/com/fr/design/images/data/file.png", FileTableData.class,
FileTableDataSmallPane.class); FileTableDataSmallPane.class);
TableDataNameObjectCreator treeTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Tree"), "/com/fr/design/images/data/tree.png", TableDataNameObjectCreator treeTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Tree"),
"Tree",
"/com/fr/design/images/data/tree.png",
RecursionTableData.class, GlobalTreeTableDataPane.class) { RecursionTableData.class, GlobalTreeTableDataPane.class) {
public boolean isNeedParameterWhenPopulateJControlPane() { public boolean isNeedParameterWhenPopulateJControlPane() {
return true; return true;
} }
}; };
TableDataNameObjectCreator multiTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Relation"), "/com/fr/design/images/data/multi.png", TableDataNameObjectCreator multiTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Relation"),
"Multi",
"/com/fr/design/images/data/multi.png",
ConditionTableData.class, GlobalMultiTDTableDataPane.class) { ConditionTableData.class, GlobalMultiTDTableDataPane.class) {
public boolean isNeedParameterWhenPopulateJControlPane() { public boolean isNeedParameterWhenPopulateJControlPane() {
return true; return true;
} }
}; };
TableDataNameObjectCreator storeProcedure = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Stored_Procedure"), "/com/fr/design/images/data/store_procedure.png", TableDataNameObjectCreator storeProcedure = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Stored_Procedure"),
"Proc",
"/com/fr/design/images/data/store_procedure.png",
StoreProcedure.class, ProcedureDataPane.class) { StoreProcedure.class, ProcedureDataPane.class) {
@Override @Override
public boolean shouldInsertSeparator() { public boolean shouldInsertSeparator() {

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

@ -168,6 +168,22 @@ public class FRGUIPaneFactory {
return jp; return jp;
} }
/**
* 创建一个带标题边框面板垂直居左布局组件顶对齐
*
* @param string 边框标题
* @return JPanel对象
*/
public static JPanel createTopVerticalTitledBorderPane(String string) {
JPanel jp = new JPanel();
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string);
jp.setBorder(explainBorder);
VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP);
layout.setAlignLeft(true);
jp.setLayout(layout);
return jp;
}
/** /**
* 创建一个带标题边框面板并且居中显示 * 创建一个带标题边框面板并且居中显示
* *
@ -584,4 +600,4 @@ public class FRGUIPaneFactory {
return h; return h;
} }
} }

33
designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java

@ -16,20 +16,17 @@ import java.awt.LayoutManager;
public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
/** /**
* This value indicates that each row of components * 竖直方向上将子组件设置为顶对齐方式
* should be left-justified.
*/ */
public static final int TOP = 0; public static final int TOP = 0;
/** /**
* This value indicates that each row of components * 竖直方向上将子组件设置为居中对齐方式
* should be centered.
*/ */
public static final int CENTER = 1; public static final int CENTER = 1;
/** /**
* This value indicates that each row of components * 竖直方向上将子组件设置为底对齐方式
* should be right-justified.
*/ */
public static final int BOTTOM = 2; public static final int BOTTOM = 2;
@ -71,7 +68,9 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
*/ */
int newAlign; // This is the one we actually use int newAlign; // This is the one we actually use
// 当列宽不一致时,是否需要左对齐(默认居中对齐) /**
* 当列宽不一致时是否需要将水平方向设置成左对齐默认水平方向为居中对齐
*/
boolean isAlignLeft = false; boolean isAlignLeft = false;
/** /**
@ -220,6 +219,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
* @param name the name of the component * @param name the name of the component
* @param comp the component to be added * @param comp the component to be added
*/ */
@Override
public void addLayoutComponent(String name, Component comp) { public void addLayoutComponent(String name, Component comp) {
} }
@ -230,6 +230,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
* @param comp the component to remove * @param comp the component to remove
* @see java.awt.Container#removeAll * @see java.awt.Container#removeAll
*/ */
@Override
public void removeLayoutComponent(Component comp) { public void removeLayoutComponent(Component comp) {
} }
@ -244,6 +245,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
* @see #minimumLayoutSize * @see #minimumLayoutSize
* @see java.awt.Container#getPreferredSize * @see java.awt.Container#getPreferredSize
*/ */
@Override
public Dimension preferredLayoutSize(Container target) { public Dimension preferredLayoutSize(Container target) {
synchronized (target.getTreeLock()) { synchronized (target.getTreeLock()) {
Dimension dim = new Dimension(0, 0); Dimension dim = new Dimension(0, 0);
@ -255,7 +257,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
if (m.isVisible()) { if (m.isVisible()) {
Dimension d = m.getPreferredSize(); Dimension d = m.getPreferredSize();
firstVisibleComponent = dialWithDim4PreferredLayoutSize(dim, d, firstVisibleComponent); firstVisibleComponent = dealWithDim4PreferredLayoutSize(dim, d, firstVisibleComponent);
} }
} }
Insets insets = target.getInsets(); Insets insets = target.getInsets();
@ -265,7 +267,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
} }
} }
protected boolean dialWithDim4PreferredLayoutSize(Dimension dim, Dimension d, boolean firstVisibleComponent) { protected boolean dealWithDim4PreferredLayoutSize(Dimension dim, Dimension d, boolean firstVisibleComponent) {
dim.width = Math.max(dim.width, d.width); dim.width = Math.max(dim.width, d.width);
if (firstVisibleComponent) { if (firstVisibleComponent) {
firstVisibleComponent = false; firstVisibleComponent = false;
@ -289,6 +291,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
* @see java.awt.Container * @see java.awt.Container
* @see java.awt.Container#doLayout * @see java.awt.Container#doLayout
*/ */
@Override
public Dimension minimumLayoutSize(Container target) { public Dimension minimumLayoutSize(Container target) {
synchronized (target.getTreeLock()) { synchronized (target.getTreeLock()) {
Dimension dim = new Dimension(0, 0); Dimension dim = new Dimension(0, 0);
@ -300,7 +303,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
if (m.isVisible()) { if (m.isVisible()) {
Dimension d = m.getMinimumSize(); Dimension d = m.getMinimumSize();
firstVisibleComponent = dialWithDim4MinimumLayoutSize(dim, d, i, firstVisibleComponent); firstVisibleComponent = dealWithDim4MinimumLayoutSize(dim, d, i, firstVisibleComponent);
} }
} }
Insets insets = target.getInsets(); Insets insets = target.getInsets();
@ -310,7 +313,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
} }
} }
protected boolean dialWithDim4MinimumLayoutSize(Dimension dim, Dimension d, int i, boolean firstVisibleComponent) { protected boolean dealWithDim4MinimumLayoutSize(Dimension dim, Dimension d, int i, boolean firstVisibleComponent) {
dim.width = Math.max(dim.width, d.width); dim.width = Math.max(dim.width, d.width);
if (i > 0) { if (i > 0) {
dim.height += vgap; dim.height += vgap;
@ -370,6 +373,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
* @see java.awt.Container * @see java.awt.Container
* @see java.awt.Container#doLayout * @see java.awt.Container#doLayout
*/ */
@Override
public void layoutContainer(Container target) { public void layoutContainer(Container target) {
synchronized (target.getTreeLock()) { synchronized (target.getTreeLock()) {
Insets insets = target.getInsets(); Insets insets = target.getInsets();
@ -410,7 +414,9 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
protected int[] dealWithDim4LayoutContainer(Container target, Insets insets, Dimension d, int x, int y, int roww, int start, int maxlen, int i, boolean ltr) { protected int[] dealWithDim4LayoutContainer(Container target, Insets insets, Dimension d, int x, int y, int roww, int start, int maxlen, int i, boolean ltr) {
if ((y == 0) || ((y + d.height) <= maxlen)) { if ((y == 0) || ((y + d.height) <= maxlen)) {
if (y > 0) y += vgap; if (y > 0) {
y += vgap;
}
y += d.height; y += d.height;
roww = Math.max(roww, d.width); roww = Math.max(roww, d.width);
} else { } else {
@ -449,6 +455,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
* *
* @return a string representation of this layout * @return a string representation of this layout
*/ */
@Override
public String toString() { public String toString() {
String str = ""; String str = "";
switch (this.newAlign) { switch (this.newAlign) {
@ -465,4 +472,4 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable {
return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + str + "]"; return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + str + "]";
} }
} }

Loading…
Cancel
Save