forked from fanruan/design
lucian
3 years ago
106 changed files with 1377 additions and 430 deletions
@ -0,0 +1,17 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.login.AbstractDesignerSSO; |
||||
import com.fr.general.CloudCenter; |
||||
|
||||
public class StudyPlanAction extends AbstractDesignerSSO { |
||||
public StudyPlanAction() { |
||||
this.setName(Toolkit.i18nText("Fine-Design_Study_Plan")); |
||||
this.setSmallIcon("/com/fr/design/images/bbs/studyPlan"); |
||||
} |
||||
|
||||
@Override |
||||
public String getJumpUrl() { |
||||
return CloudCenter.getInstance().acquireUrlByKind("bbs.studyPlan", "https://edu.fanruan.com/studypath/finereport"); |
||||
} |
||||
} |
@ -0,0 +1,5 @@
|
||||
package com.fr.design.constants; |
||||
|
||||
public class TableDataConstants { |
||||
public static final String SEPARATOR = "_"; |
||||
} |
@ -1,10 +1,14 @@
|
||||
com.fr.design.mainframe.check.CheckButton=230*118 |
||||
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185 |
||||
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=550*185 |
||||
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35 |
||||
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 |
||||
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=550*280 |
||||
com.fr.env.RemoteEnvPane.dialog=458*132 |
||||
com.fr.design.version.check.dialog=450*95 |
||||
com.fr.design.version.detail.label=700*30 |
||||
com.fr.design.version.detail.dialog=850*500 |
||||
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 |
||||
com.fr.design.web.pane.text.field=450*20 |
||||
com.fr.design.actions.server.dialog=700*630 |
||||
com.fr.design.report.fit.templatePane.dialog=600*400 |
||||
com.fr.design.report.fit.firstColumn=130*20 |
||||
com.fr.design.report.fit.column=100*20 |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 655 B |
@ -0,0 +1,85 @@
|
||||
package com.fr.van.chart.config; |
||||
|
||||
import com.fr.base.ChartPreStyleConfig; |
||||
import com.fr.chart.base.ChartBaseUtils; |
||||
import com.fr.chart.base.ChartConstants; |
||||
import com.fr.general.Background; |
||||
import com.fr.general.FRFont; |
||||
import com.fr.general.GeneralUtils; |
||||
import com.fr.stable.CodeUtils; |
||||
import com.fr.stable.Constants; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Font; |
||||
|
||||
/** |
||||
* @author shine |
||||
* @version 10.0 |
||||
* Created by shine on 2021/6/25 |
||||
*/ |
||||
public class DefaultStyleConstants { |
||||
static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 19, new Color(241, 246, 255)); |
||||
static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); |
||||
|
||||
static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); |
||||
static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(200, 211, 228)); |
||||
static final Color AXIS_LINE = new Color(46, 75, 102); |
||||
static final Color GRID_LINE = new Color(30, 55, 78); |
||||
|
||||
static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(255, 0, 0)); |
||||
|
||||
static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); |
||||
static final Color DATA_SHEET_BORDER = new Color(46, 75, 102); |
||||
|
||||
static final Color BORDER = Color.BLACK; |
||||
static final int BORDER_WIDTH = Constants.LINE_NONE; |
||||
static final int SPECIAL_BORDER_WIDTH = Constants.LINE_THIN; |
||||
|
||||
static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 13, new Color(232, 232, 232)); |
||||
|
||||
static final Color GAUGE_PANE_BACK_COLOR = null; |
||||
static final Color GAUGE_HINGE = null; |
||||
static final Color GAUGE_PANE_BACK_COLOR_4_RING = new Color(72, 73, 79); |
||||
static final Color GAUGE_SLOT_BACKGROUND_COLOR = new Color(72, 73, 79); |
||||
private static final String FONT_NAME = ChartBaseUtils.getLocalDefaultFont("verdana"); |
||||
static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 12, new Color(232, 232, 232));//试管仪表盘标签的默认样式
|
||||
static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 11, new Color(159, 173, 191)); |
||||
static final FRFont RING_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//百分比圆环仪表盘值标签的默认样式
|
||||
static final FRFont POINTER_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//多指针仪表盘值标签的默认样式
|
||||
static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 13, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式
|
||||
|
||||
static final Color MAP_NULL_VALUE_COLOR = new Color(168, 168, 168); |
||||
static final Color MAP_BORDER = Color.BLACK; |
||||
static final Color MAP_LEGEND_BACK = Color.BLACK; |
||||
static final Color MAP_TITLE_BACK = Color.BLACK; |
||||
|
||||
static final Color DRILL_MAP_DRILL_TOOLS_BACK = Color.BLACK; |
||||
static final float DRILL_MAP_DRILL_TOOLS_BACK_OPACITY = 0.8f; |
||||
|
||||
static final Background BACK = null; |
||||
|
||||
static String COLORS = null; |
||||
|
||||
static { |
||||
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); |
||||
try { |
||||
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u7ecf\u5178\u9ad8\u4eae"); |
||||
// 没有经典高亮, 用新特性
|
||||
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) { |
||||
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u65b0\u7279\u6027"); |
||||
} |
||||
// 没有新特性, 用第一个配色
|
||||
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) { |
||||
if (config.names().hasNext()) { |
||||
|
||||
String name = GeneralUtils.objectToString(config.names().next()); |
||||
if (config.getPreStyle(name) != null) { |
||||
DefaultStyleConstants.COLORS = name; |
||||
} |
||||
} |
||||
} |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,207 @@
|
||||
package com.fr.van.chart.config; |
||||
|
||||
import com.fr.base.ChartColorMatching; |
||||
import com.fr.base.ChartPreStyleConfig; |
||||
import com.fr.chart.base.AttrBorder; |
||||
import com.fr.chart.base.AttrFillStyle; |
||||
import com.fr.chart.base.ChartConstants; |
||||
import com.fr.chart.chartattr.Plot; |
||||
import com.fr.chart.chartglyph.ConditionAttr; |
||||
import com.fr.chart.chartglyph.DataSheet; |
||||
import com.fr.config.predefined.ColorFillStyle; |
||||
import com.fr.design.mainframe.chart.mode.ChartEditContext; |
||||
import com.fr.plugin.chart.PiePlot4VanChart; |
||||
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; |
||||
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
||||
import com.fr.plugin.chart.attr.plot.VanChartPlot; |
||||
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; |
||||
import com.fr.plugin.chart.base.AttrLabel; |
||||
import com.fr.plugin.chart.base.AttrLabelDetail; |
||||
import com.fr.plugin.chart.custom.type.CustomPlotType; |
||||
import com.fr.plugin.chart.gauge.VanChartGaugePlot; |
||||
import com.fr.plugin.chart.map.VanChartMapPlot; |
||||
import com.fr.plugin.chart.type.GaugeStyle; |
||||
|
||||
/** |
||||
* @author shine |
||||
* @version 10.0 |
||||
* Created by shine on 2021/10/22 |
||||
* vanchart的抽出来,因为主体代码 新增y轴 组合图新增图表都要用 |
||||
*/ |
||||
public class DefaultStyleHelper4Van { |
||||
|
||||
private static boolean duchampMode() { |
||||
try { |
||||
return ChartEditContext.duchampMode(); |
||||
} catch (Throwable e) { |
||||
//tomcat预览 默认数据的图表
|
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) { |
||||
if (!duchampMode()) { |
||||
return; |
||||
} |
||||
dealVanPlotCommonAttr(plot); |
||||
switch (customPlotType) { |
||||
case PIE: |
||||
case DIFFERENT_PIE: |
||||
case SAME_PIE: |
||||
dealPie(plot); |
||||
break; |
||||
case SLOT: |
||||
case POINTER_360: |
||||
case POINTER_180: |
||||
case CUVETTE: |
||||
case RING: |
||||
dealGauge(plot); |
||||
break; |
||||
case COLUMN: |
||||
case LINE: |
||||
case AREA: |
||||
case BUBBLE: |
||||
case RADAR: |
||||
case STACK_RADAR: |
||||
case SCATTER: |
||||
default: |
||||
break; |
||||
} |
||||
|
||||
} |
||||
|
||||
public static VanChartAxis dealAxisDefault(VanChartAxis axis) { |
||||
if (!duchampMode()) { |
||||
return axis; |
||||
} |
||||
axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE); |
||||
axis.getTextAttr().setFRFont(DefaultStyleConstants.AXIS_LABEL); |
||||
axis.setAxisColor(DefaultStyleConstants.AXIS_LINE); |
||||
axis.setMainGridColor(DefaultStyleConstants.GRID_LINE); |
||||
return axis; |
||||
} |
||||
|
||||
public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) { |
||||
if (!duchampMode()) { |
||||
return; |
||||
} |
||||
vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT); |
||||
} |
||||
|
||||
static void dealVanPlotCommonAttr(Plot plot) { |
||||
if (!duchampMode()) { |
||||
return; |
||||
} |
||||
if (plot instanceof VanChartPlot) { |
||||
VanChartPlot vanChartPlot = (VanChartPlot) plot; |
||||
|
||||
ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); |
||||
Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS); |
||||
if (preStyle instanceof ChartColorMatching) { |
||||
ColorFillStyle colorFillStyle = new ColorFillStyle(); |
||||
//default是默认的意思,为服务器默认配色方案
|
||||
//acc为多个颜色组合
|
||||
//gradient为渐变颜色
|
||||
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); |
||||
colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); |
||||
colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList()); |
||||
|
||||
AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); |
||||
if (plotFillStyle == null) { |
||||
plotFillStyle = new AttrFillStyle(); |
||||
vanChartPlot.setPlotFillStyle(plotFillStyle); |
||||
} |
||||
plotFillStyle.setColorFillStyle(colorFillStyle); |
||||
} |
||||
|
||||
|
||||
if (vanChartPlot.getLegend() != null) { |
||||
vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND); |
||||
} |
||||
|
||||
if (vanChartPlot instanceof VanChartRectanglePlot) { |
||||
VanChartRectanglePlot vanChartRectanglePlot = (VanChartRectanglePlot) vanChartPlot; |
||||
|
||||
for (VanChartAxis axis : vanChartRectanglePlot.getXAxisList()) { |
||||
dealAxisDefault(axis); |
||||
} |
||||
for (VanChartAxis axis : vanChartRectanglePlot.getYAxisList()) { |
||||
dealAxisDefault(axis); |
||||
} |
||||
} |
||||
|
||||
dealBorder(vanChartPlot); |
||||
|
||||
DataSheet dataSheet = vanChartPlot.getDataSheet(); |
||||
dataSheet.getTextAttr().setFRFont(DefaultStyleConstants.DATA_SHEET); |
||||
dataSheet.setBorderColor(DefaultStyleConstants.DATA_SHEET_BORDER); |
||||
} |
||||
|
||||
} |
||||
|
||||
private static void dealBorder(VanChartPlot vanChartPlot) { |
||||
ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr(); |
||||
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class); |
||||
if (attrBorder != null) { |
||||
attrBorder.setBorderColor(DefaultStyleConstants.BORDER); |
||||
attrBorder.setBorderStyle(defaultBorderWidth(vanChartPlot)); |
||||
} |
||||
} |
||||
|
||||
private static int defaultBorderWidth(VanChartPlot vanChartPlot) { |
||||
//pie multipie treemap map drillmap heatmap
|
||||
if (vanChartPlot instanceof PiePlot4VanChart |
||||
|| vanChartPlot instanceof VanChartMapPlot) { |
||||
return DefaultStyleConstants.SPECIAL_BORDER_WIDTH; |
||||
} |
||||
return DefaultStyleConstants.BORDER_WIDTH; |
||||
} |
||||
|
||||
static void dealPie(Plot plot) { |
||||
if (plot instanceof PiePlot4VanChart) { |
||||
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); |
||||
AttrLabel attrLabel = defaultAttr.getExisted(AttrLabel.class); |
||||
if (attrLabel == null) { |
||||
attrLabel = ((PiePlot4VanChart) plot).getDefaultAttrLabel(); |
||||
defaultAttr.addDataSeriesCondition(attrLabel); |
||||
} |
||||
attrLabel.getSecondLabelDetail().getTextAttr().setFRFont(DefaultStyleConstants.PIE_CATEGORY_LABEL); |
||||
} |
||||
} |
||||
|
||||
static void dealGauge(Plot param) { |
||||
if (!(param instanceof VanChartGaugePlot)) { |
||||
return; |
||||
} |
||||
VanChartGaugePlot plot = (VanChartGaugePlot) param; |
||||
plot.getGaugeDetailStyle().setPaneBackgroundColor(plot.getGaugeStyle() == GaugeStyle.RING ? DefaultStyleConstants.GAUGE_PANE_BACK_COLOR_4_RING : DefaultStyleConstants.GAUGE_PANE_BACK_COLOR); |
||||
plot.getGaugeDetailStyle().setSlotBackgroundColor(DefaultStyleConstants.GAUGE_SLOT_BACKGROUND_COLOR); |
||||
plot.getGaugeDetailStyle().setHingeColor(DefaultStyleConstants.GAUGE_HINGE); |
||||
|
||||
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); |
||||
AttrLabel attrLabel = defaultAttr.getExisted(AttrLabel.class); |
||||
if (attrLabel != null) { |
||||
AttrLabelDetail detail = attrLabel.getAttrLabelDetail(); |
||||
AttrLabelDetail valueDetail = attrLabel.getGaugeValueLabelDetail(); |
||||
|
||||
switch (plot.getGaugeStyle()) { |
||||
case POINTER: |
||||
case POINTER_SEMI: |
||||
detail.getContent().getCategoryFormat().setEnable(false); |
||||
detail.getTextAttr().setFRFont(DefaultStyleConstants.POINTER_CATE_LABEL_FONT); |
||||
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.POINTER_VALUE_LABEL_FONT); |
||||
break; |
||||
case RING: |
||||
case SLOT: |
||||
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.RING_VALUE_LABEL_FONT); |
||||
break; |
||||
case THERMOMETER: |
||||
detail.getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_LABEL_FONT); |
||||
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_LABEL_FONT); |
||||
plot.getGaugeAxis().getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_AXIS_LABEL); |
||||
break; |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,47 @@
|
||||
package com.fr.design.designer.ui; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Iterator; |
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 把弹窗统一管理起来 防止出现异常情况下游离的弹窗 |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/11/02 |
||||
*/ |
||||
public class PopupDialogContext { |
||||
|
||||
private static List<SelectedPopupDialog> dialogs = new ArrayList<>(); |
||||
|
||||
public static void add(SelectedPopupDialog selectedPopupDialog) { |
||||
if (dialogs.contains(selectedPopupDialog)) { |
||||
return; |
||||
} |
||||
dialogs.add(selectedPopupDialog); |
||||
} |
||||
|
||||
public static void remove(SelectedPopupDialog selectedPopupDialog) { |
||||
dialogs.remove(selectedPopupDialog); |
||||
} |
||||
|
||||
public static void checkSelectedPop(XCreator creator) { |
||||
Iterator<SelectedPopupDialog> iterator = dialogs.iterator(); |
||||
List<SelectedPopupDialog> removedDialog = new ArrayList<>(); |
||||
while (iterator.hasNext()) { |
||||
SelectedPopupDialog dialog = iterator.next(); |
||||
if (dialog.isVisible() && creator != dialog.getCreator()) { |
||||
iterator.remove(); |
||||
removedDialog.add(dialog); |
||||
} |
||||
} |
||||
for (SelectedPopupDialog dialog : removedDialog) { |
||||
dialog.setVisible(false); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
public enum ArrangementType { |
||||
LEFT_ALIGN(0), |
||||
RIGHT_ALIGN(1), |
||||
TOP_ALIGN(2), |
||||
BOTTOM_ALIGN(3), |
||||
HORIZONTAL_CENTER_ALIGN(4), |
||||
VERTICAL_CENTER_ALIGN(5), |
||||
HORIZONTAL_AUTO_DISTRIBUTION(6), |
||||
HORIZONTAL_MANUAL_DISTRIBUTION(7), |
||||
VERTICAL_AUTO_DISTRIBUTION(8), |
||||
VERTICAL_MANUAL_DISTRIBUTION(9); |
||||
|
||||
private int type; |
||||
|
||||
ArrangementType(int type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public int getType() { |
||||
return this.type; |
||||
} |
||||
|
||||
public static ArrangementType parse(int type) { |
||||
for (ArrangementType arrangementType : ArrangementType.values()) { |
||||
if (arrangementType.getType() == type) { |
||||
return arrangementType; |
||||
} |
||||
} |
||||
return LEFT_ALIGN; |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue