svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / ui / CQCursor.java @ 109
History | View | Annotate | Download (1.61 KB)
1 |
/*
|
---|---|
2 |
* Creado el 24-ago-2004
|
3 |
*/
|
4 |
package org.cresques.ui; |
5 |
|
6 |
import java.awt.Cursor; |
7 |
import java.awt.Point; |
8 |
import java.awt.Toolkit; |
9 |
|
10 |
/**
|
11 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>
|
12 |
*/
|
13 |
public class CQCursor { |
14 |
public static int ZOOMIN_CURSOR = 0x100; |
15 |
public static int ZOOMOUT_CURSOR = 0x101; |
16 |
public static int PAN_CURSOR = 0x102; |
17 |
public static int SELECT_CURSOR = 0x103; |
18 |
public static int INFO_CURSOR = 0x104; |
19 |
private static int MAXCURSORNR = 15; |
20 |
private static Cursor [] cursores = null; |
21 |
|
22 |
static {
|
23 |
cursores = new Cursor[MAXCURSORNR]; |
24 |
cursores[ZOOMIN_CURSOR - 0x100] = Toolkit.getDefaultToolkit().createCustomCursor( |
25 |
Toolkit.getDefaultToolkit().getImage("images/zi_cur.gif"), |
26 |
new Point(6,5), "ZoomMas"); |
27 |
cursores[ZOOMOUT_CURSOR - 0x100] = Toolkit.getDefaultToolkit().createCustomCursor( |
28 |
Toolkit.getDefaultToolkit().getImage("images/zo_cur.gif"), |
29 |
new Point(6,5), "ZoomMenos"); |
30 |
cursores[PAN_CURSOR - 0x100] = Toolkit.getDefaultToolkit().createCustomCursor( |
31 |
Toolkit.getDefaultToolkit().getImage("images/pan_cur.gif"), |
32 |
new Point(3,3), "Pan"); |
33 |
cursores[SELECT_CURSOR - 0x100] = Toolkit.getDefaultToolkit().createCustomCursor( |
34 |
Toolkit.getDefaultToolkit().getImage("images/select_cur.gif"), |
35 |
new Point(6,1), "Select"); |
36 |
cursores[INFO_CURSOR - 0x100] = Toolkit.getDefaultToolkit().createCustomCursor( |
37 |
Toolkit.getDefaultToolkit().getImage("images/info_cur.gif"), |
38 |
new Point(5, 26), "Info"); |
39 |
} |
40 |
|
41 |
public static Cursor getCursor(int type) { |
42 |
Cursor cursor = null; |
43 |
if (type < 0x100) |
44 |
cursor = new Cursor(type); |
45 |
else if (type >= 0x100) |
46 |
cursor = cursores[type - 0x100];
|
47 |
return cursor;
|
48 |
|
49 |
} |
50 |
} |