Browse Source

Merge pull request #8615 in DESIGN/design from release/11.0 to feature/x

* commit '17bfa59afdaafc62287b47fce13ea98860f50a18':
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-69842 修改边框颜色单元格背景颜色会变统一
  update
  REPORT-68638 fix:删除所有图表配色 重新读fvs.cpt.chart会被兼容成跟随主题
feature/x
superman 3 years ago
parent
commit
5984edb1f8
  1. 11
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  3. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  4. 46
      designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java

11
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,14 +167,21 @@ 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);
if (preStyle instanceof ChartColorMatching) {
ColorFillStyle colorFillStyle = new ColorFillStyle(); ColorFillStyle colorFillStyle = new ColorFillStyle();
if (preStyle instanceof ChartColorMatching) {
//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) {
@ -182,7 +190,6 @@ public class DefaultStyleHelper4Van {
} }
plotFillStyle.setColorFillStyle(colorFillStyle); plotFillStyle.setColorFillStyle(colorFillStyle);
} }
}
private static void dealBorder(VanChartPlot vanChartPlot) { private static void dealBorder(VanChartPlot vanChartPlot) {
ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr(); ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr();

2
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -118,7 +118,7 @@ public class CellStylePane extends AbstractCellAttrPane {
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
Format format = cellElement.getStyle().getFormat(); Format format = cellElement.getStyle().getFormat();
Style style = stylePane.updateBean(); Style style = stylePane.mergeBean(cellElement.getStyle());
// 格式不能通过样式面板中的配置项修改,因此需要保留 // 格式不能通过样式面板中的配置项修改,因此需要保留
style = style.deriveFormat(format); style = style.deriveFormat(format);
cellElement.setStyle(style); cellElement.setStyle(style);

8
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -251,6 +251,14 @@ public class StylePane extends BasicPane implements UIObserver {
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme()); followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
} }
public Style mergeBean(Style style) {
if (isFollowingTheme()) {
return updateBean();
} else {
return customStylePane.updateStyle(style);
}
}
private void fireStateChanged() { private void fireStateChanged() {
for (UIObserverListener listener: observerListeners) { for (UIObserverListener listener: observerListeners) {
listener.doChange(); listener.doChange();

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