Search in sources :

Example 1 with Light

use of org.olat.modules.coach.ui.LightedValue.Light in project OpenOLAT by OpenOLAT.

the class LightIconRenderer method getCssClass.

@Override
protected String getCssClass(Object val) {
    if (val == null) {
        return null;
    }
    if (val instanceof LightedValue) {
        LightedValue lightedVal = (LightedValue) val;
        Light light = lightedVal.getLight();
        if (light == null) {
            return null;
        }
        switch(light) {
            case grey:
                return "o_icon o_black_led";
            case green:
                return "o_icon o_green_led";
            case yellow:
                return "o_icon o_yellow_led";
            case red:
                return "o_icon o_red_led";
            case black:
                return "o_icon o_black_led";
            default:
                return null;
        }
    }
    return null;
}
Also used : Light(org.olat.modules.coach.ui.LightedValue.Light)

Example 2 with Light

use of org.olat.modules.coach.ui.LightedValue.Light in project OpenOLAT by OpenOLAT.

the class GroupsTableDataModel method getValueAt.

@Override
public Object getValueAt(int row, int col) {
    GroupStatEntry g = groups.get(row);
    int numOfStudents = g.getCountStudents();
    switch(Columns.getValueAt(col)) {
        case name:
            {
                return g.getGroupName();
            }
        case countCourses:
            {
                return new Integer(g.getCountCourses());
            }
        case countStudents:
            {
                return new Integer(numOfStudents);
            }
        case initialLaunch:
            {
                int count = g.getCountCourses() * g.getCountStudents();
                if (count == 0) {
                    return new LightedValue(null, Light.grey);
                }
                int launch = g.getInitialLaunch();
                Light light = Light.yellow;
                if (launch == count) {
                    light = Light.green;
                } else if (launch == 0) {
                    light = Light.red;
                }
                return new LightedValue(launch, light);
            }
        case countPassed:
            {
                if (numOfStudents == 0) {
                    return numOfStudents;
                }
                ProgressValue val = new ProgressValue();
                val.setTotal(numOfStudents);
                val.setGreen(g.getCountPassed());
                return val;
            }
        case countPassedLight:
            {
                if (numOfStudents == 0) {
                    return new LightedValue(null, Light.grey);
                }
                int passed = g.getCountPassed();
                Light light = Light.yellow;
                if (passed == numOfStudents) {
                    light = Light.green;
                } else if (passed == 0) {
                    light = Light.red;
                }
                return new LightedValue(passed, light);
            }
        case averageScore:
            return g.getAverageScore();
        case statistics:
            {
                return g;
            }
    }
    return null;
}
Also used : ProgressValue(org.olat.modules.coach.ui.ProgressValue) Light(org.olat.modules.coach.ui.LightedValue.Light) GroupStatEntry(org.olat.modules.coach.model.GroupStatEntry)

Example 3 with Light

use of org.olat.modules.coach.ui.LightedValue.Light in project openolat by klemens.

the class GroupsTableDataModel method getValueAt.

@Override
public Object getValueAt(int row, int col) {
    GroupStatEntry g = groups.get(row);
    int numOfStudents = g.getCountStudents();
    switch(Columns.getValueAt(col)) {
        case name:
            {
                return g.getGroupName();
            }
        case countCourses:
            {
                return new Integer(g.getCountCourses());
            }
        case countStudents:
            {
                return new Integer(numOfStudents);
            }
        case initialLaunch:
            {
                int count = g.getCountCourses() * g.getCountStudents();
                if (count == 0) {
                    return new LightedValue(null, Light.grey);
                }
                int launch = g.getInitialLaunch();
                Light light = Light.yellow;
                if (launch == count) {
                    light = Light.green;
                } else if (launch == 0) {
                    light = Light.red;
                }
                return new LightedValue(launch, light);
            }
        case countPassed:
            {
                if (numOfStudents == 0) {
                    return numOfStudents;
                }
                ProgressValue val = new ProgressValue();
                val.setTotal(numOfStudents);
                val.setGreen(g.getCountPassed());
                return val;
            }
        case countPassedLight:
            {
                if (numOfStudents == 0) {
                    return new LightedValue(null, Light.grey);
                }
                int passed = g.getCountPassed();
                Light light = Light.yellow;
                if (passed == numOfStudents) {
                    light = Light.green;
                } else if (passed == 0) {
                    light = Light.red;
                }
                return new LightedValue(passed, light);
            }
        case averageScore:
            return g.getAverageScore();
        case statistics:
            {
                return g;
            }
    }
    return null;
}
Also used : ProgressValue(org.olat.modules.coach.ui.ProgressValue) Light(org.olat.modules.coach.ui.LightedValue.Light) GroupStatEntry(org.olat.modules.coach.model.GroupStatEntry)

Example 4 with Light

use of org.olat.modules.coach.ui.LightedValue.Light in project openolat by klemens.

the class LightIconRenderer method getCssClass.

@Override
protected String getCssClass(Object val) {
    if (val == null) {
        return null;
    }
    if (val instanceof LightedValue) {
        LightedValue lightedVal = (LightedValue) val;
        Light light = lightedVal.getLight();
        if (light == null) {
            return null;
        }
        switch(light) {
            case grey:
                return "o_icon o_black_led";
            case green:
                return "o_icon o_green_led";
            case yellow:
                return "o_icon o_yellow_led";
            case red:
                return "o_icon o_red_led";
            case black:
                return "o_icon o_black_led";
            default:
                return null;
        }
    }
    return null;
}
Also used : Light(org.olat.modules.coach.ui.LightedValue.Light)

Aggregations

Light (org.olat.modules.coach.ui.LightedValue.Light)4 GroupStatEntry (org.olat.modules.coach.model.GroupStatEntry)2 ProgressValue (org.olat.modules.coach.ui.ProgressValue)2