use of com.serotonin.m2m2.gviews.component.BinaryGraphicComponent in project ma-modules-public by infiniteautomation.
the class GraphicalViewDwr method saveBinaryGraphicComponent.
@DwrPermission(user = true)
public ProcessResult saveBinaryGraphicComponent(String viewComponentId, int zeroImage, int oneImage, boolean displayText, String imageSetId) {
ProcessResult response = new ProcessResult();
// Validate
ImageSet imageSet = getImageSet(imageSetId);
if (imageSet == null)
response.addContextualMessage("graphicRendererBinaryImageSet", "viewEdit.graphic.missingImageSet");
else {
if (zeroImage == -1)
response.addContextualMessage("graphicRendererBinaryImageSetZeroMsg", "viewEdit.graphic.missingZeroImage");
if (oneImage == -1)
response.addContextualMessage("graphicRendererBinaryImageSetOneMsg", "viewEdit.graphic.missingOneImage");
}
if (!response.getHasMessages()) {
BinaryGraphicComponent c = (BinaryGraphicComponent) getViewComponent(viewComponentId);
c.tsetImageSet(imageSet);
c.setZeroImage(zeroImage);
c.setOneImage(oneImage);
c.setDisplayText(displayText);
resetPointComponent(c);
}
return response;
}
Aggregations