forked from Coded/SIPRP
no message
git-svn-id: https://svn.coded.pt/svn/SIPRP@271 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
parent
c244bb3848
commit
595f1189ce
@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* PresencasActionFactory.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.medicina.presencas;
|
||||||
|
|
||||||
|
import com.evolute.utils.data.IDObject;
|
||||||
|
import com.evolute.utils.ui.panel.multipleactionlist.ActionFactory;
|
||||||
|
import javax.swing.Action;
|
||||||
|
import siprp.medicina.presencas.actions.DesmarcadoSHSTAction;
|
||||||
|
import siprp.medicina.presencas.actions.DesmarcadoTrabalhadorAction;
|
||||||
|
import siprp.medicina.presencas.actions.FaltouAction;
|
||||||
|
import siprp.medicina.presencas.actions.RealizouAction;
|
||||||
|
import siprp.medicina.presencas.actions.RealizouParcialmenteAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class PresencasActionFactory implements ActionFactory
|
||||||
|
{
|
||||||
|
public static final int REALIZOU = 0;
|
||||||
|
public static final int REALIZOU_PARCIALMENTE = 1;
|
||||||
|
public static final int TRABALHADOR_DESMARCOU = 2;
|
||||||
|
public static final int SHST_DESMARCOU = 3;
|
||||||
|
public static final int FALTOU = 4;
|
||||||
|
|
||||||
|
protected final int TIPO;
|
||||||
|
|
||||||
|
/** Creates a new instance of PresencasActionFactory */
|
||||||
|
public PresencasActionFactory( int tipo )
|
||||||
|
{
|
||||||
|
TIPO = tipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action createAction(IDObject[] objects)
|
||||||
|
{
|
||||||
|
switch( TIPO )
|
||||||
|
{
|
||||||
|
case SHST_DESMARCOU:
|
||||||
|
return new DesmarcadoSHSTAction( DesmarcadoSHSTAction.MULTIPLE );
|
||||||
|
|
||||||
|
case FALTOU:
|
||||||
|
return new FaltouAction( FaltouAction.MULTIPLE );
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action createAction(IDObject object)
|
||||||
|
{
|
||||||
|
switch( TIPO )
|
||||||
|
{
|
||||||
|
case REALIZOU:
|
||||||
|
return new RealizouAction();
|
||||||
|
|
||||||
|
case REALIZOU_PARCIALMENTE:
|
||||||
|
return new RealizouParcialmenteAction();
|
||||||
|
|
||||||
|
case TRABALHADOR_DESMARCOU:
|
||||||
|
return new DesmarcadoTrabalhadorAction();
|
||||||
|
|
||||||
|
case SHST_DESMARCOU:
|
||||||
|
return new DesmarcadoSHSTAction( DesmarcadoSHSTAction.SINGLE );
|
||||||
|
|
||||||
|
case FALTOU:
|
||||||
|
return new FaltouAction( FaltouAction.SINGLE );
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* RegistarPresencasWindow.java
|
||||||
|
*
|
||||||
|
* Created on January 31, 2007, 3:09 PM
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.medicina.presencas;
|
||||||
|
|
||||||
|
import com.evolute.utils.data.IDObject;
|
||||||
|
import com.evolute.utils.data.MappableObject;
|
||||||
|
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 javax.swing.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class RegistarPresencasWindow extends JFrame
|
||||||
|
implements ActionListener
|
||||||
|
{
|
||||||
|
protected JCalendarPanel dataPanel;
|
||||||
|
protected JButton carregarButton;
|
||||||
|
protected JScrollPane listScroll;
|
||||||
|
protected MultipleActionListPanel listPanel;
|
||||||
|
|
||||||
|
public static void main( String args[] )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
RegistarPresencasWindow window = new RegistarPresencasWindow();
|
||||||
|
window.setVisible( true );
|
||||||
|
window.setExtendedState( window.getExtendedState() | MAXIMIZED_BOTH );
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates a new instance of RegistarPresencasWindow */
|
||||||
|
public RegistarPresencasWindow()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
setupComponents();
|
||||||
|
setExtendedState( getExtendedState() | MAXIMIZED_BOTH );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupComponents()
|
||||||
|
{
|
||||||
|
JLabel dataLabel = new JLabel( "Data" );
|
||||||
|
dataPanel = new JCalendarPanel( this );
|
||||||
|
carregarButton = new JButton( "Carregar" );
|
||||||
|
carregarButton.addActionListener( this );
|
||||||
|
|
||||||
|
PresencasActionFactory realizouFactory = new PresencasActionFactory( PresencasActionFactory.REALIZOU );
|
||||||
|
PresencasActionFactory realizouParcialmenteFactory = new PresencasActionFactory( PresencasActionFactory.REALIZOU_PARCIALMENTE );
|
||||||
|
PresencasActionFactory trabalhadorDesmarcouFactory = new PresencasActionFactory( PresencasActionFactory.TRABALHADOR_DESMARCOU );
|
||||||
|
PresencasActionFactory shstDesmarcouFactory = new PresencasActionFactory( PresencasActionFactory.SHST_DESMARCOU );
|
||||||
|
PresencasActionFactory faltouFactory = new PresencasActionFactory( PresencasActionFactory.FALTOU );
|
||||||
|
|
||||||
|
getContentPane().setLayout( new BorderLayout() );
|
||||||
|
JPanel upperPanel = new JPanel();
|
||||||
|
getContentPane().add( upperPanel, BorderLayout.NORTH );
|
||||||
|
|
||||||
|
listPanel =
|
||||||
|
new MultipleActionListPanel(
|
||||||
|
new PresencasActionFactory[]{ shstDesmarcouFactory, faltouFactory },
|
||||||
|
new PresencasActionFactory[]{ realizouFactory, realizouParcialmenteFactory,
|
||||||
|
trabalhadorDesmarcouFactory, shstDesmarcouFactory,
|
||||||
|
faltouFactory } );
|
||||||
|
listScroll = new JScrollPane( listPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
||||||
|
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
|
||||||
|
getContentPane().add( listScroll, BorderLayout.CENTER );
|
||||||
|
|
||||||
|
upperPanel.setLayout( new FlowLayout( FlowLayout.CENTER ) );
|
||||||
|
upperPanel.add( dataLabel );
|
||||||
|
upperPanel.add( dataPanel );
|
||||||
|
upperPanel.add( carregarButton );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed( ActionEvent e )
|
||||||
|
{
|
||||||
|
listPanel.showList( new IDObject[]{
|
||||||
|
new MappableObject( new Integer( 1 ), "Sr. Fernando da loja ali da esquina" ),
|
||||||
|
new MappableObject( new Integer( 1 ), "Sr. António da loja ao lado da do Sr. Fernando" ) } );
|
||||||
|
listScroll.setViewportView( listPanel );
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* DesmarcadoSHSTAction.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.medicina.presencas.actions;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class DesmarcadoSHSTAction extends AbstractAction
|
||||||
|
{
|
||||||
|
public static final int SINGLE = 0;
|
||||||
|
public static final int MULTIPLE = 1;
|
||||||
|
|
||||||
|
/** Creates a new instance of DesmarcadoSHSTAction */
|
||||||
|
public DesmarcadoSHSTAction( int cardinality )
|
||||||
|
{
|
||||||
|
super( cardinality == SINGLE ? "SIPRP Desmarcou" : "Marcar restantes como \"SIPRP desmarcou\"" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* DesmarcadoTrabalhadorAction.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.medicina.presencas.actions;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class DesmarcadoTrabalhadorAction extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Creates a new instance of DesmarcadoTrabalhadorAction */
|
||||||
|
public DesmarcadoTrabalhadorAction()
|
||||||
|
{
|
||||||
|
super( "Desmarcou" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* FaltouAction.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.medicina.presencas.actions;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class FaltouAction extends AbstractAction
|
||||||
|
{
|
||||||
|
public static final int SINGLE = 0;
|
||||||
|
public static final int MULTIPLE = 1;
|
||||||
|
|
||||||
|
/** Creates a new instance of FaltouAction */
|
||||||
|
public FaltouAction( int cardinality )
|
||||||
|
{
|
||||||
|
super( cardinality == SINGLE ? "Faltou" : "Marcar restantes como \"Faltou\"" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* RealizouAction.java
|
||||||
|
*
|
||||||
|
* Created on January 31, 2007, 6:20 PM
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.medicina.presencas.actions;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class RealizouAction extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Creates a new instance of RealizouAction */
|
||||||
|
public RealizouAction()
|
||||||
|
{
|
||||||
|
super( "Realizou" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* RealizouParcialmenteAction.java
|
||||||
|
*
|
||||||
|
* Created on January 31, 2007, 6:20 PM
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.medicina.presencas.actions;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import javax.swing.AbstractAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class RealizouParcialmenteAction extends AbstractAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Creates a new instance of RealizouParcialmenteAction */
|
||||||
|
public RealizouParcialmenteAction()
|
||||||
|
{
|
||||||
|
super( "Realizou Parcialmente" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue