package Applications.ClientsFactory; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class PrincipalFrame extends JFrame implements ActionListener { private JMenuBar menuBar1 = new JMenuBar(); private JMenu menu; private JMenuItem menuItem; private BorderLayout borderLayout1 = new BorderLayout(); private JTabbedPane jTabbedPane = new JTabbedPane(); private void Ejecutar (int orden) { switch (orden) { case 0: PushSupplierPanel push_supplier_panel = new PushSupplierPanel (); jTabbedPane.addTab ("Push Supplier", push_supplier_panel); jTabbedPane.setSelectedComponent(push_supplier_panel); break; case 1: PullSupplierPanel pull_supplier_panel = new PullSupplierPanel (); jTabbedPane.addTab ("Pull Supplier", pull_supplier_panel); jTabbedPane.setSelectedComponent(pull_supplier_panel); break; case 2: PushConsumerPanel push_consumer_panel = new PushConsumerPanel (); jTabbedPane.addTab ("Push Consumer", push_consumer_panel); jTabbedPane.setSelectedComponent(push_consumer_panel); break; case 3: PullConsumerPanel pull_consumer_panel = new PullConsumerPanel (); jTabbedPane.addTab ("Pull Consumer", pull_consumer_panel); jTabbedPane.setSelectedComponent(pull_consumer_panel); break; case 5: Destruir (-1); break; case 7: System.exit (0); } } public void Destruir ( int indice ) { if ( indice == -1 ) { indice = jTabbedPane.getSelectedIndex(); if ( indice == -1 ) { JOptionPane.showMessageDialog(this, "Necesita seleccionar el componente a destruir.", "Error", JOptionPane.ERROR_MESSAGE); return; } } if (jTabbedPane.getComponentAt(indice) instanceof PushSupplierPanel) { PushSupplierPanel c = (PushSupplierPanel) jTabbedPane.getComponentAt(indice); jTabbedPane.remove(c); c.Destruir(); } else if (jTabbedPane.getComponentAt(indice) instanceof PushConsumerPanel) { PushConsumerPanel c = (PushConsumerPanel) jTabbedPane.getComponentAt(indice); jTabbedPane.remove(c); c.Destruir(); } else if (jTabbedPane.getComponentAt(indice) instanceof PullConsumerPanel) { PullConsumerPanel c = (PullConsumerPanel) jTabbedPane.getComponentAt(indice); jTabbedPane.remove(c); c.Destruir(); } else if (jTabbedPane.getComponentAt(indice) instanceof PullSupplierPanel) { PullSupplierPanel c = (PullSupplierPanel) jTabbedPane.getComponentAt(indice); jTabbedPane.remove(c); c.Destruir(); } } String ordenes [] = { "Crear Push Supplier", "Crear Pull Supplier", "Crear Push Consumer", "Crear Pull Consumer", "", "Destruir", "", "Salir" }; private void CrearMenu () { menu = new JMenu(); menu.setText ("Acciones"); for ( int i =0; i = 0 ; i -- ) { Destruir ( i ); } System.exit(0); } } } e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


DISEÑO E IMPLEMENTACIÓN DEL SERVICIO DE EVENTOS DE CORBA PARA JAVA IDL

: Díaz Caballero, Victor M.
: Ingeniería Telecomunicación
Contenido del proyecto: