svn-document-layout / trunk / org.gvsig.app.document.layout2.app / org.gvsig.app.document.layout2.app.mainplugin / src / main / java / org / gvsig / layout / mapbox / MapBoxUtils.java @ 1738
History | View | Annotate | Download (2.27 KB)
1 |
/*
|
---|---|
2 |
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
3 |
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
4 |
*/
|
5 |
package org.gvsig.layout.mapbox; |
6 |
|
7 |
import org.gvsig.andami.IconThemeHelper; |
8 |
import org.gvsig.app.project.documents.layout.DefaultLayoutManager; |
9 |
import org.gvsig.app.project.documents.layout.LayoutControl; |
10 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
11 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutRectangleBehavior; |
12 |
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutRectangleByTwoPointsBehavior; |
13 |
import org.gvsig.layout.mapbox.fframe.FFrameMapBox; |
14 |
import org.gvsig.layout.mapbox.fframe.FFrameMapBoxFactory; |
15 |
import org.gvsig.layout.mapbox.model.CellImpl; |
16 |
import org.gvsig.layout.mapbox.model.MapBoxModel; |
17 |
import org.gvsig.layout.mapbox.model.SelectionCellImpl; |
18 |
import org.gvsig.layout.mapbox.panel.FFrameMapBoxPanel; |
19 |
import org.gvsig.layout.mapbox.tools.LayoutAddMapBoxListenerImpl; |
20 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxBehavior; |
21 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxListenerImpl; |
22 |
|
23 |
/**
|
24 |
*
|
25 |
* @author fdiaz
|
26 |
*/
|
27 |
public class MapBoxUtils { |
28 |
|
29 |
public static void register(DefaultLayoutManager layoutManager) { |
30 |
layoutManager.registerFrameFactory(new FFrameMapBoxFactory());
|
31 |
layoutManager.registerFFrameDialog( |
32 |
FFrameMapBox.PERSISTENCE_DEFINITION_NAME, FFrameMapBoxPanel.class); |
33 |
IconThemeHelper.registerIcon("action", "layout-insert-mapbox", MapBoxUtils.class); |
34 |
} |
35 |
|
36 |
public static void addLayoutTool(LayoutPanel layoutPanel, LayoutControl control) { |
37 |
LayoutAddMapBoxListenerImpl labl = new LayoutAddMapBoxListenerImpl(layoutPanel);
|
38 |
control.addLayoutTool("layoutaddmapbox", new LayoutRectangleByTwoPointsBehavior(labl)); |
39 |
LayoutEditMapBoxListenerImpl leditMapBoxListener = new LayoutEditMapBoxListenerImpl(layoutPanel);
|
40 |
control.addLayoutTool("layouteditmapbox", new LayoutEditMapBoxBehavior(leditMapBoxListener)); |
41 |
} |
42 |
|
43 |
public static void registerPersistence() { |
44 |
FFrameMapBox.registerPersistent(); |
45 |
MapBoxModel.registerPersistent(); |
46 |
SelectionCellImpl.registerPersistent(); |
47 |
CellImpl.registerPersistent(); |
48 |
} |
49 |
|
50 |
} |