Revision 20098 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/LinkListener.java

View differences:

LinkListener.java
65 65

  
66 66

  
67 67
/**
68
 * Listener que implementa PointListener para hacer el hiperlink.
69
 * Listener that implements PointListener to show the information of the HyperLink of the layer,
70
 * if the actual layer allows it. When the user selects the tool and make one clic with
71
 * the mouse throws an event to create Panels with the information of the associated HyperLink
72
 * to the layer. Creates one panel for URI provided, to load the information.
68
 * <p>Listener that gets, if exists, the associated link at the feature that's at the position selection of an active, selected
69
 *  and vector layer of the associated <code>MapControl</code>; and displays
70
 *  that linked data (image, text, ...) on a dialog.</p>
73 71
 *
72
 * <p>Listens a single click of any mouse's button.</p>
73
 *
74 74
 * @author Vicente Caballero Navarro
75
 *
76 75
 */
77 76
public class LinkListener implements PointListener {
77
	/**
78
	 * Object used to log messages for this listener.
79
	 */
78 80
	private static Logger logger = Logger.getLogger(InfoListener.class.getName());
81

  
82
	/**
83
	 * The image to display when the cursor is active.
84
	 */
79 85
	private final Image img = PluginServices.getIconTheme()
80 86
		.get("cursor-hiperlink").getImage();
87

  
88
	/**
89
	 * The cursor used to work with this tool listener.
90
	 * 
91
	 * @see #getCursor()
92
	 */
81 93
	private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(img,
82 94
			new Point(16, 16), "");
95

  
96
	/**
97
	 * Reference to the <code>MapControl</code> object that uses.
98
	 */
83 99
	private MapControl mapCtrl;
100
	
101
	/**
102
	 * Identifies the link as an image.
103
	 */
84 104
	public static final int TYPELINKIMAGE=0;
105
	
106
	/**
107
	 * Identifies the link as text.
108
	 */
85 109
	public static final int TYPELINKTEXT=1;
86 110

  
87 111
	/**
88
	 * Creates a new LinkListener
89
	 *
90
	 * @param mc mapControl
112
	 * <p>Creates a new <code>LinkListener</code> object.</p>
113
	 * 
114
	 * @param mc the <code>MapControl</code> where will be applied the changes
91 115
	 */
92 116
	public LinkListener(MapControl mc) {
93 117
		this.mapCtrl = mc;
94 118
	}
95 119

  
96
	/**
97
	 * Creates one LinkPanel for URI provided. Gets the active layers and invokes getLink
98
	 * with the catched point and the allowed tolerance if these layers allows HyperLinks.
99
	 * getLink provides an array of URIs, this method is invoked for all active layers.
100
	 *
101
	 * @param event PointEvent
102
	 * @throws BehaviorException
103
	 *
120
	/*
121
	 * (non-Javadoc)
104 122
	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
105 123
	 */
106 124
	public void point(PointEvent event) throws BehaviorException {
......
132 150
		}
133 151
	}
134 152

  
135
	/**
153
	/*
154
	 * (non-Javadoc)
136 155
	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
137 156
	 */
138 157
	public Cursor getCursor() {
139 158
		return cur;
140 159
	}
141 160

  
142
	/**
161
	/*
162
	 * (non-Javadoc)
143 163
	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
144 164
	 */
145 165
	public boolean cancelDrawing() {
146 166
		return false;
147 167
	}
148 168

  
169
	/*
170
	 * (non-Javadoc)
171
	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#pointDoubleClick(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
172
	 */
149 173
	public void pointDoubleClick(PointEvent event) throws BehaviorException {
150
		// TODO Auto-generated method stub
151

  
152 174
	}
153 175
}

Also available in: Unified diff