Revision 38765
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/gui/preferences/SnapConfigPage.java | ||
---|---|---|
1 | 1 |
package org.gvsig.editing.gui.preferences; |
2 | 2 |
|
3 | 3 |
import java.awt.BorderLayout; |
4 |
import java.util.ArrayList;
|
|
5 |
import java.util.Iterator;
|
|
4 |
import java.awt.event.MouseEvent;
|
|
5 |
import java.awt.event.MouseListener;
|
|
6 | 6 |
import java.util.prefs.Preferences; |
7 | 7 |
|
8 | 8 |
import javax.swing.ImageIcon; |
... | ... | |
10 | 10 |
|
11 | 11 |
import org.gvsig.andami.IconThemeHelper; |
12 | 12 |
import org.gvsig.andami.PluginServices; |
13 |
import org.gvsig.andami.messages.NotificationManager; |
|
14 | 13 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
15 | 14 |
import org.gvsig.andami.preferences.StoreException; |
16 | 15 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
... | ... | |
20 | 19 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
21 | 20 |
import org.gvsig.fmap.mapcontrol.MapControlManager; |
22 | 21 |
import org.gvsig.fmap.mapcontrol.tools.snapping.snappers.ISnapper; |
23 |
import org.gvsig.tools.ToolsLocator; |
|
24 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
25 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
26 |
import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension; |
|
27 | 22 |
|
28 | 23 |
|
29 | 24 |
|
... | ... | |
45 | 40 |
super(); |
46 | 41 |
this.setLayout(new BorderLayout()); |
47 | 42 |
IWindow window=PluginServices.getMDIManager().getActiveWindow(); |
48 |
if (window instanceof DefaultViewPanel){ |
|
49 |
mc=((DefaultViewPanel)window).getMapControl(); |
|
50 |
snapConfig = new SnapConfig(mc); |
|
51 |
snapConfig.setSnappers(); |
|
52 |
add(snapConfig, BorderLayout.CENTER); |
|
43 |
if (window instanceof DefaultViewPanel) { |
|
44 |
|
|
45 |
mc = ((DefaultViewPanel)window).getMapControl(); |
|
46 |
snapConfig = new SnapConfig(mc, new MouseListener() { |
|
47 |
/* |
|
48 |
* Any mouse event in the relevant components |
|
49 |
* of SnapConfig will cause changed = true |
|
50 |
*/ |
|
51 |
public void mousePressed(MouseEvent e) { |
|
52 |
setChanged(true); |
|
53 |
} |
|
54 |
public void mouseReleased(MouseEvent e) { } |
|
55 |
public void mouseExited(MouseEvent e) { } |
|
56 |
public void mouseEntered(MouseEvent e) { } |
|
57 |
public void mouseClicked(MouseEvent e) { } |
|
58 |
}); |
|
59 |
|
|
60 |
snapConfig.setSnappers(); |
|
61 |
add(snapConfig, BorderLayout.CENTER); |
|
53 | 62 |
} |
54 | 63 |
|
55 | 64 |
} |
... | ... | |
178 | 187 |
public boolean isResizeable() { |
179 | 188 |
return true; |
180 | 189 |
} |
190 |
|
|
181 | 191 |
|
182 | 192 |
|
183 | 193 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/toolListeners/snapping/gui/SnapConfig.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import java.awt.BorderLayout; |
44 | 44 |
import java.awt.Component; |
45 |
import java.util.ArrayList; |
|
46 |
import java.util.Map; |
|
45 |
import java.awt.event.MouseListener; |
|
47 | 46 |
|
48 | 47 |
import javax.swing.JButton; |
49 | 48 |
import javax.swing.JCheckBox; |
... | ... | |
62 | 61 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
63 | 62 |
import org.gvsig.fmap.mapcontrol.MapControlManager; |
64 | 63 |
import org.gvsig.fmap.mapcontrol.tools.snapping.snappers.ISnapper; |
65 |
import java.util.TreeMap; |
|
66 | 64 |
|
67 | 65 |
/** |
68 | 66 |
* @author fjp |
... | ... | |
225 | 223 |
this.mc=mc; |
226 | 224 |
initialize(); |
227 | 225 |
} |
226 |
|
|
227 |
|
|
228 |
/** |
|
229 |
* This constructor allows an aditional parameter |
|
230 |
* which will be notified of the mouse events |
|
231 |
* in the relevant components of this panel |
|
232 |
* |
|
233 |
* @param mc |
|
234 |
* @param mouseListener the mouse listener to be notified |
|
235 |
*/ |
|
236 |
public SnapConfig(MapControl mc, MouseListener mouseListener) { |
|
237 |
this(mc); |
|
238 |
getJListSnappers().addMouseListener(mouseListener); |
|
239 |
getJChkBoxRefentActive().addMouseListener(mouseListener); |
|
240 |
} |
|
228 | 241 |
|
229 | 242 |
/** |
230 | 243 |
* This method initializes this |
Also available in: Unified diff