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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Tiago Simão 17 years ago
parent 2a00a1d930
commit 4274512250

@ -41,7 +41,7 @@ public class GerirEmpresaPanel extends JPanel
panelAreas.setBorder( BorderFactory.createTitledBorder( "Postos de trabalho" ) ); panelAreas.setBorder( BorderFactory.createTitledBorder( "Postos 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 + otilde + "es" ) ); panelLegislacao.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
panelNormalizacao.setBorder( BorderFactory.createTitledBorder( "Normaliza" + ccedil + otilde + "es" ) ); panelNormalizacao.setBorder( BorderFactory.createTitledBorder( "Normaliza" + ccedil + otilde + "es" ) );
panelEmails.setPreferredSize( new Dimension(0,150) ); panelEmails.setPreferredSize( new Dimension(0,150) );
} }

@ -27,18 +27,15 @@ import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError; import leaf.ui.LeafError;
import leaf.ui.LeafIconButton; import leaf.ui.LeafIconButton;
import leaf.ui.LeafUIConstants;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsEquipamento; import siprp.database.cayenne.objects.HsEquipamento;
import siprp.logic.HigieneSegurancaLogic; import siprp.logic.HigieneSegurancaLogic;
public class GerirEquipamentosPanel extends JPanel implements CaretListener public class GerirEquipamentosPanel extends JPanel implements CaretListener, LeafUIConstants
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final String ICON_NAME_SAVE = "leaf/ui/icons/save.png";
private static final String ICON_NAME_REVERT = "leaf/ui/icons/revert.png";
private LeafIconButton buttonSaveRequesito = LeafIconButton.createButton( ICON_NAME_SAVE ); private LeafIconButton buttonSaveRequesito = LeafIconButton.createButton( ICON_NAME_SAVE );
@ -56,9 +53,9 @@ public class GerirEquipamentosPanel extends JPanel implements CaretListener
private final JTextField textModelo = new JTextField(20); private final JTextField textModelo = new JTextField(20);
private final LeafButton buttonCriar = new LeafButton( "Criar" ); private final LeafButton buttonCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonRemover = new LeafButton( "Remover" ); private final LeafButton buttonRemover = LeafIconButton.createDefaultRemoveButton();
private final DefaultMutableTreeNode root = new DefaultMutableTreeNode(); private final DefaultMutableTreeNode root = new DefaultMutableTreeNode();
@ -259,16 +256,16 @@ public class GerirEquipamentosPanel extends JPanel implements CaretListener
TableLayout layout = new TableLayout( new double[] { TableLayout layout = new TableLayout( new double[] {
TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL
}, new double[] { }, new double[] {
TableLayout.FILL TableLayout.MINIMUM, TableLayout.FILL
} ); } );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
layout = new TableLayout( new double[] { layout = new TableLayout( new double[] {
TableLayout.MINIMUM TableLayout.MINIMUM, TableLayout.MINIMUM
}, new double[] { }, new double[] {
TableLayout.MINIMUM, TableLayout.MINIMUM TableLayout.MINIMUM
} ); } );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
@ -289,7 +286,7 @@ public class GerirEquipamentosPanel extends JPanel implements CaretListener
private void placeComponents() private void placeComponents()
{ {
panelButtons.add( buttonCriar, new TableLayoutConstraints( 0, 0 ) ); panelButtons.add( buttonCriar, new TableLayoutConstraints( 0, 0 ) );
panelButtons.add( buttonRemover, new TableLayoutConstraints( 0, 1 ) ); panelButtons.add( buttonRemover, new TableLayoutConstraints( 1, 0 ) );
panelTree.add( scroll, new TableLayoutConstraints( 0, 0 ) ); panelTree.add( scroll, new TableLayoutConstraints( 0, 0 ) );
@ -303,8 +300,8 @@ public class GerirEquipamentosPanel extends JPanel implements CaretListener
panelData.add( textModelo, new TableLayoutConstraints( 1, 3, 3, 3 ) ); panelData.add( textModelo, new TableLayoutConstraints( 1, 3, 3, 3 ) );
add( panelButtons, new TableLayoutConstraints( 0, 0 ) ); add( panelButtons, new TableLayoutConstraints( 0, 0 ) );
add( panelTree, new TableLayoutConstraints( 1, 0 ) ); add( panelTree, new TableLayoutConstraints( 0, 1, 1, 1 ) );
add( panelData, new TableLayoutConstraints( 2, 0 ) ); add( panelData, new TableLayoutConstraints( 2, 1 ) );
} }
private void refresh() private void refresh()

@ -29,13 +29,15 @@ import javax.swing.tree.TreeSelectionModel;
import leaf.data.Validator; import leaf.data.Validator;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError; import leaf.ui.LeafError;
import leaf.ui.LeafIconButton;
import leaf.ui.LeafTextAreaEditor; import leaf.ui.LeafTextAreaEditor;
import leaf.ui.LeafUIConstants;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsLegislacao; import siprp.database.cayenne.objects.HsLegislacao;
import siprp.database.cayenne.objects.HsLegislacaoCategoria; import siprp.database.cayenne.objects.HsLegislacaoCategoria;
import siprp.logic.HigieneSegurancaLogic; import siprp.logic.HigieneSegurancaLogic;
public class GerirLegislacaoPanel extends JPanel public class GerirLegislacaoPanel extends JPanel implements LeafUIConstants
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -46,23 +48,23 @@ public class GerirLegislacaoPanel extends JPanel
private final JPanel panelButtonsGeral = new JPanel(); private final JPanel panelButtonsGeral = new JPanel();
private final LeafButton buttonGeralCriar = new LeafButton( "Criar" ); private final LeafButton buttonGeralCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonGeralRemover = new LeafButton( "Remover" ); private final LeafButton buttonGeralRemover = LeafIconButton.createDefaultRemoveButton();
private final JPanel panelButtonsCategoriasCategoria = new JPanel(); private final JPanel panelButtonsCategoriasCategoria = new JPanel();
private final LeafButton buttonCategoriaCriar = new LeafButton( "Criar" ); private final LeafButton buttonCategoriaCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonCategoriaEditar = new LeafButton( "Editar" ); private final LeafButton buttonCategoriaEditar = LeafIconButton.createDefaultEditButton();
private final LeafButton buttonCategoriaRemover = new LeafButton( "Remover" ); private final LeafButton buttonCategoriaRemover = LeafIconButton.createDefaultRemoveButton();
private final JPanel panelButtonsCategoriasLegislacao = new JPanel(); private final JPanel panelButtonsCategoriasLegislacao = new JPanel();
private final LeafButton buttonCategoriasLegislacaoCriar = new LeafButton( "Criar" ); private final LeafButton buttonCategoriasLegislacaoCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonCategoriasLegislacaoRemover = new LeafButton( "Remover" ); private final LeafButton buttonCategoriasLegislacaoRemover = LeafIconButton.createDefaultRemoveButton();
private final DefaultMutableTreeNode rootGeral = new DefaultMutableTreeNode(); private final DefaultMutableTreeNode rootGeral = new DefaultMutableTreeNode();
@ -102,17 +104,17 @@ public class GerirLegislacaoPanel extends JPanel
placeComponents(); placeComponents();
setupListeners(); setupListeners();
reload(); reload();
setEnable();
} }
private void startupComponents() private void startupComponents()
{ {
panelGeral.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o de aplica" + ccedil + atilde + "o geral" ) ); panelGeral.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o de aplica" + ccedil + atilde + "o geral" ) );
panelButtonsGeral.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
panelCategorias.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o espec" + iacute + "fica" ) ); panelCategorias.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o espec" + iacute + "fica" ) );
panelButtonsCategoriasCategoria.setBorder( BorderFactory.createTitledBorder( "Categoria" ) ); panelButtonsCategoriasCategoria.setBorder( BorderFactory.createTitledBorder( "Categoria" ) );
panelButtonsCategoriasLegislacao.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) ); panelButtonsCategoriasLegislacao.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
treeCategorias.setRootVisible( false ); treeCategorias.setRootVisible( false );
treeGeral.setRootVisible( false ); treeGeral.setRootVisible( false );
treeCategorias.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION ); treeCategorias.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );
@ -136,19 +138,19 @@ public class GerirLegislacaoPanel extends JPanel
panelGeral.setLayout( layout ); panelGeral.setLayout( layout );
layout = new TableLayout( new double[] { layout = new TableLayout( new double[] {
TableLayout.MINIMUM, TableLayout.FILL
}, new double[] {
TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL
}, new double[] {
TableLayout.MINIMUM, TableLayout.FILL
} ); } );
panelCategorias.setLayout( layout ); panelCategorias.setLayout( layout );
layout = new GridLayout( 2, 1, 5, 5 ); layout = new GridLayout( 1, 2, 5, 5 );
panelButtonsGeral.setLayout( layout ); panelButtonsGeral.setLayout( layout );
layout = new GridLayout( 3, 1, 5, 5 ); layout = new GridLayout( 1, 4, 5, 5 );
panelButtonsCategoriasCategoria.setLayout( layout ); panelButtonsCategoriasCategoria.setLayout( layout );
layout = new GridLayout( 2, 1, 5, 5 ); layout = new GridLayout( 1, 4, 5, 5 );
panelButtonsCategoriasLegislacao.setLayout( layout ); panelButtonsCategoriasLegislacao.setLayout( layout );
} }
@ -160,16 +162,19 @@ public class GerirLegislacaoPanel extends JPanel
panelButtonsCategoriasCategoria.add( buttonCategoriaCriar ); panelButtonsCategoriasCategoria.add( buttonCategoriaCriar );
panelButtonsCategoriasCategoria.add( buttonCategoriaEditar ); panelButtonsCategoriasCategoria.add( buttonCategoriaEditar );
panelButtonsCategoriasCategoria.add( buttonCategoriaRemover ); panelButtonsCategoriasCategoria.add( buttonCategoriaRemover );
panelButtonsCategoriasCategoria.add( new JPanel() );
panelButtonsCategoriasLegislacao.add( buttonCategoriasLegislacaoCriar ); panelButtonsCategoriasLegislacao.add( buttonCategoriasLegislacaoCriar );
panelButtonsCategoriasLegislacao.add( buttonCategoriasLegislacaoRemover ); panelButtonsCategoriasLegislacao.add( buttonCategoriasLegislacaoRemover );
panelButtonsCategoriasLegislacao.add( new JPanel() );
panelButtonsCategoriasLegislacao.add( new JPanel() );
panelGeral.add( panelButtonsGeral, new TableLayoutConstraints( 0, 0 ) ); panelGeral.add( panelButtonsGeral, new TableLayoutConstraints( 0, 0 ) );
panelGeral.add( scrollGeral, new TableLayoutConstraints( 1, 0, 1, 1 ) ); panelGeral.add( scrollGeral, new TableLayoutConstraints( 0, 1, 1, 1 ) );
panelCategorias.add( panelButtonsCategoriasCategoria, new TableLayoutConstraints( 0, 0 ) ); panelCategorias.add( panelButtonsCategoriasCategoria, new TableLayoutConstraints( 0, 0 ) );
panelCategorias.add( panelButtonsCategoriasLegislacao, new TableLayoutConstraints( 0, 1 ) ); panelCategorias.add( panelButtonsCategoriasLegislacao, new TableLayoutConstraints( 1, 0 ) );
panelCategorias.add( scrollCategorias, new TableLayoutConstraints( 1, 0, 1, 2 ) ); panelCategorias.add( scrollCategorias, new TableLayoutConstraints( 0, 1, 2, 1 ) );
this.add( panelGeral, new TableLayoutConstraints( 0, 0 ) ); this.add( panelGeral, new TableLayoutConstraints( 0, 0 ) );
this.add( panelCategorias, new TableLayoutConstraints( 0, 1 ) ); this.add( panelCategorias, new TableLayoutConstraints( 0, 1 ) );

