/ (model.getMaximum() - model.getMinimum());
width1 = Integer.toString(value);
width2 = Integer.toString((width - 2) - value);
}
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlConstants.SPAN, component);
writer.writeClassAttribute();
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
writer.startElement(HtmlConstants.IMG, null);
StyleClasses color1Classes = new StyleClasses();
color1Classes.addClass("progress", "color1");
color1Classes.addMarkupClass(component, "progress", "color1");
writer.writeClassAttribute(color1Classes);
writer.writeAttribute(HtmlAttributes.SRC, image, false);
writer.writeAttribute(HtmlAttributes.ALT, title, true);
writer.writeAttribute(HtmlAttributes.WIDTH, width1, false);
writer.writeAttribute(HtmlAttributes.BORDER, 0);
writer.endElement(HtmlConstants.IMG);
writer.startElement(HtmlConstants.IMG, null);
StyleClasses color2Classes = new StyleClasses();
color2Classes.addClass("progress", "color2");
color2Classes.addMarkupClass(component, "progress", "color2");
writer.writeClassAttribute(color2Classes);
writer.writeAttribute(HtmlAttributes.SRC, image, false);
writer.writeAttribute(HtmlAttributes.ALT, title, true);
writer.writeAttribute(HtmlAttributes.WIDTH, width2, false);
writer.writeAttribute(HtmlAttributes.BORDER, 0);
writer.endElement(HtmlConstants.IMG);
writer.endElement(HtmlConstants.SPAN);
UIComponent facet = component.getFacet("complete");
if (model.getValue() == model.getMaximum() && facet != null
&& facet instanceof UICommand) {
UICommand command = (UICommand) facet;
writer.writeJavascript("Tobago.submitAction('" + command.getClientId(facesContext) + "');");
}
}