Browse Source

Merge pull request #165 in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit '383d45ddf5c1d277b4cc791edf9b22b43dd54e55':
  CHART-2398 配置界面去掉老图表字样 功能点统计保留
  CHART-2451 甘特图细粒度
  CHART-2407 图表配色 配置文件
master
zheng 6 years ago
parent
commit
dff243718e
  1. 50
      designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 30
      designer-chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  3. 14
      designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  4. 28
      designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java
  5. 4
      designer-chart/src/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java

50
designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -275,26 +275,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
List<Integer> priorityList = getPriorityInOrder();
for (Integer aPriorityList : priorityList) {
String priority = String.valueOf(aPriorityList);
Iterator<Map.Entry<String, IndependentChartUIProvider>> chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator();
while (chartUIIterator.hasNext()) {
Map.Entry<String, IndependentChartUIProvider> chartUIEntry = chartUIIterator.next();
IndependentChartUIProvider provider = chartUIEntry.getValue();
AbstractChartTypePane pane = provider.getPlotTypePane();
pane.setPlotID(chartUIEntry.getKey());
paneList.add(pane);
}
addPlotTypePaneList(priority, paneList);
}
}
private static String getChartName(String plotID, IndependentChartUIProvider provider) {
String name = provider.getPlotTypeTitle4PopupWindow();
if (StringUtils.isEmpty(name)) {
name = ChartTypeManager.getInstance().getChartName(plotID);
}
return name;
}
private void addTitles(String priority, List<String> list) {
public void addPlotTypePaneList(String priority, List<FurtherBasicBeanPane<? extends Chart>> paneList) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) {
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
@ -305,30 +292,31 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
String plotID = entry.getKey();
if (enabledChart(plotID)) {
list.add(getChartName(plotID, entry.getValue()));
AbstractChartTypePane pane = entry.getValue().getPlotTypePane();
pane.setPlotID(plotID);
paneList.add(pane);
}
}
}
}
public String[] getTitle4PopupWindow() {
List<Integer> priorityList = getPriorityInOrder();
List<String> result = new ArrayList<String>();
for (Integer priority : priorityList) {
addTitles(String.valueOf(priority), result);
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList,
String priority, String plotID) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) {
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID);
AbstractChartTypePane pane = provider.getPlotTypePane();
pane.setPlotID(plotID);
paneList.add(pane);
}
return result.toArray(new String[result.size()]);
}
public String[] getTitle4PopupWindow(String priority) {
List<String> list = new ArrayList<String>();
addTitles(priority, list);
return list.toArray(new String[list.size()]);
private static String getChartName(String plotID, IndependentChartUIProvider provider) {
String name = provider.getPlotTypeTitle4PopupWindow();
if (StringUtils.isEmpty(name)) {
name = ChartTypeManager.getInstance().getChartName(plotID);
}
return name;
}
/**

30
designer-chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -206,19 +206,30 @@ public class ChartTypePane extends AbstractChartAttrPane{
boolean enabledChart = ChartTypeManager.enabledChart(plotID);
String item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority, plotID);
//第一步就是重构cardNames
//第一步就是重构cards
cards.clear();
if (enabledChart) {
cardNames = collection.getState() == SwitchState.DEFAULT
? ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow()
: ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority);
if (collection.getState() == SwitchState.DEFAULT) {
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(cards);
} else {
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(priority, cards);
}
} else {
cardNames = new String[]{item};
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(cards, priority, plotID);
}
//下拉框重构开始。为了防止重构是触发update
((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.REACTOR);
//重构下拉框选项
reactorComboBox();
cardNames = new String[cards.size()];
cardPane.removeAll();
jcb.removeAllItems();
for (int i = 0; i < this.cards.size(); i++) {
String name = this.cards.get(i).title4PopupWindow();// Name从各自的pane里面获取
cardNames[i] = name;
cardPane.add(this.cards.get(i), cardNames[i]);
addComboBoxItem(cards, i);
}
//重新选择选中的下拉项
jcb.setSelectedItem(item);
jcb.setEnabled(enabledChart);
@ -233,13 +244,6 @@ public class ChartTypePane extends AbstractChartAttrPane{
cl.show(cardPane, cardNames[jcb.getSelectedIndex()]);
}
private void reactorComboBox() {
jcb.removeAllItems();
for (int i = 0; i < this.cardNames.length; i++) {
jcb.addItem(cardNames[i]);
}
}
@Override
public void populateBean(Chart ob) {
for (int i = 0; i < this.cards.size(); i++) {

14
designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.ChartPreStyleManagerProvider;
import com.fr.base.ChartPreStyleServerManager;
import com.fr.base.Utils;
@ -16,8 +17,13 @@ import com.fr.design.style.background.gradient.FixedGradientBar;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@ -128,10 +134,10 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
}
private String[] getNameObj() {
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
ArrayList<String> nameArr = new ArrayList<String>();
nameArr.add(Inter.getLocText("FR-Designer_DEFAULT"));
Iterator keys = manager.names();
Iterator keys = config.names();
while (keys.hasNext()) {
Object key = keys.next();
nameArr.add(Utils.objectToString(key));

28
designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java

@ -1,7 +1,6 @@
package com.fr.design.module;
import com.fr.base.ChartPreStyleManagerProvider;
import com.fr.base.ChartPreStyleServerManager;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.Utils;
import com.fr.chart.base.ChartPreStyle;
import com.fr.design.gui.controlpane.JListControlPane;
@ -42,14 +41,14 @@ public class ChartPreStyleManagerPane extends JListControlPane {
}
public void populateBean() {
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
ArrayList list = new ArrayList();
Iterator keys = manager.names();
Iterator keys = config.names();
while(keys.hasNext()) {
Object key = keys.next();
ChartPreStyle value = (ChartPreStyle)manager.getPreStyle(key);
ChartPreStyle value = (ChartPreStyle)config.getPreStyle(key);
list.add(new NameObject(Utils.objectToString(key), value));
}
@ -57,26 +56,23 @@ public class ChartPreStyleManagerPane extends JListControlPane {
Nameable[] values = (Nameable[])list.toArray(new Nameable[list.size()]);
populate(values);
if(manager.containsName(manager.getCurrentStyle())) {
this.setSelectedName(manager.getCurrentStyle());
if(config.containsName(config.getCurrentStyle())) {
this.setSelectedName(config.getCurrentStyle());
}
}
public void updateBean() {
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
manager.clearPreStyles();
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
Nameable[] values = this.update();
manager.setCurrentStyle(getSelectedName());
config.setCurrentStyle(getSelectedName());
for(int i = 0; i < values.length; i++) {
Nameable value = values[i];
manager.putPreStyle(value.getName(), ((NameObject)value).getObject());
config.putPreStyle(value.getName(), ((NameObject)value).getObject());
}
manager.writerPreChartStyle();
// 通知报表整个刷新.
DesignerFrame frame = DesignerContext.getDesignerFrame();
if(frame != null) {

4
designer-chart/src/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java

@ -22,7 +22,9 @@ import java.awt.Component;
public class GanttTimeAxisPane extends AbstractVanChartScrollPane<VanChart> {
private static final ZoomLevel[] ZOOM_LEVELS = new ZoomLevel[]{ZoomLevel.AUTO, ZoomLevel.ZERO, ZoomLevel.ONE,
ZoomLevel.TWO, ZoomLevel.THREE, ZoomLevel.FOUR, ZoomLevel.FIVE, ZoomLevel.SIX, ZoomLevel.SEVEN,
ZoomLevel.EIGHT, ZoomLevel.NINE, ZoomLevel.TEN, ZoomLevel.ELEVEN, ZoomLevel.TWELVE};
ZoomLevel.EIGHT, ZoomLevel.NINE, ZoomLevel.TEN, ZoomLevel.ELEVEN, ZoomLevel.TWELVE, ZoomLevel.THIRTEEN,
ZoomLevel.FOURTEEN, ZoomLevel.FIFTEEN, ZoomLevel.SIXTEEN, ZoomLevel.SEVENTEEN, ZoomLevel.EIGHTEEN,
ZoomLevel.NINETEEN, ZoomLevel.TWENTY, ZoomLevel.TWENTY_ONE};
private UIButtonGroup timeZoom;
private UIComboBox initialLevel;

Loading…
Cancel
Save