Browse Source

Merge pull request #8668 in DESIGN/design from release/11.0 to final/11.0

* commit '17bfa59afdaafc62287b47fce13ea98860f50a18':
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  update
  REPORT-68638 fix:删除所有图表配色 重新读fvs.cpt.chart会被兼容成跟随主题
  REPORT-69776 切换在线组件的排序,会加载很久
  REPORT-68638 design fix:没有配色的时候渲染和配置界面配色不一致,统一成配置界面的
  REPORT-68357 fix:namestyle导致fvs.cpt中单元格样式中有主题相关配置
  REPORT-69575 设计器在线组件刷不出来
new-design
superman 3 years ago
parent
commit
d38b24450a
  1. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java
  2. 18
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  3. 21
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  4. 46
      designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java

3
designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.theme.utils;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle; import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -37,7 +38,7 @@ public class DefaultThemedTemplateCellElementCase {
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default(); ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default();
if (themedCellStyle != null) { if (themedCellStyle != null) {
NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle());
cellElement.setStyle(nameStyle); cellElement.setStyle(DesignModeContext.isDuchampMode() ? nameStyle.getRealStyle() : nameStyle);
} }
} }
return cellElement; return cellElement;

18
designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

@ -1,6 +1,7 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.chart.base.ChartConstants;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -12,8 +13,6 @@ import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.util.ArrayList;
import java.util.List;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
@ -23,6 +22,8 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
/** /**
* 配色方案选择组合色之后可以调整颜色的组件 * 配色方案选择组合色之后可以调整颜色的组件
@ -33,18 +34,7 @@ import java.awt.image.BufferedImage;
*/ */
public class ColorAdjustPane extends JPanel implements UIObserver { public class ColorAdjustPane extends JPanel implements UIObserver {
public static final Color[] DEFAULT_COLORS = { public static final Color[] DEFAULT_COLORS = ChartConstants.NEW_FEATURES;
new Color(99, 178, 238),
new Color(118, 218, 145),
new Color(248, 203, 127),
new Color(248, 149, 136),
new Color(124, 214, 207),
new Color(145, 146, 171),
new Color(120, 152, 225),
new Color(239, 166, 102),
new Color(237, 221, 134),
new Color(153, 135, 206),
};
private static final int COUNT_OF_ROW = 8; private static final int COUNT_OF_ROW = 8;

21
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -27,6 +27,7 @@ import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -166,22 +167,28 @@ public class DefaultStyleHelper4Van {
private static void dealChartColor(VanChartPlot vanChartPlot) { private static void dealChartColor(VanChartPlot vanChartPlot) {
ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance();
Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS); Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS);
ColorFillStyle colorFillStyle = new ColorFillStyle();
if (preStyle instanceof ChartColorMatching) { if (preStyle instanceof ChartColorMatching) {
ColorFillStyle colorFillStyle = new ColorFillStyle();
//default是默认的意思,为服务器默认配色方案 //default是默认的意思,为服务器默认配色方案
//acc为多个颜色组合 //acc为多个颜色组合
//gradient为渐变颜色 //gradient为渐变颜色
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC);
colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS);
colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList()); colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList());
} else {
//服务器上没有图表配色
//需要指定配色属性为自定义组合色,否则会被兼容成跟随主题
// com.fr.plugin.chart.attr.plot.VanChartPlot.compatibleFillStyle
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC);
colorFillStyle.setColorList(Arrays.asList(ChartConstants.NEW_FEATURES));
}
AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle();
if (plotFillStyle == null) { if (plotFillStyle == null) {
plotFillStyle = new AttrFillStyle(); plotFillStyle = new AttrFillStyle();
vanChartPlot.setPlotFillStyle(plotFillStyle); vanChartPlot.setPlotFillStyle(plotFillStyle);
}
plotFillStyle.setColorFillStyle(colorFillStyle);
} }
plotFillStyle.setColorFillStyle(colorFillStyle);
} }
private static void dealBorder(VanChartPlot vanChartPlot) { private static void dealBorder(VanChartPlot vanChartPlot) {

46
designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java

@ -20,8 +20,11 @@ import com.fr.form.ui.*;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -198,6 +201,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
} }
}); });
this.setPreferredSize(new Dimension(100, 20)); this.setPreferredSize(new Dimension(100, 20));
this.initPopupMenuListener(userDefined);
} }
public void setSelectedItemByWidgetClass(Class clazz) { public void setSelectedItemByWidgetClass(Class clazz) {
@ -218,7 +222,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
super.setSelectedItem(anObject); super.setSelectedItem(anObject);
} }
private Vector getWidgetsName(boolean userDefined) { private Vector<Item> getWidgetsName(boolean userDefined) {
WidgetOption[] reportWidgetInstance = getWidgetOptions(); WidgetOption[] reportWidgetInstance = getWidgetOptions();
Vector<Item> items = new Vector<Item>(); Vector<Item> items = new Vector<Item>();
@ -262,7 +266,45 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
} }
private WidgetOption[] getWidgetOptions() { private WidgetOption[] getWidgetOptions() {
return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions()); return ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions());
}
private void initPopupMenuListener(boolean userDefined) {
this.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
// 下拉刷新下列表
Vector<Item> widgetsName = getWidgetsName(userDefined);
if (modelChanged(widgetsName)) {
refreshBoxItems(widgetsName);
}
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
}
});
}
private boolean modelChanged(Vector<Item> widgetsName) {
DefaultComboBoxModel model = (DefaultComboBoxModel) getModel();
int modelSize = model.getSize();
if (modelSize != widgetsName.size()) {
return true;
}
for (int i = 0; i < modelSize; i++) {
if (!AssistUtils.equals(model.getElementAt(i), widgetsName.elementAt(i))) {
return true;
}
}
return false;
} }
} }

Loading…
Cancel
Save