Browse Source

Merge pull request #453 in BA/design from ~XIAOHU/design:dev to dev

* commit '3332fa12c40c3b8de78086cccb7bf4112fd8d66b':
  update
  update
  切换面板重构
  update
  面板重构
  图标切换方式
master
superman 8 years ago
parent
commit
ece017fc35
  1. 2
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  2. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  3. 25
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

2
designer_chart/src/com/fr/design/chart/gui/ChartComponent.java

@ -315,7 +315,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
//不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单 //不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单
//其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边 //其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边
//处理画图事件 //处理画图事件
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this); Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this, null);
g2d.drawImage(chartImage, 0, 0, null); g2d.drawImage(chartImage, 0, 0, null);
} }
} }

9
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -19,6 +19,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -502,9 +503,17 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
if (isEnabled()) { if (isEnabled()) {
noSelected(); noSelected();
//记录改变前的plotID
String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart().getPlot().getPlotID();
changeCollectionSelected(getButtonName()); changeCollectionSelected(getButtonName());
setSelectedWithFireListener(true); setSelectedWithFireListener(true);
fireSelectedChanged(); fireSelectedChanged();
//需要先更新,最后重构面板
//重构面板
if (parent != null ){
parent.reLayoutEditPane(lastPlotID, editingCollection);
}
} }
} }

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

@ -8,7 +8,6 @@ import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -127,7 +126,13 @@ public class ChartTypePane extends AbstractChartAttrPane{
protected String title4PopupWindow() { protected String title4PopupWindow() {
return null; return null;
} }
/**
* 不同图表切换分同一个selected的不同图表切换和不同selected的不同图表切换
* 如果是切换图表的某个图表发生变化则collection的选择下标不会变
* 如果是切换图表的不同图表之间切换则collection的选择下标会改变
* @param chart
*/
public void updateBean(Chart chart) { public void updateBean(Chart chart) {
Plot oldPlot = chart.getPlot(); Plot oldPlot = chart.getPlot();
@ -258,6 +263,21 @@ public class ChartTypePane extends AbstractChartAttrPane{
} }
/**
* 面板重构
* @param lastPlotID
* @param collection
*/
public void reLayoutEditPane(String lastPlotID, ChartCollection collection){
Chart chart = collection.getSelectedChart();
String plotID = chart.getPlot().getPlotID();
boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){
editPane.reLayout(chart);
}
}
public void reactorChartTypePane(ChartCollection collection){ public void reactorChartTypePane(ChartCollection collection){
if (needReactor(collection)) { if (needReactor(collection)) {
chartTypePane.reactor(collection); chartTypePane.reactor(collection);
@ -291,7 +311,6 @@ public class ChartTypePane extends AbstractChartAttrPane{
editingCollection = collection; editingCollection = collection;
buttonPane.update(collection);// 内部操作时 已经做过处理. buttonPane.update(collection);// 内部操作时 已经做过处理.
Chart chart = collection.getSelectedChart(); Chart chart = collection.getSelectedChart();
chartTypePane.updateBean(chart); chartTypePane.updateBean(chart);
} }

Loading…
Cancel
Save