forked from Coded/SIPRP
no message
git-svn-id: https://svn.coded.pt/svn/SIPRP@302 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
parent
ee2855aa36
commit
8fb2476779
@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* LembretesRemarcacaoPanel.java
|
||||||
|
*
|
||||||
|
* Created on 13 de Fevereiro de 2007, 23:24
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.lembretes.remarcacoes;
|
||||||
|
|
||||||
|
import com.evolute.utils.data.IDObject;
|
||||||
|
import com.evolute.utils.data.MappableObject;
|
||||||
|
import com.evolute.utils.ui.panel.multipleactionlist.MultipleActionListPanel;
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.swing.*;
|
||||||
|
import siprp.lembretes.Lembrete;
|
||||||
|
import siprp.lembretes.LembretesConstants;
|
||||||
|
import siprp.lembretes.LembretesDataProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Frederico
|
||||||
|
*/
|
||||||
|
public class LembretesRemarcacaoPanel extends JPanel
|
||||||
|
implements LembretesConstants
|
||||||
|
{
|
||||||
|
protected JScrollPane listTrabalhadoresScroll;
|
||||||
|
protected JScrollPane listEstabelecimentosScroll;
|
||||||
|
protected MultipleActionListPanel listTrabalhadoresPanel;
|
||||||
|
protected MultipleActionListPanel listEstabelecimentosPanel;
|
||||||
|
|
||||||
|
protected LembretesDataProvider provider;
|
||||||
|
|
||||||
|
/** Creates a new instance of LembretesRemarcacaoPanel */
|
||||||
|
public LembretesRemarcacaoPanel()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
provider = LembretesDataProvider.getProvider();
|
||||||
|
setupComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupComponents()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
listTrabalhadoresPanel =
|
||||||
|
new MultipleActionListPanel(
|
||||||
|
new RemarcacoesActionFactory[]{ },
|
||||||
|
new RemarcacoesActionFactory[]{ new RemarcacoesActionFactory( RemarcacoesActionFactory.TRABALHADOR ) } );
|
||||||
|
listTrabalhadoresScroll =
|
||||||
|
new JScrollPane( listTrabalhadoresPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
||||||
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
|
||||||
|
listEstabelecimentosPanel =
|
||||||
|
new MultipleActionListPanel(
|
||||||
|
new RemarcacoesActionFactory[]{ },
|
||||||
|
new RemarcacoesActionFactory[]{ new RemarcacoesActionFactory( RemarcacoesActionFactory.ESTABELECIMENTO ) } );
|
||||||
|
listEstabelecimentosScroll =
|
||||||
|
new JScrollPane( listTrabalhadoresPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
||||||
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
|
||||||
|
setLayout( new GridLayout( 1, 2 ) );
|
||||||
|
JPanel trabalhadoresPanel = new JPanel();
|
||||||
|
JPanel estabelecimentosPanel = new JPanel();
|
||||||
|
add( trabalhadoresPanel );
|
||||||
|
add( estabelecimentosPanel );
|
||||||
|
|
||||||
|
trabalhadoresPanel.setLayout( new BorderLayout() );
|
||||||
|
trabalhadoresPanel.add( new JLabel( "Consultas / ECDs", JLabel.CENTER ), BorderLayout.NORTH );
|
||||||
|
trabalhadoresPanel.add( listTrabalhadoresScroll, BorderLayout.CENTER );
|
||||||
|
|
||||||
|
estabelecimentosPanel.setLayout( new BorderLayout() );
|
||||||
|
estabelecimentosPanel.add( new JLabel( "Higiene e Seguran\u00e7a", JLabel.CENTER ), BorderLayout.NORTH );
|
||||||
|
estabelecimentosPanel.add( listEstabelecimentosScroll, BorderLayout.CENTER );
|
||||||
|
|
||||||
|
Lembrete lembretes[] =
|
||||||
|
provider.getLembretesByTipo(
|
||||||
|
provider.getTipoLembreteByCodigo( CODE_REMARCACOES ).getID() );
|
||||||
|
System.out.println( "\nLEMBRETES: " + lembretes.length ) ;
|
||||||
|
List<IDObject> trabalhadores = new Vector<IDObject>();
|
||||||
|
List<IDObject> estabelecimentos = new Vector<IDObject>();
|
||||||
|
for( int n = 0; n < lembretes.length; n++ )
|
||||||
|
{
|
||||||
|
if( lembretes[ n ].getMarcacaoTrabalhadorID() != null )
|
||||||
|
{
|
||||||
|
trabalhadores.add( new MappableObject(
|
||||||
|
lembretes[ n ].getMarcacaoTrabalhadorID(),
|
||||||
|
lembretes[ n ].getDescricao() ) );
|
||||||
|
}
|
||||||
|
else if( lembretes[ n ].getMarcacaoEstabelecimentoID() != null )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println( "\nTRABALHADORES: " + trabalhadores.size() ) ;
|
||||||
|
listTrabalhadoresPanel.showList( trabalhadores.toArray( new IDObject[ trabalhadores.size() ] ) );
|
||||||
|
listEstabelecimentosPanel.showList( estabelecimentos.toArray( new IDObject[ estabelecimentos.size() ] ) );
|
||||||
|
|
||||||
|
listTrabalhadoresScroll.setViewportView( listTrabalhadoresPanel );
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* RemarcacoesActionFactory.java
|
||||||
|
*
|
||||||
|
* Created on January 31, 2007, 6:37 PM
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.lembretes.remarcacoes;
|
||||||
|
|
||||||
|
import com.evolute.utils.data.IDObject;
|
||||||
|
import com.evolute.utils.ui.panel.multipleactionlist.ActionFactory;
|
||||||
|
import javax.swing.Action;
|
||||||
|
import siprp.lembretes.remarcacoes.actions.TratarMarcacaoEstabelecimentoAction;
|
||||||
|
import siprp.lembretes.remarcacoes.actions.TratarMarcacaoTrabalhadorAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class RemarcacoesActionFactory implements ActionFactory<IDObject>
|
||||||
|
{
|
||||||
|
public static final int TRABALHADOR = 0;
|
||||||
|
public static final int ESTABELECIMENTO = 1;
|
||||||
|
|
||||||
|
protected final int TIPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of RemarcacoesActionFactory
|
||||||
|
*/
|
||||||
|
public RemarcacoesActionFactory( int tipo )
|
||||||
|
{
|
||||||
|
TIPO = tipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action createAction(IDObject[] objects)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action createAction(IDObject object)
|
||||||
|
{
|
||||||
|
switch( TIPO )
|
||||||
|
{
|
||||||
|
case TRABALHADOR:
|
||||||
|
return new TratarMarcacaoTrabalhadorAction( object );
|
||||||
|
|
||||||
|
case ESTABELECIMENTO:
|
||||||
|
return new TratarMarcacaoEstabelecimentoAction( object );
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* tratarMarcacaoTrabalhadorAction.java
|
||||||
|
*
|
||||||
|
* Created on January 31, 2007, 6:21 PM
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.lembretes.remarcacoes.actions;
|
||||||
|
|
||||||
|
import com.evolute.utils.data.IDObject;
|
||||||
|
import com.evolute.utils.ui.DialogException;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class TratarMarcacaoEstabelecimentoAction extends AbstractAction
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Creates a new instance of tratarMarcacaoTrabalhadorAction
|
||||||
|
*/
|
||||||
|
public TratarMarcacaoEstabelecimentoAction( IDObject marcacaoID )
|
||||||
|
{
|
||||||
|
super( "Tratar" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
DialogException.showExceptionMessage( ex, "Erro a marcar", true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* TratarMarcacaoTrabalhadorAction.java
|
||||||
|
*
|
||||||
|
* Created on January 31, 2007, 6:21 PM
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.lembretes.remarcacoes.actions;
|
||||||
|
|
||||||
|
import com.evolute.utils.data.IDObject;
|
||||||
|
import com.evolute.utils.ui.DialogException;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class TratarMarcacaoTrabalhadorAction extends AbstractAction
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Creates a new instance of TratarMarcacaoTrabalhadorAction
|
||||||
|
*/
|
||||||
|
public TratarMarcacaoTrabalhadorAction( IDObject marcacaoID )
|
||||||
|
{
|
||||||
|
super( "Tratar" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
DialogException.showExceptionMessage( ex, "Erro a marcar", true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* MarcacaoConsultaExtendedPanel.java
|
||||||
|
*
|
||||||
|
* Created on 13 de Fevereiro de 2007, 20:36
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.medicina;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Frederico
|
||||||
|
*/
|
||||||
|
public class MarcacaoConsultaExtendedPanel extends JPanel
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Creates a new instance of MarcacaoConsultaExtendedPanel */
|
||||||
|
public MarcacaoConsultaExtendedPanel()
|
||||||
|
{
|
||||||
|
setupComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupComponents()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in new issue