Revision 19900 branches/v10/extensions/extPublish/src/org/gvsig/publish/infoproject/ProjectInfo.java
ProjectInfo.java | ||
---|---|---|
48 | 48 |
import java.util.ArrayList; |
49 | 49 |
import java.util.Iterator; |
50 | 50 |
|
51 |
import org.gvsig.publish.PublishLogger; |
|
52 |
|
|
51 | 53 |
import com.iver.cit.gvsig.project.Project; |
52 | 54 |
import com.iver.cit.gvsig.project.documents.view.ProjectView; |
53 | 55 |
import com.iver.cit.gvsig.project.documents.view.ProjectViewFactory; |
... | ... | |
60 | 62 |
*/ |
61 | 63 |
public class ProjectInfo implements IProjectInfo { |
62 | 64 |
private Project gvProject = null; |
65 |
private FilterProjectInfo filter; |
|
63 | 66 |
/** |
64 | 67 |
* Constructor |
65 | 68 |
* |
... | ... | |
92 | 95 |
return viewInfo; |
93 | 96 |
}*/ |
94 | 97 |
/** |
98 |
* Gets the information about the views |
|
99 |
* |
|
95 | 100 |
* @return IViewInfo[] array with information about the views of the project |
96 |
* TODO: I'm creating a new View info each time. I must improve that !!
|
|
101 |
* |
|
97 | 102 |
*/ |
98 | 103 |
public IViewInfo[] getViewsInfo() { |
104 |
//To use this method you must create a ProjectDocument and set its factory! |
|
99 | 105 |
ArrayList aux = gvProject.getDocumentsByType(ProjectViewFactory.registerName); |
100 |
|
|
101 | 106 |
IViewInfo[] arrayViewInfo = new IViewInfo[aux.size()]; |
102 |
|
|
103 | 107 |
int i = 0; |
104 | 108 |
for (Iterator it = aux.iterator(); it.hasNext(); i++){ |
105 | 109 |
ProjectView v = (ProjectView) it.next(); |
106 |
arrayViewInfo[i] = new ViewInfo(v,this); |
|
110 |
arrayViewInfo[i] = new ViewInfo(v,this, filter);
|
|
107 | 111 |
} |
108 | 112 |
return arrayViewInfo; |
109 | 113 |
} |
... | ... | |
128 | 132 |
} |
129 | 133 |
return null; |
130 | 134 |
} |
131 |
|
|
135 |
/* |
|
136 |
* (non-Javadoc) |
|
137 |
* @see org.gvsig.publish.infoproject.IProjectInfo#setFilter(org.gvsig.publish.infoproject.FilterProjectInfo) |
|
138 |
*/ |
|
139 |
public void setFilter(FilterProjectInfo filter) { |
|
140 |
this.filter = filter; |
|
141 |
} |
|
142 |
/* |
|
143 |
* (non-Javadoc) |
|
144 |
* @see org.gvsig.publish.infoproject.IProjectInfo#getFilterProjectInfo() |
|
145 |
*/ |
|
146 |
public FilterProjectInfo getFilterProjectInfo() { |
|
147 |
return this.filter; |
|
148 |
} |
|
149 |
/** |
|
150 |
* Clones object |
|
151 |
*/ |
|
152 |
public Object clone(){ |
|
153 |
Object obj=null; |
|
154 |
try{ |
|
155 |
obj=super.clone(); |
|
156 |
}catch(CloneNotSupportedException ex){ |
|
157 |
PublishLogger.getLog().error("ERROR " + getClass().getName() + ":I can't clone projectinfo", ex); |
|
158 |
} |
|
159 |
return obj; |
|
160 |
} |
|
132 | 161 |
} |
Also available in: Unified diff