git-svn-id: https://svn.coded.pt/svn/SIPRP@737 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Tiago Simão 18 years ago
parent cda9a95e2a
commit d6f3da1ac7

@ -1,4 +1,4 @@
package leaf;
package leaf.data;
import java.util.ArrayList;
import java.util.Collection;

@ -1,4 +1,4 @@
package leaf;
package leaf.data;
public class Pair<CarClass extends Comparable<CarClass>, CdrClass> implements Comparable<Pair<CarClass, CdrClass>>
{

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import java.awt.Color;
import java.awt.GradientPaint;

@ -1,10 +1,8 @@
package leaf;
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
@ -13,8 +11,6 @@ import java.util.Date;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import com.toedter.calendar.JCalendar;
@ -31,8 +27,6 @@ public class LeafCalendarDialog extends JDialog
private boolean clear = false;
private Calendar cal = null;
private JComponent parent = null;
private boolean enableClean = true;
@ -42,10 +36,9 @@ public class LeafCalendarDialog extends JDialog
private final JCalendar calendarPanel = new JCalendar( null, null, false, false );
/** Creates a new instance of JCalendarDialog */
public LeafCalendarDialog(JFrame parentFrame, JComponent parent)
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent)
{
super(parentFrame);
this.parent = parent;
this.enableClean = true;
setModal( true );
setupComponents();
@ -55,10 +48,9 @@ public class LeafCalendarDialog extends JDialog
}
public LeafCalendarDialog(JFrame parentFrame, JComponent parent, boolean enableClean )
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent, boolean enableClean )
{
super(parentFrame);
this.parent = parent;
this.enableClean = enableClean;
setModal( true );
setupComponents();
@ -67,10 +59,9 @@ public class LeafCalendarDialog extends JDialog
setVisible( true );
}
public LeafCalendarDialog(JFrame parentFrame, JComponent parent, boolean enableClean, boolean enableCancel )
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent, boolean enableClean, boolean enableCancel )
{
super(parentFrame);
this.parent = parent;
this.enableClean = enableClean;
this.enableCancel = enableCancel;
setModal( true );

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
@ -31,6 +31,8 @@ import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import leaf.data.OrderedMap;
public class LeafInputField<ObjClass extends Object> extends JPanel implements FocusListener, MouseListener, PropertyChangeListener
{

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import javax.swing.plaf.metal.MetalLookAndFeel;

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
@ -24,6 +24,8 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.ScrollPaneConstants;
import leaf.data.OrderedMap;
public class LeafOptionDialog<KeyClass extends Object> extends JDialog
{
@ -78,7 +80,7 @@ public class LeafOptionDialog<KeyClass extends Object> extends JDialog
public LeafOptionDialog( LeafWindow owner, OrderedMap<KeyClass> orderedMap, Map<KeyClass, Boolean> chosen, Map<KeyClass, Boolean> enabled, String message, String okButton)
{
super();
super( owner );
ordered = true;
this.message = message;
okLabel = okButton;

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
public class LeafRuntimeException extends RuntimeException
{

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;

@ -1,9 +1,11 @@
package leaf;
package leaf.ui;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import leaf.data.OrderedMap;
import siprp.database.cayenne.objects.TrabalhadoresEcd;

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
@ -40,7 +40,7 @@ public class LeafTextDialog extends JDialog
private TableLayout expandedLayout = null;
/** Creates a new instance of JCalendarDialog */
public LeafTextDialog(JFrame parentFrame, JComponent parent, String defaultText, boolean expanded)
public LeafTextDialog( LeafWindow parentFrame, JComponent parent, String defaultText, boolean expanded )
{
super( parentFrame );
this.defaultText = defaultText == null ? "" : defaultText;

@ -1,4 +1,4 @@
package leaf;
package leaf.ui;
import java.awt.AWTException;
import java.awt.Dimension;

@ -1,8 +1,8 @@
package leaf;
package leaf.ui;
import static info.clearthought.layout.TableLayoutConstants.FILL;
import static leaf.LeafLogic.ACTION_CANCEL;
import static leaf.LeafLogic.ACTION_STARTUP;
import static leaf.ui.LeafLogic.ACTION_CANCEL;
import static leaf.ui.LeafLogic.ACTION_STARTUP;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
@ -38,9 +38,10 @@ import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.table.TableModel;
import leaf.LeafLogic.Action;
import leaf.LeafLogic.LeafLogicActionBinding;
import leaf.LeafLogic.LeafUIActionBinding;
import leaf.data.Pair;
import leaf.ui.LeafLogic.Action;
import leaf.ui.LeafLogic.LeafLogicActionBinding;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import com.evolute.utils.tables.BaseTable;
import com.evolute.utils.tables.ColumnizedMappable;

@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import leaf.OrderedMap;
import leaf.data.OrderedMap;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcds;
import siprp.medicina.MedicinaConstants;

@ -5,7 +5,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import leaf.OrderedMap;
import leaf.data.OrderedMap;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsDatas;
import siprp.medicina.MedicinaConstants;

@ -94,6 +94,16 @@ public class MedicinaDAO extends MainDAO implements MedicinaConstants
return object;
}
public void deleteObject( BaseObject object )
{
if( object != null )
{
context.deleteObject( object );
context.commitChanges();
}
}
public void rollback()
{
context.rollbackChanges();

@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import leaf.LeafLogic;
import leaf.ui.LeafLogic;
import siprp.database.cayenne.objects.Prestadores;
import siprp.database.cayenne.objects.TrabalhadoresEcd;
import siprp.database.cayenne.providers.MedicinaDAO;

@ -17,12 +17,12 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import leaf.LeafButton;
import leaf.LeafInputField;
import leaf.LeafTableModel;
import leaf.LeafWindow;
import leaf.OrderedMap;
import leaf.LeafLogic.LeafUIActionBinding;
import leaf.data.OrderedMap;
import leaf.ui.LeafButton;
import leaf.ui.LeafInputField;
import leaf.ui.LeafTableModel;
import leaf.ui.LeafWindow;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos;
import siprp.database.cayenne.objects.Prestadores;

@ -5,8 +5,8 @@ import java.util.List;
import javax.swing.tree.DefaultMutableTreeNode;
import leaf.LeafLogic;
import leaf.LeafWindow.LeafObject;
import leaf.ui.LeafLogic;
import leaf.ui.LeafWindow.LeafObject;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos;
@ -18,6 +18,7 @@ import siprp.database.cayenne.objects.TrabalhadoresConsultas;
import siprp.database.cayenne.objects.TrabalhadoresConsultasDatas;
import siprp.database.cayenne.objects.TrabalhadoresConsultasDatasEmails;
import siprp.database.cayenne.objects.TrabalhadoresConsultasDatasObservacoes;
import siprp.database.cayenne.objects.TrabalhadoresEcd;
import siprp.database.cayenne.objects.TrabalhadoresEcds;
import siprp.database.cayenne.objects.TrabalhadoresEcdsDatas;
import siprp.database.cayenne.objects.TrabalhadoresEcdsDatasEmails;
@ -155,6 +156,12 @@ public class MedicinaProcessoLogic extends LeafLogic
@Action(isSave = false)
public static final String APAGAR_PROCESSO = "APAGAR_PROCESSO";
@Action(isSave = false)
public static final String APAGAR_CONSULTA = "APAGAR_CONSULTA";
@Action(isSave = false)
public static final String APAGAR_EXAME = "APAGAR_EXAME";
@Action(isSave = false)
public static final String REFRESH = "REFRESH";
@ -207,7 +214,9 @@ public class MedicinaProcessoLogic extends LeafLogic
})
public TrabalhadoresProcesso currentProcesso = null;
@LeafObject(useWith = SAVE_CONSULTA)
@LeafObject(useWith = {
SAVE_CONSULTA, APAGAR_CONSULTA
})
public TrabalhadoresConsultas currentConsulta = null;
@LeafObject(useWith = SAVE_CONSULTA_MARCACAO)
@ -233,9 +242,11 @@ public class MedicinaProcessoLogic extends LeafLogic
})
public TrabalhadoresEcdsDatas currentExameMarcacao = null;
@LeafObject(useWith = SAVE_EXAME)
@LeafObject(useWith = {
SAVE_EXAME, APAGAR_EXAME
})
public TrabalhadoresEcds currentExame = null;
public Integer currentFichaExameID = null;
public MedicinaProcessoLogic()
@ -742,6 +753,88 @@ public class MedicinaProcessoLogic extends LeafLogic
runActionLater( REFRESH );
}
@LeafLogicActionBinding(actions = {
APAGAR_CONSULTA, APAGAR_EXAME
})
public void deleteObject( BaseObject object )
{
if( object instanceof TrabalhadoresConsultas )
{
apagarConsulta( (TrabalhadoresConsultas) object );
}
if( object instanceof TrabalhadoresEcds )
{
apagarExame( (TrabalhadoresEcds) object );
}
runActionLater( SELECT_PROCESSO );
}
private void apagarConsulta( TrabalhadoresConsultas consulta )
{
List<TrabalhadoresConsultasDatas> marcacoes = consulta.getTrabalhadoresConsultasDatasArray();
if( marcacoes != null )
{
for( TrabalhadoresConsultasDatas marcacao : marcacoes )
{
List<TrabalhadoresConsultasDatasEmails> emails = marcacao.getTrabalhadoresConsultasDatasEmailsArray();
if( emails != null )
{
for( TrabalhadoresConsultasDatasEmails email : emails )
{
provider.deleteObject( email );
}
}
List<TrabalhadoresConsultasDatasObservacoes> observacoes = marcacao.getTrabalhadoresConsultasDatasObservacoesArray();
if( observacoes != null )
{
for( TrabalhadoresConsultasDatasObservacoes observacao : observacoes )
{
provider.deleteObject( observacao );
}
}
provider.deleteObject( marcacao );
}
provider.deleteObject( consulta );
}
}
private void apagarExame( TrabalhadoresEcds exame )
{
List<TrabalhadoresEcdsDatas> marcacoes = exame.getTrabalhadoresEcdsDatasArray();
if( marcacoes != null )
{
for( TrabalhadoresEcdsDatas marcacao : marcacoes )
{
List<TrabalhadoresEcd> ecds = marcacao.getTrabalhadoresEcdArray();
if( ecds != null )
{
for( TrabalhadoresEcd ecd : ecds )
{
provider.deleteObject( ecd );
}
}
List<TrabalhadoresEcdsDatasEmails> emails = marcacao.getTrabalhadoresEcdsDatasEmailsArray();
if( emails != null )
{
for( TrabalhadoresEcdsDatasEmails email : emails )
{
provider.deleteObject( email );
}
}
List<TrabalhadoresEcdsDatasObservacoes> observacoes = marcacao.getTrabalhadoresEcdsDatasObservacoesArray();
if( observacoes != null )
{
for( TrabalhadoresEcdsDatasObservacoes observacao : observacoes )
{
provider.deleteObject( observacao );
}
}
provider.deleteObject( marcacao );
}
provider.deleteObject( exame );
}
}
@LeafLogicActionBinding(actions = ACTION_CANCEL)
public void abortAction()
{

@ -11,12 +11,12 @@ import java.util.List;
import javax.swing.JSeparator;
import leaf.LeafCalendarDialog;
import leaf.LeafOptionDialog;
import leaf.LeafTextDialog;
import leaf.LeafWindow;
import leaf.OrderedMap;
import leaf.LeafLogic.LeafUIActionBinding;
import leaf.data.OrderedMap;
import leaf.ui.LeafCalendarDialog;
import leaf.ui.LeafOptionDialog;
import leaf.ui.LeafTextDialog;
import leaf.ui.LeafWindow;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import siprp.database.cayenne.objects.Lembretes;
import siprp.database.cayenne.objects.PrtGruposProtocolo;
import siprp.database.cayenne.objects.Trabalhadores;

@ -29,9 +29,9 @@ import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import leaf.LeafButton;
import leaf.LeafWindow;
import leaf.LeafWindow.ActionActivation;
import leaf.ui.LeafButton;
import leaf.ui.LeafWindow;
import leaf.ui.LeafWindow.ActionActivation;
import org.apache.cayenne.conf.Configuration;
@ -120,6 +120,9 @@ public class ProcessoAccoesPanel extends JPanel
// consulta
@ActionActivation(onSelect = CREATE_CONSULTA_MARCACAO, onChange = "")
public final LeafButton buttonNovoConsultaMarcacao = new LeafButton( "Nova Marca" + ccedil + atilde + "o" );
@ActionActivation(onSelect = APAGAR_CONSULTA, onChange = "")
public final LeafButton buttonApagarConsulta = new LeafButton( "Apagar Marca" + ccedil + atilde + "o" );
// marcacao consulta
@ActionActivation(onSelect = CREATE_CONSULTA_MARCACAO_EMAIL, onChange = "")
@ -148,6 +151,9 @@ public class ProcessoAccoesPanel extends JPanel
// exame
@ActionActivation(onSelect = CREATE_EXAME_MARCACAO, onChange = "")
public final LeafButton buttonNovoExameMarcacao = new LeafButton( "Nova Marca" + ccedil + atilde + "o" );
@ActionActivation(onSelect = APAGAR_EXAME, onChange = "")
public final LeafButton buttonApagarExame = new LeafButton( "Apagar Exame" );
// marcacao exame
@ActionActivation(onSelect = CREATE_EXAME_MARCACAO_EMAIL, onChange = "")
@ -304,6 +310,7 @@ public class ProcessoAccoesPanel extends JPanel
}
}
buttonNovoConsultaMarcacao.setEnabled( !marcacaoAberta && !new Integer( MedicinaConstants.ESTADO_REALIZADO ).equals( consulta.getEstado() ) );
buttonApagarConsulta.setEnabled( marcacaoAberta );
cardLayout.show( cardPanel, PANEL_CONSULTA_NAME );
}
else
@ -367,7 +374,9 @@ public class ProcessoAccoesPanel extends JPanel
if( exame != null )
{
boolean porMarcar = new Integer( MedicinaConstants.ESTADO_POR_MARCAR ).equals( exame.getEstado() );
boolean porRealizado = new Integer( MedicinaConstants.ESTADO_POR_REALIZAR ).equals( exame.getEstado() );
buttonNovoExameMarcacao.setEnabled( porMarcar );
buttonApagarExame.setEnabled( porRealizado );
cardLayout.show( cardPanel, PANEL_EXAME_NAME );
}
else
@ -450,7 +459,7 @@ public class ProcessoAccoesPanel extends JPanel
private void setupConsultaPanel()
{
setupSimpleActionsPanel( panelConsulta, buttonNovoConsultaMarcacao, new JPanel() );
setupSimpleActionsPanel( panelConsulta, buttonNovoConsultaMarcacao, buttonApagarConsulta, new JPanel() );
}
private void setupConsultaMarcacaoPanel()
@ -473,7 +482,7 @@ public class ProcessoAccoesPanel extends JPanel
private void setupExamePanel()
{
setupSimpleActionsPanel( panelExame, buttonNovoExameMarcacao, new JPanel() );
setupSimpleActionsPanel( panelExame, buttonNovoExameMarcacao, buttonApagarExame, new JPanel() );
}
private void setupTopBottomSimpleActionsPanel(JPanel panel, JPanel top, JPanel bottom)

