View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: IVisualResourceEntry.java
13   * Created: 2009-07-17
14   * Author: kpietak
15   * $Id$
16   */
17  
18  package pl.edu.agh.cast.resource;
19  
20  import java.util.List;
21  
22  import org.eclipse.jface.resource.ResourceRegistry;
23  
24  import pl.edu.agh.cast.data.model.Type;
25  
26  /**
27   * A class which holds all data needed to create a visual resource. The entry is provided by
28   * {@link IVisualResourcesProvider} and processed in {@link ResourceRegistry#register} method.
29   * 
30   * @see IVisualResource
31   * @author AGH CAST Team
32   */
33  public class VisualResourceEntry {
34  
35  	// BEGIN CODE - image extensions definition
36  
37  	/**
38  	 * Image file type PNG.
39  	 */
40  	public static final String RESOURCE_EXTENSION_PNG = "png"; //$NON-NLS-1$
41  
42  	/**
43  	 * Image file type BMP.
44  	 */
45  	public static final String RESOURCE_EXTENSION_BMP = "bmp"; //$NON-NLS-1$
46  
47  	/**
48  	 * Image file type GIF.
49  	 */
50  	public static final String RESOURCE_EXTENSION_GIF = "gif"; //$NON-NLS-1$
51  
52  	/**
53  	 * Image file type ICO.
54  	 */
55  	public static final String RESOURCE_EXTENSION_ICO = "ico"; //$NON-NLS-1$
56  
57  	// END CODE - image extensions definition
58  
59  	/**
60  	 * Resource id.
61  	 * 
62  	 * @see IVisualResource#getId()
63  	 */
64  	private String id;
65  
66  	/**
67  	 * Resource tags.
68  	 * 
69  	 * @see IVisualResource#getTags()
70  	 */
71  	private List<String> tags;
72  
73  	/**
74  	 * Group id.
75  	 * 
76  	 * @see IVisualResource#getGroupId()
77  	 */
78  	private String groupId;
79  
80  	/**
81  	 * Data set or element type.
82  	 * 
83  	 * @see IVisualResource#getType()
84  	 */
85  	private Type type;
86  
87  	private String label;
88  
89  	private String description;
90  
91  	private String imagesPath;
92  
93  	private String imageName;
94  
95  	private String imageExtension;
96  
97  	private List<String> imageVariants;
98  
99  	/**
100 	 * Constructor.
101 	 * 
102 	 * @param id
103 	 *            resource id (required)
104 	 * @param tags
105 	 *            resource tags
106 	 * @param groupId
107 	 *            resource group id
108 	 * @param type
109 	 *            associated element or data set type
110 	 * @param label
111 	 *            resource label (required)
112 	 * @param description
113 	 *            resource description (required)
114 	 * @param imagesPath
115 	 *            base path for resource images
116 	 * @param imageName
117 	 *            name of resource images
118 	 * @param imageExtension
119 	 *            image extension
120 	 * @param imageVariants
121 	 *            optional resource variants
122 	 */
123 	public VisualResourceEntry(String id, List<String> tags, String groupId, Type type, String label,
124 	        String description, String imagesPath, String imageName, String imageExtension, List<String> imageVariants) {
125 		setId(id);
126 		setTags(tags);
127 		setGroupId(groupId);
128 		setType(type);
129 		setLabel(label);
130 		setDescription(description);
131 		setImagesPath(imagesPath);
132 		setImageName(imageName);
133 		setImageExtension(imageExtension);
134 		setImageVariants(imageVariants);
135 	}
136 
137 	public String getId() {
138 		return id;
139 	}
140 
141 	public void setId(String id) {
142 		this.id = id;
143 	}
144 
145 	public List<String> getTags() {
146 		return tags;
147 	}
148 
149 	public void setTags(List<String> tags) {
150 		this.tags = tags;
151 	}
152 
153 	public String getGroupId() {
154 		return groupId;
155 	}
156 
157 	public void setGroupId(String groupId) {
158 		this.groupId = groupId;
159 	}
160 
161 	public Type getType() {
162 		return type;
163 	}
164 
165 	public void setType(Type type) {
166 		this.type = type;
167 	}
168 
169 	public String getLabel() {
170 		return label;
171 	}
172 
173 	public void setLabel(String label) {
174 		this.label = label;
175 	}
176 
177 	public String getDescription() {
178 		return description;
179 	}
180 
181 	public void setDescription(String description) {
182 		this.description = description;
183 	}
184 
185 	public String getImagesPath() {
186 		return imagesPath;
187 	}
188 
189 	public void setImagesPath(String imagesPath) {
190 		this.imagesPath = imagesPath;
191 	}
192 
193 	public String getImageName() {
194 		return imageName;
195 	}
196 
197 	public void setImageName(String imageName) {
198 		this.imageName = imageName;
199 	}
200 
201 	public String getImageExtension() {
202 		return imageExtension;
203 	}
204 
205 	public void setImageExtension(String imageExtension) {
206 		this.imageExtension = imageExtension;
207 	}
208 
209 	public List<String> getImageVariants() {
210 		return imageVariants;
211 	}
212 
213 	public void setImageVariants(List<String> imageVariants) {
214 		this.imageVariants = imageVariants;
215 	}
216 
217 }