Browse Source

Merge pull request #3005 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'f63e27329151d1c6d38ed5c5ded4d179848e0aa6':
  CHART-17118 试管型仪表盘标签左右位置增加居中
  REPORT-42237 代码提到release
  REPORT-42913 之前想多了,这个在调用的时候还没开始渲染整个左侧的面板,此时拿不到父容器高度
  REPORT-42913 为设置上一次关闭设计器时upPane高度加上一个判断,避免upPane高度超过容器总高度
  REPORT-42913 改变电脑分辨率导致设计器的数据集面板丢失 【问题原因】数据集面板的位置与高度都跟parent.getHeight() - toolPaneY有关,而在Windows下,如果先把数据集面板的高度调的比较小,然后减小分辨率或者调大dpi使整个界面放大时,parent.getHeight()会减小,而toolPaneY在这种操作下是不会变的,此时toolPaneY会接近甚至大于parent.getHeight(),导致了数据集面板的位置位于整个屏幕之外,并且高度为负,显示不出来,表现为丢失 【改动思路】用一个成员变量parentHeight存储父容器的高度parent.getHeight(),在layoutContainer()方法中增加一个判断,当发现父容器高度有变化时,及时调整toolPaneY的大小,避免数据集面板无法显示
research/11.0
superman 4 years ago
parent
commit
db80ca11ae
  1. 18
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  2. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  3. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

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

@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel {
private boolean isLeftRightDragEnabled = true;
private boolean isDownPaneVisible = true ;
private int paraHeight;
private int parentHeight = -1;
public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction);
@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel {
if (verticalToolPane == null || downPane == null) {
return;
}
// REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY
adjustToolPaneY(parent);
if (direction == Constants.RIGHT) {
if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel {
}
}
private void adjustToolPaneY(Container parent) {
if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight()) {
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY
toolPaneY = toolPaneY * parent.getHeight() / parentHeight;
toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight));
parentHeight = parent.getHeight();
}
}
@Override
public void addLayoutComponent(String name, Component comp) {
}
@ -540,4 +554,4 @@ public class UIResizableContainer extends JPanel {
jf.setSize(500, 500);
jf.setVisible(true);
}
}
}

10
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -195,8 +195,14 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
}
private TwoTuple<String[], Integer[]> getAlignNamesAndValues() {
String[] names = new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow"), Toolkit.i18nText("Fine-Design_Chart_Align_Left"), Toolkit.i18nText("Fine-Design_Chart_Align_Right")};
Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.RIGHT};
String[] names = new String[]{
Toolkit.i18nText("Fine-Design_Chart_Follow"),
Toolkit.i18nText("Fine-Design_Chart_Align_Left"),
Toolkit.i18nText("Fine-Design_Chart_StyleAlignment_Center"),
Toolkit.i18nText("Fine-Design_Chart_Align_Right")
};
Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.CENTER, Constants.RIGHT};
return new TwoTuple<>(names, values);
}

3
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -271,6 +271,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
}
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter);
if (isEditing) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
}
}
}
HelpDialogManager.getInstance().setPane(coverPanel);

Loading…
Cancel
Save