@ -42,18 +42,17 @@ import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import leaf.LeafCalendarDialog;
import leaf.LeafInputField;
import leaf.LeafOptionDialog;
import leaf.LeafTextDialog;
import leaf.LeafWindow;
import leaf.OrderedMap;
import leaf.LeafLogic.LeafUIActionBinding;
import leaf.LeafWindow.ActionActivation;
import leaf.data.OrderedMap;
import leaf.ui.LeafCalendarDialog;
import leaf.ui.LeafInputField;
import leaf.ui.LeafOptionDialog;
import leaf.ui.LeafTextDialog;
import leaf.ui.LeafWindow;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import leaf.ui.LeafWindow.ActionActivation;
import siprp.CompanyDataLoader;
import siprp.SingletonConstants;
import siprp.database.cayenne.objects.Contactos;
@ -549,7 +548,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO)
public void setForNewConsultaMarcacao( TrabalhadoresConsultasDatas marcacao )
{
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, true );
LeafCalendarDialog calendar = new LeafCalendarDialog( parentWindow, this, false, true );
Date date = calendar.getDate();
if( date == null )
{
@ -649,7 +648,7 @@ public class ProcessoDadosPanel extends JPanel
to = estabelecimentoEmail;
try
{
MailDialog mailDialog = new MailDialog( getParentFrame(), to, bcc, subject, body );
MailDialog mailDialog = new MailDialog( parentWindow, to, bcc, subject, body );
result = new String[2];
result[0] = mailDialog.getSubject();
result[1] = mailDialog.getMessage();
@ -669,7 +668,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO_OBSERVACOES)
public void setForNewConsultaMarcacaoObservacoes( TrabalhadoresConsultasDatasObservacoes observacoes )
{
LeafTextDialog textDialog = new LeafTextDialog( getParentFrame(), this, "", true );
LeafTextDialog textDialog = new LeafTextDialog( parentWindow, this, "", true );
String text = textDialog.getText();
observacoes.setObservacao( text );
inputConsultaMarcacaoObsMensagem.setEditable( true );
@ -678,7 +677,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_EXAME_MARCACAO)
public void setForNewExameMarcacao( TrabalhadoresEcdsDatas marcacao )
{
LeafCalendarDialog calendar = new LeafCalendarDialog( getParentFrame(), this, false, true );
LeafCalendarDialog calendar = new LeafCalendarDialog( parentWindow, this, false, true );
Date date = calendar.getDate();
if( date == null )
{
@ -742,7 +741,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_EXAME_MARCACAO_OBSERVACOES)
public void setForNewExameMarcacaoObservacoes( TrabalhadoresEcdsDatasObservacoes observacoes )
{
LeafTextDialog textDialog = new LeafTextDialog( getParentFrame(), this, "", true );
LeafTextDialog textDialog = new LeafTextDialog( parentWindow, this, "", true );
String text = textDialog.getText();
observacoes.setObservacao( text );
inputExameMarcacaoObsMensagem.setEditable( true );
@ -881,13 +880,4 @@ public class ProcessoDadosPanel extends JPanel
{
setupSimpleDataPanel( panelExameMarcacaoObservacao, "Observa" + ccedil + otilde + "es", inputExameMarcacaoObsMensagem );
}
private JFrame getParentFrame()
{
if( getRootPane() != null && getRootPane().getParent() instanceof JFrame )
{
return (JFrame) getRootPane().getParent();
}
return null;
}
}

@ -1,5 +1,7 @@
package siprp.medicina.processo.ui;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.APAGAR_CONSULTA;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.APAGAR_EXAME;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.APAGAR_PROCESSO;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.CREATE_CONSULTA;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.CREATE_CONSULTA_MARCACAO;
@ -30,9 +32,9 @@ import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import leaf.LeafWindow;
import leaf.LeafLogic.LeafUIActionBinding;
import leaf.LeafWindow.ActionActivation;
import leaf.ui.LeafWindow;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import leaf.ui.LeafWindow.ActionActivation;
import org.apache.cayenne.CayenneDataObject;
@ -153,28 +155,30 @@ public class ProcessoTreePanel extends JPanel
addAndRefresh( node, rootNode );
}
}
@LeafUIActionBinding(action = CREATE_FICHA)
public void createFichaNode( )
public void createFichaNode()
{
// if( ficha != null )
// {
// FichaAptidaoMutableTreeNode node = new FichaAptidaoMutableTreeNode( ficha );
// DefaultMutableTreeNode parentNode = nodeByObject.get( ficha.getToTrabalhadoresProcesso() );
// addAndRefresh( node, parentNode );
// }
// if( ficha != null )
// {
// FichaAptidaoMutableTreeNode node = new FichaAptidaoMutableTreeNode(
// ficha );
// DefaultMutableTreeNode parentNode = nodeByObject.get(
// ficha.getToTrabalhadoresProcesso() );
// addAndRefresh( node, parentNode );
// }
}
@LeafUIActionBinding(action = APAGAR_PROCESSO)
public void removeProcessoNode( TrabalhadoresProcesso processo )
public void apagarProcessoNode( TrabalhadoresProcesso processo )
{
if( processo != null )
{
for(int i = 0; i< rootNode.getChildCount(); ++i)
for( int i = 0; i < rootNode.getChildCount(); ++i )
{
DefaultMutableTreeNode node = (DefaultMutableTreeNode) rootNode.getChildAt( i );
if(processo.equals( node.getUserObject()))
if( processo.equals( node.getUserObject() ) )
{
removeNode( node );
break;
@ -183,6 +187,32 @@ public class ProcessoTreePanel extends JPanel
}
}
@LeafUIActionBinding(action = APAGAR_CONSULTA)
public void apagarConsultaNode( TrabalhadoresConsultas consulta )
{
if( consulta != null )
{
DefaultMutableTreeNode node = nodeByObject.get( consulta );
if( node != null )
{
removeNode( node );
}
}
}
@LeafUIActionBinding(action = APAGAR_EXAME)
public void apagarExameNode( TrabalhadoresEcds exame )
{
if( exame != null )
{
DefaultMutableTreeNode node = nodeByObject.get( exame );
if( node != null )
{
removeNode( node );
}
}
}
@LeafUIActionBinding(action = CREATE_CONSULTA)
public void createConsultaNode( TrabalhadoresConsultas consulta )
{
@ -315,7 +345,7 @@ public class ProcessoTreePanel extends JPanel
{
addNodeTo( loadExame( current ), node );
}
List<TrabalhadoresFichasAptidao> fichas = processo.getTrabalhadoresFichasAptidaoArray();
if( fichas != null )
{
@ -329,13 +359,13 @@ public class ProcessoTreePanel extends JPanel
}
if( ficha != null )
{
addNodeTo( loadFicha( ficha ), node);
addNodeTo( loadFicha( ficha ), node );
}
}
return node;
}
private FichaAptidaoMutableTreeNode loadFicha(TrabalhadoresFichasAptidao ficha)
private FichaAptidaoMutableTreeNode loadFicha( TrabalhadoresFichasAptidao ficha )
{
FichaAptidaoMutableTreeNode result = new FichaAptidaoMutableTreeNode( ficha );
return result;

@ -1,6 +1,6 @@
package siprp.medicina.processo.ui;
import static leaf.LeafLogic.ACTION_STARTUP;
import static leaf.ui.LeafLogic.ACTION_STARTUP;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.LOAD_TRABALHADOR;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.SELECT_EMPRESA;
import static siprp.medicina.processo.logic.MedicinaProcessoLogic.SELECT_ESTABELECIMENTO;
@ -14,10 +14,10 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import leaf.LeafTableModel;
import leaf.LeafWindow;
import leaf.LeafLogic.LeafUIActionBinding;
import leaf.LeafWindow.ActionActivation;
import leaf.ui.LeafTableModel;
import leaf.ui.LeafWindow;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import leaf.ui.LeafWindow.ActionActivation;
import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos;

Loading…
Cancel
Save