Revision 434

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SingleView.java
48 48
import com.iver.cit.gvsig.fmap.tools.Behavior.MoveMapTool;
49 49
import com.iver.cit.gvsig.fmap.tools.Behavior.PointMapTool;
50 50
import com.iver.cit.gvsig.fmap.tools.Behavior.RectangleMapTool;
51
import com.iver.cit.gvsig.gui.IView;
51 52
import com.iver.cit.gvsig.gui.TOC;
52 53
import com.iver.cit.gvsig.gui.Dialogs.FInfoDialog;
53 54
import com.iver.cit.gvsig.gui.Panels.FPanelAbout;
......
65 66
 * To change the template for this generated type comment go to
66 67
 * Window>Preferences>Java>Code Generation>Code and Comments
67 68
 */
68
public class SingleView extends JFrame implements WindowListener {
69
public class SingleView extends JFrame implements IView, WindowListener {
69 70
	public static ImageObserver m_ImageObserver = null;
70 71
	private static Logger logger = Logger.getLogger(SingleView.class.getName());
71 72
	
......
473 474
					} */
474 475
				}
475 476
			});
476
		m_TOC = new TOC(m_MapControl);
477
		m_TOC = new TOC(this);
477 478
		// m_MapLoc = new MapOverview(m_MapControl);
478 479
		// m_MapLoc.setPreferredSize(new Dimension(150,200));
479 480
		JSplitPane tempMainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/IView.java
1
/*
2
 * Created on 09-dic-2004
3
 *
4
 * TODO To change the template for this generated file go to
5
 * Window - Preferences - Java - Code Generation - Code and Comments
6
 */
7
package com.iver.cit.gvsig.gui;
8

  
9
import com.iver.cit.gvsig.fmap.NewMapControl;
10

  
11
/**
12
 * @author FJP
13
 * 
14
 * El motivo de tener un Interfaz IView es para poder tener aplicaciones
15
 * como SingleView, que permiten tener un interfaz del tipo SDI en lugar
16
 * de MDI.
17
 *
18
 * TODO To change the template for this generated type comment go to
19
 * Window - Preferences - Java - Code Generation - Code and Comments
20
 */
21
public interface IView {
22
	/**
23
	 * DOCUMENT ME!
24
	 *
25
	 * @return DOCUMENT ME!
26
	 */
27
	public abstract NewMapControl getMapControl();
28

  
29
	/**
30
	 * DOCUMENT ME!
31
	 *
32
	 * @return DOCUMENT ME!
33
	 */
34
	public abstract TOC getTOC();
35

  
36
	/**
37
	 * DOCUMENT ME!
38
	 */
39
	public abstract void repaintMap();
40
}
0 41

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/TOC.java
59 59
 */
60 60
public class TOC extends JComponent implements ITocOrderListener, ComponentListener {
61 61
	private NewMapControl mapCtrl;
62
	private IView view;
62 63
	private DnDJTree m_Tree;
63 64
	private DefaultTreeModel m_TreeModel;
64 65
	private DefaultMutableTreeNode m_Root;
......
126 127
					
127 128
					//Boton derecho sobre un nodo del arbol
128 129
					if ((e.getModifiers() & InputEvent.META_MASK) != 0) {
129
						//TODO quitar el siguiente comentario
130
/*						popmenu = new FPopupMenu(m_View, node);
130
						popmenu = new FPopupMenu(view, node);
131 131
						tree.add(popmenu);
132 132

  
133 133
						//System.out.println("boton derecho");
134 134
						popmenu.show(e.getComponent(), e.getX(), e.getY());
135
	*/				}
135
					}
136 136
					
137 137
				}
138 138
				
139
				//TODO quitar el siguiente comentario
140
/*
141
				if (node.getUserObject() instanceof FSymbol)
139

  
140
				if (node.getUserObject() instanceof FStyle2D)
142 141
				{
143 142
					//Boton derecho sobre un Simbolo
144 143
					if ((e.getModifiers() & InputEvent.META_MASK) != 0) {
145
						popmenu = new FPopupMenu(m_View, node);
144
						popmenu = new FPopupMenu(view, node);
146 145
						tree.add(popmenu);
147 146
						popmenu.show(e.getComponent(), e.getX(), e.getY());
148 147
					}
149 148
				}				
150
*/
149

  
151 150
				((DefaultTreeModel) tree.getModel()).nodeChanged(node);
152 151

  
153 152
				if (row == 0) {
......
163 162
	}
164 163
	
165 164
	
166
	public TOC(NewMapControl associatedMapControl) {
167
		
168
		this.mapCtrl = associatedMapControl;
165
	public TOC(IView v) {
166
		this.mapCtrl = v.getMapControl();
167
		this.view = v;
169 168

  
170 169
		this.setLayout(new BorderLayout());
171 170
		this.setMinimumSize(new Dimension(100,80));
......
320 319
	 * @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent)
321 320
	 */
322 321
	public void componentHidden(ComponentEvent e) {
323
		// TODO Auto-generated method stub
322

  
324 323
		
325 324
	}
326 325

  
......
330 329
	 * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent)
331 330
	 */
332 331
	public void componentMoved(ComponentEvent e) {
333
		// TODO Auto-generated method stub
332

  
334 333
		
335 334
	}
336 335

  
......
372 371
	 * @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent)
373 372
	 */
374 373
	public void componentShown(ComponentEvent e) {
375
		// TODO Auto-generated method stub
374

  
376 375
		
377 376
	}
378 377

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FLegendManagerWindow.java
36 36
import com.iver.cit.gvsig.fmap.core.v02.FConstant;
37 37
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
38 38
import com.iver.cit.gvsig.fmap.layers.FRecordset;
39
import com.iver.cit.gvsig.fmap.rendering.LegendInfo;
39 40
import com.iver.cit.gvsig.gui.Panels.FPanelLegendBreaks;
40 41
import com.iver.cit.gvsig.gui.Panels.FPanelLegendDefault;
41 42
import com.iver.cit.gvsig.gui.Panels.FPanelLegendLabels;
42 43
import com.iver.cit.gvsig.gui.Panels.FPanelLegendValues;
43
import com.iver.cit.gvsig.project.RendererReader;
44 44
import com.iver.cit.gvsig.project.XMLEntityXMLHandler;
45 45
import com.iver.mdiApp.App;
46 46
import com.iver.mdiApp.Utilities;
......
61 61
	private NewMapControl m_MapControl;
62 62
	private FLyrVect m_Lyr;
63 63
    private TOC m_Toc;
64
    private FRenderer m_Renderer; // Le asignaremos la leyenda del primer tema activo.
64
    private LegendInfo m_Renderer; // Le asignaremos la leyenda del primer tema activo.
65 65
    private JTabbedPane organizador = new JTabbedPane();
66 66
    private FPanelLegendDefault m_defaultLegendPanel;
67 67
    private FPanelLegendValues m_valuesLegendPanel;
......
376 376
     * @see com.iver.mdiApp.FileListener#readFile(java.io.File)
377 377
     */
378 378
    public Object read(File file) {
379
		FRenderer ret = null;
379
		LegendInfo ret = null;
380 380
        try {
381 381
            TransformerFactory transFact = TransformerFactory.newInstance();
382 382

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FPanelLegendDefault.java
43 43
import javax.swing.event.ChangeListener;
44 44
import javax.swing.plaf.basic.BasicComboBoxEditor;
45 45

  
46
import com.iver.cit.gvsig.core.FShape;
47
import com.iver.cit.gvsig.core.BasicShape.FPoint;
48
import com.iver.cit.gvsig.fmap.FConstant;
49
import com.iver.cit.gvsig.fmap.FGraphicUtilities;
50
import com.iver.cit.gvsig.fmap.FSymbol;
51
import com.iver.cit.gvsig.fmap.FSymbolFactory;
46
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
52 47
import com.iver.cit.gvsig.gui.GUIUtil;
53 48
import com.iver.mdiApp.Utilities;
54 49
import com.iver.utiles.ImageFilter;
......
63 58

  
64 59
public class FPanelLegendDefault extends JPanel {
65 60
	
66
	private FSymbol m_FSymbol = null;
61
	private FStyle2D m_FSymbol = null;
67 62
	
68 63
	
69 64
	protected static final int SLIDER_TEXT_FIELD_COLUMNS = 3;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FCellEditor.java
20 20
import javax.swing.JTable;
21 21
import javax.swing.table.TableCellEditor;
22 22

  
23
import com.iver.cit.gvsig.fmap.FSymbol;
23
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
24 24

  
25 25
/**
26 26
 * @author fjp
......
31 31
public class FCellEditor  extends AbstractCellEditor
32 32
						 implements TableCellEditor,
33 33
									ActionListener {
34
	FSymbol currentSymbol;
34
	FStyle2D currentSymbol;
35 35
	JButton button;
36 36
	// JColorChooser colorChooser;
37 37
	FPanelLegendDefault m_panelDefault;
......
74 74
			
75 75
			button.setBackground(currentSymbol.m_Color);
76 76
			m_panelDefault.setVisible(true);
77
			m_panelDefault.setFSymbol(currentSymbol);
77
			m_panelDefault.setSymbol(currentSymbol);
78 78
			// colorChooser.setColor(currentSymbol.m_Color);
79 79
			dialog.setVisible(true);
80 80

  
......
101 101
												 int column) {
102 102
												 	
103 103
		System.out.println(value.toString());												 	
104
		currentSymbol = (FSymbol )value;
104
		currentSymbol = (FStyle2D )value;
105 105
		// button.setBackground(currentSymbol.m_Color);
106 106
		return button;
107 107
	}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FSymbolFactory.java
1
/*
2
 * Created on 04-may-2004
3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6
 */
7
package com.iver.cit.gvsig.gui.Panels;
8

  
9
import java.awt.BasicStroke;
10
import java.awt.Color;
11
import java.awt.Graphics2D;
12
import java.awt.Paint;
13
import java.awt.Rectangle;
14
import java.awt.TexturePaint;
15
import java.awt.geom.Rectangle2D;
16
import java.awt.image.BufferedImage;
17

  
18
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
19

  
20

  
21
/**
22
 * @author fjp
23
 *
24
 * To change the template for this generated type comment go to
25
 * Window>Preferences>Java>Code Generation>Code and Comments
26
 */
27
/**
28
 * @author fjp
29
 *
30
 * To change the template for this generated type comment go to
31
 * Window>Preferences>Java>Code Generation>Code and Comments
32
 */
33
public class FSymbolFactory {
34
	static int w, h;
35
	
36
	// Podr?amos pasarle tambi?n un color de fondo, y usarlo como background del
37
	// graphics2D. 
38
	static private Graphics2D createG2(Color cRef, BufferedImage bi)
39
	{		
40
		   Graphics2D big = bi.createGraphics();
41
		   Color color=new Color(0,0,0,0);
42
		   big.setBackground(color);
43
		   big.clearRect(0, 0, w, h);
44
		   big.setColor(new Color(cRef.getRed(),cRef.getGreen(), cRef.getBlue(),cRef.getAlpha()));
45
		   big.setStroke(new BasicStroke());
46
		   
47
		   return big;
48
					   		
49
	}
50
	
51
	
52
	/**
53
	 * Al crear esto lo mejor ser?a mirar en un directorio y cargar todas las
54
	 * imagenes que tengamos predise?adas. 
55
	 * 
56
	 * @param cRef
57
	 * @return
58
	 */
59
	static public Paint[] createPatternFills(Color cRef)
60
	{
61
		
62
		int aux = 3;
63
		
64
		w=7; h=7;
65
		
66
		BufferedImage bi = null;
67
		Graphics2D big = null;		
68
										
69
		Rectangle2D rProv = new Rectangle();
70
		rProv.setFrame(0, 0,w,h);
71
		
72
		Paint[] patternFills = new Paint[8];
73
				
74
		// UPWARD_DIAGONAL
75
		bi= new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
76
		big = createG2(cRef, bi);
77
		big.drawLine(0,0,w,h);
78
		patternFills[FStyle2D.SYMBOL_STYLE_FILL_UPWARD_DIAGONAL-aux] = 
79
				new TexturePaint(bi,rProv);
80

  
81
		// CROSS
82
		bi= new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
83
		big = createG2(cRef, bi);
84
		big.drawLine(w/2,0,w/2,h);
85
		big.drawLine(0,h/2,w,h/2);
86
		patternFills[FConstant.SYMBOL_STYLE_FILL_CROSS-aux] = 
87
				new TexturePaint(bi,rProv);
88

  
89
		// CROSS
90
		bi= new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
91
		big = createG2(cRef, bi);
92
		big.drawLine(0,0,w,h);
93
		big.drawLine(0,h,w,0);
94
		patternFills[FConstant.SYMBOL_STYLE_FILL_CROSS_DIAGONAL-aux] = 
95
				new TexturePaint(bi,rProv);
96
				
97

  
98
		// VERTICAL
99
		bi= new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
100
		big = createG2(cRef, bi);
101
		big.drawLine(w/2,0,w/2,h);
102
		patternFills[FConstant.SYMBOL_STYLE_FILL_VERTICAL-aux] = 
103
				new TexturePaint(bi,rProv);
104
				
105
		// HORIZONTAL
106
		bi= new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
107
		big = createG2(cRef, bi);
108
		big.drawLine(0,h/2,w,h/2);
109
		patternFills[FConstant.SYMBOL_STYLE_FILL_HORIZONTAL-aux] = 
110
				new TexturePaint(bi,rProv);
111

  
112
		// DOWNWARD_DIAGONAL m?s ancho
113
		w=15;h=15;
114
		rProv.setFrame(0, 0,w,h);
115
		bi= new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
116
		big = createG2(cRef, bi);
117
		// big.setColor(Color.BLUE);
118
		big.drawLine(-1,h,w,-1);
119
		// big.setColor(Color.RED);
120
		// big.drawLine(0,0,w,h);
121
		patternFills[FConstant.SYMBOL_STYLE_FILL_DOWNWARD_DIAGONAL-aux] =
122
				new TexturePaint(bi,rProv);
123
		int trans=((TexturePaint)patternFills[FConstant.SYMBOL_STYLE_FILL_DOWNWARD_DIAGONAL-aux]).getTransparency();		
124
		
125
		return patternFills;
126
	}
127

  
128
}
0 129

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/AdjustTransparencyPanel.java
3 3
 */
4 4
package com.iver.cit.gvsig.gui.Panels;
5 5

  
6
import javax.swing.JButton;
7
import javax.swing.JDialog;
6 8
import javax.swing.JLabel;
7 9
import javax.swing.JPanel;
8

  
9
import javax.swing.JDialog;
10 10
import javax.swing.JSlider;
11 11
import javax.swing.JTextField;
12
import javax.swing.JButton;
13 12

  
14
import com.iver.cit.gvsig.fmap.FLyrDefault;
15
import com.iver.cit.gvsig.gui.ValidatingTextField;
13
import com.iver.cit.gvsig.fmap.layers.FLyrDefault;
16 14
import com.iver.cit.gvsig.gui.GUIUtil;
15
import com.iver.cit.gvsig.gui.ValidatingTextField;
17 16
import com.iver.mdiApp.App;
18 17
import com.iver.mdiApp.Utilities;
19 18
import com.iver.mdiApp.ui.MDIManager.View;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/General.java
13 13
import javax.swing.ButtonGroup;
14 14
import javax.swing.JPanel;
15 15

  
16
import com.iver.cit.gvsig.fmap.FLyrVect;
16
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
17
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
17 18
import com.iver.mdiApp.Utilities;
18 19

  
19 20

  
......
85 86
     * DOCUMENT ME!
86 87
     */
87 88
    public void rellenar() {
88
        jLabel9.setText(String.valueOf(m_layer.getLayerExtent().getMaxY()));
89
        jLabel11.setText(String.valueOf(m_layer.getLayerExtent().getMinY()));
90
        jLabel13.setText(String.valueOf(m_layer.getLayerExtent().getMinX()));
91
        jLabel15.setText(String.valueOf(m_layer.getLayerExtent().getMaxX()));
89
        try {
90
			jLabel9.setText(String.valueOf(m_layer.getFullExtent().getMaxY()));
91
	        jLabel11.setText(String.valueOf(m_layer.getFullExtent().getMinY()));
92
	        jLabel13.setText(String.valueOf(m_layer.getFullExtent().getMinX()));
93
	        jLabel15.setText(String.valueOf(m_layer.getFullExtent().getMaxX()));
94
		} catch (DriverIOException e) {
95
			// TODO Auto-generated catch block
96
			e.printStackTrace();
97
		}
98

  
92 99
    }
93 100

  
94 101
    /**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java
18 18
import javax.swing.JPopupMenu;
19 19
import javax.swing.tree.DefaultMutableTreeNode;
20 20

  
21
import com.iver.cit.gvsig.fmap.core.v02.FConstant;
22 21
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
22
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
23
import com.iver.cit.gvsig.fmap.layers.CancelationException;
23 24
import com.iver.cit.gvsig.fmap.layers.FLayer;
24 25
import com.iver.cit.gvsig.fmap.layers.FLyrDefault;
25 26
import com.iver.cit.gvsig.fmap.layers.FLyrRaster;
26 27
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
28
import com.iver.cit.gvsig.gui.IView;
27 29
import com.iver.cit.gvsig.gui.View;
28 30
import com.iver.cit.gvsig.gui.Panels.AdjustTransparencyPanel;
29 31
import com.iver.mdiApp.Utilities;
......
38 40
 */
39 41
public class FPopupMenu extends JPopupMenu {
40 42
    public DefaultMutableTreeNode nodo;
41
    public View view;
43
    public IView view;
42 44
    private JMenuItem estilo;
43 45
    private JMenuItem color;
44 46
    private JMenuItem capa;
......
48 50
    // Lo de fijar la fuente es porque en linux se ve?a mal si no se fija.
49 51
    private final static Font theFont = new Font("SansSerif", Font.PLAIN, 10);
50 52

  
51
    //private static TOC toc;
52
    public FPopupMenu() {
53
    }
54 53

  
55 54
    /**
56 55
     * Creates a new FPopupMenu object.
......
58 57
     * @param nodo DOCUMENT ME!
59 58
     * @param vista DOCUMENT ME!
60 59
     */
61
    public FPopupMenu(View vista, DefaultMutableTreeNode node) {
60
    public FPopupMenu(IView v, DefaultMutableTreeNode node) {
62 61
        //super();
63
        this.view = vista; //.getTOC();
62
        this.view = v; //.getTOC();
64 63
        this.nodo = node;
65 64
 
66 65
        //salir = new MenuItem("Salir");
......
91 90
	        });
92 91
		}
93 92

  
94
        FTheme elTema = null;
93
        TocItemBranch elTema = null;
95 94
        FLayer lyr = null;
96 95
		
97
        if (node.getUserObject() instanceof FTheme)
96
        if (node.getUserObject() instanceof TocItemBranch)
98 97
        {
99
        	elTema = (FTheme) node.getUserObject();
98
        	elTema = (TocItemBranch) node.getUserObject();
100 99
        	lyr = elTema.getLayer();
101 100
    		if (lyr instanceof FLyrVect)
102 101
    		{
......
106 105
    			//Cambio estilo
107 106
    			estilo.addActionListener(new ActionListener() {
108 107
    					public void actionPerformed(ActionEvent e) {
109
    						getView().getTOC().openLegendManager();
108
    						// TODO:
109
    						// getView().getTOC().openLegendManager();
110
    						
110 111
    					}
111 112
    				});
112 113
    			
......
123 124
    	                public void actionPerformed(ActionEvent e) {
124 125
    	                    JDialog dlg;
125 126
    	                    JColorChooser colorChooser;
126
    	                	FTheme elTema = (FTheme) nodo.getUserObject();
127
    	                    TocItemBranch elTema = (TocItemBranch) nodo.getUserObject();
127 128
    	                	FLayer lyr = elTema.getLayer();
128 129

  
129 130
    	                    if (lyr instanceof FLyrVect) {
......
134 135
    	                        dlg.show(true);
135 136
    	
136 137
								FLyrVect lyrVect = (FLyrVect) lyr;
137
								lyrVect.getLegend().getDefaultSymbol().m_Color = (Color) colorChooser.getColor();
138
								lyrVect.getRenderer().setLegendType(FConstant.LEGEND_TYPE_DEFAULT);
138
								// TODO:
139
								// lyrVect.getLegend().getDefaultSymbol().m_Color = (Color) colorChooser.getColor();
140
								// lyrVect.getRenderer().setLegendType(FConstant.LEGEND_TYPE_DEFAULT);
139 141
    							
140 142
    	                        view.repaintMap();
141 143
    	
......
158 160
    	        //Cambio color
159 161
    	        transparency.addActionListener(new ActionListener() {
160 162
	                public void actionPerformed(ActionEvent e) {
161
   	                	FLayer lyr = ((FTheme) nodo.getUserObject()).getLayer();
163
   	                	FLayer lyr = ((TocItemBranch) nodo.getUserObject()).getLayer();
162 164
                        AdjustTransparencyPanel transPanel = new AdjustTransparencyPanel((FLyrDefault) lyr);
163 165
                        //transPanel.setFLayer((FLyrDefault) lyr);
164 166
						transPanel.openJDialog();
......
185 187
            
186 188
	        zoom.addActionListener(new ActionListener() {
187 189
                public void actionPerformed(ActionEvent e) {
188
                	FTheme elTema = (FTheme) nodo.getUserObject();
190
                	TocItemBranch elTema = (TocItemBranch) nodo.getUserObject();
189 191
                	FLayer lyr = elTema.getLayer();
190 192

  
191
                    getView().getMapControl().setExtent(lyr.getLayerExtent());
193
                    try {
194
						getView().getMapControl().getMapContext().getViewPort().setExtent(lyr.getFullExtent());
195
					} catch (DriverIOException e1) {
196
						// TODO Auto-generated catch block
197
						e1.printStackTrace();
198
					}
192 199
					getView().repaintMap();
193 200
                }
194 201
            });
......
198 205
			removeLayer.setFont(theFont);
199 206
			removeLayer.addActionListener(new ActionListener() {
200 207
                public void actionPerformed(ActionEvent e) {
201
                	FTheme elTema = (FTheme) nodo.getUserObject();
208
                	TocItemBranch elTema = (TocItemBranch) nodo.getUserObject();
202 209
                	FLayer lyr = elTema.getLayer();
203 210

  
204
                    getView().getMapControl().getMapContext().getLayers().removeLayer(lyr);
211
                    try {
212
						getView().getMapControl().getMapContext().getLayers().removeLayer(lyr);
213
					} catch (CancelationException e1) {
214
						// TODO Auto-generated catch block
215
						e1.printStackTrace();
216
					}
205 217
					getView().repaintMap();
206 218
					getView().getTOC().refresh();
207 219
                }
......
214 226
     *
215 227
     * @return DOCUMENT ME!
216 228
     */
217
    private View getView() {
229
    private IView getView() {
218 230
        return view;
219 231
    }
220 232
}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/View.java
36 36
 * @author vcn
37 37
 */
38 38
public class View extends JPanel implements com.iver.mdiApp.ui.MDIManager.View,
39
    SingletonView {
39
    SingletonView, IView {
40 40

  
41 41
    /** DOCUMENT ME! */
42 42
    private NewMapControl m_MapControl;
......
250 250
        // modelo.setMapContext(m_MapControl.getMapContext());
251 251

  
252 252
        // m_MapControl.setAcceptEvents(true); Lo comento porque ya se hace en el setModel
253
        m_TOC = new TOC(m_MapControl);
253
        m_TOC = new TOC(this);
254 254

  
255 255
        JSplitPane tempMainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
256 256
        tempMainSplit.setPreferredSize(new Dimension(500, 300));
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/LegendFactory.java
80 80
     * @return DOCUMENT ME!
81 81
     */
82 82
    public static VectorialLegend createUniqueSymbolLegend(Style2D pointStyle,
83
        Style2D lineStyle, Style2D polygonStyle, Style2D textStyle) {
83
        LineStyle2D lineStyle, PolygonStyle2D polygonStyle, Style2D textStyle) {
84 84
        FStyle2D style = new FStyle2D();
85 85

  
86 86
        if (pointStyle != null) {
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/styling/FStyle2D.java
10 10
import java.awt.Rectangle;
11 11
import java.awt.image.BufferedImage;
12 12

  
13
import org.geotools.renderer.style.LineStyle2D;
14
import org.geotools.renderer.style.PolygonStyle2D;
13 15
import org.geotools.renderer.style.Style2D;
14 16

  
15 17
import com.iver.cit.gvsig.fmap.rendering.FStyledShapePainter;
......
35 37
	private int rgbPolygon;
36 38
	private int rgbText;
37 39
	private Style2D pointStyle2D;
38
	private Style2D lineStyle2D;
39
	private Style2D polygonStyle2D;
40
	private LineStyle2D lineStyle2D;
41
	private PolygonStyle2D polygonStyle2D;
40 42
	private Style2D textStyle2D;
41 43
	private static BufferedImage img = new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
42 44
	private static FStyledShapePainter shpPainter = new FStyledShapePainter();
......
70 72
	/**
71 73
	 * @return Returns the style2D.
72 74
	 */
73
	public synchronized Style2D getLineStyle2D() {
75
	public synchronized LineStyle2D getLineStyle2D() {
74 76
		return lineStyle2D;
75 77
	}
76 78
	/**
77 79
	 * @param style2D The style2D to set.
78 80
	 */
79
	public synchronized void setLineStyle2D(Style2D style2D) {
81
	public synchronized void setLineStyle2D(LineStyle2D style2D) {
80 82
		lineStyle2D = style2D;
81 83
		// Recalculamos el RGB
82 84
		Graphics2D g2 = img.createGraphics();
......
89 91
	/**
90 92
	 * @return Returns the style2D.
91 93
	 */
92
	public synchronized Style2D getPolygonStyle2D() {
94
	public synchronized PolygonStyle2D getPolygonStyle2D() {
93 95
		return polygonStyle2D;
94 96
	}
95 97
	/**
96 98
	 * @param style2D The style2D to set.
97 99
	 */
98
	public synchronized void setPolygonStyle2D(Style2D style2D) {
100
	public synchronized void setPolygonStyle2D(PolygonStyle2D style2D) {
99 101
		polygonStyle2D = style2D;
100 102
		// Recalculamos el RGB
101 103
		Graphics2D g2 = img.createGraphics();
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/demo/ImageFrame.java
12 12
import org.geotools.renderer.style.MarkStyle2D;
13 13
import org.geotools.renderer.style.PolygonStyle2D;
14 14

  
15
import com.hardcode.driverManager.DriverLoadException;
15 16
import com.iver.cit.gvsig.fmap.NewMapControl;
16 17
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
17 18
import com.iver.cit.gvsig.fmap.drivers.shp.DemoSHPDriver;
......
87 88

  
88 89
				DemoSHPDriver driver = new DemoSHPDriver();
89 90
				IProjection proj = ProjectionPool.get("ed50utm30");
90
				FLyrVect l = LayerFactory.createLayer(driver, new File("d:/fjp/chiara/plano/vias.shp"), proj);
91
				FLyrVect l = LayerFactory.createLayer(driver.getName(), new File("d:/fjp/chiara/plano/vias.shp"), proj);
91 92
				l.setName("Vias"); 
92 93
				DemoSHPDriver driver2 = new DemoSHPDriver();
93
				FLyrVect l2 = LayerFactory.createLayer(driver2, new File("d:/fjp/chiara/plano/provin.shp"), proj);
94
				FLyrVect l2 = LayerFactory.createLayer(driver2.getName(), new File("d:/fjp/chiara/plano/provin.shp"), proj);
94 95
				l2.setName("Provin");
95 96
				PolygonStyle2D psd = new PolygonStyle2D();
96 97
				psd.setContour(Color.DARK_GRAY);
......
105 106
		        pointSym.setShape(Java2DMark.getWellKnownMark(""));
106 107
		        pointSym.setFill(Color.RED);
107 108
		        pointSym.setSize(5);
108
				FLyrVect l3 = LayerFactory.createLayer(driver3, new File("d:/fjp/chiara/plano/poblac.shp"), null);
109
				FLyrVect l3 = LayerFactory.createLayer(driver3.getName(), new File("d:/fjp/chiara/plano/poblac.shp"), null);
109 110
				l3.setName("Poblac");
110 111
				l3.setLegend(LegendFactory.createUniqueSymbolLegend(pointSym, null, null, null));
111 112

  
......
176 177
				}
177 178
            } catch (DriverIOException e) {
178 179
                e.printStackTrace();
179
            }
180
            } catch (DriverLoadException e) {
181
				// TODO Auto-generated catch block
182
				e.printStackTrace();
183
			}
180 184
        }
181 185

  
182 186
        return jPanel;
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java
22 22
	private IProjection projection;
23 23
	private boolean visible;
24 24
	private boolean active;
25
	private int transparency = 0;
25 26

  
26 27
	/**
27 28
	 * Las propiedades que se deben devolver aqu? son la propiedad selected y
......
89 90
		this.parentLayer=root;
90 91
	}
91 92
	
93
	public int getTransparency() {
94
		return transparency;
95
	}
96
	public void setTransparency(int trans) {
97
		transparency = trans;
98
	}
99
	
92 100
	public void setProjection(IProjection proj){
93 101
		projection = proj;
94 102
	}

Also available in: Unified diff