Revision 144 branches/usability_v2/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/DefaultLayoutContext.java
DefaultLayoutContext.java | ||
---|---|---|
134 | 134 |
for (int i = fcr.getFrameManager().getAllFFrames().length - 1; i >= 0; i--) { |
135 | 135 |
IFFrame fframe = fcr.getFrameManager().getFFrame(i); |
136 | 136 |
|
137 |
if (fframe.getSelected() != IFFrame.NOSELECT) { |
|
137 |
if (fframe.isSelected()) { |
|
138 |
observers.notifyObservers(this, |
|
139 |
new DefaultLayoutNotification(LayoutNotification.FRAME_REMOVING)); |
|
138 | 140 |
fframe.setSelected(false); |
139 | 141 |
fcr.delete(fframe); |
142 |
observers.notifyObservers(this, |
|
143 |
new DefaultLayoutNotification(LayoutNotification.FRAME_REMOVED)); |
|
140 | 144 |
} |
141 | 145 |
} |
142 | 146 |
fcr.endComplex(); |
... | ... | |
153 | 157 |
} |
154 | 158 |
|
155 | 159 |
public void delFFrame(int index) { |
156 |
for (int i = 0; i < fcr.getFrameManager().getAllFFrames().length; i++) { |
|
157 |
IFFrame frame = getFFrame(index); |
|
158 |
if (fcr.getFrameManager().getFFrame(i).equals(frame)) { |
|
159 |
fcr.delete(frame); |
|
160 |
} |
|
161 |
} |
|
162 |
updateFFrames(); |
|
160 |
IFFrame frame = getFFrame(index); |
|
161 |
delFFrame(frame); |
|
163 | 162 |
} |
164 | 163 |
|
165 | 164 |
public void delFFrame(IFFrame frame) { |
165 |
observers.notifyObservers(this, |
|
166 |
new DefaultLayoutNotification(LayoutNotification.FRAME_REMOVING)); |
|
166 | 167 |
for (int i = 0; i < fcr.getFrameManager().getAllFFrames().length; i++) { |
167 | 168 |
if (fcr.getFrameManager().getFFrame(i).equals(frame)) { |
169 |
frame.setSelected(false); |
|
168 | 170 |
fcr.delete(frame); |
169 | 171 |
} |
170 | 172 |
} |
171 | 173 |
updateFFrames(); |
174 |
observers.notifyObservers(this, |
|
175 |
new DefaultLayoutNotification(LayoutNotification.FRAME_REMOVED)); |
|
172 | 176 |
} |
173 | 177 |
|
174 | 178 |
public FrameCommandsRecord getFrameCommandsRecord() { |
... | ... | |
176 | 180 |
} |
177 | 181 |
|
178 | 182 |
public void addFFrame(IFFrame frame, boolean clearSelection, boolean select) { |
183 |
this.addObserver(frame); |
|
184 |
observers.notifyObservers(this, |
|
185 |
new DefaultLayoutNotification(LayoutNotification.FRAME_ADDING)); |
|
179 | 186 |
IFFrame[] fframes = getFFrames(); |
180 | 187 |
if (clearSelection) { |
181 | 188 |
for (int i = fframes.length - 1; i >= 0; i--) { |
... | ... | |
198 | 205 |
frame.setSelected(select); |
199 | 206 |
frame.setLevel(getNumBefore()); |
200 | 207 |
updateFFrames(); |
208 |
observers.notifyObservers(this, |
|
209 |
new DefaultLayoutNotification(LayoutNotification.FRAME_ADDED)); |
|
201 | 210 |
} |
202 | 211 |
|
203 | 212 |
public void addFFrameSameProperties(IFFrame frame) { |
213 |
this.addObserver(frame); |
|
214 |
observers.notifyObservers(this, |
|
215 |
new DefaultLayoutNotification(LayoutNotification.FRAME_ADDING)); |
|
204 | 216 |
fcr.insert(frame); |
205 | 217 |
frame.setSelected(true); |
206 | 218 |
frame.setLevel(getNumBefore()); |
207 | 219 |
updateFFrames(); |
220 |
observers.notifyObservers(this, |
|
221 |
new DefaultLayoutNotification(LayoutNotification.FRAME_ADDED)); |
|
208 | 222 |
} |
209 | 223 |
|
210 | 224 |
public int getNumBehind() { |
Also available in: Unified diff