forked from fanruan/design
Browse Source
* commit 'eae7ebe0d2824d3f130c7692dfaca40d1080d100': ignore 根据最新视觉调整单元格边框颜色 POM-2302 cpt组件默认样式 REPORT-58394 fix:不安装旧版本图表插件 只是不能新建 图表配置面板也是要出来的feature/big-screen
superman
3 years ago
9 changed files with 81 additions and 23 deletions
@ -0,0 +1,46 @@ |
|||||||
|
package com.fr.design.utils.gui; |
||||||
|
|
||||||
|
import com.fr.base.Style; |
||||||
|
import com.fr.base.background.ColorBackground; |
||||||
|
import com.fr.design.base.mode.DesignModeContext; |
||||||
|
import com.fr.report.cell.CellElement; |
||||||
|
import com.fr.report.cell.FloatElement; |
||||||
|
|
||||||
|
import java.awt.Color; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author shine |
||||||
|
* @version 10.0 |
||||||
|
* Created by shine on 2021/9/6 |
||||||
|
*/ |
||||||
|
public class AdjustWorkBookDefaultStyleUtils { |
||||||
|
|
||||||
|
private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); |
||||||
|
private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); |
||||||
|
|
||||||
|
public static void adjustCellElement(CellElement cellElement) { |
||||||
|
if (DesignModeContext.isDuchampMode()) { |
||||||
|
Style style = cellElement.getStyle(); |
||||||
|
style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); |
||||||
|
style = style.deriveBorder(0, CELL_ELEMENT_BORDER, |
||||||
|
0, CELL_ELEMENT_BORDER, |
||||||
|
0, CELL_ELEMENT_BORDER, |
||||||
|
0, CELL_ELEMENT_BORDER); |
||||||
|
cellElement.setStyle(style); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void adjustFloatElement(FloatElement floatElement) { |
||||||
|
if (DesignModeContext.isDuchampMode()) { |
||||||
|
Style style = floatElement.getStyle(); |
||||||
|
style = style.deriveBackground(ColorBackground.getInstance(TEMPLATE_BACKGROUND)); |
||||||
|
style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); |
||||||
|
floatElement.setStyle(style); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static Color adjustBack(Color color) { |
||||||
|
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue