Statistics
| Revision:

svn-document-layout / 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 / gui / DefaultLayoutPanel.java @ 147

History | View | Annotate | Download (21.7 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.project.documents.layout.gui;
23

    
24
import java.awt.BorderLayout;
25
import java.awt.Component;
26
import java.awt.Graphics2D;
27
import java.awt.geom.AffineTransform;
28
import java.awt.print.PageFormat;
29
import java.awt.print.Printable;
30
import java.awt.print.PrinterException;
31
import java.awt.print.PrinterJob;
32
import java.beans.PropertyChangeEvent;
33
import java.beans.PropertyChangeListener;
34
import java.io.File;
35

    
36
import javax.print.Doc;
37
import javax.print.DocFlavor;
38
import javax.print.DocPrintJob;
39
import javax.print.PrintException;
40
import javax.print.PrintService;
41
import javax.print.PrintServiceLookup;
42
import javax.print.ServiceUI;
43
import javax.print.SimpleDoc;
44
import javax.print.attribute.PrintRequestAttributeSet;
45
import javax.print.event.PrintJobAdapter;
46
import javax.print.event.PrintJobEvent;
47
import javax.print.event.PrintJobListener;
48
import javax.swing.JComponent;
49
import javax.swing.JOptionPane;
50
import javax.swing.JPanel;
51
import javax.swing.JSplitPane;
52
import javax.swing.filechooser.FileFilter;
53

    
54
import org.gvsig.andami.PluginServices;
55
import org.gvsig.andami.messages.NotificationManager;
56
import org.gvsig.andami.ui.mdiManager.WindowInfo;
57
import org.gvsig.app.project.documents.Document;
58
import org.gvsig.app.project.documents.gui.WindowLayout;
59
import org.gvsig.app.project.documents.layout.DefaultLayoutControl;
60
import org.gvsig.app.project.documents.layout.DefaultLayoutDocument;
61
import org.gvsig.app.project.documents.layout.LayoutContext;
62
import org.gvsig.app.project.documents.layout.LayoutControl;
63
import org.gvsig.app.project.documents.layout.LayoutDocument;
64
import org.gvsig.app.project.documents.layout.LayoutManager;
65
import org.gvsig.app.project.documents.layout.TocModelChangedNotification;
66
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
67
import org.gvsig.app.project.documents.layout.fframes.IFFrameUseFMap;
68
import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog;
69
import org.gvsig.app.project.documents.layout.gui.dialogs.FConfigLayoutDialog;
70
import org.gvsig.app.project.documents.layout.gui.panel.UIManager;
71
import org.gvsig.app.project.documents.layout.toc.TocModelObserver;
72
import org.gvsig.app.project.documents.view.toc.gui.TOC;
73
import org.gvsig.fmap.mapcontext.MapContext;
74
import org.gvsig.fmap.mapcontext.events.AtomicEvent;
75
import org.gvsig.fmap.mapcontext.events.ColorEvent;
76
import org.gvsig.fmap.mapcontext.events.ExtentEvent;
77
import org.gvsig.fmap.mapcontext.events.ProjectionEvent;
78
import org.gvsig.fmap.mapcontext.events.listeners.AtomicEventListener;
79
import org.gvsig.fmap.mapcontext.layers.CancelationException;
80
import org.gvsig.fmap.mapcontext.layers.LayerCollectionEvent;
81
import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener;
82
import org.gvsig.fmap.mapcontext.layers.LayerEvent;
83
import org.gvsig.fmap.mapcontext.layers.LayerListener;
84
import org.gvsig.fmap.mapcontext.layers.LayerPositionEvent;
85
import org.gvsig.fmap.mapcontext.rendering.legend.events.LegendChangedEvent;
86
import org.gvsig.fmap.mapcontext.rendering.legend.events.listeners.LegendListener;
87
import org.gvsig.gui.beans.swing.JFileChooser;
88
import org.gvsig.tools.ToolsLocator;
89
import org.gvsig.tools.dynobject.DynStruct;
90
import org.gvsig.tools.observer.Observable;
91
import org.gvsig.tools.persistence.PersistenceManager;
92
import org.gvsig.tools.persistence.PersistentState;
93
import org.gvsig.tools.persistence.exception.PersistenceException;
94
import org.gvsig.utils.GenericFileFilter;
95

    
96
/**
97
 * Graphic representation of the elements to print.
98
 * 
99
 * @author Vicente Caballero Navarro
100
 */
101
public class DefaultLayoutPanel extends LayoutPanel {
102

    
103
    private static final long serialVersionUID = 916830228032567624L;
104

    
105
    private static final int DEFAULT_HEIGHT = 450;
106

    
107
    private static final int DEFAULT_WIDTH = 700;
108

    
109
    public static final String PERSISTENCE_DEFINITION_NAME = "LayoutPanel";
110
    private static final String LAYOUTCONTEXT_OBJECT = "LayoutContext";
111
    private static final String LAYOUTDOCUMENT_OBJECT = "LayoutDocument";
112

    
113
    public static final String PDF_AND_PS_FILECHOOSER =
114
        "PDF_AND_PS_FILECHOOSER";
115

    
116
    public static File defaultPDFFolderPath;
117

    
118
    private MapProperties m_propertiesLayout = null;
119
    private PrintService[] m_cachePrintServices = null;
120
    private PrintService m_cachePrintService = null;
121
    private LayoutDocument layoutDocument = null;
122
    private Doc doc = null;
123
    private PrintRequestAttributeSet att = null;
124
    private WindowInfo m_viewInfo = null;
125
    /**
126
     * We use it when we are doing a layout and assigning tags.
127
     * It is put in debug when we do a VIEW_TAGS
128
     */
129
    private boolean bShowIconTag = false;
130
    private LayoutControl layoutControl = null;
131
    private LayoutContext layoutContext = null;
132
    private LayoutManager layoutManager = null;
133

    
134
        private UIManager uiManager;
135

    
136
        private JPanel leftPanel;
137
        private TOC toc = null;
138

    
139
        private JSplitPane splitPane;
140
        private int lastPanePos = 150;
141

    
142
    /**
143
     * Creates a new Layout object.
144
     */
145
    public DefaultLayoutPanel() {
146
        DefaultLayoutControl defaultLayoutControl = new DefaultLayoutControl();
147
        this.layoutControl = defaultLayoutControl;
148
        defaultLayoutControl.initialize(this);       
149
        this.initComponents();
150
    }
151

    
152
    public void setDocument(Document document) {
153
        layoutDocument = (LayoutDocument) document;
154
        setLayoutContext(layoutDocument.getLayoutContext());
155
        this.setName(document.getName());
156
        layoutDocument.addPropertyChangeListener(new PropertyChangeListener() {
157

    
158
            public void propertyChange(PropertyChangeEvent evt) {
159
                if (evt.getPropertyName().equals("name")) {
160
                    PluginServices
161
                        .getMDIManager()
162
                        .getWindowInfo(DefaultLayoutPanel.this)
163
                        .setTitle(
164
                            PluginServices.getText(this, "Mapa") + " : "
165
                                + (String) evt.getNewValue());
166
                }
167
            }
168
        });
169
        
170
        setToc();
171
    }
172
  
173
    /**
174
     * It initializes the components.
175
     */
176
    private void initComponents() {
177
            this.setLayout(new BorderLayout());
178
            
179
        leftPanel = new JPanel(new BorderLayout());
180
        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
181
                        leftPanel, layoutControl.getComponent());
182
        splitPane.setResizeWeight(0.2);
183
        splitPane.setOneTouchExpandable(true);
184
        splitPane.setContinuousLayout(true);
185
        setToc();
186
        add(splitPane, BorderLayout.CENTER);
187
        layoutControl.getComponent().setDoubleBuffered(true);
188
    }
189
    
190
    protected void createToc() {
191
                if (toc==null) {
192
                        toc = new TOC();
193
                }
194
                toc.setMapContext(getLayoutContext().getTocModel());
195
                leftPanel.removeAll();
196
                leftPanel.add(toc);
197
    }
198
    
199
    protected void setToc() {
200
        if (getLayoutContext()!=null) {
201
                if (getLayoutContext().getTocModel()!=null) {
202
                        createToc();
203
                }
204
                else if (toc!=null) {
205
                        DefaultLayoutPanel.this.leftPanel.remove(toc);
206
                }
207
                                
208
                this.getLayoutContext().addTocObserver(new TocModelObserver() {
209
                                
210
                                public void tocUpdated(Object observable,
211
                                                TocModelChangedNotification notification) {
212
                                        if (TocModelChangedNotification.MODEL_CHANGED==notification.getType()) {
213
                                                if (DefaultLayoutPanel.this.toc!=null){
214
                                                        DefaultLayoutPanel.this.toc.refresh();
215
                                                }
216
                                        }
217
                                        else if (TocModelChangedNotification.MODEL_SET==notification.getType()) {
218
                                                MapContext mapContext = notification.getModel();
219
                                                if (mapContext!=null) {
220
                                                        createToc();
221
                                                }
222
                                                else if (DefaultLayoutPanel.this.toc!=null){
223
                                                        DefaultLayoutPanel.this.leftPanel.remove(DefaultLayoutPanel.this.toc);
224
                                                }
225
                                        }
226
                                }
227
                        });
228
        }
229
    }
230

    
231
    /**
232
     * Open the dialog of Layout properties.
233
     * 
234
     * @param job
235
     *            PrinterJob
236
     */
237
    public void showPagePropertiesWindow(PrinterJob job) {
238
        PageFormat pf1;
239

    
240
        pf1 = layoutContext.getAttributes().getPageFormat();
241
        pf1 = job.pageDialog(pf1);
242
        layoutContext.getAttributes().setPageFormat(pf1);
243
        layoutControl.refresh();
244
    }
245

    
246
    public void obtainRect(boolean isPrint) {
247
        layoutContext.getAttributes().obtainRect(isPrint,
248
            layoutControl.getRect(), getWidth(), getHeight());
249
    }
250
    
251
    public void showFConfig() {
252
        FConfigLayoutDialog m_configLayout = new FConfigLayoutDialog(this);
253
        PluginServices.getMDIManager().addWindow(m_configLayout);
254
    }
255

    
256
    public boolean showFProperties() {
257
        if (layoutDocument == null) {
258
            layoutDocument = new DefaultLayoutDocument();
259
            layoutDocument.setName(getName());
260
        }
261

    
262
        m_propertiesLayout = new MapProperties(layoutDocument);
263
        PluginServices.getMDIManager().addWindow(m_propertiesLayout);
264
        return m_propertiesLayout.isAccepted();
265
    }
266

    
267
    public void showPrintDialog(PrinterJob job) {
268
        if (job != null) {
269
            job.printDialog();
270

    
271
            try {
272
                job.setPrintable((Printable) PluginServices
273
                    .getExtension(org.gvsig.app.extension.Print.class));
274
                job.print();
275
            } catch (PrinterException e) {
276
                e.printStackTrace();
277
            }
278
        } else {
279
            // Actualizar attributes
280
            att = layoutContext.getAttributes().toPrintRequestAttributeSet();
281

    
282
            // ------------------ The Printing things --------------------- //
283
            DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
284

    
285
            // returns the set of printers that support printing a specific
286
            // document type (such as GIF)
287
            // with a specific set of attributes (such as two sided).
288
            // PrintRequestAttributeSet pras = new
289
            // HashPrintRequestAttributeSet();
290
            // interestingly, the printer dialog's default behavior has changed
291
            // with the new API: by default the dialog is not shown.
292
            // So we must use the ServiceUI class to create a print dialog
293
            // returns the default print service.
294
            if (m_cachePrintServices == null) {
295
                m_cachePrintServices =
296
                    PrintServiceLookup.lookupPrintServices(flavor, null);
297
            }
298

    
299
            PrintService defaultService = null;
300

    
301
            if (m_cachePrintService == null) {
302
                defaultService = PrintServiceLookup.lookupDefaultPrintService();
303
            }
304

    
305
            if ((defaultService == null) && (m_cachePrintService == null)) {
306
                JOptionPane.showMessageDialog((Component) PluginServices
307
                    .getMainFrame(), PluginServices.getText(this,
308
                    "ninguna_impresora_configurada"));
309

    
310
                return;
311
            }
312

    
313
            if (m_cachePrintService == null) {
314
                m_cachePrintService =
315
                    ServiceUI.printDialog(null, 200, 200, m_cachePrintServices,
316
                        defaultService, flavor, att);
317
            } else {
318
                m_cachePrintService =
319
                    ServiceUI.printDialog(null, 200, 200, m_cachePrintServices,
320
                        m_cachePrintService, flavor, att);
321
            }
322

    
323
            if (m_cachePrintService != null) {
324
                DocPrintJob jobNuevo = m_cachePrintService.createPrintJob();
325
                PrintJobListener pjlistener = new PrintJobAdapter() {
326

    
327
                    public void printDataTransferCompleted(PrintJobEvent e) {
328
                        // System.out.println("Fin de impresi?n");
329
                        layoutControl.fullRect();
330
                    }
331
                };
332

    
333
                jobNuevo.addPrintJobListener(pjlistener);
334

    
335
                Printable pb = null;
336
                Class repClass = null;
337
                try {
338
                     repClass = Class.forName(flavor.getRepresentationClassName());
339
                } catch (Throwable e) {
340
                    throw new IllegalArgumentException("unknown representation class");
341
                }
342

    
343
                Object printData = PluginServices.getExtension(org.gvsig.app.extension.Print.class);
344
                
345
                doc = new SimpleDoc(printData, flavor, null);
346

    
347
                try {
348
                    jobNuevo.print(doc, att);
349

    
350
                } catch (PrintException pe) {
351
                    NotificationManager.addError(pe);
352
                }
353
            }
354
        }
355
    }
356

    
357
    public IFFrameDialog createFFrameDialog(IFFrame fframe) {
358
        return layoutManager.createFFrameDialog(fframe, this);
359
    }
360

    
361
    /**
362
     * This method is used to get <strong>an initial</strong> ViewInfo object
363
     * for this Map. It is not intended to retrieve the ViewInfo object in a
364
     * later time. <strong>Use PluginServices.getMDIManager().getViewInfo(view)
365
     * to retrieve the ViewInfo object at any time after the creation of the
366
     * object.
367
     * 
368
     * @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
369
     */
370
    public WindowInfo getWindowInfo() {
371
        if (m_viewInfo == null) {
372
            m_viewInfo =
373
                new WindowInfo(WindowInfo.ICONIFIABLE | WindowInfo.RESIZABLE
374
                    | WindowInfo.MAXIMIZABLE);
375
            m_viewInfo.setWidth(DEFAULT_WIDTH);
376
            m_viewInfo.setHeight(DEFAULT_HEIGHT);
377

    
378
            m_viewInfo.setTitle(PluginServices.getText(this, "Mapa") + " : "
379
                + layoutDocument.getName());
380
        }
381
        return m_viewInfo;
382
    }
383

    
384
    public LayoutContext getLayoutContext() {
385
        return layoutContext;
386
    }
387

    
388
    public LayoutControl getLayoutControl() {
389
        return layoutControl;
390
    }
391

    
392
    /**
393
     * @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
394
     */
395
    public void windowActivated() {
396
        // fullRect();
397
        layoutControl.refresh();
398
        PluginServices
399
            .getMainFrame()
400
            .getStatusBar()
401
            .setMessage(
402
                "units",
403
                PluginServices.getText(this, layoutContext.getAttributes()
404
                    .getNameUnit()));
405
        // ensure requestFocus is enabled
406
        if (!layoutControl.getComponent().isRequestFocusEnabled()) {
407
            layoutControl.getComponent().setRequestFocusEnabled(true);
408
        }
409
        IFFrameUseFMap[] selectedViews = layoutContext.getSelectedFFrames(IFFrameUseFMap.class);
410
        if (selectedViews.length==1) {
411
                IFFrameUseFMap ffview = selectedViews[0];
412
                // FIXME CMI: we should do sth more specific to update the ScaleControl
413
                ffview.refresh();
414
        }
415
        requestFocus();
416
        layoutControl.getComponent().requestFocus();
417
    }
418

    
419
    /**
420
     * @see com.iver.mdiApp.ui.MDIManager.SingletonWindow#getWindowModel()
421
     */
422
    public Object getWindowModel() {
423
        return layoutDocument;
424
    }
425

    
426
    public Document getDocument() {
427
        return layoutDocument;
428
    }
429

    
430
    /**
431
     * @see com.iver.cit.gvsig.fmap.ExtentListener#extentChanged(org.gvsig.fmap.mapcontext.events.ExtentEvent)
432
     */
433
    public void extentChanged(ExtentEvent e) {
434
        
435
    }
436

    
437
    /**
438
     * @see org.gvsig.andami.ui.mdiManager.IWindowListener#windowClosed()
439
     */
440
    public void windowClosed() {
441
        
442
    }
443

    
444
    /**
445
     * @see org.gvsig.fmap.mapcontext.events.listeners.ViewPortListener#backColorChanged(org.gvsig.fmap.mapcontext.events.ColorEvent)
446
     */
447
    public void backColorChanged(ColorEvent e) {
448
        // refresh();
449
    }
450

    
451
    public void layoutToPDF(String suggestedName) {
452
        FileFilter pdfFilter =
453
            new GenericFileFilter("pdf", PluginServices.getText(this, "pdf"));
454

    
455
        JFileChooser jfc =
456
            new JFileChooser(PDF_AND_PS_FILECHOOSER, defaultPDFFolderPath);
457
        if (suggestedName != null) {
458
            jfc.setSelectedFile(new File(suggestedName));
459
        }
460
        jfc.addChoosableFileFilter(pdfFilter);
461
        jfc.setFileFilter(pdfFilter);
462

    
463
        if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
464
            File f = jfc.getSelectedFile();
465
            File faux = null;
466

    
467
            if (f.getName().endsWith(".pdf") || f.getName().endsWith(".PDF")) {
468
                faux = f;
469
            } else {
470
                faux = new File(f.getPath() + ".pdf");
471
            }
472

    
473
            layoutControl.getLayoutDraw().toPDF(faux);
474
        }
475
    }
