root / trunk / extensions / extGeoreferencing / src / org / gvsig / georeferencing / gui / pointsTable / ButtonsExportImportPanel.java @ 5217
History | View | Annotate | Download (3.3 KB)
1 |
package org.gvsig.georeferencing.gui.pointsTable; |
---|---|
2 |
|
3 |
import java.awt.FlowLayout; |
4 |
|
5 |
import javax.swing.ImageIcon; |
6 |
import javax.swing.JButton; |
7 |
import javax.swing.JPanel; |
8 |
|
9 |
import com.iver.andami.PluginServices; |
10 |
|
11 |
/**
|
12 |
* Control para el manejo de tablas. No contiene eventos, estos deben
|
13 |
* ser manejados desde la clase que lo llame.
|
14 |
*
|
15 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
16 |
*
|
17 |
*/
|
18 |
public class ButtonsExportImportPanel extends JPanel{ |
19 |
|
20 |
//**********************Vars**********************************
|
21 |
private JButton bSave = null; |
22 |
private JButton bLoad = null; |
23 |
private JButton bExportToAscii = null; |
24 |
private String pathToImages = "images/";//"/com/iver/cit/gvsig/gui/panels/images/"; |
25 |
//**********************End Vars******************************
|
26 |
|
27 |
//**********************Methods*******************************
|
28 |
/**
|
29 |
* This is the default constructor
|
30 |
*/
|
31 |
public ButtonsExportImportPanel() {
|
32 |
super();
|
33 |
initialize(); |
34 |
} |
35 |
|
36 |
/**
|
37 |
* This method initializes this
|
38 |
*
|
39 |
* @return void
|
40 |
*/
|
41 |
private void initialize() { |
42 |
this.setSize(new java.awt.Dimension(68,22)); |
43 |
FlowLayout flowLayout5 = new FlowLayout(); |
44 |
flowLayout5.setHgap(0);
|
45 |
flowLayout5.setVgap(0);
|
46 |
|
47 |
this.setLayout(flowLayout5);
|
48 |
|
49 |
this.add(getBSave(), null); |
50 |
this.add(getBLoad(), null); |
51 |
this.add(getBExportToAscii(), null); |
52 |
} |
53 |
//**********************End Methods***************************
|
54 |
|
55 |
//**********************Getters & Setters*********************
|
56 |
/**
|
57 |
* This method initializes jButton
|
58 |
*
|
59 |
* @return javax.swing.JButton
|
60 |
*/
|
61 |
public JButton getBLoad() { |
62 |
if (bLoad == null) { |
63 |
bLoad = new JButton(); |
64 |
bLoad.setPreferredSize(new java.awt.Dimension(22,22)); |
65 |
bLoad.setEnabled(true);
|
66 |
bLoad.setIcon(new ImageIcon(getClass().getClassLoader().getResource(pathToImages + "load.png"))); |
67 |
bLoad.setToolTipText(PluginServices.getText(this, "load_from_xml")); |
68 |
} |
69 |
return bLoad;
|
70 |
} |
71 |
|
72 |
/**
|
73 |
* This method initializes bSave
|
74 |
*
|
75 |
* @return javax.swing.JButton
|
76 |
*/
|
77 |
public JButton getBSave() { |
78 |
if (bSave == null) { |
79 |
bSave = new JButton(); |
80 |
bSave.setText("");
|
81 |
bSave.setEnabled(false);
|
82 |
bSave.setPreferredSize(new java.awt.Dimension(22,22)); |
83 |
bSave.setIcon(new ImageIcon(getClass().getClassLoader().getResource(pathToImages + "save.png"))); |
84 |
bSave.setActionCommand("");
|
85 |
bSave.setToolTipText(PluginServices.getText(this, "save_to_xml")); |
86 |
} |
87 |
return bSave;
|
88 |
} |
89 |
|
90 |
/**
|
91 |
* This method initializes jButton
|
92 |
*
|
93 |
* @return javax.swing.JButton
|
94 |
*/
|
95 |
public JButton getBExportToAscii() { |
96 |
if (bExportToAscii == null) { |
97 |
bExportToAscii = new JButton(); |
98 |
bExportToAscii.setPreferredSize(new java.awt.Dimension(22,22)); |
99 |
bExportToAscii.setEnabled(false);
|
100 |
bExportToAscii.setIcon(new ImageIcon(getClass().getClassLoader().getResource(pathToImages + "exportToAscii.png"))); |
101 |
bExportToAscii.setToolTipText(PluginServices.getText(this, "save_to_ascii")); |
102 |
} |
103 |
return bExportToAscii;
|
104 |
} |
105 |
|
106 |
/**
|
107 |
* Activa o desactiva los botones de exportar capa de puntos y salvar
|
108 |
* la tabla a Ascii.
|
109 |
*@param isPossible Si vale true activa los controles de salvar y exportaci?n
|
110 |
*y si vale false los desactiva
|
111 |
*/
|
112 |
public void setSaveToDisk(boolean isPossible){ |
113 |
this.getBSave().setEnabled(isPossible);
|
114 |
this.getBExportToAscii().setEnabled(isPossible);
|
115 |
} |
116 |
//**********************End Getters & Setters*****************
|
117 |
} |