|
|
@ -18,6 +18,16 @@ public class AdjustWorkBookDefaultStyleUtils { |
|
|
|
private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); |
|
|
|
private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); |
|
|
|
private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); |
|
|
|
private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Color currentStoryBack = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void setCurrentStoryBack(Color color) { |
|
|
|
|
|
|
|
currentStoryBack = color; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Color getCurrentStoryBack() { |
|
|
|
|
|
|
|
return currentStoryBack == null ? TEMPLATE_BACKGROUND : currentStoryBack; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void adjustCellElement(CellElement cellElement) { |
|
|
|
public static void adjustCellElement(CellElement cellElement) { |
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
Style style = cellElement.getStyle(); |
|
|
|
Style style = cellElement.getStyle(); |
|
|
@ -33,14 +43,14 @@ public class AdjustWorkBookDefaultStyleUtils { |
|
|
|
public static void adjustFloatElement(FloatElement floatElement) { |
|
|
|
public static void adjustFloatElement(FloatElement floatElement) { |
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
Style style = floatElement.getStyle(); |
|
|
|
Style style = floatElement.getStyle(); |
|
|
|
style = style.deriveBackground(ColorBackground.getInstance(TEMPLATE_BACKGROUND)); |
|
|
|
style = style.deriveBackground(ColorBackground.getInstance(getCurrentStoryBack())); |
|
|
|
style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); |
|
|
|
style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); |
|
|
|
floatElement.setStyle(style); |
|
|
|
floatElement.setStyle(style); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Color adjustBack(Color color) { |
|
|
|
public static Color adjustBack(Color color) { |
|
|
|
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; |
|
|
|
return DesignModeContext.isDuchampMode() ? getCurrentStoryBack() : color; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|