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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Tiago Simão 17 years ago
parent 4d946887cc
commit e05a5812f5

@ -219,6 +219,7 @@ public class GerirMedidaRelatorioPanel extends JPanel
{
relacao.setIsPlanoActuacao( checkPlanoActuacao.isSelected() );
relacao.save();
firePropertyChange( MEDIDA_CHANGED, null, relacao );
}
}

@ -3,6 +3,7 @@ package siprp.higiene.relatorio;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -24,6 +25,7 @@ import siprp.database.cayenne.objects.HsRelatorioMedida;
import siprp.database.cayenne.objects.HsRelatorioPosto;
import siprp.database.cayenne.objects.HsRelatorioPostoMedida;
import siprp.database.cayenne.objects.HsRelatorioPostoRisco;
import siprp.database.cayenne.objects.HsRelatorioRisco;
import siprp.logic.HigieneSegurancaLogic;
import siprp.logic.node.MedidaRelatorioNode;
import siprp.logic.node.RiscoRelatorioNode;
@ -35,6 +37,8 @@ public class GerirMedidasRelatorioPanel extends JPanel
public static final String SELECTION_CHANGED = "RISCOS_SELECTION_CHANGED";
public static final String VALUE_CHANGED = "VALUE_CHANGED";
private final LeafButton buttonAdicionar = new LeafButton("Adicionar");
private final LeafButton buttonRemover = new LeafButton("Remover");
@ -72,18 +76,36 @@ public class GerirMedidasRelatorioPanel extends JPanel
{
super.getTreeCellRendererComponent(pTree, pValue, pIsSelected, pIsExpanded, pIsLeaf, pRow, pHasFocus);
boolean highlight= false;
Color highColor = null;
Color lowColor = null;
if( pValue instanceof RiscoRelatorioNode )
{
Object userObject = ((RiscoRelatorioNode)pValue).getUserObject();
if( userObject instanceof HsRelatorioPostoRisco )
{
highlight = HigieneSegurancaLogic.isRelatorioRiscoPreenchido( (HsRelatorioPostoRisco) userObject );
highColor = RelatorioHigieneSegurancaWindow.COLOR_RISCO_OK_SEL;
lowColor = RelatorioHigieneSegurancaWindow.COLOR_RISCO_OK;
}
}
else if( pValue instanceof MedidaRelatorioNode )
{
Object userObject = ((MedidaRelatorioNode)pValue).getUserObject();
if( userObject instanceof HsRelatorioPostoMedida )
{
HsRelatorioPostoMedida medida = (HsRelatorioPostoMedida) userObject;
if( medida.getIsPlanoActuacao() != null )
{
highlight = medida.getIsPlanoActuacao();
highColor = RelatorioHigieneSegurancaWindow.COLOR_MEDIDA_OK_SEL;
lowColor = RelatorioHigieneSegurancaWindow.COLOR_MEDIDA_OK;
}
}
}
if( highlight )
{
setOpaque( true );
setBackground( pIsSelected ? RelatorioHigieneSegurancaWindow.COLOR_OK_SEL : RelatorioHigieneSegurancaWindow.COLOR_OK );
setBackground( pIsSelected ? highColor : lowColor );
}
else
{
@ -260,14 +282,12 @@ public class GerirMedidasRelatorioPanel extends JPanel
for( HsRelatorioPostoRisco rel : posto.getHsRelatorioPostoRiscoArray() )
{
RiscoRelatorioNode node = new RiscoRelatorioNode( rel );
if( rel.getToHsRelatorioRisco() != null )
HsRelatorioRisco risco = rel.getToHsRelatorioRisco();
for( HsRelatorioMedida medida : risco.getHsRelatorioMedidaArray() )
{
for( HsRelatorioPostoMedida medida : posto.getHsRelatorioPostoMedidaArray() )
for( HsRelatorioPostoMedida medidaRel : medida.getHsRelatorioPostoMedidaArray() )
{
if( rel.getToHsRelatorioPosto().equals( medida.getToHsRelatorioPosto() ) )
{
node.add( new MedidaRelatorioNode(medida) );
}
node.add( new MedidaRelatorioNode(medidaRel) );
}
}
root.add( node );

@ -115,11 +115,16 @@ public class PlanoActuacaoPanel extends JPanel
@Override
public void propertyChange( PropertyChangeEvent evt )
{
if( evt.getNewValue() instanceof HsRelatorioPostoRisco )
{
riscos.repaint();
areas.repaint();
}
riscos.repaint();
areas.repaint();
}
} );
valoresMedida.addPropertyChangeListener( GerirMedidaRelatorioPanel.MEDIDA_CHANGED, new PropertyChangeListener()
{
@Override
public void propertyChange( PropertyChangeEvent evt )
{
riscos.repaint();
}
} );
}

@ -31,9 +31,13 @@ public class RelatorioHigieneSegurancaWindow extends JFrame implements Trackable
{
private static final long serialVersionUID = 1L;
public static final Color COLOR_OK = new Color(200,255,200);
public static final Color COLOR_RISCO_OK = new Color(200,255,200);
public static final Color COLOR_OK_SEL = new Color(140,240,140);
public static final Color COLOR_RISCO_OK_SEL = new Color(140,240,140);
public static final Color COLOR_MEDIDA_OK = new Color(200,230,255);
public static final Color COLOR_MEDIDA_OK_SEL = new Color(160,190,255);
public static final String TITLE = "Relat" + oacute + "rios de Higiene e Seguran" + ccedil + "a no Trabalho";

@ -3,6 +3,7 @@ package siprp.higiene.relatorio;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JPanel;
@ -61,6 +62,8 @@ public class VerAreasRelatorioPanel extends JPanel
{
super.getTreeCellRendererComponent(pTree, pValue, pIsSelected, pIsExpanded, pIsLeaf, pRow, pHasFocus);
boolean highlight= false;
Color highColor = null;
Color lowColor = null;
if( pValue instanceof PostoRelatorioNode )
{
Object userObject = ((PostoRelatorioNode)pValue).getUserObject();
@ -72,14 +75,15 @@ public class VerAreasRelatorioPanel extends JPanel
{
allOk &= HigieneSegurancaLogic.isRelatorioRiscoPreenchido( rel );
}
highColor = RelatorioHigieneSegurancaWindow.COLOR_RISCO_OK_SEL;
lowColor = RelatorioHigieneSegurancaWindow.COLOR_RISCO_OK;
highlight = allOk;
}
}
if( highlight )
{
setOpaque( true );
setBackground( pIsSelected ? RelatorioHigieneSegurancaWindow.COLOR_OK_SEL : RelatorioHigieneSegurancaWindow.COLOR_OK );
setBackground( pIsSelected ? highColor : lowColor );
}
else
{

Loading…
Cancel
Save