diff --git a/trunk/siprp/medicina/processo/ProcessoController.java b/trunk/siprp/medicina/processo/ProcessoController.java index c15331a1..158ac93a 100644 --- a/trunk/siprp/medicina/processo/ProcessoController.java +++ b/trunk/siprp/medicina/processo/ProcessoController.java @@ -9,6 +9,9 @@ package siprp.medicina.processo; +import siprp.medicina.processo.detalhes.DetalhesProcessoPanel; +import siprp.medicina.processo.estrutura.EstruturaProcessoPanel; + /** * * @author Frederico diff --git a/trunk/siprp/medicina/processo/ProcessoEvent.java b/trunk/siprp/medicina/processo/ProcessoEvent.java index dc960185..d14ed592 100644 --- a/trunk/siprp/medicina/processo/ProcessoEvent.java +++ b/trunk/siprp/medicina/processo/ProcessoEvent.java @@ -33,11 +33,12 @@ public class ProcessoEvent public static final int ACCAO_ESCREVER_MAIL = 15; public static final int OBJECTO_ANY = 0; - public static final int OBJECTO_CONSULTA = 1; - public static final int OBJECTO_ECDS = 2; - public static final int OBJECTO_DATA = 3; - public static final int OBJECTO_OBSERVACOES = 4; - public static final int OBJECTO_MAIL = 5; + public static final int OBJECTO_PROCESSO = 1; + public static final int OBJECTO_CONSULTA = 2; + public static final int OBJECTO_ECDS = 3; + public static final int OBJECTO_DATA = 4; + public static final int OBJECTO_OBSERVACOES = 5; + public static final int OBJECTO_MAIL = 6; protected final int accao; protected final int tiposObjectos[]; diff --git a/trunk/siprp/medicina/processo/ProcessoPanel.java b/trunk/siprp/medicina/processo/ProcessoPanel.java index 3f4c30b0..61d83e4b 100644 --- a/trunk/siprp/medicina/processo/ProcessoPanel.java +++ b/trunk/siprp/medicina/processo/ProcessoPanel.java @@ -22,6 +22,7 @@ import javax.swing.*; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import siprp.medicina.processo.data.MarcacoesProcessoData; +import siprp.medicina.processo.estrutura.EstruturaProcessoPanel; /** * diff --git a/trunk/siprp/medicina/processo/ProcessoWindow.java b/trunk/siprp/medicina/processo/ProcessoWindow.java index a7cafb15..f74381d0 100644 --- a/trunk/siprp/medicina/processo/ProcessoWindow.java +++ b/trunk/siprp/medicina/processo/ProcessoWindow.java @@ -16,6 +16,7 @@ import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; +import siprp.medicina.processo.estrutura.EstruturaProcessoPanel; /** * diff --git a/trunk/siprp/medicina/processo/DetalhesProcessoPanel.java b/trunk/siprp/medicina/processo/detalhes/DetalhesProcessoPanel.java similarity index 89% rename from trunk/siprp/medicina/processo/DetalhesProcessoPanel.java rename to trunk/siprp/medicina/processo/detalhes/DetalhesProcessoPanel.java index 5cf86aa1..121e365d 100644 --- a/trunk/siprp/medicina/processo/DetalhesProcessoPanel.java +++ b/trunk/siprp/medicina/processo/detalhes/DetalhesProcessoPanel.java @@ -7,10 +7,11 @@ * and open the template in the editor. */ -package siprp.medicina.processo; +package siprp.medicina.processo.detalhes; import java.util.Vector; import javax.swing.JPanel; +import siprp.medicina.processo.*; /** * diff --git a/trunk/siprp/medicina/processo/estrutura/ConsultaMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/ConsultaMutableTreeNode.java new file mode 100644 index 00000000..2a6988db --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/ConsultaMutableTreeNode.java @@ -0,0 +1,30 @@ +/* + * ConsultaMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:31 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class ConsultaMutableTreeNode extends EstruturaProcessoMutableTreeNode +{ + public static final String ICON_PATH = "/siprp/medicina/processo/estrutura/icons/consulta.png"; + + /** Creates a new instance of ConsultaMutableTreeNode */ + public ConsultaMutableTreeNode( Integer id, String descricao ) + { + super( id, descricao ); + } + + protected String getIconPath() + { + return ICON_PATH; + } +} diff --git a/trunk/siprp/medicina/processo/estrutura/DataMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/DataMutableTreeNode.java new file mode 100644 index 00000000..3332ad62 --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/DataMutableTreeNode.java @@ -0,0 +1,30 @@ +/* + * DataMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:32 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class DataMutableTreeNode extends EstruturaProcessoMutableTreeNode +{ + public static final String ICON_PATH = "/siprp/medicina/processo/estrutura/icons/data.png"; + + /** Creates a new instance of DataMutableTreeNode */ + public DataMutableTreeNode( Integer id, String descricao ) + { + super( id, descricao ); + } + + protected String getIconPath() + { + return ICON_PATH; + } +} \ No newline at end of file diff --git a/trunk/siprp/medicina/processo/estrutura/ECDsMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/ECDsMutableTreeNode.java new file mode 100644 index 00000000..7f161227 --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/ECDsMutableTreeNode.java @@ -0,0 +1,30 @@ +/* + * ECDsMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:31 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class ECDsMutableTreeNode extends EstruturaProcessoMutableTreeNode +{ + public static final String ICON_PATH = "/siprp/medicina/processo/estrutura/icons/ecds.png"; + + /** Creates a new instance of ECDsMutableTreeNode */ + public ECDsMutableTreeNode( Integer id, String descricao ) + { + super( id, descricao ); + } + + protected String getIconPath() + { + return ICON_PATH; + } +} diff --git a/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoMutableTreeNode.java new file mode 100644 index 00000000..e9b0079d --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoMutableTreeNode.java @@ -0,0 +1,77 @@ +/* + * EstruturaProcessoMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 18:57 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +import com.evolute.utils.data.IDObject; +import com.evolute.utils.images.ImageIconLoader; +import javax.swing.Icon; +import javax.swing.tree.DefaultMutableTreeNode; + +/** + * + * @author Frederico + */ +abstract public class EstruturaProcessoMutableTreeNode extends DefaultMutableTreeNode + implements IDObject +{ + protected Icon icon; + protected Integer id; + protected String descricao; + + /** Creates a new instance of EstruturaProcessoMutableTreeNode */ + public EstruturaProcessoMutableTreeNode( Integer id, String descricao ) + { + super( descricao ); + this.id = id; + this.descricao = descricao; + } + + public Integer getID() + { + return id; + } + + public void setID( Integer id ) + { + this.id = id; + } + + public String getDescricao() + { + return descricao; + } + + public void setDescricao( String descricao ) + { + this.descricao = descricao; + } + + abstract protected String getIconPath(); + + public Icon getICon() + { + return icon; + } + + protected void loadIcon() + { + if( icon == null ) + { + try + { + ImageIconLoader.loadImageIcon( getClass(), getIconPath() ); + } + catch( Exception ex ) + { + ex.printStackTrace(); + } + } + } +} diff --git a/trunk/siprp/medicina/processo/EstruturaProcessoPanel.java b/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoPanel.java similarity index 90% rename from trunk/siprp/medicina/processo/EstruturaProcessoPanel.java rename to trunk/siprp/medicina/processo/estrutura/EstruturaProcessoPanel.java index aea35a6b..9263a309 100644 --- a/trunk/siprp/medicina/processo/EstruturaProcessoPanel.java +++ b/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoPanel.java @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package siprp.medicina.processo; +package siprp.medicina.processo.estrutura; import com.evolute.utils.data.IDObject; import com.evolute.utils.data.MappableObject; @@ -23,6 +23,7 @@ import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; +import siprp.medicina.processo.*; import siprp.medicina.processo.data.MarcacoesProcessoData; /** @@ -43,8 +44,6 @@ public class EstruturaProcessoPanel extends JPanel protected IDObject trabalhador; protected final HashMap PROCESSOS_POR_ID = new HashMap(); - private final Vector SELECTION_LISTENERS = - new Vector(); private final Vector PROCESSO_LISTENERS = new Vector(); @@ -125,22 +124,9 @@ public class EstruturaProcessoPanel extends JPanel } } - public void addTreeSelectionListener( TreeSelectionListener listener ) - { - SELECTION_LISTENERS.add( listener ); - } - - public void removeTreeSelectionListener( TreeSelectionListener listener ) - { - SELECTION_LISTENERS.remove( listener ); - } - public void valueChanged(TreeSelectionEvent e) { - for( int n = 0; n < SELECTION_LISTENERS.size(); n++ ) - { - SELECTION_LISTENERS.get( n ).valueChanged( e ); - } + } public MarcacoesProcessoData getProcessoEscolhido() diff --git a/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoRenderer.java b/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoRenderer.java new file mode 100644 index 00000000..fa026fb0 --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/EstruturaProcessoRenderer.java @@ -0,0 +1,46 @@ +/* + * EstruturaProcessoRenderer.java + * + * Created on 29 de Abril de 2007, 18:52 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +import java.awt.Component; +import javax.swing.*; +import javax.swing.tree.*; + +/** + * + * @author Frederico + */ +public class EstruturaProcessoRenderer extends DefaultTreeCellRenderer +{ + + /** Creates a new instance of EstruturaProcessoRenderer */ + public EstruturaProcessoRenderer() + { + } + + public Component getTreeCellRendererComponent( + JTree tree, + Object value, + boolean sel, + boolean expanded, + boolean leaf, + int row, + boolean hasFocus) { + + super.getTreeCellRendererComponent( + tree, value, sel, + expanded, leaf, row, + hasFocus); + EstruturaProcessoMutableTreeNode node = ( EstruturaProcessoMutableTreeNode ) value; + setIcon( node.getICon() ); + + return this; + } +} diff --git a/trunk/siprp/medicina/processo/estrutura/FichaAptidaoMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/FichaAptidaoMutableTreeNode.java new file mode 100644 index 00000000..d961d024 --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/FichaAptidaoMutableTreeNode.java @@ -0,0 +1,30 @@ +/* + * FichaAptidaoMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:32 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class FichaAptidaoMutableTreeNode extends EstruturaProcessoMutableTreeNode +{ + public static final String ICON_PATH = "/siprp/medicina/processo/estrutura/icons/fichaaptidao.png"; + + /** Creates a new instance of FichaAptidaoMutableTreeNode */ + public FichaAptidaoMutableTreeNode( Integer id, String descricao ) + { + super( id, descricao ); + } + + protected String getIconPath() + { + return ICON_PATH; + } +} diff --git a/trunk/siprp/medicina/processo/estrutura/MailMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/MailMutableTreeNode.java new file mode 100644 index 00000000..0a1687d4 --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/MailMutableTreeNode.java @@ -0,0 +1,30 @@ +/* + * MailMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:32 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class MailMutableTreeNode extends EstruturaProcessoMutableTreeNode +{ + public static final String ICON_PATH = "/siprp/medicina/processo/estrutura/icons/mail.png"; + + /** Creates a new instance of MailMutableTreeNode */ + public MailMutableTreeNode( Integer id, String descricao ) + { + super( id, descricao ); + } + + protected String getIconPath() + { + return ICON_PATH; + } +} diff --git a/trunk/siprp/medicina/processo/estrutura/ObservacoesMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/ObservacoesMutableTreeNode.java new file mode 100644 index 00000000..3c5046cb --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/ObservacoesMutableTreeNode.java @@ -0,0 +1,30 @@ +/* + * ObservacoesMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:32 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class ObservacoesMutableTreeNode extends EstruturaProcessoMutableTreeNode +{ + public static final String ICON_PATH = "/siprp/medicina/processo/estrutura/icons/observacoes.png"; + + /** Creates a new instance of ObservacoesMutableTreeNode */ + public ObservacoesMutableTreeNode( Integer id, String descricao ) + { + super( id, descricao ); + } + + protected String getIconPath() + { + return ICON_PATH; + } +} diff --git a/trunk/siprp/medicina/processo/estrutura/ProcessoMutableTreeNode.java b/trunk/siprp/medicina/processo/estrutura/ProcessoMutableTreeNode.java new file mode 100644 index 00000000..b0629ab5 --- /dev/null +++ b/trunk/siprp/medicina/processo/estrutura/ProcessoMutableTreeNode.java @@ -0,0 +1,24 @@ +/* + * ProcessoMutableTreeNode.java + * + * Created on 29 de Abril de 2007, 19:31 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.medicina.processo.estrutura; + +/** + * + * @author Frederico + */ +public class ProcessoMutableTreeNode +{ + + /** Creates a new instance of ProcessoMutableTreeNode */ + public ProcessoMutableTreeNode() + { + } + +} diff --git a/trunk/siprp/medicina/processo/estrutura/icons/consulta.png b/trunk/siprp/medicina/processo/estrutura/icons/consulta.png new file mode 100644 index 00000000..f07be69b Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/consulta.png differ diff --git a/trunk/siprp/medicina/processo/estrutura/icons/data.png b/trunk/siprp/medicina/processo/estrutura/icons/data.png new file mode 100644 index 00000000..59f184fc Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/data.png differ diff --git a/trunk/siprp/medicina/processo/estrutura/icons/ecds.png b/trunk/siprp/medicina/processo/estrutura/icons/ecds.png new file mode 100644 index 00000000..4aa424d1 Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/ecds.png differ diff --git a/trunk/siprp/medicina/processo/estrutura/icons/fichaaptidao.png b/trunk/siprp/medicina/processo/estrutura/icons/fichaaptidao.png new file mode 100644 index 00000000..ce2d52a5 Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/fichaaptidao.png differ diff --git a/trunk/siprp/medicina/processo/estrutura/icons/mail.png b/trunk/siprp/medicina/processo/estrutura/icons/mail.png new file mode 100644 index 00000000..84af8975 Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/mail.png differ diff --git a/trunk/siprp/medicina/processo/estrutura/icons/observacoes.png b/trunk/siprp/medicina/processo/estrutura/icons/observacoes.png new file mode 100644 index 00000000..1f0856fb Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/observacoes.png differ diff --git a/trunk/siprp/medicina/processo/estrutura/icons/processo.png b/trunk/siprp/medicina/processo/estrutura/icons/processo.png new file mode 100644 index 00000000..d3f22513 Binary files /dev/null and b/trunk/siprp/medicina/processo/estrutura/icons/processo.png differ