shine
3 years ago
9 changed files with 80 additions and 23 deletions
@ -0,0 +1,45 @@
|
||||
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); |
||||
|
||||
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, Color.WHITE, |
||||
0, Color.WHITE, |
||||
0, Color.WHITE, |
||||
0, Color.WHITE); |
||||
cellElement.setStyle(style); |
||||
} |
||||
} |
||||
|
||||
public static void adjustFloat(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