Browse Source

merge code

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
ee982bc994
  1. 39
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 32
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  3. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java
  5. 122
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  6. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

39
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -141,8 +141,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private int eastRegionToolPaneY = 300; private int eastRegionToolPaneY = 300;
private int eastRegionContainerWidth = 260; private int eastRegionContainerWidth = 260;
private int westRegionToolPaneY = 300;
private int westRegionContainerWidth = 240; private int westRegionContainerWidth = 240;
private double westRegionToolPaneYRate = 0.5;
private String encryptionKey; private String encryptionKey;
private String jdkHome; private String jdkHome;
@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
//这里不判断路径是.的情况,放在checkValid方法里面,重新选 //这里不判断路径是.的情况,放在checkValid方法里面,重新选
if (installHome != null) { if (installHome != null) {
String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String name = Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT");
String envPath = designerEnvManager.getDefaultenvPath(installHome); String envPath = designerEnvManager.getDefaultenvPath(installHome);
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath));
designerEnvManager.setCurEnvName(name); designerEnvManager.setCurEnvName(name);
@ -304,8 +304,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH);
String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
if (!new java.io.File(fileName).exists()) { if (!new File(fileName).exists()) {
StableUtils.makesureFileExist(new java.io.File(fileName)); StableUtils.makesureFileExist(new File(fileName));
} }
Handler handler = new FileHandler(fileName, true); Handler handler = new FileHandler(fileName, true);
@ -440,12 +440,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.lastOpenFilePath = lastOpenFilePath; this.lastOpenFilePath = lastOpenFilePath;
} }
/** /**
* 获取西面板的上子面板的高度占容器总高度的比例 * 得到西面板的上下子面板的高度区分
*
* @return * @return
*/ */
public double getLastWestRegionToolPaneYRate() { public int getLastWestRegionToolPaneY() {
return westRegionToolPaneYRate; return this.westRegionToolPaneY;
} }
/** /**
@ -458,11 +460,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
/** /**
* 设置关闭设计器前西面板的上子面板的高度占容器总高度的比例 * 设置西面板的上下子面板的高度区分
* @param westRegionToolPaneYRate *
* @param toolPaneY
*/ */
public void setLastWestRegionToolPaneYRate(double westRegionToolPaneYRate) { public void setLastWestRegionToolPaneY(int toolPaneY) {
this.westRegionToolPaneYRate = westRegionToolPaneYRate; this.westRegionToolPaneY = toolPaneY;
} }
/** /**
@ -526,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
return env; return env;
} }
} }
String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); String name = Toolkit.i18nText("Fine-Design_Basic_Workspace_Default");
LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath); LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath);
this.putEnv(name, newDefaultEnv); this.putEnv(name, newDefaultEnv);
return newDefaultEnv; return newDefaultEnv;
@ -549,7 +552,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
} }
} }
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); return Toolkit.i18nText("Fine-Design_Basic_Workspace_Default");
} }
@ -1607,8 +1610,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private void readLastWestRegionLayout(XMLableReader reader) { private void readLastWestRegionLayout(XMLableReader reader) {
String tmpVal; String tmpVal;
if ((tmpVal = reader.getAttrAsString("toolPaneYRate", null)) != null) { if ((tmpVal = reader.getAttrAsString("toolPaneY", null)) != null) {
this.setLastWestRegionToolPaneYRate(Double.parseDouble(tmpVal)); this.setLastWestRegionToolPaneY(Integer.parseInt(tmpVal));
} }
if ((tmpVal = reader.getAttrAsString("containerWidth", null)) != null) { if ((tmpVal = reader.getAttrAsString("containerWidth", null)) != null) {
this.setLastWestRegionContainerWidth(Integer.parseInt(tmpVal)); this.setLastWestRegionContainerWidth(Integer.parseInt(tmpVal));
@ -1640,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) { if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) {
// marks:兼容6.1的 // marks:兼容6.1的
// marks:设置默认的目录. // marks:设置默认的目录.
String curReportServerName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); String curReportServerName = Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server");
LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal); LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal);
this.putEnv(curReportServerName, reportServer); this.putEnv(curReportServerName, reportServer);
@ -1931,8 +1934,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private void writeLastWestRegionLayout(XMLPrintWriter writer) { private void writeLastWestRegionLayout(XMLPrintWriter writer) {
writer.startTAG("LastWestRegionLayout"); writer.startTAG("LastWestRegionLayout");
if (this.getLastWestRegionToolPaneYRate() >= 0) { if (this.getLastWestRegionToolPaneY() >= 0) {
writer.attr("toolPaneYRate", this.getLastWestRegionToolPaneYRate()); writer.attr("toolPaneY ", this.getLastWestRegionToolPaneY());
} }
if (this.getLastWestRegionContainerWidth() >= 0) { if (this.getLastWestRegionContainerWidth() >= 0) {
writer.attr("containerWidth", this.getLastWestRegionContainerWidth()); writer.attr("containerWidth", this.getLastWestRegionContainerWidth());

32
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -44,7 +44,6 @@ public class UIResizableContainer extends JPanel {
private boolean isDownPaneVisible = true ; private boolean isDownPaneVisible = true ;
private int paraHeight; private int paraHeight;
private int parentHeight = -1; private int parentHeight = -1;
private double toolPaneYRate;
public UIResizableContainer(int direction) { public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction); this(new JPanel(), new JPanel(), direction);
@ -157,20 +156,12 @@ public class UIResizableContainer extends JPanel {
return this.toolPaneY; return this.toolPaneY;
} }
/**
* 获取上子面板高度占容器总高度的比例
* @return
*/
public double getToolPaneYRate() {
return toolPaneYRate;
}
/** /**
* 设置关闭设计器前最新的上子面板的高度比例 * 设置关闭设计器前最新的上子面板的高度比例
* @param toolPaneYRate * @param toolPaneY
*/ */
public void setLastToolPaneYRate(double toolPaneYRate) { public void setLastToolPaneY(int toolPaneY) {
this.toolPaneYRate = toolPaneYRate; this.toolPaneY = toolPaneY;
} }
/** /**
@ -248,9 +239,10 @@ public class UIResizableContainer extends JPanel {
if (parentHeight == -1) { if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height // 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight(); parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight() && parent.getHeight() > 0) { }
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi或者容器高度发生变化了,此时调整toolPaneY if (parentHeight != parent.getHeight() && (parent.getHeight() - toolPaneHeight) >= 0) {
toolPaneY = Math.min((int) (parent.getHeight() * toolPaneYRate), (parent.getHeight() - toolPaneHeight)); // 调整toolPaneY,保证至少水平的拖拽条horizontToolPane不丢失
toolPaneY = Math.min(toolPaneY, parent.getHeight() - toolPaneHeight);
parentHeight = parent.getHeight(); parentHeight = parent.getHeight();
} }
} }
@ -376,7 +368,6 @@ public class UIResizableContainer extends JPanel {
toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y; toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y;
toolPaneY = toolPaneY < 0 ? 0 : toolPaneY; toolPaneY = toolPaneY < 0 ? 0 : toolPaneY;
toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight(); toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight();
adjustToolPaneYRate();
refreshContainer(); refreshContainer();
} }
}); });
@ -398,10 +389,8 @@ public class UIResizableContainer extends JPanel {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getX() <= ARROW_RANGE) { if (e.getX() <= ARROW_RANGE) {
toolPaneY = 0; toolPaneY = 0;
UIResizableContainer.this.adjustToolPaneYRate();
} else if (e.getX() >= getWidth() - ARROW_RANGE) { } else if (e.getX() >= getWidth() - ARROW_RANGE) {
toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight(); toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight();
UIResizableContainer.this.adjustToolPaneYRate();
} else { } else {
return; return;
} }
@ -562,11 +551,4 @@ public class UIResizableContainer extends JPanel {
jf.setSize(500, 500); jf.setSize(500, 500);
jf.setVisible(true); jf.setVisible(true);
} }
/**
* 当toolPaneY发生变化时也需要调整toolPaneYRate
*/
private void adjustToolPaneYRate() {
this.toolPaneYRate = ((double) toolPaneY) / this.getHeight();
}
} }

4
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -1170,8 +1170,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath());
} }
DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneYRate( DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY(
WestRegionContainerPane.getInstance().getToolPaneYRate()); WestRegionContainerPane.getInstance().getToolPaneY());
DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth( DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth(
WestRegionContainerPane.getInstance().getContainerWidth()); WestRegionContainerPane.getInstance().getContainerWidth());
DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY( DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY(

2
designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java

@ -24,7 +24,7 @@ public class WestRegionContainerPane extends UIResizableContainer {
public static final WestRegionContainerPane getInstance() { public static final WestRegionContainerPane getInstance() {
if (THIS == null) { if (THIS == null) {
THIS = new WestRegionContainerPane(); THIS = new WestRegionContainerPane();
THIS.setLastToolPaneYRate(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneYRate()); THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY());
THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth()); THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth());
} }
return THIS; return THIS;

122
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -53,7 +53,6 @@ import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -74,6 +73,7 @@ import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.Image; import java.awt.Image;
import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter; import java.awt.event.FocusAdapter;
@ -119,10 +119,6 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
protected JavaScriptActionPane parentPane; protected JavaScriptActionPane parentPane;
private int keyColumnWidth = 100;
private int resizeColumnCount = 4;
private int btnWidth = 110;
private int btnHeight = 20;
private String subMitName; private String subMitName;
private static final String[] DML_CONFIG_TYPES = new String[]{ private static final String[] DML_CONFIG_TYPES = new String[]{
@ -194,8 +190,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4)); JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4));
editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST); editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST);
for (int i = 0; i < actions.length; i++) { for (UpdateAction action : actions) {
controlBtnPane.add(new UIButton(actions[i])); controlBtnPane.add(new UIButton(action));
} }
checkBoxUpdatePane = new JPanel(new BorderLayout(0, 0)); checkBoxUpdatePane = new JPanel(new BorderLayout(0, 0));
checkBoxUpdatePane.setPreferredSize(new Dimension(120, 20)); checkBoxUpdatePane.setPreferredSize(new Dimension(120, 20));
@ -209,7 +205,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
FormatExplanationPane formatExplanation = new FormatExplanationPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Help"), 12f); FormatExplanationPane formatExplanation = new FormatExplanationPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Help"), 12f);
BasicDialog dlg = formatExplanation.showMediumWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), BasicDialog dlg = formatExplanation.showMediumWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this),
new DialogActionAdapter(){}); new DialogActionAdapter() {
});
dlg.setVisible(true); dlg.setVisible(true);
} }
}); });
@ -230,8 +227,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
for (int i = 0; i < model.getRowCount(); i++) { for (int i = 0; i < model.getRowCount(); i++) {
columnObjects.add(model.getKeyColumnNameValue(i).cv.getObj()); columnObjects.add(model.getKeyColumnNameValue(i).cv.getObj());
} }
for (int i = 0;i < columnObjects.size();i++){ for (Object ob : columnObjects) {
Object ob = columnObjects.get(i) ;
if (!(ob instanceof ColumnRow || ob instanceof ColumnRowGroup)) { if (!(ob instanceof ColumnRow || ob instanceof ColumnRowGroup)) {
setUpdateCheckBoxEnable(false); setUpdateCheckBoxEnable(false);
UpdateCheckBox.setSelected(false); UpdateCheckBox.setSelected(false);
@ -261,6 +257,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
UIButton addSubmitEventButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Event")); UIButton addSubmitEventButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Event"));
addSubmitEventButton.addActionListener(new ActionListener() { addSubmitEventButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final SubmitJobListPane jobsPane = createSubmitJobListPane(); final SubmitJobListPane jobsPane = createSubmitJobListPane();
@ -409,6 +406,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
*/ */
keyColumnValuesTable.addFocusListener(new FocusAdapter() { keyColumnValuesTable.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) { public void focusGained(FocusEvent e) {
refreshColumnsComboBox(); refreshColumnsComboBox();
} }
@ -438,6 +436,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
BasicPane bPane = new BasicPane() { BasicPane bPane = new BasicPane() {
@ -449,6 +448,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
bPane.setLayout(FRGUIPaneFactory.createBorderLayout()); bPane.setLayout(FRGUIPaneFactory.createBorderLayout());
final CheckBoxList list = new CheckBoxList(currentColumnNames(), CheckBoxList.SelectedState.ALL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Chart_Field_Name")) { final CheckBoxList list = new CheckBoxList(currentColumnNames(), CheckBoxList.SelectedState.ALL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Chart_Field_Name")) {
@Override
public String value2Text(Object value) { public String value2Text(Object value) {
if (value instanceof ColumnName) { if (value instanceof ColumnName) {
return ((ColumnName) value).name; return ((ColumnName) value).name;
@ -460,6 +460,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
bPane.add(new JScrollPane(list), BorderLayout.CENTER); bPane.add(new JScrollPane(list), BorderLayout.CENTER);
BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() {
@Override
public void doOk() { public void doOk() {
addFields(list); addFields(list);
updateUpdateCheckBoxEnable(); updateUpdateCheckBoxEnable();
@ -481,9 +482,9 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
// Richie:用了存储新的KeyColumnNameValue的List. // Richie:用了存储新的KeyColumnNameValue的List.
List<KeyColumnNameValue> newKeyColumnNameValueList = new ArrayList<KeyColumnNameValue>(); List<KeyColumnNameValue> newKeyColumnNameValueList = new ArrayList<KeyColumnNameValue>();
if (!keyColumnNameValueList.isEmpty()) { if (!keyColumnNameValueList.isEmpty()) {
for (int i = 0; i < selected.length; i++) { for (Object o : selected) {
// Richie:先填上空的. // Richie:先填上空的.
newKeyColumnNameValueList.add(new KeyColumnNameValue(false, (ColumnName)selected[i], new ColumnValue(""), false)); newKeyColumnNameValueList.add(new KeyColumnNameValue(false, (ColumnName) o, new ColumnValue(""), false));
} }
} }
// Richie:初始化 // Richie:初始化
@ -498,11 +499,11 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
if (returnValue == 0 || returnValue == 3) { if (returnValue == 0 || returnValue == 3) {
break; break;
} }
for (int j = 0; j < keyColumnNameValueList.size(); j++) { for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) {
if (ComparatorUtils.equals(selected[i], keyColumnNameValueList.get(j).cn)) { if (ComparatorUtils.equals(selected[i], keyColumnNameValue.cn)) {
Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Covered_All"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Yes"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_None")}; Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Covered_All"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Yes"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_None")};
returnValue = JOptionPane.showOptionDialog(DBManipulationPane.this, returnValue = JOptionPane.showOptionDialog(DBManipulationPane.this,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_Tips", keyColumnNameValueList.get(j).cn.name), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_Tips", keyColumnNameValue.cn.name),
"", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]); "", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
// Richie:全部覆盖 // Richie:全部覆盖
if (returnValue == 0) { if (returnValue == 0) {
@ -514,7 +515,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
} else if (returnValue == 2) { } else if (returnValue == 2) {
coverNumber = i; coverNumber = i;
newKeyColumnNameValueList.remove(i); newKeyColumnNameValueList.remove(i);
newKeyColumnNameValueList.add(i, keyColumnNameValueList.get(j)); newKeyColumnNameValueList.add(i, keyColumnNameValue);
// Richie:全部不覆盖 // Richie:全部不覆盖
} else if (returnValue == 3) { } else if (returnValue == 3) {
coverNumber = i; coverNumber = i;
@ -538,10 +539,10 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
model.removeAllKeyColumnNameValue(); model.removeAllKeyColumnNameValue();
// Richie:全部不覆盖,已经存在的就保留,不存在的添加默认行 // Richie:全部不覆盖,已经存在的就保留,不存在的添加默认行
for (int i = coverNumber; i < selected.length; i++) { for (int i = coverNumber; i < selected.length; i++) {
for (int j = 0; j < keyColumnNameValueList.size(); j++) { for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) {
if (ComparatorUtils.equals(selected[i], keyColumnNameValueList.get(j).cn)) { if (ComparatorUtils.equals(selected[i], keyColumnNameValue.cn)) {
newKeyColumnNameValueList.remove(i); newKeyColumnNameValueList.remove(i);
newKeyColumnNameValueList.add(i, keyColumnNameValueList.get(j)); newKeyColumnNameValueList.add(i, keyColumnNameValue);
} }
} }
@ -565,8 +566,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
// Richie:初始化 // Richie:初始化
if (keyColumnNameValueList.isEmpty()) { if (keyColumnNameValueList.isEmpty()) {
model.removeAllKeyColumnNameValue(); model.removeAllKeyColumnNameValue();
for (int i = 0; i < selected.length; i++) { for (Object o : selected) {
model.addKeyColumnNameValue(new KeyColumnNameValue(false, (ColumnName)selected[i], new ColumnValue(""), false)); model.addKeyColumnNameValue(new KeyColumnNameValue(false, (ColumnName) o, new ColumnValue(""), false));
} }
} }
@ -579,6 +580,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Add_Field")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Add_Field"));
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel();
@ -596,6 +598,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Remove_Field")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Remove_Field"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
// DBManipulationPane target = this.getDBManipulationPane(); // DBManipulationPane target = this.getDBManipulationPane();
@ -636,8 +639,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
model.removeAllElements(); model.removeAllElements();
ColumnName[] columnNames = currentColumnNames(); ColumnName[] columnNames = currentColumnNames();
for (int i = 0; i < columnNames.length; i++) { for (ColumnName columnName : columnNames) {
model.addElement(columnNames[i]); model.addElement(columnName);
} }
} }
@ -673,6 +676,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
columnsComboBox = new UIComboBox(new DefaultComboBoxModel()); columnsComboBox = new UIComboBox(new DefaultComboBoxModel());
columnsComboBox.setRenderer(new UIComboBoxRenderer() { columnsComboBox.setRenderer(new UIComboBoxRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
@ -685,12 +689,9 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
}); });
column1.setCellEditor(new DefaultCellEditor(columnsComboBox) { column1.setCellEditor(new DefaultCellEditor(columnsComboBox) {
@Override
public boolean stopCellEditing() { public boolean stopCellEditing() {
if (super.stopCellEditing()) { return super.stopCellEditing();
return true;
}
return false;
} }
}); });
((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2);
@ -699,6 +700,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
column2.setCellEditor(new ColumnValueEditor()); column2.setCellEditor(new ColumnValueEditor());
} }
@Override
public void populateBean(DBManipulation dbManipulation) { public void populateBean(DBManipulation dbManipulation) {
if (dbManipulation == null) { if (dbManipulation == null) {
dbManipulation = new DBManipulation(); dbManipulation = new DBManipulation();
@ -782,6 +784,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
} }
} }
@Override
public DBManipulation updateBean() { public DBManipulation updateBean() {
DataBaseItems para = chooseTable.updateBean(true); DataBaseItems para = chooseTable.updateBean(true);
DBManipulation dbMani = new DBManipulation(); DBManipulation dbMani = new DBManipulation();
@ -812,8 +815,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
dmlConfig.setUpdateSelected(UpdateCheckBox.isSelected()); dmlConfig.setUpdateSelected(UpdateCheckBox.isSelected());
if (jobs != null) { if (jobs != null) {
for (int i = 0; i < jobs.length; i++) { for (NameSubmitJob job : jobs) {
dmlConfig.addSubmitJob(jobs[i]); dmlConfig.addSubmitJob(job);
} }
} }
dmlConfig.setCondition(condition); dmlConfig.setCondition(condition);
@ -840,6 +843,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Values_Editor"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Values_Editor");
} }
@Override
public void populateBean(Object object) { public void populateBean(Object object) {
vPane.populate(object); vPane.populate(object);
} }
@ -855,42 +859,53 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
* alex:ColumnValue的编辑器,弹出对话框来编辑...个人觉得不大好 * alex:ColumnValue的编辑器,弹出对话框来编辑...个人觉得不大好
*/ */
protected class ColumnValueEditor extends AbstractCellEditor implements TableCellEditor { protected class ColumnValueEditor extends AbstractCellEditor implements TableCellEditor {
/** The Swing component being edited. */ /**
private UILabel textLabel; * The Swing component being edited.
private ValuePane vPane; */
private BasicDialog vPaneDLG; private final UILabel textLabel;
private final ValuePane vPane;
protected ColumnValueEditor() { protected ColumnValueEditor() {
this(v_Types); this(v_Types);
} }
/**
* 列值编辑器
*
* @param types 编辑器类型
*/
protected ColumnValueEditor(Editor<?>[] types) { protected ColumnValueEditor(Editor<?>[] types) {
textLabel = new UILabel(); textLabel = new UILabel();
textLabel.addMouseListener(new MouseAdapter() { DialogActionAdapter adapter = new DialogActionAdapter() {
public void mousePressed(MouseEvent e) { @Override
vPaneDLG.setAlwaysOnTop(true);
vPaneDLG.setVisible(true);
}
});
vPane = new ValuePane(types);
vPaneDLG = vPane.showSmallWindow(new JFrame(), new DialogActionAdapter() {
public void doOk() { public void doOk() {
fireEditingStopped(); // Make the renderer fireEditingStopped(); // Make the renderer
// reappear. // reappear.
updateUpdateCheckBoxEnable(); updateUpdateCheckBoxEnable();
} }
@Override
public void doCancel() { public void doCancel() {
fireEditingCanceled(); fireEditingCanceled();
} }
};
textLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
Window window = e.getComponent() == null
? DesignerContext.getDesignerFrame()
: SwingUtilities.getWindowAncestor(e.getComponent());
vPane.showSmallWindow(window, adapter)
.setVisible(true);
}
}); });
vPane = new ValuePane(types);
} }
/* /*
* 双击以编辑 * 双击以编辑
*/ */
@Override
public boolean isCellEditable(EventObject anEvent) { public boolean isCellEditable(EventObject anEvent) {
if (anEvent instanceof MouseEvent) { if (anEvent instanceof MouseEvent) {
return ((MouseEvent) anEvent).getClickCount() >= 2; return ((MouseEvent) anEvent).getClickCount() >= 2;
@ -898,6 +913,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return true; return true;
} }
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (value instanceof ColumnValue) { if (value instanceof ColumnValue) {
vPane.populateBean(((ColumnValue) value).obj); vPane.populateBean(((ColumnValue) value).obj);
@ -912,6 +928,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return textLabel; return textLabel;
} }
@Override
public Object getCellEditorValue() { public Object getCellEditorValue() {
return new ColumnValue(vPane.updateBean()); return new ColumnValue(vPane.updateBean());
} }
@ -924,6 +941,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
this.name = name; this.name = name;
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof ColumnName)) { if (!(obj instanceof ColumnName)) {
return false; return false;
@ -949,6 +967,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return obj; return obj;
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof ColumnValue)) { if (!(obj instanceof ColumnValue)) {
return false; return false;
@ -998,14 +1017,17 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
} }
} }
@Override
public String getColumnName(int col) { public String getColumnName(int col) {
return COLUMN_NAMES[col]; return COLUMN_NAMES[col];
} }
@Override
public int getColumnCount() { public int getColumnCount() {
return COLUMN_NAMES.length; return COLUMN_NAMES.length;
} }
@Override
public int getRowCount() { public int getRowCount() {
return keyColumnNameValueList.size(); return keyColumnNameValueList.size();
} }
@ -1040,6 +1062,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
super(model); super(model);
} }
@Override
public Object getValueAt(int row, int col) { public Object getValueAt(int row, int col) {
KeyColumnNameValue knv = keyColumnNameValueList.get(row); KeyColumnNameValue knv = keyColumnNameValueList.get(row);
@ -1054,6 +1077,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return null; return null;
} }
@Override
public void setValueAt(Object value, int row, int col) { public void setValueAt(Object value, int row, int col) {
KeyColumnNameValue knv = keyColumnNameValueList.get(row); KeyColumnNameValue knv = keyColumnNameValueList.get(row);
@ -1066,6 +1090,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
} }
} }
@Override
public Class<?> getColumnClass(int c) { public Class<?> getColumnClass(int c) {
switch (c) { switch (c) {
case 0: case 0:
@ -1078,6 +1103,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
return String.class; return String.class;
} }
@Override
public boolean isCellEditable(int row, int col) { public boolean isCellEditable(int row, int col) {
return true; return true;
} }
@ -1094,7 +1120,6 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
} }
public static class KeyColumnNameValue { public static class KeyColumnNameValue {
private boolean isKey = false; private boolean isKey = false;
private ColumnName cn; private ColumnName cn;
@ -1111,6 +1136,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
* *
* @return 字符串z * @return 字符串z
*/ */
@Override
public String toString() { public String toString() {
return (isKey ? "* " : "") + cn + ":" + cv; return (isKey ? "* " : "") + cn + ":" + cv;
} }
@ -1124,7 +1150,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
/* /*
* ColumnNameTableCellRenderer * ColumnNameTableCellRenderer
*/ */
public class ColumnNameTableCellRenderer extends DefaultTableCellRenderer { public static class ColumnNameTableCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
@ -1139,7 +1166,8 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
/* /*
* ColumnValueTableCellRenderer * ColumnValueTableCellRenderer
*/ */
private class ColumnValueTableCellRenderer extends DefaultTableCellRenderer { private static class ColumnValueTableCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

11
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -122,8 +122,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
return new Component[][]{ return new Component[][]{
new Component[]{dataLabelContentPane, null}, new Component[]{dataLabelContentPane, null},
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null},
new Component[]{createLabelBorderPane(), null}, new Component[]{createBorderAndBackgroundPane(), null},
new Component[]{createLabelBackgroundPane(), null}
}; };
} }
@ -138,6 +137,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}; };
} }
private JPanel createBorderAndBackgroundPane() {
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 5));
jPanel.add(createLabelBorderPane(), BorderLayout.NORTH);
jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER);
return jPanel;
}
private JPanel createLabelBorderPane() { private JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithShapePane(); borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);

Loading…
Cancel
Save