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;
}
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;
}
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;
}
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;
}
Aggregations