Revision 38564 branches/v2_0_0_prep/extensions/extCenterViewToPoint/src/org/gvsig/centerviewpoint/CenterViewToPointExtension.java

View differences:

CenterViewToPointExtension.java
45 45

  
46 46
import java.awt.Color;
47 47

  
48
import org.gvsig.andami.IconThemeHelper;
48 49
import org.gvsig.andami.PluginServices;
49 50
import org.gvsig.andami.plugins.Extension;
50 51
import org.gvsig.app.project.documents.view.ViewDocument;
......
63 64
public class CenterViewToPointExtension extends Extension {
64 65
	private DefaultViewPanel vista;
65 66
	public static Color COLOR=Color.red;
66
    /* (non-Javadoc)
67
     * @see com.iver.andami.plugins.Extension#inicializar()
68
     */
69
    public void initialize() {
70
        // TODO Auto-generated method stub
71
    	PluginServices.getIconTheme().registerDefault(
72
				"view-center-to-point",
73
				this.getClass().getClassLoader().getResource("images/centerviewtopoint.png")
74
			);
67
	
68
	public void initialize() {
69
		IconThemeHelper.registerIcon("action", "view-navigation-center-view-to-point", this);
75 70
    }
76 71

  
77 72
    /* (non-Javadoc)
78 73
     * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
79 74
     */
80 75
    public void execute(String actionCommand) {
81
		vista = (DefaultViewPanel)PluginServices.getMDIManager().getActiveWindow();
82
        MapContext mapContext = vista.getModel().getMapContext();
83
        InputCoordinatesPanel dataSelectionPanel = new InputCoordinatesPanel(mapContext);
84
        //dataSelectionPanel.setColor(color);
85
		PluginServices.getMDIManager().addWindow(dataSelectionPanel);
76
    	if( "view-navigation-center-view-to-point".equalsIgnoreCase(actionCommand)) {
77
			vista = (DefaultViewPanel)PluginServices.getMDIManager().getActiveWindow();
78
	        MapContext mapContext = vista.getModel().getMapContext();
79
	        InputCoordinatesPanel dataSelectionPanel = new InputCoordinatesPanel(mapContext);
80
	        //dataSelectionPanel.setColor(color);
81
			PluginServices.getMDIManager().addWindow(dataSelectionPanel);
82
    	}
86 83
    }
87 84

  
88 85
    public DefaultViewPanel getView(){

Also available in: Unified diff