Revision 34304 trunk/extensions/extGraph/src/org/gvsig/graph/gui/RouteControlPanel.java

View differences:

RouteControlPanel.java
166 166

  
167 167
import javax.swing.ImageIcon;
168 168
import javax.swing.JCheckBox;
169
import javax.swing.JComboBox;
170 169
import javax.swing.JLabel;
171 170
import javax.swing.JOptionPane;
172 171
import javax.swing.JPanel;
......
846 845
		return btnSaveStage;
847 846
	}
848 847

  
849
	class FormatSelectionPanel extends JPanel implements IWindow {
850

  
851
		JComboBox formats;
852
		WindowInfo wi = null;
853
		private boolean isOkButtonPressed = false;;
854

  
855
		public FormatSelectionPanel(String introductoryText) {
856
			super(new BorderLayout());
857
			String[] formatos = { "SHP", "DXF", "POSTGIS" }; //, "GML" };
858
			formats = new JComboBox(formatos);
859
			GridBagLayoutPanel contentPanel =
860
				new GridBagLayoutPanel();
861
			contentPanel.addComponent(new JLabel(introductoryText));
862
			contentPanel.addComponent(formats);
863
			JButton okButton = new JButton(PluginServices.getText(null,
864
					"Aceptar"));
865
			okButton.addActionListener(new ActionListener() {
866
				public void actionPerformed(ActionEvent arg0) {
867
					setIsOkButtonPressed(true);
868
					close();
869
				}
870
			});
871
			contentPanel.addComponent(okButton);
872

  
873
			add(contentPanel);
874
		}
875

  
876
		protected void setIsOkButtonPressed(boolean b) {
877
			this.isOkButtonPressed  = b;
878
			
879
		}
880

  
881
		void close() {
882
			PluginServices.getMDIManager().closeWindow(this);
883
		}
884

  
885
		public String getSelectedFormat() {
886
			return (String) formats.getSelectedItem();
887
		}
888

  
889
		public WindowInfo getWindowInfo() {
890
			if (wi == null) {
891
				wi = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.PALETTE);
892
				wi.setTitle(PluginServices
893
						.getText(null, "Format_selection"));// Internacionalizar
894
																// esto
895
				wi.setWidth(400);
896
				wi.setHeight(55);
897
			}
898
			return wi;
899
		}
900

  
901
		public Object getWindowProfile() {
902
			return WindowInfo.DIALOG_PROFILE;
903
		}
904

  
905
		public boolean isOkButtonPressed() {
906
			return isOkButtonPressed;
907
		}
908

  
909
	}
910

  
911 848
	public void actionPerformed(ActionEvent e) {
912 849
		Component c = (Component) e.getSource();
913 850
		if (c.equals(getBtnLoadStage())) {

Also available in: Unified diff