1 /* 2 * Copyright (C) 2008 Esmertec AG. 3 * Copyright (C) 2008 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.android.mms.model; 19 20 public class RegionModel extends Model { 21 private static final String DEFAULT_FIT = "meet"; 22 private final String mRegionId; 23 private String mFit; 24 private int mLeft; 25 private int mTop; 26 private int mWidth; 27 private int mHeight; 28 private String mBackgroundColor; 29 30 public RegionModel(String regionId, int left, int top, 31 int width, int height) { 32 this(regionId, DEFAULT_FIT, left, top, width, height); 33 } 34 35 public RegionModel(String regionId, String fit, int left, int top, 36 int width, int height) { 37 this(regionId, fit, left, top, width, height, null); 38 } 39 40 public RegionModel(String regionId, String fit, int left, int top, 41 int width, int height, String bgColor) { 42 mRegionId = regionId; 43 mFit = fit; 44 mLeft = left; 45 mTop = top; 46 mWidth = width; 47 mHeight = height; 48 mBackgroundColor = bgColor; 49 } 50 51 /** 52 * @return the mRegionId 53 */ 54 public String getRegionId() { 55 return mRegionId; 56 } 57 58 /** 59 * @return the mFit 60 */ 61 public String getFit() { 62 return mFit; 63 } 64 65 /** 66 * @param fit the mFit to set 67 */ 68 public void setFit(String fit) { 69 mFit = fit; 70 notifyModelChanged(true); 71 } 72 73 /** 74 * @return the mLeft 75 */ 76 public int getLeft() { 77 return mLeft; 78 } 79 80 /** 81 * @param left the mLeft to set 82 */ 83 public void setLeft(int left) { 84 mLeft = left; 85 notifyModelChanged(true); 86 } 87 88 /** 89 * @return the mTop 90 */ 91 public int getTop() { 92 return mTop; 93 } 94 95 /** 96 * @param top the mTop to set 97 */ 98 public void setTop(int top) { 99 mTop = top; 100 notifyModelChanged(true); 101 } 102 103 /** 104 * @return the mWidth 105 */ 106 public int getWidth() { 107 return mWidth; 108 } 109 110 /** 111 * @param width the mWidth to set 112 */ 113 public void setWidth(int width) { 114 mWidth = width; 115 notifyModelChanged(true); 116 } 117 118 /** 119 * @return the mHeight 120 */ 121 public int getHeight() { 122 return mHeight; 123 } 124 125 /** 126 * @param height the mHeight to set 127 */ 128 public void setHeight(int height) { 129 mHeight = height; 130 notifyModelChanged(true); 131 } 132 133 /** 134 * @return the mBackgroundColor 135 */ 136 public String getBackgroundColor() { 137 return mBackgroundColor; 138 } 139 140 /** 141 * @param bgColor the mBackgroundColor to set 142 */ 143 public void setBackgroundColor(String bgColor) { 144 mBackgroundColor = bgColor; 145 notifyModelChanged(true); 146 } 147 } 148