Browse Source

选中图表按id看是否相同,不按index。因为图表切换plotlist会变

master
fr_shine 8 years ago
parent
commit
dc464a7d67
  1. 12
      designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java
  2. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

12
designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -247,7 +247,17 @@ public class FRTreeComboBox extends UIComboBox {
}
@Override
protected UIButton createArrowButton() {
arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON);
arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON){
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
@Override
public boolean shouldResponseChangeListener() {
return false;
}
};
((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT);
arrowButton.addMouseListener(this);
comboBox.addMouseListener(this);

6
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -129,7 +129,9 @@ public class ChartTypePane extends AbstractChartAttrPane{
}
public void updateBean(Chart chart) {
int lastSelectIndex = editPane.getSelectedChartIndex(chart);
Plot oldPlot = chart.getPlot();
String lastPlotID = oldPlot == null ? StringUtils.EMPTY : oldPlot.getPlotID();
try{
Chart newDefaultChart = (Chart)((AbstractChartTypePane)getSelectedPane()).getDefaultChart().clone();
@ -159,7 +161,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
if(editPane.isDefaultPane() != isUseDefault || (!isUseDefault && lastSelectIndex != jcb.getSelectedIndex())){
if(editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){
editPane.reLayout(chart);
}
}

Loading…
Cancel
Save