From 2a859d0c3bb4121282d58352a3bb95d448ca5cd9 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Wed, 31 Jan 2007 19:26:20 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@273 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/SIPRPTracker.java | 25 ++++++++--- .../presencas/RegistarPresencasWindow.java | 42 ++++++++++++++++++- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/trunk/siprp/SIPRPTracker.java b/trunk/siprp/SIPRPTracker.java index b6fc4707..121336d8 100644 --- a/trunk/siprp/SIPRPTracker.java +++ b/trunk/siprp/SIPRPTracker.java @@ -6,14 +6,11 @@ package siprp; -import javax.swing.*; import javax.swing.tree.*; import java.util.*; import com.evolute.utils.*; import com.evolute.utils.tracker.*; - -import siprp.*; import siprp.ficha.*; import siprp.clientes.*; import siprp.estatistica.*; @@ -21,6 +18,7 @@ import siprp.higiene.mapa.*; import siprp.higiene.marcacoes.*; import siprp.impressaofichas.*; import siprp.medicina.*; +import siprp.medicina.presencas.RegistarPresencasWindow; import siprp.pesquisas.*; /** * @@ -32,6 +30,8 @@ public class SIPRPTracker extends WindowTracker public static final String CRIACAO_FICHA_APTIDAO = "Cria\u00e7\u00e3o de Fichas de Aptid\u00e3o"; public static final String GESTAO_CLIENTES = "Gest\u00e3o de Clientes"; public static final String MEDICINA = "Medicina"; + public static final String MEDICINA_MARCACOES = "Marca\u00e7\u00f5es"; + public static final String MEDICINA_PRESENCAS = "Presen\u00e7as"; public static final String HIGIENE_SEGURANCA = "Higiene e Seguran\u00e7a"; public static final String RELATORIO_ANUAL = "Relat\u00f3rio Anual"; public static final String LISTAGENS = "Listagens"; @@ -120,9 +120,11 @@ public class SIPRPTracker extends WindowTracker return clientesWindow; } } ); - - rootNode.add( new DefaultMutableTreeNode( MEDICINA ) ); - creators.put( MEDICINA, new WindowCreator() { + + DefaultMutableTreeNode medicinaNode = new DefaultMutableTreeNode( MEDICINA ); + + medicinaNode.add( new DefaultMutableTreeNode( MEDICINA_MARCACOES ) ); + creators.put( MEDICINA_MARCACOES, new WindowCreator() { public TrackableWindow create() throws Exception { @@ -135,6 +137,17 @@ public class SIPRPTracker extends WindowTracker } } ); + medicinaNode.add( new DefaultMutableTreeNode( MEDICINA_PRESENCAS ) ); + creators.put( MEDICINA_PRESENCAS, new WindowCreator() { + public TrackableWindow create() + throws Exception + { + return new RegistarPresencasWindow(); + } + } ); + + rootNode.add( medicinaNode ); + DefaultMutableTreeNode higieneNode = new DefaultMutableTreeNode( HIGIENE_SEGURANCA ); higieneNode.add( new DefaultMutableTreeNode( MarcacoesHigieneWindow.TITLE ) ); diff --git a/trunk/siprp/medicina/presencas/RegistarPresencasWindow.java b/trunk/siprp/medicina/presencas/RegistarPresencasWindow.java index 4a87e66d..ed70ba49 100644 --- a/trunk/siprp/medicina/presencas/RegistarPresencasWindow.java +++ b/trunk/siprp/medicina/presencas/RegistarPresencasWindow.java @@ -11,12 +11,15 @@ package siprp.medicina.presencas; import com.evolute.utils.data.IDObject; import com.evolute.utils.data.MappableObject; +import com.evolute.utils.tracker.TrackableWindow; import com.evolute.utils.ui.calendar.JCalendarPanel; import com.evolute.utils.ui.panel.multipleactionlist.MultipleActionListPanel; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import javax.swing.*; /** @@ -24,7 +27,7 @@ import javax.swing.*; * @author fpalma */ public class RegistarPresencasWindow extends JFrame - implements ActionListener + implements ActionListener, TrackableWindow { protected JCalendarPanel dataPanel; protected JButton carregarButton; @@ -44,7 +47,7 @@ public class RegistarPresencasWindow extends JFrame throws Exception { setupComponents(); - setExtendedState( getExtendedState() | MAXIMIZED_BOTH ); + } private void setupComponents() @@ -80,6 +83,14 @@ public class RegistarPresencasWindow extends JFrame upperPanel.add( dataPanel ); upperPanel.add( carregarButton ); + setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE ); + addWindowListener( new WindowAdapter(){ + public void windowClosing( WindowEvent e ) + { + close(); + } + } ); + } public void actionPerformed( ActionEvent e ) @@ -89,4 +100,31 @@ public class RegistarPresencasWindow extends JFrame new MappableObject( new Integer( 1 ), "Sr. António da loja ao lado da do Sr. Fernando" ) } ); listScroll.setViewportView( listPanel ); } + + public void refresh() + { + } + + public void open() + { + setVisible( true ); + setExtendedState( getExtendedState() | MAXIMIZED_BOTH ); + } + + public void close() + { + SwingUtilities.invokeLater( new Runnable() { + public void run() + { + setVisible( false ); + dispose(); + } + } ); + } + + public boolean closeIfPossible() + { + close(); + return true; + } }