Revision 12154 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/properties/dialog/PropertiesRasterRegistrableDialog.java

View differences:

PropertiesRasterRegistrableDialog.java
26 26
import com.iver.andami.PluginServices;
27 27
import com.iver.andami.ui.mdiManager.IWindow;
28 28
import com.iver.andami.ui.mdiManager.WindowInfo;
29

  
30 29
/**
31
 * 
32 30
 * @author Nacho Brodin (nachobrodin@gmail.com)
33
 *
34 31
 */
35 32
public class PropertiesRasterRegistrableDialog extends JPanel implements IWindow{
36
	final private static long 			serialVersionUID = 0;
37
	private int 						sizePanelX = 500;
38
	private int 						sizePanelY = 310;
39
	private String 						title = "";
40
	private RegistrableTabPanel 		registrable = null;
41
	private ButtonsPanel				buttons = null;
42
	private TreeMap						params = new TreeMap();
43
	
44
	public PropertiesRasterRegistrableDialog(){
45
		title = PluginServices.getText(this, "propiedades_raster");
46
		registrable = new RegistrableTabPanel(sizePanelX, sizePanelY);
47
		buttons = new ButtonsPanel(sizePanelX);
33
	private static final long   serialVersionUID = -2920327107654323732L;
34
	private RegistrableTabPanel registrable      = null;
35
	private ButtonsPanel        buttons          = null;
36
	private TreeMap             params           = new TreeMap();
37

  
38
	public PropertiesRasterRegistrableDialog() {
39
		registrable = new RegistrableTabPanel();
40
		buttons = new ButtonsPanel();
48 41
		new PropertiesRasterListener(this);
49
		init();
42
		initialize();
50 43
	}
51
	
52
	private void init(){
44

  
45
	private void initialize() {
53 46
		this.setLayout(new BorderLayout());
54
        add(registrable, BorderLayout.CENTER);
55
        add(buttons, BorderLayout.SOUTH);
47
		add(registrable, BorderLayout.CENTER);
48
		add(buttons, BorderLayout.SOUTH);
56 49
	}
57
	
50

  
58 51
	/**
59 52
	 * Add params to register panels. Each extension knows the name and the class to its 
60 53
	 * parameters. This method provide a generic way to register this.
61 54
	 * @param key Parameter name
62 55
	 * @param value parameter's value
63 56
	 */
64
	public void setParam(String key, Object value){
57
	public void setParam(String key, Object value) {
65 58
		params.put(key, value);
66 59
	}
67
	
60

  
68 61
	/**
69 62
	 * Get a parameter registered by the user of this class. Each extension knows the 
70 63
	 * name and the class to its parameters. This method provide a generic way to recover this.
71 64
	 * @param key Parameter name
72 65
	 * @return parameter's value
73 66
	 */
74
	public Object getParam(String key){
67
	public Object getParam(String key) {
75 68
		return params.get(key);
76 69
	}
77
	
70

  
78 71
	/*
79 72
	 *  (non-Javadoc)
80 73
	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
81 74
	 */
82 75
	public WindowInfo getWindowInfo() {
83
		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG
84
				| WindowInfo.RESIZABLE);
85
		m_viewinfo.setTitle(title);
86
		m_viewinfo.setHeight(sizePanelY);
87
		m_viewinfo.setWidth(sizePanelX);
76
		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
77
		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_raster"));
78
		m_viewinfo.setWidth(500);
79
		m_viewinfo.setHeight(310);
88 80
		return m_viewinfo;
89
	}	
90
	
81
	}
82

  
91 83
	/**
92 84
	 * Get buttons panel
93 85
	 * @return ButtonsPanel
94 86
	 */
95
	public ButtonsPanel getButtonsPanel(){
87
	public ButtonsPanel getButtonsPanel() {
96 88
		return this.buttons;
97 89
	}
98
	
90

  
99 91
	/**
100 92
	 * Get registrable panel
101 93
	 * @return RegistrableTabPanel
102 94
	 */
103
	public RegistrableTabPanel getRegistrablePanel(){
95
	public RegistrableTabPanel getRegistrablePanel() {
104 96
		return this.registrable;
105 97
	}
106
	
98

  
107 99
	/**
108 100
	 * Acciones a ejecutar cuando se cancela
109 101
	 */
110
	public void close(){
111
		try{
102
	public void close() {
103
		try {
112 104
			PluginServices.getMDIManager().closeWindow(PropertiesRasterRegistrableDialog.this);
113
		}catch(ArrayIndexOutOfBoundsException e){
114
			//Si la ventana no se puede eliminar no hacemos nada
105
		} catch (ArrayIndexOutOfBoundsException e) {
106
			// Si la ventana no se puede eliminar no hacemos nada
115 107
		}
116 108
	}
117
}
118

  
109
}

Also available in: Unified diff