Search in sources :

Example 1 with ColorManager

use of de.jaret.util.swt.ColorManager in project translationstudio8 by heartsome.

the class CellRendererBase method getBackgroundColor.

/**
     * Get the background color according to a cell style.
     * 
     * @param style cell style
     * @param printing true for printing
     * @return the color
     */
protected Color getBackgroundColor(ICellStyle style, boolean printing) {
    Device device = printing ? _printer : Display.getCurrent();
    ColorManager cm = ColorManager.getColorManager(device);
    Color bg = cm.getColor(style.getBackgroundColor() != null ? style.getBackgroundColor() : WHITERGB);
    return bg;
}
Also used : Device(org.eclipse.swt.graphics.Device) Color(org.eclipse.swt.graphics.Color) ColorManager(de.jaret.util.swt.ColorManager)

Example 2 with ColorManager

use of de.jaret.util.swt.ColorManager in project translationstudio8 by heartsome.

the class CellRendererBase method getBorderColor.

/**
     * Get the border color according to the cell style.
     * 
     * @param style cell style
     * @param printing true for printing
     * @return the border color
     */
protected Color getBorderColor(ICellStyle style, boolean printing) {
    Device device = printing ? _printer : Display.getCurrent();
    ColorManager cm = ColorManager.getColorManager(device);
    Color bg = cm.getColor(style.getBorderColor() != null ? style.getBorderColor() : new RGB(0, 0, 0));
    return bg;
}
Also used : Device(org.eclipse.swt.graphics.Device) Color(org.eclipse.swt.graphics.Color) RGB(org.eclipse.swt.graphics.RGB) ColorManager(de.jaret.util.swt.ColorManager)

Example 3 with ColorManager

use of de.jaret.util.swt.ColorManager in project translationstudio8 by heartsome.

the class CellRendererBase method getForegroundColor.

/**
     * Get the foreground color according to the cell style.
     * 
     * @param style cell style
     * @param printing true for printing
     * @return the foreground color
     */
protected Color getForegroundColor(ICellStyle style, boolean printing) {
    Device device = printing ? _printer : Display.getCurrent();
    ColorManager cm = ColorManager.getColorManager(device);
    Color bg = cm.getColor(style.getForegroundColor() != null ? style.getForegroundColor() : BLACKRGB);
    return bg;
}
Also used : Device(org.eclipse.swt.graphics.Device) Color(org.eclipse.swt.graphics.Color) ColorManager(de.jaret.util.swt.ColorManager)

Aggregations

ColorManager (de.jaret.util.swt.ColorManager)3 Color (org.eclipse.swt.graphics.Color)3 Device (org.eclipse.swt.graphics.Device)3 RGB (org.eclipse.swt.graphics.RGB)1