@Override
public void setupOuterRectangle(Offset actualSize) {
switch (shape) {
case HORIZONTAL_LINE:
innerRectangle = new Offset(actualSize.width, THICKNESS);
break;
case VERTICAL_LINE:
innerRectangle = new Offset(THICKNESS, actualSize.height);
break;
case NOTHING:
innerRectangle = new Offset(0.0, 0.0);
break;
case CONTOUR:
innerRectangle = new Offset(actualSize);
break;
case INTEGRAL:
innerRectangle = new Offset(actualSize);
if (actualSize.height < INTEGRAL_RATIO*actualSize.width) { // Does this matter?
innerRectangle.width = innerRectangle.height/INTEGRAL_RATIO;
}
break;
case RADICAL:
// TODO: While using a minimum size to ensure a
// kind of aspect ratio, this should be
// replaced with a context aware alternative.
innerRectangle = new Offset(actualSize);
break;
case OPEN_SQUARE:
innerRectangle = new Offset(2*THICKNESS, actualSize.height);
break;
case CLOSE_SQUARE:
innerRectangle = new Offset(2*THICKNESS, actualSize.height);
break;
case OPEN_ROUND:
innerRectangle = new Offset(0, actualSize.height);
break;
case CLOSE_ROUND:
innerRectangle = new Offset(0, actualSize.height); //? 0?
break;
case OPEN_PARENTHESIS:
innerRectangle = new Offset(PARENTHESIS_MIN.width, actualSize.height);
break;
case CLOSE_PARENTHESIS:
innerRectangle = new Offset(PARENTHESIS_MIN.height, actualSize.height);
break;
case BRA:
innerRectangle = new Offset(actualSize);
break;
case KET:
innerRectangle = new Offset(actualSize);
break;
default:
throw new RuntimeException("unfinished");
}