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. 1736
      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
  7. 4
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.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 eastRegionContainerWidth = 260;
private int westRegionToolPaneY = 300;
private int westRegionContainerWidth = 240;
private double westRegionToolPaneYRate = 0.5;
private String encryptionKey;
private String jdkHome;
@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String installHome = StableUtils.getInstallHome();
//这里不判断路径是.的情况,放在checkValid方法里面,重新选
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);
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath));
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 fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
if (!new java.io.File(fileName).exists()) {
StableUtils.makesureFileExist(new java.io.File(fileName));
if (!new File(fileName).exists()) {
StableUtils.makesureFileExist(new File(fileName));
}
Handler handler = new FileHandler(fileName, true);
@ -440,12 +440,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.lastOpenFilePath = lastOpenFilePath;
}
/**
* 获取西面板的上子面板的高度占容器总高度的比例
* 得到西面板的上下子面板的高度区分
*
* @return
*/
public double getLastWestRegionToolPaneYRate() {
return westRegionToolPaneYRate;
public int getLastWestRegionToolPaneY() {
return this.westRegionToolPaneY;
}
/**
@ -458,11 +460,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
/**
* 设置关闭设计器前西面板的上子面板的高度占容器总高度的比例
* @param westRegionToolPaneYRate
* 设置西面板的上下子面板的高度区分
*
* @param toolPaneY
*/
public void setLastWestRegionToolPaneYRate(double westRegionToolPaneYRate) {
this.westRegionToolPaneYRate = westRegionToolPaneYRate;
public void setLastWestRegionToolPaneY(int toolPaneY) {
this.westRegionToolPaneY = toolPaneY;
}
/**
@ -526,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
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);
this.putEnv(name, 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) {
String tmpVal;
if ((tmpVal = reader.getAttrAsString("toolPaneYRate", null)) != null) {
this.setLastWestRegionToolPaneYRate(Double.parseDouble(tmpVal));
if ((tmpVal = reader.getAttrAsString("toolPaneY", null)) != null) {
this.setLastWestRegionToolPaneY(Integer.parseInt(tmpVal));
}
if ((tmpVal = reader.getAttrAsString("containerWidth", null)) != null) {
this.setLastWestRegionContainerWidth(Integer.parseInt(tmpVal));
@ -1640,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) {
// marks:兼容6.1的
// 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);
this.putEnv(curReportServerName, reportServer);
@ -1931,8 +1934,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private void writeLastWestRegionLayout(XMLPrintWriter writer) {
writer.startTAG("LastWestRegionLayout");
if (this.getLastWestRegionToolPaneYRate() >= 0) {
writer.attr("toolPaneYRate", this.getLastWestRegionToolPaneYRate());
if (this.getLastWestRegionToolPaneY() >= 0) {
writer.attr("toolPaneY ", this.getLastWestRegionToolPaneY());
}
if (this.getLastWestRegionContainerWidth() >= 0) {
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 int paraHeight;
private int parentHeight = -1;
private double toolPaneYRate;
public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction);
@ -157,20 +156,12 @@ public class UIResizableContainer extends JPanel {
return this.toolPaneY;
}
/**
* 获取上子面板高度占容器总高度的比例
* @return
*/
public double getToolPaneYRate() {
return toolPaneYRate;
}
/**
* 设置关闭设计器前最新的上子面板的高度比例
* @param toolPaneYRate
* @param toolPaneY
*/
public void setLastToolPaneYRate(double toolPaneYRate) {
this.toolPaneYRate = toolPaneYRate;
public void setLastToolPaneY(int toolPaneY) {
this.toolPaneY = toolPaneY;
}
/**
@ -248,9 +239,10 @@ public class UIResizableContainer extends JPanel {
if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight() && parent.getHeight() > 0) {
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi或者容器高度发生变化了,此时调整toolPaneY
toolPaneY = Math.min((int) (parent.getHeight() * toolPaneYRate), (parent.getHeight() - toolPaneHeight));
}
if (parentHeight != parent.getHeight() && (parent.getHeight() - toolPaneHeight) >= 0) {
// 调整toolPaneY,保证至少水平的拖拽条horizontToolPane不丢失
toolPaneY = Math.min(toolPaneY, parent.getHeight() - toolPaneHeight);
parentHeight = parent.getHeight();
}
}
@ -376,7 +368,6 @@ public class UIResizableContainer extends JPanel {
toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y;
toolPaneY = toolPaneY < 0 ? 0 : toolPaneY;
toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight();
adjustToolPaneYRate();
refreshContainer();
}
});
@ -398,10 +389,8 @@ public class UIResizableContainer extends JPanel {
public void mouseClicked(MouseEvent e) {
if (e.getX() <= ARROW_RANGE) {
toolPaneY = 0;
UIResizableContainer.this.adjustToolPaneYRate();
} else if (e.getX() >= getWidth() - ARROW_RANGE) {
toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight();
UIResizableContainer.this.adjustToolPaneYRate();
} else {
return;
}
@ -562,11 +551,4 @@ public class UIResizableContainer extends JPanel {
jf.setSize(500, 500);
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().setLastWestRegionToolPaneYRate(
WestRegionContainerPane.getInstance().getToolPaneYRate());
DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY(
WestRegionContainerPane.getInstance().getToolPaneY());
DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth(
WestRegionContainerPane.getInstance().getContainerWidth());
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() {
if (THIS == null) {
THIS = new WestRegionContainerPane();
THIS.setLastToolPaneYRate(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneYRate());
THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY());
THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth());
}
return THIS;

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

File diff suppressed because it is too large Load Diff

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[][]{
new Component[]{dataLabelContentPane, null},
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null},
new Component[]{createLabelBorderPane(), null},
new Component[]{createLabelBackgroundPane(), null}
new Component[]{createBorderAndBackgroundPane(), 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() {
borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);

4
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -456,7 +456,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
newAdd.clear();
for (int i = 0; i < cs; i++) {
for (int j = 0; j < rs; j++) {
TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j );
TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j);
if (cellElement != null && ((i + c) != 0 || (r + j) != 0)) {
String value = cellElement.toString();
if (!newAdd.contains(value) && !allColumnRow.contains(value)) {
@ -512,7 +512,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) {
@Override
public void doOk() {
((KeyColumnTableModel)keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel)model);
((KeyColumnTableModel) keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel) model);
}
@Override

Loading…
Cancel
Save