PageRenderTime 38ms CodeModel.GetById 17ms app.highlight 16ms RepoModel.GetById 2ms app.codeStats 0ms

/v3.2/nimbits-model/src/com/nimbits/client/model/diagram/DiagramModel.java

http://nimbits-server.googlecode.com/
Java | 143 lines | 93 code | 32 blank | 18 comment | 0 complexity | a2aa4f617a915311965cfee5f99a6a2f MD5 | raw file
  1/*
  2 * Copyright (c) 2010 Tonic Solutions LLC.
  3 *
  4 * http://www.nimbits.com
  5 *
  6 *
  7 * 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
  8 *
  9 * http://www.gnu.org/licenses/gpl.html
 10 *
 11 * 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.
 12 */
 13
 14package com.nimbits.client.model.diagram;
 15
 16
 17import com.nimbits.client.model.ClientType;
 18import com.nimbits.client.model.common.CommonFactoryLocator;
 19
 20import java.io.Serializable;
 21
 22/**
 23 * Created by bsautner
 24 * User: benjamin
 25 * Date: 5/20/11
 26 * Time: 4:07 PM
 27 */
 28public class DiagramModel implements Serializable, Diagram {
 29
 30    private boolean fullScreenView;
 31    private boolean readOnly;
 32    private long id;
 33    private long categoryFk;
 34    private int protectionLevel;
 35    private String uuid;
 36    private long userFk;
 37    private String blobKey;
 38    private String name;
 39
 40    public ClientType getClientType() {
 41        return clientType;
 42    }
 43
 44    public void setClientType(ClientType clientType) {
 45        this.clientType = clientType;
 46    }
 47
 48    private ClientType clientType;
 49
 50
 51    public DiagramModel(final long ownerFk) {
 52        this.userFk = ownerFk;
 53    }
 54
 55    public boolean isFullScreenView() {
 56        return fullScreenView;
 57    }
 58
 59    public void setFullScreenView(final boolean fullScreenView) {
 60        this.fullScreenView = fullScreenView;
 61    }
 62
 63    public String getUuid() {
 64        return uuid;
 65    }
 66
 67    public void setUuid(final String uuid) {
 68        this.uuid = uuid;
 69    }
 70
 71    public void setProtectionLevel(final int protectionLevel) {
 72        this.protectionLevel = protectionLevel;
 73    }
 74
 75    public DiagramModel() {
 76    }
 77
 78    public DiagramModel(final long userFk, final String blogKey, final String name) {
 79        this.userFk = userFk;
 80        this.blobKey = blogKey;
 81        this.name = name;
 82        this.protectionLevel = 0;
 83    }
 84
 85    public DiagramModel(final Diagram diagram) {
 86        this.userFk = diagram.getUserFk();
 87        this.blobKey = diagram.getBlobKey();
 88        this.name = diagram.getName().getValue();
 89        this.categoryFk = diagram.getCategoryFk();
 90        this.id = diagram.getId();
 91        this.protectionLevel = diagram.getProtectionLevel();
 92        this.uuid = diagram.getUuid();
 93        this.readOnly = diagram.isReadOnly();
 94
 95    }
 96
 97
 98    @Override
 99    public long getId() {
100        return this.id;
101    }
102
103    @Override
104    public long getUserFk() {
105        return this.userFk;
106    }
107
108    @Override
109    public String getBlobKey() {
110        return blobKey;
111    }
112
113    @Override
114    public DiagramName getName() {
115        return CommonFactoryLocator.getInstance().createDiagramName(name);
116    }
117
118    @Override
119    public long getCategoryFk() {
120        return categoryFk;
121    }
122
123    @Override
124    public void setCategoryFk(final long id) {
125        this.categoryFk = id;
126    }
127
128
129    @Override
130    public void setReadOnly(final boolean readOnly) {
131        this.readOnly = readOnly;
132    }
133
134    @Override
135    public int getProtectionLevel() {
136        return this.protectionLevel;
137
138    }
139
140    public boolean isReadOnly() {
141        return readOnly;
142    }
143}