Browse Source

Merge pull request #8715 in DESIGN/design from final/11.0 to persist/11.0

* commit '7ab40537de73cd0e228837469803c25dc0c958b2':
  REPORT-69962 超链设置优化多单元格组合设置效果确认 1、修改判断方式,判断单元格有无超链接
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-68949 控件-预定义控件-预定义控件新建后控件列表中没有刷新出来
  REPORT-69842 修改边框颜色单元格背景颜色会变统一
  update
  REPORT-68638 fix:删除所有图表配色 重新读fvs.cpt.chart会被兼容成跟随主题
  REPORT-69776 切换在线组件的排序,会加载很久
  REPORT-68638 design fix:没有配色的时候渲染和配置界面配色不一致,统一成配置界面的
  REPORT-68357 fix:namestyle导致fvs.cpt中单元格样式中有主题相关配置
  REPORT-69575 设计器在线组件刷不出来
fix-lag
superman 3 years ago
parent
commit
cde11963c3
  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. 11
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  6. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  7. 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;

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/HyperlinkGroupPaneActionImpl.java

@ -89,7 +89,7 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
} }
// 首次添加超链接,将文字样式默认改为蓝色下划线 // 首次添加超链接,将文字样式默认改为蓝色下划线
if (updateNameHyperlinks.size() == 1 && hyperlinkGroupPane.getCurrentEvent() != null && hyperlinkGroupPane.getCurrentEvent().getType() == ListDataEvent.INTERVAL_ADDED) { if (editCellElement.getNameHyperlinkGroup() == null && hyperlinkGroupPane.getCurrentEvent() != null && hyperlinkGroupPane.getCurrentEvent().getType() == ListDataEvent.INTERVAL_ADDED) {
editCellElement.setStyle(elementStyle.deriveFRFont(frFont)); editCellElement.setStyle(elementStyle.deriveFRFont(frFont));
} }

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