Browse Source

Merge pull request #1184 in BA/design from ~MANGO/design:release/8.0 to release/8.0

* commit 'ff3cd152cb4a5d06d42b917552f58db4d4f88d16':
  修改代码检查错误
  修改代码检查错误
  修改一直触发查询bug
  修改一直触发查询bug
  修改一直触发查询bug,整理chartEditPane加载代码。
master
superman 7 years ago
parent
commit
d645a250cd
  1. 3
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  2. 36
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java

3
designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -64,7 +65,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.setContainer(container);
chartEditPane.addTitleChangeListener(titleListener);
String tabname = chartEditPane.getSelectedTabName();
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : ""));
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : StringUtils.EMPTY));
resetChartEditPane();
}

36
designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java

@ -6,6 +6,8 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.AttributeChangeListener;
@ -20,14 +22,17 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
public class ChartEditPane extends BasicPane implements AttributeChange, ChartEditPaneProvider {
public class ChartEditPane extends BasicPane implements AttributeChange, Prepare4DataSourceChange, ChartEditPaneProvider {
private final static int CHANGE_MIN_TIME = 80;
@ -65,9 +70,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
paneList.add(otherPane);
createTabsPane();
//TableDataComboBox 中有注册DSChangeListener,这里没有必要再次注册。
//registerDSChangeListener();
registerDSChangeListener();
}
//构建主面板
@ -140,7 +143,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
addTypePane();
boolean isDefault = true;
String plotID = "";
String plotID = StringUtils.EMPTY;
if (currentChart.getPlot() != null) {
plotID = currentChart.getPlot().getPlotID();
isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
@ -177,6 +180,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
}
protected void setSelectedTab() {
//doNothing
}
/**
@ -222,7 +226,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
return;
}
if (checkNeedsReLayout(collection.getSelectedChart())) {
if (isNeedsReLayout(collection.getSelectedChart())) {
reLayout(collection.getSelectedChart());
}
@ -263,7 +267,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
}
//populate的时候看看要不要重构面板
private boolean checkNeedsReLayout(Chart chart) {
private boolean isNeedsReLayout(Chart chart) {
if (chart != null) {
int lastIndex = typePane.getSelectedIndex();
int currentIndex = getSelectedChartIndex(chart);
@ -315,7 +319,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
}
protected void dealWithStyleChange() {
//doNothing
}
/**
@ -324,7 +328,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
* @param isFromToolBar 是否来自工具栏
*/
public void styleChange(boolean isFromToolBar) {
//doNothing
}
/**
@ -336,4 +340,18 @@ public class ChartEditPane extends BasicPane implements AttributeChange, ChartEd
paneList.get(index).addAttributeChangeListener(listener);
}
/**
* 数据集改变的事件监听
*/
public void registerDSChangeListener() {
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
AbstractChartAttrPane attrPane = paneList.get(tabsHeaderIconPane.getSelectedIndex());
//不显示,没有处于编辑状态,没必要更新。
if (attrPane.isShowing()) {
attrPane.refreshChartDataPane(collection);
}
}
});
}
}
Loading…
Cancel
Save