/v3.2/nimbits-tds/src/com/nimbits/client/model/GxtPointModel.java
http://nimbits-server.googlecode.com/ · Java · 82 lines · 50 code · 14 blank · 18 comment · 2 complexity · 3520a6c6411a4e4969529e450a2d1856 MD5 · raw file
- /*
- * Copyright (c) 2010 Tonic Solutions LLC.
- *
- * http://www.nimbits.com
- *
- *
- * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/gpl.html
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- */
- package com.nimbits.client.model;
- import com.extjs.gxt.ui.client.data.BaseModelData;
- import com.nimbits.client.model.point.Point;
- import com.nimbits.client.model.point.PointName;
- import com.nimbits.client.model.value.AlertType;
- /**
- * Created by bsautner
- * User: benjamin
- * Date: 7/8/11
- * Time: 5:35 PM
- */
- public class GxtPointModel extends BaseModelData {
- private final long id;
- private PointName name;
- private final boolean readOnly;
- private boolean isDirty;
- public void setAlertState(AlertType alertState) {
- this.alertState = alertState;
- }
- private AlertType alertState;
- public GxtPointModel(Point point) {
- this.id = point.getId();
- String lastNote = point.getLastNote();
- this.name = point.getName();
- this.readOnly = point.getReadOnly();
- this.alertState = point.getAlertState();
- set(Const.PARAM_ID, this.id);
- set(Const.PARAM_NAME, this.name.getValue());
- set(Const.PARAM_ICON, Const.PARAM_POINT);
- set(Const.PARAM_NOTE, lastNote);
- }
- public long getId() {
- return id;
- }
- public PointName getName() {
- return name;
- }
- public void setName(PointName name) {
- this.name = name;
- }
- public boolean isReadOnly() {
- return readOnly;
- }
- public boolean isDirty() {
- return isDirty;
- }
- public void setDirty(final boolean dirty) {
- isDirty = dirty;
- }
- public AlertType getAlertState() {
- if (alertState == null) {
- alertState = AlertType.OK;
- }
- return alertState;
- }
- }