comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/OutputSettings.java @ 1503:3304608baf35

Issue 433. Allways load original chart settings when opening the dialog. flys-client/trunk@3632 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 09 Jan 2012 17:07:17 +0000
parents c899a7ffdc8f
children bb5edff31866
comparison
equal deleted inserted replaced
1502:d1223d93dd68 1503:3304608baf35
5 import java.util.ArrayList; 5 import java.util.ArrayList;
6 6
7 /** 7 /**
8 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> 8 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
9 */ 9 */
10 public class OutputSettings implements Settings { 10 public class OutputSettings implements Settings, Cloneable {
11 11
12 /** The output name. */ 12 /** The output name. */
13 protected String name; 13 protected String name;
14 14
15 /** The categories and settings container. */ 15 /** The categories and settings container. */
48 public List<Property> getSettings(String category) { 48 public List<Property> getSettings(String category) {
49 return categories.get(category); 49 return categories.get(category);
50 } 50 }
51 51
52 52
53 public List getCategories() { 53 public List<String> getCategories() {
54 ArrayList<String> list = new ArrayList<String>(categories.keySet()); 54 ArrayList<String> list = new ArrayList<String>(categories.keySet());
55 return list; 55 return list;
56 } 56 }
57
58
59 public Object clone() {
60 OutputSettings clone = new OutputSettings(this.getName());
61 for (String s: this.getCategories()) {
62 ArrayList cloneList = new ArrayList<Property>();
63 for(Property p: this.getSettings(s)) {
64 cloneList.add((Property)p.clone());
65 }
66 clone.setSettings(s, cloneList);
67 }
68 return clone;
69 }
57 } 70 }

http://dive4elements.wald.intevation.org