476

    
477
    public void layoutToPS(String suggestedName) {
478
        FileFilter pdfFilter =
479
            new GenericFileFilter("ps", PluginServices.getText(this, "ps"));
480

    
481
        JFileChooser jfc =
482
            new JFileChooser(PDF_AND_PS_FILECHOOSER, defaultPDFFolderPath);
483
        if (suggestedName != null) {
484
            jfc.setSelectedFile(new File(suggestedName));
485
        }
486
        jfc.addChoosableFileFilter(pdfFilter);
487
        jfc.setFileFilter(pdfFilter);
488

    
489
        if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
490
            File f = jfc.getSelectedFile();
491
            File faux = null;
492

    
493
            if (f.getName().endsWith(".ps") || f.getName().endsWith(".PS")) {
494
                faux = f;
495
            } else {
496
                faux = new File(f.getPath() + ".ps");
497
            }
498

    
499
            layoutControl.getLayoutDraw().toPS(faux);
500
        }
501
    }
502

    
503
    public void layoutToPDF() {
504
        layoutToPDF(null);
505
    }
506

    
507
    public void layoutToPS() {
508
        layoutToPS(null);
509
    }
510

    
511
    public boolean isShowIconTag() {
512
        return bShowIconTag;
513
    }
514

    
515
    public void setShowIconTag(boolean modeDebug) {
516
        bShowIconTag = modeDebug;
517
    }
