root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / view / info / gui / FInfoDialog.java @ 38607
History | View | Annotate | Download (2.22 KB)
1 | 7304 | caballero | |
---|---|---|---|
2 | 29596 | jpiera | package org.gvsig.app.project.documents.view.info.gui; |
3 | 7304 | caballero | |
4 | 33429 | cordinyana | import java.awt.BorderLayout; |
5 | |||
6 | import javax.swing.JPanel; |
||
7 | 38607 | jldominguez | import javax.swing.JScrollPane; |
8 | 33429 | cordinyana | |
9 | 29596 | jpiera | import org.gvsig.andami.PluginServices; |
10 | 33657 | cordinyana | import org.gvsig.andami.ui.mdiManager.IWindowListener; |
11 | 29596 | jpiera | import org.gvsig.andami.ui.mdiManager.SingletonWindow; |
12 | import org.gvsig.andami.ui.mdiManager.WindowInfo; |
||
13 | 33657 | cordinyana | import org.gvsig.fmap.mapcontrol.swing.dynobject.LayersDynObjectSetComponent; |
14 | 20994 | jmvivo | |
15 | 7304 | caballero | |
16 | |||
17 | /**
|
||
18 | * Dialog that contains the generic Feature Info Viewer
|
||
19 | *
|
||
20 | * @author laura
|
||
21 | *
|
||
22 | */
|
||
23 | 33657 | cordinyana | public class FInfoDialog extends JPanel implements SingletonWindow, |
24 | IWindowListener { |
||
25 | 7304 | caballero | |
26 | 33657 | cordinyana | private static final long serialVersionUID = -6707094091114785970L; |
27 | 38607 | jldominguez | |
28 | 38562 | jldominguez | private LayersDynObjectSetComponent infoViewer;
|
29 | 38607 | jldominguez | private JScrollPane scroll = null; |
30 | 33657 | cordinyana | |
31 | 38562 | jldominguez | public FInfoDialog(LayersDynObjectSetComponent info) {
|
32 | 33429 | cordinyana | super(new BorderLayout()); |
33 | 38562 | jldominguez | this.infoViewer = info;
|
34 | 38607 | jldominguez | |
35 | scroll = new JScrollPane( |
||
36 | JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
|
||
37 | JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||
38 | scroll.setViewportView(infoViewer.asJComponent()); |
||
39 | add(scroll, BorderLayout.CENTER);
|
||
40 | 38562 | jldominguez | setSize(500, 375); |
41 | 7304 | caballero | } |
42 | 38562 | jldominguez | |
43 | public void setInfo(LayersDynObjectSetComponent info) { |
||
44 | |||
45 | if (infoViewer != null) { |
||
46 | infoViewer.dispose(); |
||
47 | } |
||
48 | 38607 | jldominguez | |
49 | 38562 | jldominguez | this.removeAll();
|
50 | this.infoViewer = info;
|
||
51 | 38607 | jldominguez | |
52 | scroll = new JScrollPane( |
||
53 | JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
|
||
54 | JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||
55 | scroll.setViewportView(infoViewer.asJComponent()); |
||
56 | add(scroll, BorderLayout.CENTER);
|
||
57 | 38562 | jldominguez | } |
58 | 7304 | caballero | |
59 | public WindowInfo getWindowInfo() {
|
||
60 | |||
61 | WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG |
|
||
62 | WindowInfo.RESIZABLE | WindowInfo.PALETTE); |
||
63 | m_viewinfo.setWidth(getWidth()+8);
|
||
64 | m_viewinfo.setHeight(getHeight()); |
||
65 | m_viewinfo.setTitle(PluginServices.getText(this,
|
||
66 | "Identificar_Resultados"));
|
||
67 | |||
68 | return m_viewinfo;
|
||
69 | } |
||
70 | |||
71 | public Object getWindowModel() { |
||
72 | return "FInfoDialog"; |
||
73 | } |
||
74 | 26449 | jmvivo | |
75 | public Object getWindowProfile() { |
||
76 | return WindowInfo.PROPERTIES_PROFILE;
|
||
77 | } |
||
78 | 33657 | cordinyana | |
79 | public void windowActivated() { |
||
80 | // Nothing to do
|
||
81 | } |
||
82 | |||
83 | public void windowClosed() { |
||
84 | infoViewer.dispose(); |
||
85 | } |
||
86 | 7304 | caballero | } |