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/gui/DefaultLayoutPanel.java

View differences:

DefaultLayoutPanel.java
21 21
 */
22 22
package org.gvsig.app.project.documents.layout.gui;
23 23

  
24
import java.awt.BorderLayout;
24 25
import java.awt.Component;
25 26
import java.awt.Graphics2D;
26 27
import java.awt.GridLayout;
......
45 46
import javax.print.event.PrintJobAdapter;
46 47
import javax.print.event.PrintJobEvent;
47 48
import javax.print.event.PrintJobListener;
49
import javax.swing.JComponent;
48 50
import javax.swing.JOptionPane;
51
import javax.swing.JPanel;
52
import javax.swing.JSplitPane;
49 53
import javax.swing.filechooser.FileFilter;
50 54

  
51 55
import org.cresques.cts.IProjection;
......
65 69
import org.gvsig.app.project.documents.layout.fframes.IFFrameUseFMap;
66 70
import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog;
67 71
import org.gvsig.app.project.documents.layout.gui.dialogs.FConfigLayoutDialog;
72
import org.gvsig.app.project.documents.layout.gui.panel.DefaultUIManager;
73
import org.gvsig.app.project.documents.layout.gui.panel.UIManager;
74
import org.gvsig.app.project.documents.layout.gui.panel.UIManager.Area;
68 75
import org.gvsig.fmap.mapcontext.MapContext;
69 76
import org.gvsig.fmap.mapcontext.events.ColorEvent;
70 77
import org.gvsig.fmap.mapcontext.events.ExtentEvent;
......
100 107

  
101 108
    public static File defaultPDFFolderPath;
102 109

  
103
    private IFFrameDialog fframedialog = null;
104 110
    private MapProperties m_propertiesLayout = null;
105 111
    private PrintService[] m_cachePrintServices = null;
106 112
    private PrintService m_cachePrintService = null;
......
117 123
    private LayoutContext layoutContext = null;
118 124
    private LayoutManager layoutManager = null;
119 125

  
126
	private UIManager uiManager;
127

  
128
	private JPanel leftPanel;
129

  
130
	private JSplitPane splitPane;
131
	private int lastPanePos = 0;
132

  
120 133
    /**
121 134
     * Creates a new Layout object.
122 135
     */
......
150 163
     * It initializes the components.
151 164
     */
152 165
    private void initComponents() {
153
        this.setLayout(new GridLayout(1, 1));
154
        add(layoutControl.getComponent());
155
        setDoubleBuffered(true);
166
    	this.setLayout(new BorderLayout());
167
        leftPanel = new JPanel(new BorderLayout());
168
        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
169
        		leftPanel, layoutControl.getComponent());
170
        splitPane.setResizeWeight(0.2);
171
        splitPane.setOneTouchExpandable(true);
172
        splitPane.setContinuousLayout(true);
173

  
174
        add(splitPane, BorderLayout.CENTER);
175
        layoutControl.getComponent().setDoubleBuffered(true);
156 176
    }
157 177

  
158 178
    /**
......
258 278
                };
259 279

  
260 280
                jobNuevo.addPrintJobListener(pjlistener);
261
                
262
                /*
263
       Class repClass = null;
264
       try {
265
            repClass = Class.forName(flavor.getRepresentationClassName());
266
       } catch (Throwable e) {
267
           throw new IllegalArgumentException("unknown representation class");
268
       }
269
  
270
       if (!repClass.isInstance(printData)) {
271
           throw new IllegalArgumentException("data is not of declared type");
272
       }                 */
273 281

  
274 282
                Printable pb = null;
275 283
                Class repClass = null;
......
559 567
        // impresi�n.
560 568
        // g2.drawRect(0, 0, (int) rect.getWidth(), (int) rect.getHeight());
561 569
    }
570
	
571
	public void addLateralComponent(JComponent c) {
572
		leftPanel.removeAll();
573
		leftPanel.add(c, BorderLayout.CENTER);
574
	}
575
	
576
	public void removeLateralComponent() {
577
		if (leftPanel.getComponentCount()>0) {
578
			leftPanel.remove(0);
579
		}
580
	}
581
	
582
	public void hideLateralComponent(JComponent c) {
583
		lastPanePos = splitPane.getDividerLocation();
584
		splitPane.setDividerLocation(0);
585
	}
562 586

  
587
	public void showLateralComponent(JComponent c) {
588
		splitPane.setDividerLocation(lastPanePos);
589
		
590
	}
591

  
563 592
}

Also available in: Unified diff