518

    
519
    /**
520
     * Event to change the projection.
521
     */
522
    public void projectionChanged(ProjectionEvent e) {
523
        // TODO Auto-generated method stub
524

    
525
    }
526

    
527
    public void update(Observable observable, Object notification) {
528
            this.layoutContext.updateFFrames();
529
            this.layoutControl.refresh();
530
    }
531

    
532
    public Object getWindowProfile() {
533
        return WindowInfo.EDITOR_PROFILE;
534
    }
535

    
536
    public void saveToState(PersistentState state) throws PersistenceException {
537
        state.set(LAYOUTCONTEXT_OBJECT, layoutContext);
538
        state.set(LAYOUTDOCUMENT_OBJECT, layoutDocument);
539
    }
540

    
541
    public void loadFromState(PersistentState state)
542
        throws PersistenceException {
543
        this.layoutContext = (LayoutContext) state.get(LAYOUTCONTEXT_OBJECT);
544
        this.layoutDocument = (LayoutDocument) state.get(LAYOUTDOCUMENT_OBJECT);
545
        this.layoutControl.setLayoutContext(layoutContext);
546
    }
547

    
548
    public static void registerPersistent() {
549
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
550
        if (manager.getDefinition(PERSISTENCE_DEFINITION_NAME) == null) {
551
            DynStruct definition =
552
                manager.addDefinition(DefaultLayoutPanel.class,
553
                    PERSISTENCE_DEFINITION_NAME,
554
                    "Layout panel persistence definition", null, null);
555

    
556
            definition.addDynFieldObject(LAYOUTCONTEXT_OBJECT)
557
                .setClassOfValue(LayoutContext.class).setMandatory(true);
558
            definition.addDynFieldObject(LAYOUTDOCUMENT_OBJECT)
559
                .setClassOfValue(LayoutDocument.class).setMandatory(true);
560
        }
561
    }
562

    
563
    public WindowLayout getWindowLayout() {
564
        return null;
565
    }
566

    
567
    public void setWindowLayout(WindowLayout layout) {
568

    
569
    }
570

    
571
    private void setLayoutContext(LayoutContext theLayoutcontext) {
572
        this.layoutContext = theLayoutcontext;
573
        this.layoutControl.setLayoutContext(theLayoutcontext);
574
        layoutContext.getAttributes().setDistanceUnitX(layoutControl.getRect());
575
        layoutContext.getAttributes().setDistanceUnitY(layoutControl.getRect());
576

    
577
        layoutControl.setTool("layoutzoomin");
578
    }
579

    
580
    @Override
581
    public void setLayoutManager(LayoutManager layoutManager) {
582
        this.layoutManager = layoutManager;
583
    }
584
    
585
    
586
    /**
587
     * Method to print the Layout without modify the Affinetransform.
588
     *
589
     * @param g2 Geaphics2D
590
     */
591
    public void drawLayoutPrint(Graphics2D g2) {
592
        layoutControl.setCancelDrawing(false);
593

    
594
        double scale = 0;
595
        scale = layoutControl.getRect().height / layoutContext.getAttributes().m_sizePaper.getAlto() * 1;
596
        AffineTransform escalado = new AffineTransform();
597
        AffineTransform translacion = new AffineTransform();
598
        translacion.setToTranslation(layoutControl.getRect().getMinX(), layoutControl.getRect().getMinY());
599
        escalado.setToScale(scale, scale);
600
        layoutControl.getAT().setToIdentity();
601
        layoutControl.getAT().concatenate(translacion);
602
        layoutControl.getAT().concatenate(escalado);
603
        layoutContext.getAttributes().setDistanceUnitX(layoutControl.getRect());
604
        layoutContext.getAttributes().setDistanceUnitY(layoutControl.getRect());
605
        IFFrame[] fframes=layoutContext.getFFrames();
606
        
607
        for (int i = 0; i < fframes.length; i++) {
608
            fframes[i].print(
609
                g2,
610
                layoutControl.getAT(),
611
                null,
612
                layoutContext.getAttributes().toPrintAttributes());
613
        }
614
    }
615
        
616
        public void hideToc(JComponent c) {
617
                lastPanePos = splitPane.getDividerLocation();
618
                splitPane.setDividerLocation(0);
619
        }
620

    
621
        public void showToc(JComponent c) {
622
                splitPane.setDividerLocation(lastPanePos);
623
                
624
        }
625

    
626
}