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 @ 1714
History | View | Annotate | Download (2.16 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.layout.mapbox.fframe.FFrameMapBox; |
13 |
import org.gvsig.layout.mapbox.fframe.FFrameMapBoxFactory; |
14 |
import org.gvsig.layout.mapbox.model.CellImpl; |
15 |
import org.gvsig.layout.mapbox.model.MapBoxModel; |
16 |
import org.gvsig.layout.mapbox.model.SelectionCellImpl; |
17 |
import org.gvsig.layout.mapbox.panel.FFrameMapBoxPanel; |
18 |
import org.gvsig.layout.mapbox.tools.LayoutAddMapBoxListenerImpl; |
19 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxBehavior; |
20 |
import org.gvsig.layout.mapbox.tools.LayoutEditMapBoxListenerImpl; |
21 |
|
22 |
/**
|
23 |
*
|
24 |
* @author fdiaz
|
25 |
*/
|
26 |
public class MapBoxUtils { |
27 |
|
28 |
public static void register(DefaultLayoutManager layoutManager) { |
29 |
layoutManager.registerFrameFactory(new FFrameMapBoxFactory());
|
30 |
layoutManager.registerFFrameDialog( |
31 |
FFrameMapBox.PERSISTENCE_DEFINITION_NAME, FFrameMapBoxPanel.class); |
32 |
IconThemeHelper.registerIcon("action", "layout-insert-mapbox", MapBoxUtils.class); |
33 |
} |
34 |
|
35 |
public static void addLayoutTool(LayoutPanel layoutPanel, LayoutControl control) { |
36 |
LayoutAddMapBoxListenerImpl labl = new LayoutAddMapBoxListenerImpl(layoutPanel);
|
37 |
control.addLayoutTool("layoutaddmapbox", new LayoutRectangleBehavior(labl)); |
38 |
LayoutEditMapBoxListenerImpl leditMapBoxListener = new LayoutEditMapBoxListenerImpl(layoutPanel);
|
39 |
control.addLayoutTool("layouteditmapbox", new LayoutEditMapBoxBehavior(leditMapBoxListener)); |
40 |
} |
41 |
|
42 |
public static void registerPersistence() { |
43 |
FFrameMapBox.registerPersistent(); |
44 |
MapBoxModel.registerPersistent(); |
45 |
SelectionCellImpl.registerPersistent(); |
46 |
CellImpl.registerPersistent(); |
47 |
} |
48 |
|
49 |
} |