Skip to content
Snippets Groups Projects
Commit d5f636ca authored by Piotr Gawron's avatar Piotr Gawron
Browse files

improved color parsing

parent 23b515f9
No related branches found
No related tags found
1 merge request!1Appointments dev
...@@ -155,10 +155,21 @@ public class PrcSubjectsParser extends SubjectParser { ...@@ -155,10 +155,21 @@ public class PrcSubjectsParser extends SubjectParser {
@Override @Override
protected boolean parseResigned(Row row) { protected boolean parseResigned(Row row) {
try { try {
IndexedColors color = IndexedColors.fromInt(row.getSheet().getWorkbook().getFontAt(row.getCell(0).getCellStyle().getFontIndex()).getColor()); int colorId = row.getSheet().getWorkbook().getFontAt(row.getCell(0).getCellStyle().getFontIndex()).getColor();
//special case for black
if (colorId == 32767) {
return false;
}
IndexedColors color = IndexedColors.fromInt(colorId);
switch (color) { switch (color) {
case RED: case RED:
return true; return true;
case SEA_GREEN:
return false;
case PINK:
return false;
case PLUM:
return false;
case BLUE: case BLUE:
return false; return false;
case BLACK: case BLACK:
......
#Set root logger 's level and its appender to an appender called CONSOLE which is defined below. #Set root logger 's level and its appender to an appender called CONSOLE which is defined below.
log4j.rootLogger=fatal, CONSOLE log4j.rootLogger=debug, CONSOLE
#Set the behavior of the CONSOLE appender #Set the behavior of the CONSOLE appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
......
...@@ -9,6 +9,7 @@ import org.junit.runners.Suite.SuiteClasses; ...@@ -9,6 +9,7 @@ import org.junit.runners.Suite.SuiteClasses;
CellParserTest.class, // CellParserTest.class, //
LihControlMappingParserTest.class, // LihControlMappingParserTest.class, //
LihControlParserTest.class, // LihControlParserTest.class, //
PrcControlParserTest.class, //
PrcFlyingParserTest.class, // PrcFlyingParserTest.class, //
PrcSubjectsParserTest.class, // PrcSubjectsParserTest.class, //
RedcapParserTest.class, // RedcapParserTest.class, //
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment