Revision 31359
tags/tmp_build/frameworks/_fwAndami/.cvsignore | ||
---|---|---|
1 |
bin |
|
2 |
gvsig.log |
|
3 |
gvSIG |
|
4 |
web |
|
5 |
andami.jar |
|
6 |
keystore |
|
7 |
java.hprof.txt |
|
8 |
build-doc |
|
9 |
*.log |
|
10 |
cachedir |
|
11 |
bin-test |
|
0 | 12 |
tags/tmp_build/frameworks/_fwAndami/schemas/andami-config.xml | ||
---|---|---|
1 |
<andami-config locale-language="es" locale-country="ES" locale-variant="es" pluginsDirectory="c:\tirar"> |
|
2 |
<andami update="yes"/> |
|
3 |
<plugin name="com.iver.cit.gvsig" update="yes"/> |
|
4 |
<plugin name="com.iver.core" update="no"/> |
|
5 |
<andami-options> |
|
6 |
<option name="CustomOption1" value="customValue1"/> |
|
7 |
<icon-theme name="DefaultTheme" resource="iconThemes/default" basedir="iconThemes" /> |
|
8 |
</andami-options> |
|
9 |
</andami-config> |
|
0 | 10 |
tags/tmp_build/frameworks/_fwAndami/schemas/sample-plugins-persistence.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugins-status> |
|
3 |
<plugin name="gvsig" lastUpdate="237628686"> |
|
4 |
<xml-entity name="config"> |
|
5 |
<property name="dataDirectory" value="c:\"/> |
|
6 |
<xml-entity> |
|
7 |
<property name="dataDirectory" value="c:\"/> |
|
8 |
<property name="dataDirectory" value="c:\"/> |
|
9 |
<property name="dataDirectory" value="c:\"/> |
|
10 |
</xml-entity> |
|
11 |
</xml-entity> |
|
12 |
<bookmarks> |
|
13 |
<bookmark text="Recientes/raster"> |
|
14 |
<xml-entity> |
|
15 |
<property name="projection" value="EPSG:3403"/> |
|
16 |
<property name="boundinBox" value="12,12,115,115"/> |
|
17 |
</xml-entity> |
|
18 |
</bookmark> |
|
19 |
</bookmarks> |
|
20 |
<windows> |
|
21 |
<window id="0" rectangle="0,0,150,150"/> |
|
22 |
<window id="2" rectangle="50,50,150,150"/> |
|
23 |
<window id="8" rectangle="100,100,150,150"/> |
|
24 |
<window id="12" rectangle="150,150,150,150"/> |
|
25 |
</windows> |
|
26 |
</plugin> |
|
27 |
<tool-bars> |
|
28 |
<tool-bar name="gvsig.herramientas" x-position="0" y-position="1"/> |
|
29 |
<tool-bar name="gvsig.herramientas" x-position="0" y-position="0"/> |
|
30 |
</tool-bars> |
|
31 |
</plugins-status> |
|
0 | 32 |
tags/tmp_build/frameworks/_fwAndami/schemas/sample-config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<icon src="images/logoGVA.gif" text="gvSIG"/> |
|
4 |
<resourceBundle name="text"/> |
|
5 |
<import plugin-name="com.iver.cit.gvsig" /> |
|
6 |
<labelSet class="com.iver.cit.gvsig.gui.View"> |
|
7 |
<label id="1" size="100"/> |
|
8 |
<label id="2" size="230"/> |
|
9 |
</labelSet> |
|
10 |
<libraries> |
|
11 |
<library file="com.iver.cit.gvsig.jar"/> |
|
12 |
<library file="wmsclient.jar"/> |
|
13 |
</libraries> |
|
14 |
<extensions> |
|
15 |
<extension> |
|
16 |
<class name="com.iver.cit.gvsig.ProjectExtension"/> |
|
17 |
<menu text="Archivo/nuevo_proyecto" |
|
18 |
key="n" mnemonic="n" |
|
19 |
tooltip="nuevo_tooltip" |
|
20 |
action-command="NUEVO" icon="images/new.png"/> |
|
21 |
<menu text="Archivo/abrir_proyecto" |
|
22 |
key="a" mnemonic="a" |
|
23 |
tooltip="abrir_tooltip" |
|
24 |
action-command="ABRIR" icon="images/open.png"/> |
|
25 |
<menu text="Archivo/guardar_proyecto" |
|
26 |
key="g" mnemonic="g" |
|
27 |
tooltip="guardar_tooltip" |
|
28 |
action-command="GUARDAR" icon="images/save.png"/> |
|
29 |
|
|
30 |
<toolBar> |
|
31 |
<tool icon="images/new.png" tooltip="nuevo_tooltip" |
|
32 |
action-command="NUEVO"/> |
|
33 |
<tool icon="images/open.png" tooltip="abrir_tooltip" |
|
34 |
action-command="ABRIR"/> |
|
35 |
<tool icon="images/save.png" tooltip="guardar_tooltip" |
|
36 |
action-command="GUARDAR"/> |
|
37 |
|
|
38 |
<!-- these will be added to the containing toolbar --> |
|
39 |
<combo-scale |
|
40 |
name="JPEG Quality" |
|
41 |
elements="15;30;60;70;80;90;100" |
|
42 |
value="80" |
|
43 |
action-command="JPEG_QUALITY" /> |
|
44 |
|
|
45 |
<combo-button |
|
46 |
name="Copy/paste tools"> |
|
47 |
<combo-button-element icon="images/scissor.png" action-command="CUT" /> |
|
48 |
<combo-button-element icon="images/paste.png" action-command="PASTE" /> |
|
49 |
<combo-button-element icon="images/copy.png" action-command="COPY" /> |
|
50 |
</combo-button> |
|
51 |
</toolBar> |
|
52 |
|
|
53 |
</extension> |
|
54 |
|
|
55 |
<extension> |
|
56 |
<class name="com.iver.cit.gvsig.ZoomPrev"/> |
|
57 |
<menu text="Vista/Zoom_Previo" icon="images/ZoomPrevio.png"/> |
|
58 |
<tool-bar name="Herramientas"> |
|
59 |
<action-tool icon="images/ZoomPrevio.png" action-command="ZOOM_PREV" tooltip="Zoom_Previo" position="11"/> |
|
60 |
</tool-bar> |
|
61 |
|
|
62 |
<!-- these will be added to the status-bar (because they are not contained in any toolbar) --> |
|
63 |
<combo-scale |
|
64 |
name="Scale" |
|
65 |
label="Scale:" |
|
66 |
elements="1000;2000;5000;10000;25000;50000;100000;200000;500000;1000000;2000000;5000000" |
|
67 |
value="10000" |
|
68 |
action-command="CHANGE_SCALE" /> |
|
69 |
|
|
70 |
<combo-button |
|
71 |
name="Tool Mode"> |
|
72 |
<combo-button-element icon="images/once.png" action-command="USE_ONCE" /> |
|
73 |
<combo-button-element icon="images/sticky-tool.png" action-command="UNTIL_CHANGED" /> |
|
74 |
</combo-button> |
|
75 |
</extension> |
|
76 |
<extension processing-position="2"> |
|
77 |
<class name="com.iver.cit.gvsig.ViewControls"/> |
|
78 |
<menus> |
|
79 |
<menu text="Vista/Zoom_Completo" action-command="FULL" icon="images/MapContents.png" tooltip="Zoom completo a la v?sta"/> |
|
80 |
<menu text="Vista/Zoom_Select" action-command="ZOOM_SELECT" icon="image/Select.png"/> |
|
81 |
<menu text="Vista/Encuadre" action-command="ENCUADRE" icon="images/encuadre.png"/> |
|
82 |
<menu text="Vista/Seleccion_por_tema" action-command="SELECTIONBYSHAPE"/> |
|
83 |
<menu text="Vista/configurar_localizador" action-command="CONFIG_LOCATOR"/> |
|
84 |
<menu text="Vista/propiedades" action-command="PROPERTIES"/> |
|
85 |
</menus> |
|
86 |
<tool-bar name="Herramientas" y-position="1"> |
|
87 |
<action-tool icon="images/MapContents.png" action-command="FULL" tooltip="Zoom_Completo" position="1"/> |
|
88 |
<action-tool icon="images/encuadre.png" action-command="ENCUADRE" tooltip="gestion_encuadre" last="true" position="2"/> |
|
89 |
<selectable-tool group="grupo1" default="true" icon="images/ZoomIn.png" action-command="ZOOM_IN" tooltip="Zoom_M?s" position="3"/> |
|
90 |
<selectable-tool group="grupo1" icon="images/ZoomOut.png" action-command="ZOOM_OUT" position="4"/> |
|
91 |
<selectable-tool group="grupo1" icon="images/Pan.png" action-command="PAN" tooltip="Encuadre" position="5"/> |
|
92 |
<selectable-tool group="grupo1" icon="images/Identify.png" action-command="INFO" tooltip="informacion" position="6" /> |
|
93 |
<selectable-tool group="grupo2" icon="images/Distancia.png" action-command="MEDICION" tooltip="medir_distancias" position="7"/> |
|
94 |
<selectable-tool group="grupo2" icon="images/Poligono16.png" action-command="AREA" tooltip="medir_area" position="8"/> |
|
95 |
<selectable-tool group="grupo2" default="true" icon="images/Select.png" action-command="SELPOINT" tooltip="seleccionar_por_punto" position="9"/> |
|
96 |
<selectable-tool group="grupo2" icon="images/SelEspacial2b.png" action-command="SELRECT" tooltip="seleccionar_por_rectangulo" position="10"/> |
|
97 |
</tool-bar> |
|
98 |
</extension> |
|
99 |
<extension> |
|
100 |
<class name="com.iver.cit.gvsig.ThemeControls"/> |
|
101 |
<menu text="Tema/propiedades"/> |
|
102 |
</extension> |
|
103 |
</extensions> |
|
104 |
|
|
105 |
<file-extensions> |
|
106 |
<file-extension description="DGNfiles" ends-with="dgn" dialog="openLayer"> |
|
107 |
<class name="com.iver.cit.gvsig.DGNFileExtension"/> |
|
108 |
</file-extension> |
|
109 |
<file-extension description="Rasterfiles" ends-with="ecw,tif,tiff,jpg,png" dialog="openLayer"> |
|
110 |
<class name="com.iver.cit.gvsig.RasterFileExtension"/> |
|
111 |
</file-extension> |
|
112 |
</file-extensions> |
|
113 |
</plugin-config> |
|
0 | 114 |
tags/tmp_build/frameworks/_fwAndami/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>_fwAndami</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> |
|
15 |
<triggers>full,incremental,</triggers> |
|
16 |
<arguments> |
|
17 |
<dictionary> |
|
18 |
<key>LaunchConfigHandle</key> |
|
19 |
<value><project>/.externalToolBuilders/Ant.launch</value> |
|
20 |
</dictionary> |
|
21 |
</arguments> |
|
22 |
</buildCommand> |
|
23 |
<buildCommand> |
|
24 |
<name>de.loskutov.FileSync.FSBuilder</name> |
|
25 |
<arguments> |
|
26 |
</arguments> |
|
27 |
</buildCommand> |
|
28 |
</buildSpec> |
|
29 |
<natures> |
|
30 |
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> |
|
31 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
32 |
<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> |
|
33 |
</natures> |
|
34 |
</projectDescription> |
|
0 | 35 |
tags/tmp_build/frameworks/_fwAndami/gvSIG.bat | ||
---|---|---|
1 |
d: |
|
2 |
cd d:\eclipse\workspace\fwAndami |
|
3 |
java -cp andami.jar;lib/beans.jar;./lib/castor-0.9.5.3-xml.jar;./lib/crimson.jar;./lib/gvsig-i18n.jar;./lib/iver-utiles.jar;./lib/javaws.jar;lib/JWizardComponent.jar;./lib/log4j-1.2.8.jar;lib/looks-2.0.2.jar;./lib/xerces_2_5_0.jar;./lib/xml-apis.jar -Xmx500M com.iver.andami.Launcher gvSIG gvSIG/extensiones %1 |
|
0 | 4 |
tags/tmp_build/frameworks/_fwAndami/castor.properties | ||
---|---|---|
1 |
org.exolab.castor.indent=true |
|
0 | 2 |
tags/tmp_build/frameworks/_fwAndami/src/log4j.properties | ||
---|---|---|
1 |
log4j.rootLogger=debug, stdout |
|
2 |
|
|
3 |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender |
|
4 |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout |
|
5 |
|
|
6 |
# Pattern to output the caller's file name and line number. |
|
7 |
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n |
|
8 |
|
|
0 | 9 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/MDIManagerLoadException.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.andami.ui; |
|
42 |
|
|
43 |
/** |
|
44 |
* |
|
45 |
*/ |
|
46 |
public class MDIManagerLoadException extends Exception{ |
|
47 |
|
|
48 |
/** |
|
49 |
* |
|
50 |
*/ |
|
51 |
public MDIManagerLoadException() { |
|
52 |
super(); |
|
53 |
// TODO Auto-generated constructor stub |
|
54 |
} |
|
55 |
/** |
|
56 |
* @param message |
|
57 |
*/ |
|
58 |
public MDIManagerLoadException(String message) { |
|
59 |
super(message); |
|
60 |
// TODO Auto-generated constructor stub |
|
61 |
} |
|
62 |
/** |
|
63 |
* @param message |
|
64 |
* @param cause |
|
65 |
*/ |
|
66 |
public MDIManagerLoadException(String message, Throwable cause) { |
|
67 |
super(message, cause); |
|
68 |
// TODO Auto-generated constructor stub |
|
69 |
} |
|
70 |
/** |
|
71 |
* @param cause |
|
72 |
*/ |
|
73 |
public MDIManagerLoadException(Throwable cause) { |
|
74 |
super(cause); |
|
75 |
// TODO Auto-generated constructor stub |
|
76 |
} |
|
77 |
} |
|
0 | 78 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/GlassPane.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 22-oct-2004 |
|
3 |
* |
|
4 |
* To change the template for this generated file go to |
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments |
|
6 |
*/ |
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
8 |
* |
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
10 |
* |
|
11 |
* This program is free software; you can redistribute it and/or |
|
12 |
* modify it under the terms of the GNU General Public License |
|
13 |
* as published by the Free Software Foundation; either version 2 |
|
14 |
* of the License, or (at your option) any later version. |
|
15 |
* |
|
16 |
* This program is distributed in the hope that it will be useful, |
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
19 |
* GNU General Public License for more details. |
|
20 |
* |
|
21 |
* You should have received a copy of the GNU General Public License |
|
22 |
* along with this program; if not, write to the Free Software |
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
24 |
* |
|
25 |
* For more information, contact: |
|
26 |
* |
|
27 |
* Generalitat Valenciana |
|
28 |
* Conselleria d'Infraestructures i Transport |
|
29 |
* Av. Blasco Ib??ez, 50 |
|
30 |
* 46010 VALENCIA |
|
31 |
* SPAIN |
|
32 |
* |
|
33 |
* +34 963862235 |
|
34 |
* gvsig@gva.es |
|
35 |
* www.gvsig.gva.es |
|
36 |
* |
|
37 |
* or |
|
38 |
* |
|
39 |
* IVER T.I. S.A |
|
40 |
* Salamanca 50 |
|
41 |
* 46005 Valencia |
|
42 |
* Spain |
|
43 |
* |
|
44 |
* +34 963163400 |
|
45 |
* dac@iver.es |
|
46 |
*/ |
|
47 |
package com.iver.andami.ui.mdiFrame; |
|
48 |
import java.awt.Cursor; |
|
49 |
|
|
50 |
import javax.swing.JPanel; |
|
51 |
import javax.swing.event.MouseInputAdapter; |
|
52 |
|
|
53 |
public class GlassPane extends JPanel { |
|
54 |
|
|
55 |
public GlassPane(){ |
|
56 |
this.setOpaque(false); |
|
57 |
this.addMouseListener(new MouseInputAdapter(){}); |
|
58 |
this.addMouseMotionListener(new MouseInputAdapter(){}); |
|
59 |
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* @see java.awt.Component#setCursor(java.awt.Cursor) |
|
64 |
*/ |
|
65 |
public void setCursor(Cursor cursor) { |
|
66 |
super.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); |
|
67 |
} |
|
68 |
|
|
69 |
} |
|
70 |
|
|
0 | 71 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/JMenuItem.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.andami.ui.mdiFrame; |
|
42 |
|
|
43 |
import javax.swing.Action; |
|
44 |
import javax.swing.Icon; |
|
45 |
|
|
46 |
public class JMenuItem extends javax.swing.JMenuItem implements EnableTextSupport{ |
|
47 |
/** |
|
48 |
* |
|
49 |
*/ |
|
50 |
public JMenuItem() { |
|
51 |
super(); |
|
52 |
// TODO Auto-generated constructor stub |
|
53 |
} |
|
54 |
/** |
|
55 |
* @param text |
|
56 |
*/ |
|
57 |
public JMenuItem(String text) { |
|
58 |
super(text); |
|
59 |
// TODO Auto-generated constructor stub |
|
60 |
} |
|
61 |
/** |
|
62 |
* @param text |
|
63 |
* @param mnemonic |
|
64 |
*/ |
|
65 |
public JMenuItem(String text, int mnemonic) { |
|
66 |
super(text, mnemonic); |
|
67 |
// TODO Auto-generated constructor stub |
|
68 |
} |
|
69 |
/** |
|
70 |
* @param text |
|
71 |
* @param icon |
|
72 |
*/ |
|
73 |
public JMenuItem(String text, Icon icon) { |
|
74 |
super(text, icon); |
|
75 |
// TODO Auto-generated constructor stub |
|
76 |
} |
|
77 |
/** |
|
78 |
* @param a |
|
79 |
*/ |
|
80 |
public JMenuItem(Action a) { |
|
81 |
super(a); |
|
82 |
// TODO Auto-generated constructor stub |
|
83 |
} |
|
84 |
/** |
|
85 |
* @param icon |
|
86 |
*/ |
|
87 |
public JMenuItem(Icon icon) { |
|
88 |
super(icon); |
|
89 |
// TODO Auto-generated constructor stub |
|
90 |
} |
|
91 |
private String enableText; |
|
92 |
private String toolTip = super.getToolTipText(); |
|
93 |
|
|
94 |
|
|
95 |
/** |
|
96 |
* @return Returns the enableText. |
|
97 |
*/ |
|
98 |
public String getEnableText() { |
|
99 |
return enableText; |
|
100 |
} |
|
101 |
/** |
|
102 |
* @param enableText The enableText to set. |
|
103 |
*/ |
|
104 |
public void setEnableText(String enableText) { |
|
105 |
this.enableText = enableText; |
|
106 |
} |
|
107 |
|
|
108 |
|
|
109 |
/** |
|
110 |
* @see java.awt.Component#setVisible(boolean) |
|
111 |
*/ |
|
112 |
public void setEnabled(boolean aFlag) { |
|
113 |
super.setEnabled(aFlag); |
|
114 |
if (aFlag){ |
|
115 |
setToolTipText(toolTip); |
|
116 |
}else{ |
|
117 |
setToolTipText(enableText); |
|
118 |
} |
|
119 |
} |
|
120 |
/** |
|
121 |
* @see javax.swing.JComponent#setToolTipText(java.lang.String) |
|
122 |
*/ |
|
123 |
public void setToolTip(String text) { |
|
124 |
toolTip = text; |
|
125 |
} |
|
126 |
} |
|
0 | 127 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/ToggleButtonModel.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
|
|
42 |
package com.iver.andami.ui.mdiFrame; |
|
43 |
|
|
44 |
import javax.swing.ButtonGroup; |
|
45 |
|
|
46 |
/** |
|
47 |
* @author Cesar Martinez Izquierdo <cesar.martinez@iver.es> |
|
48 |
*/ |
|
49 |
public class ToggleButtonModel extends javax.swing.JToggleButton.ToggleButtonModel { |
|
50 |
|
|
51 |
private String _groupName = null; |
|
52 |
|
|
53 |
public ButtonGroup getGroup() { |
|
54 |
return group; |
|
55 |
} |
|
56 |
|
|
57 |
public String getGroupName() { |
|
58 |
return _groupName; |
|
59 |
} |
|
60 |
|
|
61 |
public void setGroupName(String groupName) { |
|
62 |
_groupName = groupName; |
|
63 |
} |
|
64 |
|
|
65 |
} |
|
0 | 66 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/MainFrame.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004-2007 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.andami.ui.mdiFrame; |
|
42 |
|
|
43 |
import java.awt.event.ActionListener; |
|
44 |
|
|
45 |
import javax.swing.JComponent; |
|
46 |
|
|
47 |
import org.gvsig.gui.beans.controls.IControl; |
|
48 |
|
|
49 |
import com.iver.andami.plugins.PluginClassLoader; |
|
50 |
import com.iver.andami.plugins.config.generate.Label; |
|
51 |
import com.iver.andami.plugins.config.generate.Menu; |
|
52 |
|
|
53 |
|
|
54 |
/** |
|
55 |
* This interface represents the main application's window. It allow to access |
|
56 |
* the menus, the tool bars and the status bar. |
|
57 |
*/ |
|
58 |
public interface MainFrame { |
|
59 |
/** |
|
60 |
* Adds the provided menu to the menu bar. |
|
61 |
* |
|
62 |
* @param menu A Menu object containing the menu definition |
|
63 |
* @param listener Object which receives the menu events |
|
64 |
* @param loader ClassLoader of the plug-in that installs this menu |
|
65 |
*/ |
|
66 |
public void addMenu(Menu menu, ActionListener listener, |
|
67 |
PluginClassLoader loader); |
|
68 |
|
|
69 |
/** |
|
70 |
* Changes the menu name, and thus also its location, as the name determines |
|
71 |
* the location of the menu. |
|
72 |
* |
|
73 |
* @param menu An array of Strings which represents the full menu path, |
|
74 |
* for example, {"Vista", "export", "imagen"} is a reference to the menu |
|
75 |
* "Vista/export/imagen" (that is, the menu Image within the submenu |
|
76 |
* View-Export). Menu names are translation keys, "Vista", "export", etc will |
|
77 |
* be translated to the suitable language when they are displayed. |
|
78 |
* @param newName New menu's name, in the syntax "Vista/export/symbols". Each |
|
79 |
* part of the name is a translation key. |
|
80 |
* @param loader ClassLoader of the plug-in that added the menu |
|
81 |
* |
|
82 |
* @throws NoSuchMenuException If there is no menu matching the provided |
|
83 |
* menu path |
|
84 |
*/ |
|
85 |
public void changeMenuName(String[] menu, String newName, |
|
86 |
PluginClassLoader loader) throws NoSuchMenuException; |
|
87 |
|
|
88 |
/** |
|
89 |
* Deletes the provided menu, if found. |
|
90 |
* |
|
91 |
* @param menu The menu to delete from the menu bar |
|
92 |
*/ |
|
93 |
public void removeMenu(Menu menu); |
|
94 |
|
|
95 |
/** |
|
96 |
* It checks whether each extension is enabled and visible, in order to |
|
97 |
* enable/disable and show/hide their associated controls. |
|
98 |
*/ |
|
99 |
public void enableControls(); |
|
100 |
|
|
101 |
/** |
|
102 |
* Gets the status bar, the bar located in the bottom part of the main window. |
|
103 |
* It can be used to show messages, show progress bars, or change the status. |
|
104 |
* |
|
105 |
* @return The main application's status bar. |
|
106 |
*/ |
|
107 |
public NewStatusBar getStatusBar(); |
|
108 |
|
|
109 |
/** |
|
110 |
* Sets the main window title. |
|
111 |
* |
|
112 |
* @param titulo The title to be set in the main window |
|
113 |
*/ |
|
114 |
public void setTitle(String titulo); |
|
115 |
|
|
116 |
/** |
|
117 |
* Gets a previously added JComponent by name (including |
|
118 |
* tool bars, buttons from tool bars, status bar controls |
|
119 |
* and menus. For example |
|
120 |
* you can use it if you need to obtain an status bar |
|
121 |
* control or a JToolBar to |
|
122 |
* add some customized component |
|
123 |
* @param name |
|
124 |
* @return the JComponent or null if none has been found |
|
125 |
*/ |
|
126 |
public JComponent getComponentByName(String name); |
|
127 |
|
|
128 |
/** |
|
129 |
* Sets the tool associated to the provided actionComand |
|
130 |
* as the selected tool for the currently selected Andami window. |
|
131 |
*/ |
|
132 |
public void setSelectedTool(String actionCommand); |
|
133 |
|
|
134 |
/** |
|
135 |
* Gets an array containing all the toolbars. |
|
136 |
* |
|
137 |
* @return An array containing all the toolbars. |
|
138 |
*/ |
|
139 |
public SelectableToolBar[] getToolbars(); |
|
140 |
|
|
141 |
/** |
|
142 |
* Gets wheter or not this toolbar should be shown by Andami. |
|
143 |
* Note that this does not reflect the actual visibility |
|
144 |
* of the toolbar, because it also depends on other conditions |
|
145 |
* (the toolbar should contain at lest a currently visible button). |
|
146 |
* |
|
147 |
* @param name The toolbar's name |
|
148 |
* @return |
|
149 |
*/ |
|
150 |
public boolean getToolbarVisibility(String name); |
|
151 |
|
|
152 |
/** |
|
153 |
* Sets wheter or not this toolbar should be shown by Andami. |
|
154 |
* This is useful if to hide some toolbars when they are not |
|
155 |
* going to be used. |
|
156 |
* If it's false, the toolbar will be |
|
157 |
* hidden even if its associated extensions are visible. |
|
158 |
* Note that setting visibility to true does not automatically |
|
159 |
* show the toolbar, because it also depends on other conditions |
|
160 |
* (the toolbar should contain at lest a currently visible button). |
|
161 |
* However, it allows the toolbar to be visible when necessary |
|
162 |
* conditions are fulfilled. |
|
163 |
* |
|
164 |
* @param name The toolbar's name. |
|
165 |
* @param visibility |
|
166 |
* @return |
|
167 |
*/ |
|
168 |
public boolean setToolbarVisibility(String name, boolean visibility); |
|
169 |
|
|
170 |
/** |
|
171 |
* Gets the menu entry corresponding the provided menu path. |
|
172 |
* |
|
173 |
* @param menuPath The menu path to the menu entry that we want to |
|
174 |
* retrieve. For example, if we want to retrieve the menu entry |
|
175 |
* corresponding to the XML menu "Layer/Export/Export_to_PDF" we |
|
176 |
* will provide an array containing ["Layer", "Export", "Export_to_PDF"]. |
|
177 |
* |
|
178 |
* @return The menu entry corresponding the provided menu path. Note that |
|
179 |
* the menu entry may be an instance of <code>javax.swing.JMenuItem</code>, |
|
180 |
* <code>javax.swing.JMenu</code> or |
|
181 |
* <code>com.iver.andami.ui.mdiFrame.JMenuItem</code>. |
|
182 |
*/ |
|
183 |
public javax.swing.JMenuItem getMenuEntry(String[] menuPath); |
|
184 |
|
|
185 |
/** |
|
186 |
* Adds a control to the status bar and associate it with the |
|
187 |
* provided extension. The control will be enabled and visible |
|
188 |
* when the extension is enabled and visible. |
|
189 |
* |
|
190 |
* @param extensionClass Extension which will determine whether the |
|
191 |
* control is enabled and visible. |
|
192 |
* @param control The control to add. |
|
193 |
*/ |
|
194 |
public void addStatusBarControl(Class extensionClass, IControl control); |
|
195 |
|
|
196 |
/** |
|
197 |
* Removes the providedcontrol from the status bar. |
|
198 |
* |
|
199 |
* @param name The name of the control to remove |
|
200 |
*/ |
|
201 |
public void removeStatusBarControl(String name); |
|
202 |
|
|
203 |
/** |
|
204 |
* Sets the provided label-set as the labels associated with the provided |
|
205 |
* class. The labels will be visible in the status bar if the |
|
206 |
* currently selected Andami window is an instance of the provided |
|
207 |
* class. |
|
208 |
* |
|
209 |
* @param clase The class which will be associated to the label-set. The |
|
210 |
* labels will be visible if the currently selected Andami window is an |
|
211 |
* instance of this class. |
|
212 |
* |
|
213 |
* @param label An array of Labels. Each label has an ID which will be |
|
214 |
* used to write text on them. |
|
215 |
*/ |
|
216 |
public void setStatusBarLabels(Class clase, Label[] label); |
|
217 |
|
|
218 |
/** |
|
219 |
* Removes the labels associated with the provided class. |
|
220 |
* |
|
221 |
* @param clase The class whose associated labels are to be removed. |
|
222 |
*/ |
|
223 |
public void removeStatusBarLabels(Class clase); |
|
224 |
|
|
225 |
} |
|
0 | 226 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/JPopUpMenu.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.andami.ui.mdiFrame; |
|
42 |
|
|
43 |
import javax.swing.JPopupMenu; |
|
44 |
|
|
45 |
public class JPopUpMenu extends JPopupMenu implements EnableTextSupport{ |
|
46 |
private String enableText; |
|
47 |
private String toolTip = super.getToolTipText(); |
|
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* @return Returns the enableText. |
|
52 |
*/ |
|
53 |
public String getEnableText() { |
|
54 |
return enableText; |
|
55 |
} |
|
56 |
/** |
|
57 |
* @param enableText The enableText to set. |
|
58 |
*/ |
|
59 |
public void setEnableText(String enableText) { |
|
60 |
this.enableText = enableText; |
|
61 |
} |
|
62 |
|
|
63 |
|
|
64 |
/** |
|
65 |
* @see java.awt.Component#setVisible(boolean) |
|
66 |
*/ |
|
67 |
public void setEnabled(boolean aFlag) { |
|
68 |
super.setEnabled(aFlag); |
|
69 |
if (aFlag){ |
|
70 |
setToolTipText(toolTip); |
|
71 |
}else{ |
|
72 |
setToolTipText(enableText); |
|
73 |
} |
|
74 |
} |
|
75 |
/** |
|
76 |
* @see javax.swing.JComponent#setToolTipText(java.lang.String) |
|
77 |
*/ |
|
78 |
public void setToolTip(String text) { |
|
79 |
toolTip = text; |
|
80 |
} |
|
81 |
/** |
|
82 |
* |
|
83 |
*/ |
|
84 |
public JPopUpMenu() { |
|
85 |
super(); |
|
86 |
// TODO Auto-generated constructor stub |
|
87 |
} |
|
88 |
/** |
|
89 |
* @param label |
|
90 |
*/ |
|
91 |
public JPopUpMenu(String label) { |
|
92 |
super(label); |
|
93 |
// TODO Auto-generated constructor stub |
|
94 |
} |
|
95 |
} |
|
0 | 96 |
tags/tmp_build/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/NewStatusBar.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib��ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.andami.ui.mdiFrame; |
|
42 |
|
|
43 |
import java.awt.BorderLayout; |
|
44 |
import java.awt.Component; |
|
45 |
import java.awt.Dimension; |
|
46 |
import java.awt.FlowLayout; |
|
47 |
import java.util.HashMap; |
|
48 |
|
|
49 |
import javax.swing.BorderFactory; |
|
50 |
import javax.swing.ImageIcon; |
|
51 |
import javax.swing.JLabel; |
|
52 |
import javax.swing.JPanel; |
|
53 |
import javax.swing.JProgressBar; |
|
54 |
import javax.swing.SwingConstants; |
|
55 |
import javax.swing.border.BevelBorder; |
|
56 |
|
|
57 |
import org.apache.log4j.Logger; |
|
58 |
import org.gvsig.gui.beans.controls.IControl; |
|
59 |
|
|
60 |
import com.iver.andami.PluginServices; |
|
61 |
import com.iver.andami.messages.Messages; |
|
62 |
import com.iver.andami.plugins.config.generate.Label; |
|
63 |
|
|
64 |
|
|
65 |
/** |
|
66 |
* <p>This class contains the status bar. It contains the graphical component, |
|
67 |
* and the methods to manage it. |
|
68 |
* </p> |
|
69 |
* |
|
70 |
* <p>The status bar is divided in several areas. At the very left, there is |
|
71 |
* an icon and the main status text. There are three icons to show: |
|
72 |
* Info, Warning and Error icons. They can be set together with the main |
|
73 |
* status text using the methods <code>setInfoText()</code>, |
|
74 |
* <code>setWarningText()</code> and <code>setErrorText()</code> (and also with |
|
75 |
* <code>setInfoTextTemporal()</code>, etc). Then, there is a right area which |
|
76 |
* contains labels and other controls. Labels are set in the config.xml files |
|
77 |
* and are visible or not depending on the currently selected Andami window. |
|
78 |
* Controls are associated to extensions, and are enabled/disabled and |
|
79 |
* visible/hidden depending on the associated extension. |
|
80 |
* </p> |
|
81 |
* |
|
82 |
*/ |
|
83 |
public class NewStatusBar extends JPanel { |
|
84 |
private static Logger logger = Logger.getLogger(NewStatusBar.class.getName()); |
|
85 |
private static final int INFO = 0; |
|
86 |
private static final int WARNING = 1; |
|
87 |
private static final int ERROR = 2; |
|
88 |
private JLabel lblIcon = null; |
|
89 |
private JLabel lblTexto = null; |
|
90 |
private boolean contenidoTemporal; |
|
91 |
private String textoAnterior; |
|
92 |
private int estadoAnterior; |
|
93 |
private ImageIcon infoIcon; |
|
94 |
private ImageIcon warningIcon; |
|
95 |
private ImageIcon errorIcon; |
|
96 |
private int estado; |
|
97 |
private JProgressBar progressBar = null; |
|
98 |
private HashMap idLabel = new HashMap(); |
|
99 |
private int[] widthlabels = null; |
|
100 |
private HashMap controls = new HashMap(); |
|
101 |
private JPanel controlContainer; |
|
102 |
/** |
|
103 |
* This is the default constructor |
|
104 |
*/ |
|
105 |
public NewStatusBar() { |
|
106 |
super(); |
|
107 |
initialize(); |
|
108 |
infoIcon = PluginServices.getIconTheme().get("info-icon"); |
|
109 |
warningIcon = PluginServices.getIconTheme().get("warning-icon"); |
|
110 |
errorIcon = PluginServices.getIconTheme().get("error-icon"); |
|
111 |
|
|
112 |
} |
|
113 |
|
|
114 |
/** |
|
115 |
* This method initializes the status bar. It creates the required |
|
116 |
* containers and sets the layout. |
|
117 |
*/ |
|
118 |
private void initialize() { |
|
119 |
BorderLayout mainLayout = new BorderLayout(); |
|
120 |
this.setLayout(mainLayout); |
|
121 |
|
|
122 |
JPanel container1 = new JPanel(); |
|
123 |
this.add(container1, BorderLayout.CENTER); |
|
124 |
controlContainer = new JPanel(); |
|
125 |
this.add(controlContainer, BorderLayout.EAST); |
|
126 |
|
|
127 |
this.setPreferredSize(new java.awt.Dimension(183,20)); |
|
128 |
this.setSize(new java.awt.Dimension(183,20)); |
|
129 |
lblIcon = new JLabel(); |
|
130 |
lblTexto = new JLabel(); |
|
131 |
lblTexto.setAlignmentX(JLabel.LEFT_ALIGNMENT); |
|
132 |
lblTexto.setHorizontalAlignment(SwingConstants.LEFT); |
|
133 |
lblTexto.setHorizontalTextPosition(SwingConstants.LEFT); |
|
134 |
|
|
135 |
FlowLayout rightLayout = new FlowLayout(); |
|
136 |
controlContainer.setLayout(rightLayout); |
|
137 |
rightLayout.setHgap(1); |
|
138 |
rightLayout.setVgap(2); |
|
139 |
rightLayout.setAlignment(java.awt.FlowLayout.RIGHT); |
|
140 |
lblIcon.setText(""); |
|
141 |
lblTexto.setText(Messages.getString("StatusBar.Aplicacion_iniciada")); |
|
142 |
|
|
143 |
FlowLayout leftLayout = new FlowLayout(FlowLayout.LEFT); |
|
144 |
leftLayout.setHgap(1); |
|
145 |
leftLayout.setVgap(2); |
|
146 |
container1.setLayout(leftLayout); |
|
147 |
container1.add(lblIcon, null); |
|
148 |
container1.add(getProgressBar(), null); |
|
149 |
container1.add(lblTexto, null); |
|
150 |
} |
|
151 |
|
|
152 |
/** |
|
153 |
* Gets the status bar main text. |
|
154 |
* |
|
155 |
* @return The status bar main text. |
|
156 |
* @see #setInfoText(String) |
|
157 |
* @see #setWarningText(String) |
|
158 |
* @see #setErrorText(String) |
|
159 |
* @see #setInfoTextTemporal(String) |
|
160 |
* @see #setWarningTextTemporal(String) |
|
161 |
* @see #setErrorTextTemporal(String) |
|
162 |
*/ |
|
163 |
public String getStatusText() { |
|
164 |
return lblTexto.getText(); |
|
165 |
} |
|
166 |
|
|
167 |
/** |
|
168 |
* Restores the previous contents in the status bar main text, |
|
169 |
* after the {@link #setInfoTextTemporal(String)}, {@link #setWarningTextTemporal(String)} |
|
170 |
* or {@link #setErrorTextTemporal(String)} have been called. |
|
171 |
* |
|
172 |
* @see #setInfoTextTemporal(String) |
|
173 |
* @see #setWarningTextTemporal(String) |
|
174 |
* @see #setErrorTextTemporal(String) |
|
175 |
*/ |
|
176 |
public void restaurarTexto() { |
|
177 |
contenidoTemporal = false; |
|
178 |
|
|
179 |
if (estadoAnterior == -1) { |
|
180 |
return; |
|
181 |
} |
|
182 |
|
|
183 |
switch (estadoAnterior) { |
|
184 |
case INFO: |
|
185 |
setInfoText(textoAnterior); |
|
186 |
|
|
187 |
break; |
|
188 |
|
|
189 |
case WARNING: |
|
190 |
setWarningText(textoAnterior); |
|
191 |
|
|
192 |
break; |
|
193 |
|
|
194 |
case ERROR: |
|
195 |
setErrorText(textoAnterior); |
|
196 |
|
|
197 |
break; |
|
198 |
} |
|
199 |
|
|
200 |
estadoAnterior = -1; |
|
201 |
textoAnterior = null; |
|
202 |
} |
|
203 |
|
|
204 |
/** |
|
205 |
* Sets a temporary information message in the status bar, and changes the |
|
206 |
* icon to an Info icon. The previous text and icon can be restored using |
|
207 |
* the {@link #restaurarTexto()} method. |
|
208 |
* |
|
209 |
* @param texto The text to set |
|
210 |
* @see #restaurarTexto() |
|
211 |
*/ |
|
212 |
public void setInfoTextTemporal(String texto) { |
|
213 |
if (!contenidoTemporal) { |
|
214 |
textoAnterior = getStatusText(); |
|
215 |
estadoAnterior = this.estado; |
|
216 |
contenidoTemporal = true; |
|
217 |
} |
|
218 |
|
|
219 |
this.estado = INFO; |
|
220 |
lblIcon.setIcon(infoIcon); |
|
221 |
lblTexto.setText(texto); |
|
222 |
} |
|
223 |
|
|
224 |
/** |
|
225 |
* Sets a temporary warning message in the status bar, and changes the |
|
226 |
* icon to a Warning icon. The previous text and icon can be restored using |
|
227 |
* the {@link #restaurarTexto()} method. |
|
228 |
* |
|
229 |
* @param texto The text to set |
|
230 |
* @see #restaurarTexto() |
|
231 |
*/ |
|
232 |
public void setWarningTextTemporal(String texto) { |
|
233 |
if (!contenidoTemporal) { |
|
234 |
estadoAnterior = this.estado; |
|
235 |
textoAnterior = getStatusText(); |
|
236 |
contenidoTemporal = true; |
|
237 |
} |
|
238 |
this.estado = WARNING; |
|
239 |
lblIcon.setIcon(warningIcon); |
|
240 |
lblTexto.setText(texto); |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* Sets a temporary error message in the status bar, and changes the |
|
245 |
* icon to an Error icon. The previous text and icon can be restored using |
|
246 |
* the {@link #restaurarTexto()} method. |
|
247 |
* |
|
248 |
* @param texto The text to set |
|
249 |
* @see #restaurarTexto() |
|
250 |
*/ |
|
251 |
public void setErrorTextTemporal(String texto) { |
|
252 |
if (!contenidoTemporal) { |
|
253 |
estadoAnterior = this.estado; |
|
254 |
textoAnterior = getStatusText(); |
|
255 |
contenidoTemporal = true; |
|
256 |
} |
|
257 |
|
|
258 |
this.estado = ERROR; |
|
259 |
lblIcon.setIcon(errorIcon); |
|
260 |
lblTexto.setText(texto); |
|
261 |
} |
|
262 |
|
|
263 |
/** |
|
264 |
* Sets a permanent info message in the status bar, and changes the |
|
265 |
* permanent icon to an Info icon. If there is a temporary message showing |
|
266 |
* at the moment, the message set now is not shown until |
|
267 |
* the {@link #restaurarTexto()} method is called. |
|
268 |
* |
|
269 |
* @param texto The permanent info message to set |
|
270 |
* @see #restaurarTexto() |
|
271 |
*/ |
|
272 |
public void setInfoText(String texto) { |
|
273 |
if (contenidoTemporal) { |
|
274 |
textoAnterior = texto; |
|
275 |
estadoAnterior = INFO; |
|
276 |
} else { |
|
277 |
lblTexto.setText(texto); |
|
278 |
lblIcon.setIcon(infoIcon); |
|
279 |
estado = INFO; |
|
280 |
} |
|
281 |
} |
|
282 |
|
|
283 |
/** |
|
284 |
* Sets a permanent warning message in the status bar, and changes the |
|
285 |
* permanent icon to a Warning icon. If there is a temporary message showing |
|
286 |
* at the moment, the message set now is not shown until |
|
287 |
* the {@link #restaurarTexto()} method is called. |
|
288 |
* |
|
289 |
* @param texto The permanent warning message to set |
|
290 |
* @see #restaurarTexto() |
|
291 |
*/ |
|
292 |
public void setWarningText(String texto) { |
|
293 |
if (contenidoTemporal) { |
|
294 |
textoAnterior = texto; |
|
295 |
estadoAnterior = WARNING; |
|
296 |
} else { |
|
297 |
lblTexto.setText(texto); |
|
298 |
lblIcon.setIcon(warningIcon); |
|
299 |
estado = WARNING; |
|
300 |
} |
|
301 |
} |
|
302 |
|
|
303 |
/** |
|
304 |
* Sets a permanent error message in the status bar, and changes the |
|
305 |
* permanent icon to an Error icon. If there is a temporary message showing |
|
306 |
* at the moment, the message set now is not shown until |
|
307 |
* the {@link #restaurarTexto()} method is called. |
|
308 |
* |
|
309 |
* @param texto The permanent info message to set |
|
310 |
* @see #restaurarTexto() |
|
311 |
*/ |
|
312 |
public void setErrorText(String texto) { |
|
313 |
if (contenidoTemporal) { |
|
314 |
textoAnterior = texto; |
|
315 |
estadoAnterior = ERROR; |
|
316 |
} else { |
|
317 |
lblTexto.setText(texto); |
|
318 |
lblIcon.setIcon(errorIcon); |
|
319 |
estado = ERROR; |
|
320 |
} |
|
321 |
} |
|
322 |
|
|
323 |
/** |
|
324 |
* If <code>p</code> is a value between 0 and 99, it shows a progress bar |
|
325 |
* in the left area of the status bar, and sets the specified progress. |
|
326 |
* If <code>p</code> is bigger than 99, it hides the progress bar. |
|
327 |
* |
|
328 |
* @param p The progress to set in the progress bar. If it is bigger |
|
329 |
* than 99, the task will be considered to be finished, and the |
|
330 |
* progress bar will be hidden. |
|
331 |
*/ |
|
332 |
public void setProgress(int p) { |
|
333 |
if (p < 100) { |
|
334 |
getProgressBar().setValue(p); |
|
335 |
getProgressBar().setVisible(true); |
|
336 |
} else { |
|
337 |
getProgressBar().setVisible(false); |
|
338 |
} |
|
339 |
|
|
340 |
getProgressBar().repaint(); |
|
341 |
} |
|
342 |
|
|
343 |
/** |
|
344 |
* Sets a label-set to be shown in the status bar. This method it is not |
|
345 |
* intended to be used directly, because the set will be overwritten when the selected |
|
346 |
* window changes. Use {@link MainFrame#setStatusBarLabels(Class, Label[])} |
|
347 |
* to permanently associate a label set with a window. |
|
348 |
* |
|
349 |
* @param labels The labels to set. |
|
350 |
* @see MainFrame#setStatusBarLabels(Class, Label[]) |
|
351 |
*/ |
|
352 |
public void setLabelSet(Label[] labels) { |
|
353 |
removeAllLabels(); |
|
354 |
idLabel.clear(); |
|
355 |
|
|
356 |
for (int i = 0; i < labels.length; i++) { |
|
357 |
JLabel lbl = new JLabel(); |
|
358 |
lbl.setPreferredSize(new Dimension(labels[i].getSize(), |
|
359 |
this.getHeight() - 2)); |
|
360 |
lbl.setSize(new Dimension(labels[i].getSize(), this.getHeight() - 2)); |
|
361 |
lbl.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
|
362 |
lbl.setName(labels[i].getId()); |
|
363 |
controlContainer.add(lbl); |
|
364 |
|
|
365 |
/* if (i != labels.length - 1){ |
|
366 |
this.add(new JSeparator(JSeparator.VERTICAL)); |
|
367 |
} |
|
368 |
*/ |
|
369 |
idLabel.put(labels[i].getId(), lbl); |
|
370 |
} |
|
371 |
|
|
372 |
JLabel[] configlabels = (JLabel[]) idLabel.values().toArray(new JLabel[0]); |
|
373 |
widthlabels = new int[configlabels.length]; |
|
374 |
|
|
375 |
for (int i = 0; i < labels.length; i++) { |
|
376 |
widthlabels[i] = configlabels[i].getWidth(); |
|
377 |
} |
|
378 |
|
|
379 |
this.repaint(); |
|
380 |
} |
|
381 |
|
|
382 |
/** |
|
383 |
* Hides the empty labels and adjust the space in the bar. |
|
384 |
*/ |
|
385 |
public void ajustar() { |
|
386 |
if (widthlabels == null) { |
|
387 |
return; |
|
388 |
} |
|
389 |
|
|
390 |
int ws = this.getWidth(); |
|
391 |
|
|
392 |
JLabel[] labels = (JLabel[]) idLabel.values().toArray(new JLabel[0]); |
|
393 |
|
|
394 |
/* double total = 1; |
|
395 |
for (int i = 0; i < widthlabels.length; i++) { |
|
396 |
if (labels[i].getText().compareTo("") != 0) { |
|
397 |
total += widthlabels[i]; |
|
398 |
} |
|
399 |
} |
|
400 |
double p = (ws - lblTexto.getWidth() - 20) / total; |
|
401 |
*/ |
|
402 |
for (int i = 0; i < labels.length; i++) { |
|
403 |
//if (labels[i] instanceof JLabel){ |
|
404 |
JLabel label = (JLabel) labels[i]; |
|
405 |
|
|
406 |
if (label.getText().compareTo("") != 0) { |
|
407 |
label.setVisible(true); |
|
408 |
label.setPreferredSize(new Dimension((int) (widthlabels[i]), |
|
409 |
this.getHeight() - 2)); |
|
410 |
} else { |
|
411 |
label.setVisible(false); |
|
412 |
|
|
413 |
//label.setPreferredSize(new Dimension(0,this.getHeight())); |
|
414 |
} |
|
415 |
|
Also available in: Unified diff