Revision 1608 trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/extension/reportfromlayout/ConfigureReportFromLayout.java
ConfigureReportFromLayout.java | ||
---|---|---|
8 | 8 |
import java.awt.Dimension; |
9 | 9 |
import java.awt.event.ActionEvent; |
10 | 10 |
import java.awt.event.ActionListener; |
11 |
import java.io.ByteArrayOutputStream; |
|
12 |
import java.io.InputStream; |
|
13 |
import java.nio.charset.StandardCharsets; |
|
14 | 11 |
import java.util.List; |
15 | 12 |
import java.util.function.Predicate; |
16 | 13 |
import javax.json.JsonObject; |
... | ... | |
18 | 15 |
import javax.swing.JComponent; |
19 | 16 |
import javax.swing.JOptionPane; |
20 | 17 |
import javax.swing.SwingUtilities; |
18 |
import javax.swing.event.ChangeEvent; |
|
21 | 19 |
import javax.swing.event.DocumentEvent; |
22 | 20 |
import javax.swing.event.DocumentListener; |
23 | 21 |
import javax.swing.event.TreeSelectionEvent; |
24 |
import org.apache.commons.codec.binary.Hex; |
|
25 |
import org.apache.commons.io.IOUtils; |
|
26 | 22 |
import org.apache.commons.lang3.StringUtils; |
27 | 23 |
import org.gvsig.app.ApplicationLocator; |
28 |
import org.gvsig.app.gui.styling.SymbolSelector; |
|
29 | 24 |
import org.gvsig.app.project.documents.Document; |
30 | 25 |
import org.gvsig.app.project.documents.layout.LayoutDocument; |
31 | 26 |
import org.gvsig.app.project.documents.layout.fframes.FFrameView; |
32 | 27 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
33 | 28 |
import org.gvsig.app.project.documents.layout.report.LayoutReportAction; |
34 | 29 |
import org.gvsig.app.project.documents.layout.report.LayoutReportActionFactory; |
35 |
import org.gvsig.app.project.documents.layout.report.LayoutReportActionImpl; |
|
36 |
import org.gvsig.app.project.documents.view.legend.gui.ISymbolSelector; |
|
37 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
30 |
import org.gvsig.app.project.documents.layout.report.LayoutReportActionParameters; |
|
38 | 31 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
39 | 32 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
40 | 33 |
import org.gvsig.fmap.dal.swing.DataSwingManager; |
41 | 34 |
import org.gvsig.fmap.dal.swing.report.ReportAction; |
42 | 35 |
import org.gvsig.fmap.dal.swing.storesrepository.StoresRepositoryController; |
43 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
44 | 36 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
45 |
import org.gvsig.json.Json; |
|
46 |
import org.gvsig.json.JsonObjectBuilder; |
|
37 |
import org.gvsig.symbology.swing.SymbologySwingLocator; |
|
47 | 38 |
import org.gvsig.tools.ToolsLocator; |
48 | 39 |
import org.gvsig.tools.dispose.DisposeUtils; |
49 | 40 |
import org.gvsig.tools.i18n.I18nManager; |
50 |
import org.gvsig.tools.persistence.PersistenceManager; |
|
51 |
import org.gvsig.tools.persistence.PersistentState; |
|
52 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
|
53 | 41 |
import org.gvsig.tools.swing.api.ListElement; |
54 | 42 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
55 | 43 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
56 | 44 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
57 | 45 |
import org.gvsig.tools.swing.api.documentfilters.PositiveDoubleDocumentFilter; |
46 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
|
58 | 47 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
59 | 48 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
60 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
61 | 49 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
62 | 50 |
import org.gvsig.tools.util.LabeledValue; |
63 | 51 |
import org.gvsig.tools.util.LabeledValueImpl; |
... | ... | |
71 | 59 |
public class ConfigureReportFromLayout extends ConfigureReportFromLayoutPanelView { |
72 | 60 |
|
73 | 61 |
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureReportFromLayout.class); |
62 |
private static final int TO_RECORD_VALUE = 1; |
|
63 |
private static final int TO_EVERYTIHNG_EXCEPT_RECORD_VALUE = 2; |
|
74 | 64 |
|
75 | 65 |
private StoresRepositoryController treeSourceController; |
76 | 66 |
private FeatureStore source; |
77 | 67 |
private Dialog dialog; |
78 | 68 |
private ISymbol highlightSymbol; |
69 |
private PickerController<ISymbol> symbolPicker; |
|
79 | 70 |
|
80 | 71 |
public ConfigureReportFromLayout() { |
81 | 72 |
this.initComponents(); |
... | ... | |
127 | 118 |
doUpdateComponents(); |
128 | 119 |
}); |
129 | 120 |
|
130 |
this.btnSelectSymbol.addActionListener((ActionEvent e) -> {
|
|
131 |
doSelectSymbol();
|
|
121 |
this.chkHighlightRecord.addActionListener((ActionEvent e) -> {
|
|
122 |
doUpdateComponents();
|
|
132 | 123 |
}); |
133 | 124 |
|
134 |
ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager();
|
|
125 |
fillCboApplyTo();
|
|
135 | 126 |
|
127 |
this.symbolPicker = SymbologySwingLocator.getSwingManager().createSymbolPickerController(btnSelectSymbol, highlightSymbol); |
|
128 |
this.symbolPicker.addChangeListener((ChangeEvent e) -> { |
|
129 |
this.highlightSymbol = this.symbolPicker.get(); |
|
130 |
}); |
|
131 |
|
|
136 | 132 |
PositiveDoubleDocumentFilter.install(txtBufferSize); |
137 | 133 |
|
138 | 134 |
Dimension screensize = ApplicationLocator.getApplicationManager().getUIManager().getInternalSize(); |
... | ... | |
166 | 162 |
doUpdateComponents(); |
167 | 163 |
} |
168 | 164 |
|
169 |
private void doSelectSymbol() { |
|
170 |
|
|
171 |
if(this.source == null){ |
|
172 |
return; |
|
173 |
} |
|
174 |
FeatureAttributeDescriptor geomAttr = this.source.getDefaultFeatureTypeQuietly().getDefaultGeometryAttribute(); |
|
175 |
if(geomAttr == null){ |
|
176 |
return; |
|
177 |
} |
|
178 |
int geomType = geomAttr.getGeomType().getType(); |
|
179 |
|
|
180 |
if(this.highlightSymbol == null) { |
|
181 |
this.highlightSymbol = MapContextLocator.getMapContextManager().createSymbol(geomType); |
|
182 |
} |
|
183 |
ISymbolSelector symSel = SymbolSelector.createSymbolSelector(this.highlightSymbol, geomType); |
|
184 |
|
|
185 |
WindowManager_v2 windowManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
186 |
windowManager.showWindow((JComponent)symSel, "_Symbol", WindowManager.MODE.DIALOG); |
|
187 |
this.highlightSymbol = (ISymbol) symSel.getSelectedObject(); |
|
188 |
|
|
189 |
} |
|
165 |
// private void doChangeApplySymbolTo() { |
|
166 |
// Object item = cboApplySymbolTo.getSelectedItem(); |
|
167 |
// ((LabeledValue)item) |
|
168 |
// doUpdateComponents(); |
|
169 |
// } |
|
190 | 170 |
|
191 |
|
|
192 | 171 |
private void doUpdateComponents() { |
193 | 172 |
this.treeSourceController.setEnabled(true); |
194 | 173 |
|
... | ... | |
196 | 175 |
|
197 | 176 |
this.txtBufferSize.setEnabled(this.chkZoomToCurrentRow.isSelected()); |
198 | 177 |
|
178 |
this.btnSelectSymbol.setEnabled(this.chkHighlightRecord.isSelected()); |
|
179 |
this.cboApplySymbolTo.setEnabled(this.chkHighlightRecord.isSelected()); |
|
180 |
|
|
199 | 181 |
if(this.dialog != null){ |
200 | 182 |
boolean enabled = (this.source != null) && (this.getLayoutDocument() != null) && StringUtils.isNotBlank(this.txtIdentifier.getText()); |
201 | 183 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, enabled); |
... | ... | |
265 | 247 |
} |
266 | 248 |
this.cboView.setModel(model); |
267 | 249 |
} |
250 |
|
|
251 |
private void fillCboApplyTo() { |
|
252 |
DefaultComboBoxModel<LabeledValue<Integer>> model = new DefaultComboBoxModel(); |
|
253 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
254 |
|
|
255 |
model.addElement(new LabeledValueImpl<>(i18n.getTranslation("_to_record"), TO_RECORD_VALUE)); |
|
256 |
model.addElement(new LabeledValueImpl<>(i18n.getTranslation("_to_everything_except_record"), TO_EVERYTIHNG_EXCEPT_RECORD_VALUE)); |
|
257 |
|
|
258 |
this.cboApplySymbolTo.setModel(model); |
|
259 |
} |
|
268 | 260 |
|
261 |
|
|
269 | 262 |
private LayoutReportAction getReportAction(){ |
270 | 263 |
LabeledValue<LayoutReportAction> selected = (LabeledValue<LayoutReportAction>)cboReport.getSelectedItem(); |
271 | 264 |
if(selected == null){ |
... | ... | |
274 | 267 |
return selected.getValue(); |
275 | 268 |
} |
276 | 269 |
|
277 |
private LayoutDocument getLayoutDocument(){
|
|
270 |
public LayoutDocument getLayoutDocument(){
|
|
278 | 271 |
LabeledValue<LayoutDocument> selected = (LabeledValue<LayoutDocument>)cboLayout.getSelectedItem(); |
279 | 272 |
if(selected == null){ |
280 | 273 |
return null; |
... | ... | |
290 | 283 |
return selected.getValue(); |
291 | 284 |
} |
292 | 285 |
|
293 |
public void fetch(ConfigureReportFromLayoutParameters params){
|
|
294 |
params.setLayout(this.getLayoutDocument()); |
|
295 |
params.setSource(this.source); |
|
286 |
public void fetch(LayoutReportActionParameters params){
|
|
287 |
// params.setLayout(this.getLayoutDocument());
|
|
288 |
// params.setSource(this.source);
|
|
296 | 289 |
params.setIdentifier(this.txtIdentifier.getText()); |
297 | 290 |
params.setLabel(this.txtLabel.getText()); |
298 | 291 |
|
... | ... | |
301 | 294 |
double bufferSize = PositiveDoubleDocumentFilter.getValue(this.txtBufferSize); |
302 | 295 |
params.setBufferSize(bufferSize); |
303 | 296 |
params.setViewTag(this.getViewTag()); |
304 |
params.setUseIntervalPdfViewer(this.chkUseInternalPdfViewer.isSelected());
|
|
297 |
params.setUseInternalPdfViewer(this.chkUseInternalPdfViewer.isSelected());
|
|
305 | 298 |
params.setHighlightRecord(this.chkHighlightRecord.isSelected()); |
306 | 299 |
params.setHighlightSymbol(this.highlightSymbol); |
300 |
Object applyToItem = this.cboApplySymbolTo.getSelectedItem(); |
|
301 |
if(applyToItem == null){ |
|
302 |
params.setApplySymbolToRecord(false); |
|
303 |
params.setApplySymbolToEverythingExceptRecord(false); |
|
304 |
} else { |
|
305 |
switch ((int)((LabeledValue)applyToItem).getValue()) { |
|
306 |
case TO_RECORD_VALUE: |
|
307 |
params.setApplySymbolToRecord(true); |
|
308 |
params.setApplySymbolToEverythingExceptRecord(false); |
|
309 |
break; |
|
310 |
case TO_EVERYTIHNG_EXCEPT_RECORD_VALUE: |
|
311 |
params.setApplySymbolToRecord(false); |
|
312 |
params.setApplySymbolToEverythingExceptRecord(true); |
|
313 |
break; |
|
314 |
default: |
|
315 |
params.setApplySymbolToRecord(false); |
|
316 |
params.setApplySymbolToEverythingExceptRecord(false); |
|
317 |
} |
|
318 |
} |
|
307 | 319 |
} |
308 | 320 |
|
309 | 321 |
private void translate() { |
... | ... | |
322 | 334 |
manager.translate(txtBufferSize); |
323 | 335 |
manager.translate(chkHighlightRecord); |
324 | 336 |
manager.translate(btnSelectSymbol); |
337 |
manager.translate(lblAppySymbolTo); |
|
338 |
manager.translate(cboApplySymbolTo); |
|
325 | 339 |
} |
326 | 340 |
|
327 |
public boolean doConfigureReportFromLayout(ConfigureReportFromLayoutParameters params) {
|
|
328 |
LayoutDocument layout = params.getLayout(); |
|
329 |
FeatureStore source = params.getSource(); |
|
341 |
public boolean doConfigureReportFromLayout(LayoutReportActionParameters params, LayoutDocument layout, FeatureStore source) {
|
|
342 |
// LayoutDocument layout = params.getLayout();
|
|
343 |
// FeatureStore source = params.getSource();
|
|
330 | 344 |
String identifier = params.getIdentifier(); |
331 | 345 |
String label = params.getLabel(); |
332 | 346 |
|
... | ... | |
364 | 378 |
boolean zoomToCurrentRow = params.isZoomToCurrentRow(); |
365 | 379 |
double bufferSize = params.getBufferSize(); |
366 | 380 |
boolean highlightRecord = params.isHighlightRecord(); |
367 |
ISymbol highlightSymbol = params.getHighlightSymbol(); |
|
368 |
boolean useInternalPdfViewer = params.isUseIntervalPdfViewer(); |
|
381 |
ISymbol highlightSymbol = params.getHighlightSymbol(source); |
|
382 |
boolean applySymbolToRecord = params.isApplySymbolToRecord(); |
|
383 |
boolean applySymbolToEverythingExceptRecord = params.isApplySymbolToEverythingExceptRecord(); |
|
384 |
boolean useInternalPdfViewer = params.isUseInternalPdfViewer(); |
|
369 | 385 |
String viewTag = params.getViewTag(); |
370 | 386 |
|
371 | 387 |
return doConfigureReportFromLayout( |
... | ... | |
378 | 394 |
bufferSize, |
379 | 395 |
highlightRecord, |
380 | 396 |
highlightSymbol, |
397 |
applySymbolToRecord, |
|
398 |
applySymbolToEverythingExceptRecord, |
|
381 | 399 |
viewTag, |
382 | 400 |
useInternalPdfViewer); |
383 | 401 |
|
... | ... | |
394 | 412 |
double bufferSize, |
395 | 413 |
boolean highlightRecord, |
396 | 414 |
ISymbol highlightSymbol, |
415 |
boolean applySymbolToRecord, |
|
416 |
boolean applySymbolToEverythingExceptRecord, |
|
397 | 417 |
String viewTag, |
398 | 418 |
boolean useInternalPdfViewer |
399 | 419 |
) { |
400 |
ResourcesStorage.Resource resource = null; |
|
401 |
ResourcesStorage.Resource resourceLayout = null; |
|
402 |
boolean selfContained = layout.isPersistIndependent(); |
|
403 | 420 |
try { |
404 |
ResourcesStorage resources = store.getResourcesStorage(); |
|
405 |
|
|
406 |
String resourceName = getResourceName(resources, name); |
|
407 |
if(resourceName == null){ |
|
408 |
resourceName = getNextResourceName(resources, "report"); |
|
409 |
} |
|
410 |
|
|
411 |
String templateName = LayoutReportActionFactory.LAYOUT_REPORT_ACTION_NAME; |
|
412 |
if(StringUtils.contains(resourceName, resources.getSeparator())){ |
|
413 |
templateName = StringUtils.replaceIgnoreCase(resourceName, resources.getSeparator()+"report", resources.getSeparator()+LayoutReportActionFactory.LAYOUT_REPORT_ACTION_NAME); |
|
414 |
} |
|
415 |
JsonObjectBuilder jsonBuilder = Json.createObjectBuilder(); |
|
416 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_NAME, name); |
|
417 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_TYPE, LayoutReportActionFactory.LAYOUT_REPORT_ACTION_NAME); |
|
418 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_LABEL, label); |
|
419 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_TEMPLATE_NAME, templateName); |
|
420 |
if(highlightSymbol != null){ |
|
421 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_HIGHLIGHT_SYMBOL, this.toString(highlightSymbol)); |
|
422 |
} |
|
423 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_CENTER_TO_CURRENT_ROW, centerToCurrentRow); |
|
424 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_ZOOM_TO_CURRENT_ROW, zoomToCurrentRow); |
|
425 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_BUFFER_SIZE, bufferSize); |
|
426 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_HIGHLIGHT_RECORD, highlightRecord); |
|
427 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_VIEW_TAG, viewTag); |
|
428 |
jsonBuilder.add(LayoutReportActionImpl.LAYOUT_REPORT_USE_INTERNAL_PDF_VIEWER, useInternalPdfViewer); |
|
429 |
|
|
430 |
resource = resources.getResource(resourceName); |
|
431 |
IOUtils.write(jsonBuilder.toString(), resource.asOutputStream(), StandardCharsets.UTF_8); |
|
432 |
|
|
433 |
resourceLayout = resources.getResource(templateName); |
|
434 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
|
435 |
layout.setPersistIndependent(true); |
|
436 |
PersistentState persistentState = persistenceManager.getState(layout.getMainWindow()); |
|
437 |
persistenceManager.saveState(persistentState, resourceLayout.asOutputStream()); |
|
421 |
LayoutReportActionParameters reportParameters = LayoutReportActionParameters.create(); |
|
422 |
reportParameters.setIdentifier(name); |
|
423 |
reportParameters.setLabel(label); |
|
424 |
reportParameters.setHighlightSymbol(highlightSymbol); |
|
425 |
reportParameters.setCenterToCurrentRow(centerToCurrentRow); |
|
426 |
reportParameters.setZoomToCurrentRow(zoomToCurrentRow); |
|
427 |
reportParameters.setBufferSize(bufferSize); |
|
428 |
reportParameters.setHighlightRecord(highlightRecord); |
|
429 |
reportParameters.setApplySymbolToRecord(applySymbolToRecord); |
|
430 |
reportParameters.setApplySymbolToEverythingExceptRecord(applySymbolToEverythingExceptRecord); |
|
431 |
reportParameters.setViewTag(viewTag); |
|
432 |
reportParameters.setUseInternalPdfViewer(useInternalPdfViewer); |
|
433 |
|
|
434 |
reportParameters.save(store, layout); |
|
438 | 435 |
((JComponent)dialog).setVisible(false); |
439 | 436 |
return true; |
440 | 437 |
} catch (Exception ex) { |
... | ... | |
446 | 443 |
"_Configure_report_from_layout", |
447 | 444 |
JOptionPane.WARNING_MESSAGE); |
448 | 445 |
return false; |
449 |
} finally { |
|
450 |
layout.setPersistIndependent(selfContained); |
|
451 |
IOUtils.closeQuietly(resource); |
|
452 |
IOUtils.closeQuietly(resourceLayout); |
|
453 | 446 |
} |
454 |
|
|
455 | 447 |
} |
456 | 448 |
|
457 |
private String toString(ISymbol symbol){ |
|
458 |
try { |
|
459 |
if(symbol == null){ |
|
460 |
return null; |
|
461 |
} |
|
462 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
|
463 |
PersistentState state = persistenceManager.getState(symbol); |
|
464 |
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
|
465 |
persistenceManager.saveState(state, out); |
|
466 |
return Hex.encodeHexString(out.toByteArray()); |
|
467 |
} catch (Exception ex) { |
|
468 |
throw new RuntimeException("Can't persist symbol", ex); |
|
469 |
} |
|
470 |
} |
|
471 |
|
|
472 |
private String getNextResourceName(ResourcesStorage resources, String resourceName){ |
|
473 |
List<ResourcesStorage.Resource> reports = resources.getResources(resourceName); |
|
474 |
if(reports == null || reports.isEmpty()){ |
|
475 |
return resourceName; |
|
476 |
} |
|
477 |
int n = -1; |
|
478 |
for (ResourcesStorage.Resource report : reports) { |
|
479 |
if(StringUtils.contains(report.getName(), resources.getSeparator())){ |
|
480 |
String[] s = StringUtils.split(report.getName(), resources.getSeparator()); |
|
481 |
n = Math.max(n, Integer.parseInt(s[0])); |
|
482 |
} else { |
|
483 |
n=0; |
|
484 |
} |
|
485 |
} |
|
486 |
|
|
487 |
if (n < 0) { |
|
488 |
return resourceName; |
|
489 |
} |
|
490 |
|
|
491 |
n++; |
|
492 |
return String.valueOf(n) + resources.getSeparator() + resourceName; |
|
493 |
|
|
494 |
|
|
495 |
} |
|
496 |
|
|
497 |
private String getResourceName(ResourcesStorage resources, String reportName) { |
|
498 |
try { |
|
499 |
if (resources != null) { |
|
500 |
List<ResourcesStorage.Resource> reportsResources = resources.getResources("report"); |
|
501 |
if (reportsResources != null && !reportsResources.isEmpty()) { |
|
502 |
for (ResourcesStorage.Resource resource : reportsResources) { |
|
503 |
InputStream is = null; |
|
504 |
try { |
|
505 |
is = resource.asInputStream(); |
|
506 |
JsonObject json = javax.json.Json.createReader(is).readObject(); |
|
507 |
String name = json.getString(LayoutReportActionImpl.LAYOUT_REPORT_NAME, null); |
|
508 |
if(StringUtils.equalsIgnoreCase(name, reportName)){ |
|
509 |
return resource.getName(); |
|
510 |
} |
|
511 |
} catch (Exception ex) { |
|
512 |
LOGGER.warn("Can't load report form resource (" + resource.getURL() + ")", ex); |
|
513 |
} finally { |
|
514 |
IOUtils.closeQuietly(is); |
|
515 |
} |
|
516 |
DisposeUtils.disposeQuietly(resource); |
|
517 |
} |
|
518 |
} |
|
519 |
} |
|
520 |
} finally { |
|
521 |
DisposeUtils.disposeQuietly(resources); |
|
522 |
} |
|
523 |
return null; |
|
524 |
} |
|
525 |
|
|
526 |
|
|
527 | 449 |
private void doChangeReport() { |
528 | 450 |
LayoutReportAction report = getReportAction(); |
529 | 451 |
if(report == null){ |
... | ... | |
532 | 454 |
} else { |
533 | 455 |
this.txtIdentifier.setText(report.getReportName()); |
534 | 456 |
this.txtLabel.setText(report.getReportLabel()); |
535 |
this.chkCenterToCurrentRow.setSelected(report.isCenterToCurrentRow()); |
|
536 |
this.chkZoomToCurrentRow.setSelected(report.isZoomToCurrentRow()); |
|
537 |
PositiveDoubleDocumentFilter.setValue(this.txtBufferSize,report.getBufferSize()); |
|
538 |
this.chkHighlightRecord.setSelected(report.isHighlightRecord()); |
|
539 |
ListElement.setSelected(this.cboView, report.getViewTag()); |
|
540 |
this.chkUseInternalPdfViewer.setSelected(report.isUseInternalPdfViewer()); |
|
457 |
this.chkCenterToCurrentRow.setSelected(report.getParameters().isCenterToCurrentRow()); |
|
458 |
this.chkZoomToCurrentRow.setSelected(report.getParameters().isZoomToCurrentRow()); |
|
459 |
PositiveDoubleDocumentFilter.setValue(this.txtBufferSize,report.getParameters().getBufferSize()); |
|
460 |
this.chkHighlightRecord.setSelected(report.getParameters().isHighlightRecord()); |
|
461 |
this.highlightSymbol = report.getParameters().getHighlightSymbol(this.source); |
|
462 |
ListElement.setSelected(this.cboView, report.getParameters().getViewTag()); |
|
463 |
this.chkUseInternalPdfViewer.setSelected(report.getParameters().isUseInternalPdfViewer()); |
|
464 |
this.symbolPicker.set(this.highlightSymbol); |
|
541 | 465 |
} |
542 | 466 |
doUpdateComponents(); |
543 | 467 |
} |
... | ... | |
545 | 469 |
void setDialog(Dialog dialog) { |
546 | 470 |
this.dialog = dialog; |
547 | 471 |
} |
472 |
|
|
473 |
public FeatureStore getStore() { |
|
474 |
return this.source; |
|
475 |
} |
|
548 | 476 |
|
549 | 477 |
|
550 | 478 |
|
Also available in: Unified diff