Revision 944 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/MapOverview.java
MapOverview.java | ||
---|---|---|
48 | 48 |
public MapOverview(NewMapControl mapAssoc) { |
49 | 49 |
super(); |
50 | 50 |
m_MapAssoc = mapAssoc; |
51 |
///m_MapAssoc.getMapContext().getViewPort().addExtentListener(this); |
|
52 |
/*if (pv!=null){ |
|
53 |
this.setMapContext(pv.getMapOverViewContext()); |
|
54 |
} |
|
55 |
*/ |
|
51 |
|
|
56 | 52 |
// setModel((FMap) m_MapAssoc.getMapContext().clone()); // Lo inicializamos con |
57 | 53 |
// los mismos temas que tenga el grande. |
58 | 54 |
addMapTool("zoomtopoint", new PointMapTool()); |
... | ... | |
118 | 114 |
// System.out.println("Dibujo el extent " + m_MapAssoc.getExtent().toString()); |
119 | 115 |
} |
120 | 116 |
} |
121 |
public void setModel(FMap model){ |
|
122 |
if (model==null){ |
|
123 |
model=new FMap(null); |
|
124 |
} |
|
125 |
this.setMapContext(model); |
|
126 |
m_MapAssoc.getMapContext().getViewPort().addExtentListener(this); |
|
127 |
getMapContext().getViewPort().addExtentListener(this); |
|
128 |
///repaint(); |
|
129 |
} |
|
117 |
|
|
130 | 118 |
/** |
131 | 119 |
* DOCUMENT ME! |
132 | 120 |
* |
133 |
* @return DOCUMENT ME!
|
|
121 |
* @param model DOCUMENT ME!
|
|
134 | 122 |
*/ |
135 |
/*public XMLEntity getXMLEntity() { |
|
136 |
XMLEntity xml = new XMLEntity(); |
|
137 |
xml.addChild(this.getMapContext().getXMLEntity()); |
|
138 |
|
|
139 |
ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
140 |
ArrayList views = pe.getProject().getViews(); |
|
141 |
|
|
142 |
boolean hasIndex = false; |
|
143 |
|
|
144 |
for (int i = 0; i < views.size(); i++) { |
|
145 |
if (this.getAssociatedMapContext() == ((ProjectView) views.get(i)).getMapContext()) { |
|
146 |
xml.putProperty("indice", i); |
|
147 |
hasIndex = true; |
|
148 |
} |
|
149 |
} |
|
150 |
|
|
151 |
if (!hasIndex) { |
|
152 |
xml.putProperty("indice", -1); |
|
153 |
} |
|
154 |
|
|
155 |
return xml; |
|
123 |
public void setModel(FMap model) { |
|
124 |
this.setMapContext(model); |
|
125 |
m_MapAssoc.getMapContext().getViewPort().addExtentListener(this); |
|
126 |
getMapContext().getViewPort().addExtentListener(this); |
|
156 | 127 |
} |
157 |
*/ |
|
158 |
/*public static MapOverview createFromXML(XMLEntity xml){ |
|
159 |
NewMapControl mc=new NewMapControl(); |
|
160 |
ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
161 |
ArrayList views = pe.getProject().getViews(); |
|
162 |
if (xml.getIntProperty("indice")!=-1){ |
|
163 |
mc.setMapContext(((ProjectView)views.get(xml.getIntProperty("indice"))).getMapContext()); |
|
164 |
} |
|
165 |
MapOverview mov=new MapOverview(mc); |
|
166 |
return mov; |
|
167 |
} |
|
168 |
*/ |
|
169 | 128 |
} |
Also available in: Unified diff