@ -31,12 +31,14 @@ import javax.swing.tree.TreeSelectionModel;
import leaf.data.Validator; import leaf.data.Validator;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError; import leaf.ui.LeafError;
import leaf.ui.LeafIconButton;
import leaf.ui.LeafTextAreaEditor; import leaf.ui.LeafTextAreaEditor;
import leaf.ui.LeafUIConstants;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsNormalizacao; import siprp.database.cayenne.objects.HsNormalizacao;
import siprp.logic.HigieneSegurancaLogic; import siprp.logic.HigieneSegurancaLogic;
public class GerirNormalizacaoPanel extends JPanel public class GerirNormalizacaoPanel extends JPanel implements LeafUIConstants
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -47,19 +49,19 @@ public class GerirNormalizacaoPanel extends JPanel
private final JPanel panelButtonsPortuguesa = new JPanel(); private final JPanel panelButtonsPortuguesa = new JPanel();
private final LeafButton buttonPortuguesaCriar = new LeafButton( "Criar" ); private final LeafButton buttonPortuguesaCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonPortuguesaEditar = new LeafButton( "Editar" ); private final LeafButton buttonPortuguesaEditar = LeafIconButton.createDefaultEditButton();
private final LeafButton buttonPortuguesaRemover = new LeafButton( "Remover" ); private final LeafButton buttonPortuguesaRemover = LeafIconButton.createDefaultRemoveButton();
private final JPanel panelButtonsInternacional = new JPanel(); private final JPanel panelButtonsInternacional = new JPanel();
private final LeafButton buttonInternacionalCriar = new LeafButton( "Criar" ); private final LeafButton buttonInternacionalCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonInternacionalEditar = new LeafButton( "Editar" ); private final LeafButton buttonInternacionalEditar = LeafIconButton.createDefaultEditButton();
private final LeafButton buttonInternacionalRemover = new LeafButton( "Remover" ); private final LeafButton buttonInternacionalRemover = LeafIconButton.createDefaultRemoveButton();
private final DefaultMutableTreeNode rootPortuguesa = new DefaultMutableTreeNode(); private final DefaultMutableTreeNode rootPortuguesa = new DefaultMutableTreeNode();
@ -101,6 +103,7 @@ public class GerirNormalizacaoPanel extends JPanel
placeComponents(); placeComponents();
setupListeners(); setupListeners();
reload(); reload();
setEnable();
} }
private void startupComponents() private void startupComponents()
@ -145,10 +148,10 @@ public class GerirNormalizacaoPanel extends JPanel
panelInternacional.setLayout( layout ); panelInternacional.setLayout( layout );
layout = new GridLayout( 3, 1, 5, 5 ); layout = new GridLayout( 1, 3, 5, 5 );
panelButtonsPortuguesa.setLayout( layout ); panelButtonsPortuguesa.setLayout( layout );
layout = new GridLayout( 3, 1, 5, 5 ); layout = new GridLayout( 1, 3, 5, 5 );
panelButtonsInternacional.setLayout( layout ); panelButtonsInternacional.setLayout( layout );
layout = new TableLayout( new double[] { layout = new TableLayout( new double[] {
@ -172,10 +175,10 @@ public class GerirNormalizacaoPanel extends JPanel
panelButtonsInternacional.add( buttonInternacionalRemover ); panelButtonsInternacional.add( buttonInternacionalRemover );
panelPortuguesa.add( panelButtonsPortuguesa, new TableLayoutConstraints( 0, 0 ) ); panelPortuguesa.add( panelButtonsPortuguesa, new TableLayoutConstraints( 0, 0 ) );
panelPortuguesa.add( scrollPortuguesa, new TableLayoutConstraints( 1, 0, 1, 1 ) ); panelPortuguesa.add( scrollPortuguesa, new TableLayoutConstraints( 0, 1, 1, 1 ) );
panelInternacional.add( panelButtonsInternacional, new TableLayoutConstraints( 0, 0 ) ); panelInternacional.add( panelButtonsInternacional, new TableLayoutConstraints( 0, 0 ) );
panelInternacional.add( scrollInternacional, new TableLayoutConstraints( 1, 0, 1, 1 ) ); panelInternacional.add( scrollInternacional, new TableLayoutConstraints( 0, 1, 1, 1 ) );
panelData.add( new JLabel("C" + oacute + "digo"), new TableLayoutConstraints( 0, 0 ) ); panelData.add( new JLabel("C" + oacute + "digo"), new TableLayoutConstraints( 0, 0 ) );
panelData.add( textCodigo, new TableLayoutConstraints( 1, 0 ) ); panelData.add( textCodigo, new TableLayoutConstraints( 1, 0 ) );

@ -29,6 +29,8 @@ import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError; import leaf.ui.LeafError;
import leaf.ui.LeafIconButton;
import leaf.ui.LeafUIConstants;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.Empresas; import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.HsArea; import siprp.database.cayenne.objects.HsArea;
@ -36,7 +38,7 @@ import siprp.database.cayenne.objects.HsPosto;
import siprp.logic.node.AreaNode; import siprp.logic.node.AreaNode;
import siprp.logic.node.PostoNode; import siprp.logic.node.PostoNode;
public class GerirAreasPanel extends JPanel public class GerirAreasPanel extends JPanel implements LeafUIConstants
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -45,17 +47,17 @@ public class GerirAreasPanel extends JPanel
private final JPanel panelTree = new JPanel(); private final JPanel panelTree = new JPanel();
public final LeafButton buttonAreaCriar = new LeafButton( "Criar" ); public final LeafButton buttonAreaCriar = LeafIconButton.createDefaultNewButton();
public final LeafButton buttonAreaEditar = new LeafButton( "Editar" ); public final LeafButton buttonAreaEditar = LeafIconButton.createDefaultEditButton();
public final LeafButton buttonAreaRemover = new LeafButton( "Remover" ); public final LeafButton buttonAreaRemover = LeafIconButton.createDefaultRemoveButton();
public final LeafButton buttonPostoCriar = new LeafButton( "Criar" ); public final LeafButton buttonPostoCriar = LeafIconButton.createDefaultNewButton();
public final LeafButton buttonPostoEditar = new LeafButton( "Editar" ); public final LeafButton buttonPostoEditar = LeafIconButton.createDefaultEditButton();
public final LeafButton buttonPostoRemover = new LeafButton( "Remover" ); public final LeafButton buttonPostoRemover = LeafIconButton.createDefaultRemoveButton();
private final DefaultMutableTreeNode root = new DefaultMutableTreeNode(); private final DefaultMutableTreeNode root = new DefaultMutableTreeNode();
@ -117,7 +119,7 @@ public class GerirAreasPanel extends JPanel
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
panel.setBorder( BorderFactory.createTitledBorder( "Area" ) ); panel.setBorder( BorderFactory.createTitledBorder( "Area" ) );
panel.setLayout( new GridLayout( 3, 1 ) ); panel.setLayout( new GridLayout( 1, 3 ) );
panel.add( buttonAreaCriar ); panel.add( buttonAreaCriar );
panel.add( buttonAreaEditar ); panel.add( buttonAreaEditar );
panel.add( buttonAreaRemover ); panel.add( buttonAreaRemover );
@ -125,7 +127,7 @@ public class GerirAreasPanel extends JPanel
panel = new JPanel(); panel = new JPanel();
panel.setBorder( BorderFactory.createTitledBorder( "Posto" ) ); panel.setBorder( BorderFactory.createTitledBorder( "Posto" ) );
panel.setLayout( new GridLayout( 3, 1 ) ); panel.setLayout( new GridLayout( 1, 3 ) );
panel.add( buttonPostoCriar ); panel.add( buttonPostoCriar );
panel.add( buttonPostoEditar ); panel.add( buttonPostoEditar );
panel.add( buttonPostoRemover ); panel.add( buttonPostoRemover );

@ -27,6 +27,8 @@ import javax.swing.tree.TreeSelectionModel;
import leaf.ui.LeafButton; import leaf.ui.LeafButton;
import leaf.ui.LeafError; import leaf.ui.LeafError;
import leaf.ui.LeafIconButton;
import leaf.ui.LeafUIConstants;
import leaf.ui.TreeTools; import leaf.ui.TreeTools;
import siprp.database.cayenne.objects.HsMedida; import siprp.database.cayenne.objects.HsMedida;
import siprp.database.cayenne.objects.HsRisco; import siprp.database.cayenne.objects.HsRisco;
@ -34,7 +36,7 @@ import siprp.database.cayenne.objects.HsRiscoMedida;
import siprp.database.cayenne.objects.HsRiscoTema; import siprp.database.cayenne.objects.HsRiscoTema;
import siprp.logic.HigieneSegurancaLogic; import siprp.logic.HigieneSegurancaLogic;
public class GerirRiscosPanel extends JPanel public class GerirRiscosPanel extends JPanel implements LeafUIConstants
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -57,21 +59,21 @@ public class GerirRiscosPanel extends JPanel
private final GerirMedidaPanel panelDataMedida = new GerirMedidaPanel(); private final GerirMedidaPanel panelDataMedida = new GerirMedidaPanel();
private final LeafButton buttonTemaCriar = new LeafButton( "Criar" ); private final LeafButton buttonTemaCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonTemaEditar = new LeafButton( "Editar" ); private final LeafButton buttonTemaEditar = LeafIconButton.createDefaultEditButton();
private final LeafButton buttonTemaRemover = new LeafButton( "Remover" ); private final LeafButton buttonTemaRemover = LeafIconButton.createDefaultRemoveButton();
private final LeafButton buttonRiscoCriar = new LeafButton( "Criar" ); private final LeafButton buttonRiscoCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonRiscoEditar = new LeafButton( "Editar" ); private final LeafButton buttonRiscoEditar = LeafIconButton.createDefaultEditButton();
private final LeafButton buttonRiscoRemover = new LeafButton( "Remover" ); private final LeafButton buttonRiscoRemover = LeafIconButton.createDefaultRemoveButton();
private final LeafButton buttonMedidaCriar = new LeafButton( "Criar" ); private final LeafButton buttonMedidaCriar = LeafIconButton.createDefaultNewButton();
private final LeafButton buttonMedidaRemover = new LeafButton( "Remover" ); private final LeafButton buttonMedidaRemover = LeafIconButton.createDefaultRemoveButton();
private final DefaultMutableTreeNode root = new DefaultMutableTreeNode(); private final DefaultMutableTreeNode root = new DefaultMutableTreeNode();
@ -429,18 +431,18 @@ public class GerirRiscosPanel extends JPanel
private void startupLayout() private void startupLayout()
{ {
TableLayout layout = new TableLayout( new double[] { TableLayout layout = new TableLayout( new double[] {
TableLayout.MINIMUM, TableLayout.PREFERRED, TableLayout.FILL TableLayout.PREFERRED, TableLayout.FILL
}, new double[] { }, new double[] {
TableLayout.FILL TableLayout.MINIMUM, TableLayout.FILL
} ); } );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
setLayout( layout ); setLayout( layout );
layout = new TableLayout( new double[] { layout = new TableLayout( new double[] {
TableLayout.MINIMUM TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL
}, new double[] { }, new double[] {
TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL TableLayout.MINIMUM
} ); } );
layout.setHGap( 5 ); layout.setHGap( 5 );
layout.setVGap( 5 ); layout.setVGap( 5 );
@ -480,24 +482,25 @@ public class GerirRiscosPanel extends JPanel
{ {
JPanel panel = new JPanel(); JPanel panel = new JPanel();
panel.setBorder( BorderFactory.createTitledBorder( "Tema" ) ); panel.setBorder( BorderFactory.createTitledBorder( "Tema" ) );
panel.setLayout( new GridLayout( 3, 1 ) ); panel.setLayout( new GridLayout( 1, 3 ) );
panel.add( buttonTemaCriar ); panel.add( buttonTemaCriar );
panel.add( buttonTemaEditar ); panel.add( buttonTemaEditar );
panel.add( buttonTemaRemover ); panel.add( buttonTemaRemover );
panelButtons.add( panel, new TableLayoutConstraints( 0, 0 ) ); panelButtons.add( panel, new TableLayoutConstraints( 0, 0 ) );
panel = new JPanel(); panel = new JPanel();
panel.setBorder( BorderFactory.createTitledBorder( "Risco" ) ); panel.setBorder( BorderFactory.createTitledBorder( "Risco" ) );
panel.setLayout( new GridLayout( 3, 1 ) ); panel.setLayout( new GridLayout( 1, 3 ) );
panel.add( buttonRiscoCriar ); panel.add( buttonRiscoCriar );
panel.add( buttonRiscoEditar ); panel.add( buttonRiscoEditar );
panel.add( buttonRiscoRemover ); panel.add( buttonRiscoRemover );
panelButtons.add( panel, new TableLayoutConstraints( 0, 1 ) ); panelButtons.add( panel, new TableLayoutConstraints( 1, 0 ) );
panel = new JPanel(); panel = new JPanel();
panel.setBorder( BorderFactory.createTitledBorder( "Requisito" ) ); panel.setBorder( BorderFactory.createTitledBorder( "Requisito" ) );
panel.setLayout( new GridLayout( 2, 1 ) ); panel.setLayout( new GridLayout( 1, 3 ) );
panel.add( buttonMedidaCriar ); panel.add( buttonMedidaCriar );
panel.add( buttonMedidaRemover ); panel.add( buttonMedidaRemover );
panelButtons.add( panel, new TableLayoutConstraints( 0, 2 ) ); panel.add( new JPanel() );
panelButtons.add( panel, new TableLayoutConstraints( 2, 0 ) );
panelTree.add( scroll, new TableLayoutConstraints( 0, 0 ) ); panelTree.add( scroll, new TableLayoutConstraints( 0, 0 ) );
@ -506,8 +509,8 @@ public class GerirRiscosPanel extends JPanel
panelData.add( panelDataMedida, PANEL_MEDIDA ); panelData.add( panelDataMedida, PANEL_MEDIDA );
add( panelButtons, new TableLayoutConstraints( 0, 0 ) ); add( panelButtons, new TableLayoutConstraints( 0, 0 ) );
add( panelTree, new TableLayoutConstraints( 1, 0 ) ); add( panelTree, new TableLayoutConstraints( 0, 1 ) );
add( panelData, new TableLayoutConstraints( 2, 0 ) ); add( panelData, new TableLayoutConstraints( 1, 1 ) );
} }
private void selectCard() private void selectCard()

@ -85,7 +85,9 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
private final PlanoActuacaoPanel panelPlano = new PlanoActuacaoPanel(); private final PlanoActuacaoPanel panelPlano = new PlanoActuacaoPanel();
private final RelatorioLegislacoesPanel panelLegislacao = new RelatorioLegislacoesPanel(); private final RelatorioLegislacaoPanel panelLegislacao = new RelatorioLegislacaoPanel();
private final RelatorioNormalizacaoPanel panelNormalizacao = new RelatorioNormalizacaoPanel();
ButtonGroup bg = new ButtonGroup(); ButtonGroup bg = new ButtonGroup();
@ -110,6 +112,11 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
panelEquipamentos.setBorder( BorderFactory.createTitledBorder( "Equipamentos de medi"+ccedil+atilde+"o" ) ); panelEquipamentos.setBorder( BorderFactory.createTitledBorder( "Equipamentos de medi"+ccedil+atilde+"o" ) );
tabs.addTab( "Plano de actua" + ccedil + atilde + "o", panelPlano ); tabs.addTab( "Plano de actua" + ccedil + atilde + "o", panelPlano );
tabs.addTab( "Legisla" + ccedil + atilde + "o", panelLegislacao ); tabs.addTab( "Legisla" + ccedil + atilde + "o", panelLegislacao );
tabs.addTab( "Normaliza" + ccedil + atilde + "o", panelNormalizacao );
tabs.setEnabledAt( 1, false );
tabs.setEnabledAt( 2, false );
buttonSave.setToolTipText( "Guardar" );
buttonRevert.setToolTipText( "Reverter" );
} }
private void startupLayout() private void startupLayout()

@ -2,7 +2,7 @@ package siprp.higiene.relatorio;
import javax.swing.JPanel; import javax.swing.JPanel;
public class RelatorioLegislacoesPanel extends JPanel public class RelatorioLegislacaoPanel extends JPanel
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -0,0 +1,10 @@
package siprp.higiene.relatorio;
import javax.swing.JPanel;
public class RelatorioNormalizacaoPanel extends JPanel
{
private static final long serialVersionUID = 1L;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 879 B

@ -5,7 +5,7 @@ import java.awt.Insets;
import com.evolute.utils.images.ImageException; import com.evolute.utils.images.ImageException;
import com.evolute.utils.images.ImageIconLoader; import com.evolute.utils.images.ImageIconLoader;
public class LeafIconButton extends LeafButton public class LeafIconButton extends LeafButton implements LeafUIConstants
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -14,6 +14,27 @@ public class LeafIconButton extends LeafButton
super(ImageIconLoader.loadImageIcon( imagePath )); super(ImageIconLoader.loadImageIcon( imagePath ));
} }
public static LeafIconButton createDefaultNewButton()
{
LeafIconButton result = createButton( ICON_NAME_CREATE );
result.setToolTipText( "Criar" );
return result;
}
public static LeafIconButton createDefaultEditButton()
{
LeafIconButton result = createButton( ICON_NAME_EDIT );
result.setToolTipText( "Editar" );
return result;
}
public static LeafIconButton createDefaultRemoveButton()
{
LeafIconButton result = createButton( ICON_NAME_REMOVE );
result.setToolTipText( "Remover" );
return result;
}
public static LeafIconButton createButton( String imagePath ) public static LeafIconButton createButton( String imagePath )
{ {
LeafIconButton result = null; LeafIconButton result = null;

@ -0,0 +1,15 @@
package leaf.ui;
public interface LeafUIConstants
{
public static final String ICON_NAME_CREATE = "leaf/ui/icons/create.png";
public static final String ICON_NAME_EDIT = "leaf/ui/icons/edit.png";
public static final String ICON_NAME_REMOVE = "leaf/ui/icons/delete.png";
public static final String ICON_NAME_SAVE = "leaf/ui/icons/save.png";
public static final String ICON_NAME_REVERT = "leaf/ui/icons/revert.png";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Loading…
Cancel
Save