Search in sources :

Example 1 with MultistateGraphicComponent

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;
}
Also used : MultistateGraphicComponent(com.serotonin.m2m2.gviews.component.MultistateGraphicComponent) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) ImageSet(com.serotonin.m2m2.view.ImageSet) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

MultistateGraphicComponent (com.serotonin.m2m2.gviews.component.MultistateGraphicComponent)1 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)1 ImageSet (com.serotonin.m2m2.view.ImageSet)1 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)1