use of com.serotonin.m2m2.gviews.component.MultistateGraphicComponent in project ma-modules-public by infiniteautomation.
the class GraphicalViewDwr method saveMultistateGraphicComponent.
@DwrPermission(user = true)
public ProcessResult saveMultistateGraphicComponent(String viewComponentId, List<IntStringPair> imageStates, int defaultImage, boolean displayText, String imageSetId) {
ProcessResult response = new ProcessResult();
// Validate
ImageSet imageSet = getImageSet(imageSetId);
if (imageSet == null)
response.addContextualMessage("graphicRendererMultistateImageSet", "viewEdit.graphic.missingImageSet");
if (!response.getHasMessages()) {
MultistateGraphicComponent c = (MultistateGraphicComponent) getViewComponent(viewComponentId);
c.setImageStateList(imageStates);
c.setDefaultImage(defaultImage);
c.setDisplayText(displayText);
c.tsetImageSet(imageSet);
resetPointComponent(c);
}
return response;
}
Aggregations