public void createOperations(PhysicalOperationsCollector col,
Element element,
Content value,
Rectangle2D bounds) {
if (bounds == null)
{
throw new NullPointerException("Bounds is null");
}
if (element == null)
{
throw new NullPointerException("element is null");
}
if (value == null)
{
throw new NullPointerException("Value is null");
}
final Content c = value.getContentForBounds(bounds);
if (c == null)
{
return;
}
// Font
final FontDefinition font = element.getStyle().getFontDefinitionProperty();
// Paint
final Color paint = (Color) element.getStyle().getStyleProperty(ElementStyleSheet.PAINT);
col.addOperation(new PhysicalOperation.SetFontOperation(font));
col.addOperation(new PhysicalOperation.SetPaintOperation(paint));
final ElementAlignment va
= (ElementAlignment) element.getStyle().getStyleProperty(ElementStyleSheet.VALIGNMENT);
final VerticalBoundsAlignment vba = getVerticalLayout(va, bounds);
// calculate the horizontal shift ... is applied later
final Rectangle2D cBounds = c.getMinimumContentSize();
float vbaShift = (float) cBounds.getY();
vbaShift = (float) vba.align(c.getMinimumContentSize()).getY() - vbaShift;
final ElementAlignment ha
= (ElementAlignment) element.getStyle().getStyleProperty(ElementStyleSheet.ALIGNMENT);
final HorizontalBoundsAlignment hba = getHorizontalLayout(ha, bounds);
addContent(c, col, hba, vbaShift);
// bugfix here: Dont move the line content within the global content bounds.
}
Creates a list of operations. |