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

lxbfYeaa
Tiago Simão 17 years ago
parent 9dbc04cb23
commit 2af55e5762

@ -20,15 +20,10 @@ import javax.swing.plaf.ColorUIResource;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.MutableTreeNode;
import org.apache.cayenne.access.DataContext;
import org.apache.cayenne.access.DataDomain;
import org.apache.cayenne.access.DataNode;
import org.apache.cayenne.conf.Configuration;
import org.apache.cayenne.conf.DefaultConfiguration;
import org.apache.cayenne.conf.DriverDataSourceFactory;
import org.apache.cayenne.conn.DataSourceInfo;
import org.apache.cayenne.conn.DriverDataSource;
import org.apache.cayenne.conn.PoolManager;
import org.apache.cayenne.dba.AutoAdapter;
import org.apache.cayenne.map.DataMap;

@ -138,7 +138,7 @@ public class AdicionarEquipamentosPanel extends JPanel
if( relatorio != null )
{
DefaultMutableTreeNode allEquipamentos = HigieneSegurancaLogic.getEquipamentosTree();
TreeInserterDialog dialog = new TreeInserterDialog(this,"Adicionar equipamento",allEquipamentos);
TreeInserterDialog dialog = new TreeInserterDialog("Adicionar equipamento",allEquipamentos);
DefaultMutableTreeNode result = dialog.getResult();
if( result != null )
{

@ -45,7 +45,7 @@ private static final long serialVersionUID = 1L;
{
DefaultMutableTreeNode allLegislacao = getAllLegislacao();
removeCurrent( allLegislacao );
TreeInserterDialog dialog = new TreeInserterDialog( this, "Adicionar Legisla" + ccedil + atilde + "o", allLegislacao );
TreeInserterDialog dialog = new TreeInserterDialog( "Adicionar Legisla" + ccedil + atilde + "o", allLegislacao );
DefaultMutableTreeNode result = dialog.getResult();
if( result != null )
{

@ -47,7 +47,7 @@ public class AdicionarNormalizacaoPanel extends AdicionarPanel
{
DefaultMutableTreeNode allNormalizacao = getAllNormalizacao();
removeCurrent( allNormalizacao );
TreeInserterDialog dialog = new TreeInserterDialog( this, "Adicionar Normaliza" + ccedil + atilde + "o", allNormalizacao );
TreeInserterDialog dialog = new TreeInserterDialog( "Adicionar Normaliza" + ccedil + atilde + "o", allNormalizacao );
DefaultMutableTreeNode result = dialog.getResult();
if( result != null )
{

@ -135,7 +135,7 @@ public class AdicionarAreasPanel extends JPanel
{
DefaultMutableTreeNode allPostos = HigieneSegurancaLogic.getAreasTree( estabelecimento.getToEmpresas() );
TreeTools.removeAll( allPostos, HigieneSegurancaLogic.getPostosTree( estabelecimento ) );
TreeInserterDialog dialog = new TreeInserterDialog( this, "Adicionar Postos de Trabalho", allPostos );
TreeInserterDialog dialog = new TreeInserterDialog( "Adicionar Postos de Trabalho", allPostos );
save( dialog.getResult() );
refresh();
}

@ -143,7 +143,7 @@ public class AdicionarRiscosPanel extends JPanel
{
DefaultMutableTreeNode allRiscos = getAllRiscos();
TreeTools.removeAll( allRiscos, getRiscosTree() );
TreeInserterDialog dialog = new TreeInserterDialog( this, "Adicionar Riscos", allRiscos );
TreeInserterDialog dialog = new TreeInserterDialog( "Adicionar Riscos", allRiscos );
DefaultMutableTreeNode result = dialog.getResult();
if( result != null )
{

@ -205,9 +205,16 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
@Override
public void actionPerformed( ActionEvent e )
{
if( isValidPlano() && confirmSubmit() )
if( isValidEmail() || JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(null, "Emails n" + atilde + "o preenchidos para este estabelecimento!\nContinuar?", "Aviso", JOptionPane.YES_NO_OPTION ) )
{
submit();
if( isValidPlano() && confirmSubmit() )
{
submit();
}
}
else
{
}
}
} );
@ -221,13 +228,21 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
} );
}
private boolean isValidEmail()
{
boolean result = false;
List<HsEmailEstabelecimento> emails = relatorio.getToHsMarcacoesEstabelecimento().getToEstabelecimentos().getHsEmailEstabelecimento();
result = emails != null && emails.size() > 0;
return result;
}
private boolean isValidPlano()
{
boolean result = false;
result = panelPlano.isValidPlano();
if( !result )
{
JOptionPane.showMessageDialog( this, "Todos os riscos devem ser preenchidos antes da submiss"+ atilde + "o do plano de actua" + ccedil + atilde+ "o!", "Erro", JOptionPane.ERROR_MESSAGE, null );
JOptionPane.showMessageDialog( null, "Todos os riscos devem ser preenchidos antes da submiss"+ atilde + "o do plano de actua" + ccedil + atilde+ "o!", "Erro", JOptionPane.ERROR_MESSAGE, null );
}
return result;
}

@ -58,15 +58,15 @@ public class RelatorioHigieneSegurancaWindow extends JFrame implements Trackable
startupComponents();
startupLayout();
placeComponents();
setLocationRelativeTo( null );
setTitle( TITLE );
setSize( SIZE );
setLocationRelativeTo( null );
}
private void startupComponents()
{
panelRelatorio.setBorder( BorderFactory.createTitledBorder( "Relat" + oacute + "rio" ) );
for( Empresas empresa : HigieneSegurancaLogic.getAllEmpresas())
for( Empresas empresa : HigieneSegurancaLogic.getAllEmpresas() )
{
comboEmpresas.addItem( empresa );
}

@ -188,7 +188,7 @@ public class MedicinaProcessoWindow extends LeafWindow
{
if( lembrete != null )
{
Date date = new LeafCalendarDialog( this, null ).getDate();
Date date = new LeafCalendarDialog( this ).getDate();
if( date != null && date.getTime() != 0 )
{
String text = new LeafTextDialog( this, null, "", true ).getText();

@ -556,7 +556,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_CONSULTA_MARCACAO)
public void setForNewConsultaMarcacao( TrabalhadoresConsultasDatas marcacao )
{
LeafCalendarDialog calendar = new LeafCalendarDialog( parentWindow, this, false, true );
LeafCalendarDialog calendar = new LeafCalendarDialog( parentWindow, false, true );
Date date = calendar.getDate();
if( date == null )
{
@ -685,7 +685,7 @@ public class ProcessoDadosPanel extends JPanel
@LeafUIActionBinding(action = CREATE_EXAME_MARCACAO)
public void setForNewExameMarcacao( TrabalhadoresEcdsDatas marcacao )
{
LeafCalendarDialog calendar = new LeafCalendarDialog( parentWindow, this, false, true );
LeafCalendarDialog calendar = new LeafCalendarDialog( parentWindow, false, true );
Date date = calendar.getDate();
if( date == null )
{

@ -36,14 +36,14 @@ public class LeafCalendarDialog extends JDialog
private final JCalendar calendarPanel = new JCalendar( null, null, false, false );
/** Creates a new instance of JCalendarDialog */
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent)
public LeafCalendarDialog( LeafWindow parentFrame )
{
super(parentFrame);
this.enableClean = true;
setModal( true );
setupComponents();
setUndecorated( true );
setLocationRelativeTo( parent );
setLocationRelativeTo( null );
setVisible( true );
}
@ -59,7 +59,7 @@ public class LeafCalendarDialog extends JDialog
setVisible( true );
}
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent, boolean enableClean, boolean enableCancel )
public LeafCalendarDialog( LeafWindow parentFrame, boolean enableClean, boolean enableCancel )
{
super(parentFrame);
this.enableClean = enableClean;
@ -67,7 +67,7 @@ public class LeafCalendarDialog extends JDialog
setModal( true );
setupComponents();
setUndecorated( true );
setLocationRelativeTo( parent );
setLocationRelativeTo( null );
setVisible( true );
}

@ -129,7 +129,7 @@ public class LeafInputField<ObjClass extends Object> extends JPanel implements F
private Date getDateFromUser()
{
LeafCalendarDialog calendarDialog = new LeafCalendarDialog( getParentWindow(), this );
LeafCalendarDialog calendarDialog = new LeafCalendarDialog( getParentWindow() );
return calendarDialog.getDate();
}

@ -62,7 +62,7 @@ public class TreeInserterDialog extends JDialog
private final LeafButton buttonCancel = new LeafButton( "Cancelar" );
public TreeInserterDialog( Component relativeTo, String title, DefaultMutableTreeNode root )
public TreeInserterDialog( String title, DefaultMutableTreeNode root )
{
this.allRoot = root;
this.allModel = new DefaultTreeModel( allRoot );
@ -83,8 +83,8 @@ public class TreeInserterDialog extends JDialog
startupListeners();
TreeTools.refreshTree(allTree, allRoot);
setEnabled();
this.setLocationRelativeTo( relativeTo );
this.setSize( 680, 400 );
this.setLocationRelativeTo( null );
this.setModal( true );
this.setVisible( true );
}

Loading…
Cancel
Save