Revision 38564 branches/v2_0_0_prep/extensions/org.gvsig.selectiontools.app/org.gvsig.selectiontools.app.extension/src/main/java/org/gvsig/selectiontools/app/extension/tools/CircleSelectionListener.java

View differences:

CircleSelectionListener.java
29 29

  
30 30
import javax.swing.ImageIcon;
31 31

  
32
import org.gvsig.andami.IconThemeHelper;
32 33
import org.gvsig.andami.PluginServices;
33 34
import org.gvsig.andami.messages.NotificationManager;
34 35
import org.gvsig.fmap.dal.exception.DataException;
......
66 67
    /**
67 68
     * The image to display when the cursor is active.
68 69
     */
69
    private final Image img = new ImageIcon(this.getClass()
70
        .getClassLoader()
71
        .getResource("images/circle-cursor-icon.png")).getImage();
70
//    private final Image img = new ImageIcon(this.getClass()
71
//        .getClassLoader()
72
//        .getResource("images/circle-cursor-icon.png")).getImage();
72 73

  
73 74
    /**
74 75
     * The cursor used to work with this tool listener.
75 76
     * 
76 77
     * @see #getCursor()
77 78
     */
78
    private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(img,
79
        new java.awt.Point(16, 16),
80
        "");
79
    private Cursor cur = null ; 
81 80

  
82 81
    /**
83 82
     * Reference to the <code>MapControl</code> object that uses.
......
223 222
     * 
224 223
     * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
225 224
     */
226
    public Cursor getCursor() {
227
        return cur;
228
    }
225
	public Cursor getCursor() {
226
		if (cur == null) {
227
			cur = Toolkit.getDefaultToolkit().createCustomCursor(
228
					this.getImageCursor(), new java.awt.Point(16, 16), "");
229
		}
230
		return cur;
231
	}
229 232

  
230 233
    /*
231 234
     * (non-Javadoc)
......
237 240
    }
238 241

  
239 242
    public Image getImageCursor() {
240
        return img;
243
        return IconThemeHelper.getImage("cursor-select-by-circle");
241 244
    }
242 245
}

Also available in: Unified diff