|
|
|
@ -6,6 +6,7 @@ import info.clearthought.layout.TableLayout;
|
|
|
|
import info.clearthought.layout.TableLayoutConstraints;
|
|
|
|
import info.clearthought.layout.TableLayoutConstraints;
|
|
|
|
|
|
|
|
|
|
|
|
import java.awt.Dimension;
|
|
|
|
import java.awt.Dimension;
|
|
|
|
|
|
|
|
import java.awt.GridLayout;
|
|
|
|
import java.awt.event.ItemEvent;
|
|
|
|
import java.awt.event.ItemEvent;
|
|
|
|
import java.awt.event.ItemListener;
|
|
|
|
import java.awt.event.ItemListener;
|
|
|
|
import java.beans.PropertyChangeEvent;
|
|
|
|
import java.beans.PropertyChangeEvent;
|
|
|
|
@ -19,6 +20,7 @@ import siprp.database.cayenne.objects.Empresas;
|
|
|
|
import siprp.database.cayenne.objects.Estabelecimentos;
|
|
|
|
import siprp.database.cayenne.objects.Estabelecimentos;
|
|
|
|
import siprp.database.cayenne.objects.HsPosto;
|
|
|
|
import siprp.database.cayenne.objects.HsPosto;
|
|
|
|
import siprp.higiene.gestao.legislacao.AdicionarLegislacaoPanel;
|
|
|
|
import siprp.higiene.gestao.legislacao.AdicionarLegislacaoPanel;
|
|
|
|
|
|
|
|
import siprp.higiene.gestao.normalizacao.AdicionarNormalizacaoPanel;
|
|
|
|
import siprp.higiene.gestao.postos.AdicionarAreasPanel;
|
|
|
|
import siprp.higiene.gestao.postos.AdicionarAreasPanel;
|
|
|
|
import siprp.higiene.gestao.riscos.AdicionarRiscosPanel;
|
|
|
|
import siprp.higiene.gestao.riscos.AdicionarRiscosPanel;
|
|
|
|
|
|
|
|
|
|
|
|
@ -28,10 +30,12 @@ public class GerirEstabelecimentosPanel extends JPanel
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
|
|
private final JComboBox comboEstabelecimentos = new JComboBox();
|
|
|
|
private final JComboBox comboEstabelecimentos = new JComboBox();
|
|
|
|
|
|
|
|
private final JPanel panelAreasRiscos = new JPanel();
|
|
|
|
private final AdicionarAreasPanel panelAreas = new AdicionarAreasPanel();
|
|
|
|
private final AdicionarAreasPanel panelAreas = new AdicionarAreasPanel();
|
|
|
|
private final AdicionarRiscosPanel panelRiscos = new AdicionarRiscosPanel();
|
|
|
|
private final AdicionarRiscosPanel panelRiscos = new AdicionarRiscosPanel();
|
|
|
|
private final AdicionarEmailsPanel panelEmails = new AdicionarEmailsPanel();
|
|
|
|
private final AdicionarEmailsPanel panelEmails = new AdicionarEmailsPanel();
|
|
|
|
private final AdicionarLegislacaoPanel panelLegislacao = new AdicionarLegislacaoPanel();
|
|
|
|
private final AdicionarLegislacaoPanel panelLegislacao = new AdicionarLegislacaoPanel();
|
|
|
|
|
|
|
|
private final AdicionarNormalizacaoPanel panelNormalizacao = new AdicionarNormalizacaoPanel();
|
|
|
|
|
|
|
|
|
|
|
|
public GerirEstabelecimentosPanel()
|
|
|
|
public GerirEstabelecimentosPanel()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -43,31 +47,35 @@ public class GerirEstabelecimentosPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
|
|
private void startupComponents()
|
|
|
|
private void startupComponents()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
panelAreas.setBorder( BorderFactory.createTitledBorder( "Postos de trabalho" ) );
|
|
|
|
panelAreasRiscos.setBorder( BorderFactory.createTitledBorder( "Riscos por posto de trabalho" ) );
|
|
|
|
panelRiscos.setBorder( BorderFactory.createTitledBorder( "Riscos" ) );
|
|
|
|
panelRiscos.setBorder( BorderFactory.createTitledBorder( "Riscos" ) );
|
|
|
|
panelEmails.setBorder( BorderFactory.createTitledBorder( "Emails" ) );
|
|
|
|
panelEmails.setBorder( BorderFactory.createTitledBorder( "Emails" ) );
|
|
|
|
panelLegislacao.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
|
|
|
|
panelLegislacao.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
|
|
|
|
|
|
|
|
|
|
|
|
panelEmails.setPreferredSize( new Dimension(0,150) );
|
|
|
|
panelEmails.setPreferredSize( new Dimension(0,150) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setupLayout()
|
|
|
|
private void setupLayout()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
double [] cols = new double[]{ TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, };
|
|
|
|
double [] cols = new double[]{ TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, };
|
|
|
|
double [] rows = new double[]{ TableLayout.MINIMUM, TableLayout.FILL, TableLayout.PREFERRED };
|
|
|
|
double [] rows = new double[]{ TableLayout.MINIMUM, TableLayout.FILL,TableLayout.FILL, TableLayout.PREFERRED };
|
|
|
|
TableLayout layout = new TableLayout( cols, rows );
|
|
|
|
TableLayout layout = new TableLayout( cols, rows );
|
|
|
|
layout.setHGap( 5 );
|
|
|
|
layout.setHGap( 5 );
|
|
|
|
layout.setVGap( 5 );
|
|
|
|
layout.setVGap( 5 );
|
|
|
|
this.setLayout( layout );
|
|
|
|
this.setLayout( layout );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panelAreasRiscos.setLayout( new GridLayout( 1, 2 ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void placeComponents()
|
|
|
|
private void placeComponents()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
panelAreasRiscos.add( panelAreas );
|
|
|
|
|
|
|
|
panelAreasRiscos.add( panelRiscos );
|
|
|
|
|
|
|
|
|
|
|
|
this.add( comboEstabelecimentos, new TableLayoutConstraints( 0, 0, 2, 0 ) );
|
|
|
|
this.add( comboEstabelecimentos, new TableLayoutConstraints( 0, 0, 2, 0 ) );
|
|
|
|
this.add( panelAreas, new TableLayoutConstraints( 0, 1, 0, 2 ) );
|
|
|
|
this.add( panelAreasRiscos, new TableLayoutConstraints( 0, 1, 1, 3 ) );
|
|
|
|
this.add( panelRiscos, new TableLayoutConstraints( 1, 1, 1, 2 ) );
|
|
|
|
|
|
|
|
this.add( panelLegislacao, new TableLayoutConstraints( 2, 1 ) );
|
|
|
|
this.add( panelLegislacao, new TableLayoutConstraints( 2, 1 ) );
|
|
|
|
this.add( panelEmails, new TableLayoutConstraints( 2, 2 ) );
|
|
|
|
this.add( panelNormalizacao, new TableLayoutConstraints( 2, 2 ) );
|
|
|
|
|
|
|
|
this.add( panelEmails, new TableLayoutConstraints( 2, 3 ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void startupListeners()
|
|
|
|
private void startupListeners()
|
|
|
|
@ -81,7 +89,11 @@ public class GerirEstabelecimentosPanel extends JPanel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( e.getItem() instanceof Estabelecimentos )
|
|
|
|
if( e.getItem() instanceof Estabelecimentos )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
panelAreas.setEstabelecimento( (Estabelecimentos) e.getItem() );
|
|
|
|
Estabelecimentos estabelecimento = (Estabelecimentos) e.getItem();
|
|
|
|
|
|
|
|
panelAreas.setEstabelecimento( estabelecimento );
|
|
|
|
|
|
|
|
panelEmails.setEstabelecimento( estabelecimento );
|
|
|
|
|
|
|
|
panelLegislacao.setEstabelecimento( estabelecimento );
|
|
|
|
|
|
|
|
panelNormalizacao.setEstabelecimento( estabelecimento );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -118,8 +130,6 @@ public class GerirEstabelecimentosPanel extends JPanel
|
|
|
|
comboEstabelecimentos.setSelectedIndex( 0 );
|
|
|
|
comboEstabelecimentos.setSelectedIndex( 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
panelEmails.setEmpresa( empresa );
|
|
|
|
|
|
|
|
panelLegislacao.setEmpresa( empresa );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|