Examples of PointComponent


Examples of com.serotonin.m2m2.gviews.component.PointComponent

            if (vc.isPointComponent()) {
                if (vc.getId().equals(viewComponentId))
                    return ((PointComponent) vc).tgetDataPoint();
            }
            else if (vc.isCompoundComponent()) {
                PointComponent pc = ((CompoundComponent) vc).findPointComponent(viewComponentId);
                if (pc != null)
                    return pc.tgetDataPoint();
            }
        }
        return null;
    }
View Full Code Here

Examples of com.serotonin.m2m2.gviews.component.PointComponent

    private void addPointComponentState(ViewComponent viewComponent, RuntimeManager rtm, Map<String, Object> model,
            HttpServletRequest request, GraphicalView view, User user, List<ViewComponentState> states, boolean edit,
            boolean add) {
        if (viewComponent.isPointComponent() && (edit || viewComponent.isVisible())) {
            PointComponent pointComponent = (PointComponent) viewComponent;

            DataPointRT dataPointRT = null;
            if (pointComponent.tgetDataPoint() != null)
                dataPointRT = rtm.getDataPoint(pointComponent.tgetDataPoint().getId());

            ViewComponentState state = preparePointComponentState(pointComponent, user, dataPointRT, model, request);

            if (!edit) {
                if (pointComponent.isSettable()) {
                    int access = view.getUserAccess(user);
                    if (access == ShareUser.ACCESS_OWNER || access == ShareUser.ACCESS_SET)
                        setChange(pointComponent.tgetDataPoint(), state, dataPointRT, request, model);
                }

                if (pointComponent.tgetDataPoint() != null)
                    setChart(pointComponent.tgetDataPoint(), state, request, model);
            }

            if (add)
                states.add(state);
View Full Code Here

Examples of com.serotonin.m2m2.gviews.component.PointComponent

    @DwrPermission(user = true)
    public ProcessResult setPointComponentSettings(String pointComponentId, int dataPointId, String name,
            boolean settable, String bkgdColorOverride, boolean displayControls, int x, int y) {
        ProcessResult response = new ProcessResult();
        PointComponent pc = (PointComponent) getViewComponent(pointComponentId);
        User user = Common.getUser();

        DataPointVO dp = new DataPointDao().getDataPoint(dataPointId);
        if (dp == null || !Permissions.hasDataPointReadPermission(user, dp))
            response.addContextualMessage("settingsPointInfo", "validate.required");

        if (x < 0)
            response.addContextualMessage("settingsX", "validate.cannotBeNegative");
        if (y < 0)
            response.addContextualMessage("settingsY", "validate.cannotBeNegative");

        if (!response.getHasMessages()) {
            pc.tsetDataPoint(dp);
            pc.setNameOverride(name);
            pc.setSettableOverride(settable && Permissions.hasDataPointSetPermission(user, dp));
            pc.setBkgdColorOverride(bkgdColorOverride);
            pc.setDisplayControls(displayControls);
            pc.setLocation(x, y);

            pc.validateDataPoint(user, false);

            response.addData("x", x);
            response.addData("y", y);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.