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

lxbfYeaa
Tiago Simão 17 years ago
parent a635d06904
commit d644cfc5d3

@ -0,0 +1,342 @@
package leaf.data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
public class OrderedMap<KeyClass extends Object> implements Iterable<KeyClass>
{
private static final long serialVersionUID = 1L;
private Vector<KeyClass> order = new Vector<KeyClass>();
private HashMap<KeyClass, List<Object>> map = new HashMap<KeyClass, List<Object>>();
public OrderedMap()
{
}
public OrderedMap(Collection<KeyClass> allPrestadores)
{
Iterator<KeyClass> iterator = allPrestadores.iterator();
while( iterator.hasNext() )
{
KeyClass value = iterator.next();
this.putLast( value, value );
}
}
public List<Object> getRow( int row )
{
return map.get( order.get( row ) );
}
public List<Object> getValues( KeyClass key )
{
return map.get( key );
}
public int rows()
{
return order.size();
}
public KeyClass getKeyForValue( Object value )
{
for( KeyClass key : map.keySet() )
{
List<Object> values = map.get( key );
if( value.equals( values ) )
{
return key;
}
else
{
for( Object currentValue : values )
{
if( currentValue.equals( value ) )
{
return key;
}
}
}
}
return null;
}
/**
* returns the length of the biggest line
*
* @return
*/
public int columns()
{
int result = 0;
for( KeyClass key : order )
{
result = map.get( key ).size() > result ? map.get( key ).size() : result;
}
return result;
}
public List<Object> getColumn( int i )
{
List<Object> result = new ArrayList<Object>();
if( order != null && order.size() > 0 )
{
for( KeyClass key : order )
{
List<Object> row = map.get( key );
if( row != null && row.size() > 0 )
{
result.add( row.get( 0 ) );
}
else
{
row.add( null );
}
}
}
return result;
}
public KeyClass getFirst()
{
return order.isEmpty() ? null : order.get( 0 );
}
public Iterator<KeyClass> iterator()
{
return order.iterator();
}
public boolean containsKey( KeyClass key )
{
return map.containsKey( key );
}
public Object getValueAt( int row, int column )
{
Object result = null;
if( row < order.size() )
{
List<Object> line = map.get( order.get( row ) );
if( column < line.size() )
{
result = line.get( column );
}
}
return result;
}
/**
* Adds arguments to the end of the row (on given order)
*
* @param key
* @param values
*/
public void putLast( KeyClass key, Object... values )
{
if( values != null )
{
for( Object currentValue : values )
{
putLast( key, currentValue );
}
}
}
/**
* Adds argument to the end of the row
*
* @param key
* @param value
*/
public void putLast( KeyClass key, Object value )
{
List<Object> list;
if( map.containsKey( key ) )
{
list = map.get( key );
}
else
{
list = new ArrayList<Object>();
order.add( key );
}
list.add( value );
map.put( key, list );
}
public List<Object> remove( Object key )
{
order.remove( key );
return map.remove( key );
}
/**
* Orders by first column (rows compared as strings)
*/
public void order()
{
order( 0 );
}
public void order( int columnNumber )
{
order( new int[] {
columnNumber
}, 0, 0, order.size() - 1, order );
}
public void order( int[] colNumbers )
{
order( colNumbers, 0, 0, order.size() - 1, order );
}
private void order( int[] colNumbers, int currentColumnIndex, int fromLineNumber, int toLineNumber, List<KeyClass> order )
{
if( colNumbers != null && currentColumnIndex >= 0 && fromLineNumber < toLineNumber && toLineNumber < order.size() && currentColumnIndex < colNumbers.length )
{
int columnNumber = colNumbers[currentColumnIndex];
if( order != null && order.size() > 0 )
{
List<Pair<String, KeyClass>> sortedList = new ArrayList<Pair<String, KeyClass>>();
for( int i = fromLineNumber; i < order.size() && i < (toLineNumber + 1); ++i )
{
KeyClass key = order.get( i );
List<Object> row = map.get( key );
String value = "";
if( row != null && row.size() > columnNumber && row.get( columnNumber ) != null )
{
value = row.get( columnNumber ).toString();
}
sortedList.add( new Pair<String, KeyClass>( value, key ) );
}
Collections.sort( sortedList );
List<Pair<String, KeyClass>> equalEntries = new ArrayList<Pair<String, KeyClass>>();
for( int i = 0; i < sortedList.size(); ++i )
{
Pair<String, KeyClass> entry = sortedList.get( i );
if( equalEntries.isEmpty() && i < (sortedList.size() - 1) )
{
equalEntries.add( entry );
}
else
{
Pair<String, KeyClass> previousEntry = equalEntries.get( 0 );
if( previousEntry.getCar().equals( entry.getCar() ) )
{
if( i < (sortedList.size() - 1) )
{
equalEntries.add( entry );
continue;
}
else
{
equalEntries.add( entry );
++i;
}
}
if( equalEntries.size() > 1 )
{
List<KeyClass> toSubOrder = new Vector<KeyClass>();
List<String> DEBUGLIST = new Vector<String>();
for( Pair<String, KeyClass> pair : equalEntries )
{
toSubOrder.add( pair.getCdr() );
DEBUGLIST.add( pair.getCar() );
}
order( colNumbers, currentColumnIndex + 1, 0, toSubOrder.size() - 1, toSubOrder );
for( int j = 0; j < toSubOrder.size(); ++j )
{
sortedList.set( i - toSubOrder.size() + j, new Pair<String, KeyClass>( "", toSubOrder.get( j ) ) );
}
}
equalEntries.clear();
if( i < (sortedList.size() - 1) )
{
equalEntries.add( entry );
}
}
}
for( int i = 0; i < sortedList.size(); ++i )
{
Pair<String, KeyClass> value = sortedList.get( i );
order.set( i, value.getCdr() );
}
}
}
}
public void addRow( KeyClass key, List<Object> grupo )
{
if( key != null && grupo != null )
{
order.add( key );
map.put( key, grupo );
}
}
public void clear()
{
order.clear();
map.clear();
}
public void deleteRow( int row )
{
if( row < order.size() )
{
KeyClass key = order.get( row );
order.remove( row );
map.remove( key );
}
}
public KeyClass getKeyForRow( int row )
{
KeyClass result = null;
if( row < order.size() )
{
result = order.get( row );
}
return result;
}
public void setValueAt( int row, int col, Object obj )
{
if( row < order.size() )
{
List<Object> line = map.get( order.get( row ) );
if( col < line.size() )
{
line.add( col, obj );
}
}
}
public Object getFirstValue( KeyClass key )
{
return getValue( key, 0 );
}
public Object getValue( KeyClass key, int i )
{
Object result = null;
if( key != null && order.contains( key ) )
{
List<Object> row = map.get( key );
if( row != null && row.size() > i )
{
result = row.get( i );
}
}
return result;
}
}

@ -0,0 +1,48 @@
package leaf.data;
public class Pair<CarClass extends Comparable<CarClass>, CdrClass> implements Comparable<Pair<CarClass, CdrClass>>
{
private final CarClass car;
private final CdrClass cdr;
public Pair(CarClass car, CdrClass cdr)
{
this.car = car;
this.cdr = cdr;
}
public CarClass getCar()
{
return car;
}
public CdrClass getCdr()
{
return cdr;
}
@Override
public int compareTo( Pair<CarClass, CdrClass> toPair )
{
if(toPair == null)
{
return 1;
}
else if(car == null && toPair.getCar() == null)
{
return 0;
}
else
{
return getCar().compareTo( toPair.getCar() );
}
}
@Override
public String toString()
{
return "(" + (car == null ? "" : car.toString()) + ", "+ (cdr == null ? "" : cdr.toString()) + ")";
}
}

@ -0,0 +1,62 @@
package leaf.ui;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JButton;
public class LeafButton extends JButton
{
private static final long serialVersionUID = 1L;
public LeafButton(String text)
{
super( text );
setOpaque( false );
}
protected void paintComponent( Graphics g )
{
boolean pushed = getModel().isPressed();
// Color borderColor = getBackground();
// Color highlightColor = getBackground();
Color textColor = isEnabled() ? getForeground() : getForeground().brighter().brighter().brighter();
Color textAccent = getBackground();
Color textAccentHot = getBackground();
GradientPaint topGradientUp = new GradientPaint( 0, 0, getBackground().brighter(), 0, getHeight() / 2, getBackground() );
GradientPaint topGradientDown = new GradientPaint( 0, 0, getBackground().brighter(), 0, getHeight() / 2, getBackground() );
GradientPaint bottomGradientDown = new GradientPaint( 0, getHeight() / 2, getBackground(), 0, getHeight(), getBackground().darker() );
GradientPaint bottomGradientUp = new GradientPaint( 0, getHeight() / 2, getBackground(), 0, getHeight(), getBackground().darker().darker() );
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
int height = getHeight() / 2;
g2.setPaint( pushed ? topGradientDown : topGradientUp );
g2.fillRect( 0, 0, getWidth(), height );
g2.setPaint( pushed ? bottomGradientDown : bottomGradientUp );
g2.fillRect( 0, height, getWidth(), height );
// g2.setColor( borderColor );
// g2.drawRect( 0, 0, getWidth() - 1, getHeight() - 1 );
//
// g2.setColor( highlightColor );
// g2.drawRect( 1, 1, getWidth() - 3, getHeight() - 3 );
int x = (getWidth() - g2.getFontMetrics().stringWidth( getText() )) / 2;
int y = getHeight() - ((getHeight() - g2.getFontMetrics().getHeight()) / 2) - 3;
y += 1;
g2.setColor( pushed ? textAccentHot : textAccent );
g2.drawString( getText(), x, y );
y -= 1;
g2.setColor( textColor );
g2.drawString( getText(), x, y );
// super.paintComponent( g );
}
}

@ -0,0 +1,149 @@
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Date;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.border.BevelBorder;
import com.toedter.calendar.JCalendar;
public class LeafCalendarDialog extends JDialog
{
private static final long serialVersionUID = 1L;
public static final int ABOVE = 0;
public static final int BELOW = 1;
public static final int RIGHT = 0;
public static final int LEFT = 1;
private boolean ok = false;
private boolean clear = false;
private Calendar cal = null;
private boolean enableClean = true;
private boolean enableCancel = true;
private final JCalendar calendarPanel = new JCalendar( null, null, false, false );
/** Creates a new instance of JCalendarDialog */
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent)
{
super(parentFrame);
this.enableClean = true;
setModal( true );
setupComponents();
setUndecorated( true );
setLocationRelativeTo( parent );
setVisible( true );
}
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent, boolean enableClean )
{
super(parentFrame);
this.enableClean = enableClean;
setModal( true );
setupComponents();
setUndecorated( true );
setLocationRelativeTo( parent );
setVisible( true );
}
public LeafCalendarDialog( LeafWindow parentFrame, JComponent parent, boolean enableClean, boolean enableCancel )
{
super(parentFrame);
this.enableClean = enableClean;
this.enableCancel = enableCancel;
setModal( true );
setupComponents();
setUndecorated( true );
setLocationRelativeTo( parent );
setVisible( true );
}
private void setupComponents()
{
TableLayout layout = new TableLayout(new double[]{TableLayout.FILL,TableLayout.FILL,TableLayout.FILL}, new double[]{TableLayout.FILL, TableLayout.MINIMUM});
getContentPane().setLayout( layout );
getContentPane().add( calendarPanel, new TableLayoutConstraints(0,0,2,0));
LeafButton okButton = new LeafButton( "OK" );
okButton.addActionListener( new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
ok = true;
close();
}
} );
LeafButton cancelarButton = new LeafButton( "Cancelar" );
cancelarButton.setEnabled( enableCancel );
cancelarButton.addActionListener( new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
ok = false;
close();
}
} );
LeafButton limparButton = new LeafButton( "Limpar" );
limparButton.setEnabled(enableClean);
limparButton.addActionListener( new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
ok = false;
clear = true;
close();
}
} );
getContentPane().add( okButton, new TableLayoutConstraints(0,1) );
getContentPane().add( cancelarButton, new TableLayoutConstraints(1,1) );
getContentPane().add( limparButton, new TableLayoutConstraints(2,1) );
setSize( 250, 250 );
((JComponent) getContentPane()).setBorder( BorderFactory.createBevelBorder( BevelBorder.RAISED ) );
}
public Date getDate()
{
Date result = null;
if( ok )
{
cal = Calendar.getInstance();
cal.set( Calendar.HOUR_OF_DAY, 12 );
cal = calendarPanel.getCalendar();
cal.set( Calendar.YEAR, calendarPanel.getYearChooser().getYear() );
cal.set( Calendar.DAY_OF_MONTH, calendarPanel.getDayChooser().getDay() );
result = cal != null ? cal.getTime() : null;
}
else if( clear )
{
result = new Date( 0 );
}
return result;
}
public void close()
{
setVisible( false );
dispose();
}
}

@ -0,0 +1,29 @@
package leaf.ui;
import java.awt.Color;
import javax.swing.JPanel;
public class LeafGradientPanel extends JPanel
{
private static final long serialVersionUID = 1L;
public LeafGradientPanel()
{
setBackground( new Color(220,220,220) );
}
// @Override
// public void paintComponent( Graphics g )
// {
// Graphics2D g2d = (Graphics2D) g;
// GradientPaint gradientIn = new GradientPaint( 0, 0, getBackground(), getWidth()/2, 0, Color.DARK_GRAY );
// g2d.setPaint( gradientIn );
// g2d.fillRect( 0, 0, getWidth()/2, getHeight() );
//
// GradientPaint gradientOut = new GradientPaint( getWidth()/2, 0, Color.DARK_GRAY, getWidth(),0, getBackground() );
// g2d.setPaint( gradientOut );
// g2d.fillRect( getWidth()/2, 0, getWidth(), getHeight() );
// }
}

@ -0,0 +1,630 @@
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import leaf.data.OrderedMap;
public class LeafInputField<ObjClass extends Object> extends JPanel implements FocusListener, MouseListener, PropertyChangeListener
{
public static final String PROPERTY_CHANGED_CONSTANT = "LEAF_INPUT_PROPERTY_CHANGED";
public static final String PROPERTY_CHANGED_CLICK = "LEAF_PROPERTY_CHANGED_CLICK";
private static final long serialVersionUID = 1L;
private static final DateFormat sdf = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
private static final int defaultColorDec = 20;
private int colorDec = defaultColorDec;
public Dimension size = null;
private Color hot = null;
private Color cold = null;
private Color background = null;
private Color endColor = null;
private Color highLightColor = new Color( 180, 255, 180 );
private Object selectedOption = null;
private boolean isEditable = false;
private boolean isClickable = false;
private boolean highLighted = false;
private boolean collapseOptions = true;
private ObjClass object = null;
private GradientPaint outerContour = null;
private GradientPaint outerReversedContour = null;
private GradientPaint innerContour = null;
private GradientPaint innerReversedContour = null;
private GradientPaint gradient = null;
private TableLayout layout = null;
private JComponent thiz = null;
private List<JComponent> theeze = null;
public LeafInputField()
{
super();
setOpaque( false );
setBorder( BorderFactory.createEmptyBorder( 3, 10, 3, 10 ) );
setBackground( Color.WHITE );
hot = getBackground();
cold = new Color( hot.getRed() > colorDec ? hot.getRed() - colorDec : 0, hot.getGreen() > colorDec ? hot.getGreen() - colorDec : 0, hot.getBlue() > colorDec ? hot.getBlue() - colorDec : 0, hot.getAlpha() );
background = cold;
setObject( null );
}
public boolean isCollapseOptions()
{
return collapseOptions;
}
public void setCollapseOptions( boolean collapse )
{
collapseOptions = collapse;
}
private String getStringFromUser()
{
LeafTextDialog textDialog = new LeafTextDialog( getParentWindow(), this, (String) object, true );
return textDialog.getText();
}
private Object getOptionFromUser()
{
if( object instanceof Map )
{
if(((Map) object).size() > 0)
{
LeafOptionDialog<Object> optionDialog = new LeafOptionDialog<Object>( getParentWindow(), (Map) object, null );
return optionDialog.getOption();
}
}
else if( object instanceof OrderedMap )
{
if(((OrderedMap) object).rows() > 0)
{
LeafOptionDialog<Object> optionDialog = new LeafOptionDialog<Object>( getParentWindow(), (OrderedMap<Object>) object, null, null, null, null );
return optionDialog.getOption();
}
}
return null;
}
private Date getDateFromUser()
{
LeafCalendarDialog calendarDialog = new LeafCalendarDialog( getParentWindow(), this );
return calendarDialog.getDate();
}
private LeafWindow getParentWindow()
{
LeafWindow result = null;
for( Container parent = this.getParent(); parent != null; parent = parent.getParent() )
{
if( parent instanceof LeafWindow )
{
result = (LeafWindow) parent;
}
}
return result;
}
protected void paintComponent( Graphics g )
{
Graphics2D g2d = (Graphics2D) g;
int width = getWidth(), height = getHeight();
setColors( width, height );
g2d.setPaint( outerReversedContour );
g2d.fillRect( 15, 0, width / 4, height );
g2d.setPaint( outerContour );
g2d.fillRect( width / 4, 0, width, height );
g2d.setPaint( innerReversedContour );
g2d.fillRect( 15, 0, width / 4, height - 1 );
g2d.setPaint( innerContour );
g2d.fillRect( width / 4, 0, width, height - 1 );
g2d.setPaint( gradient );
g2d.fillRoundRect( 0, 2, width, height - 5, 15, 15 );
super.paintComponent( g );
}
private void setColors( int width, int height )
{
endColor = getGradientEndColor( background );
outerContour = new GradientPaint( width / 4, 0, Color.GRAY, width, 0, this.getParent().getBackground() );
outerReversedContour = new GradientPaint( 15, 0, this.getParent().getBackground(), width / 4, 0, Color.GRAY );
innerContour = new GradientPaint( width / 4, 0, Color.LIGHT_GRAY, width, 0, this.getParent().getBackground() );
innerReversedContour = new GradientPaint( 15, 0, this.getParent().getBackground(), width / 4, 0, Color.LIGHT_GRAY );
gradient = new GradientPaint( 0, 0, background, width, height, endColor );
}
private Color getGradientEndColor( Color startColor )
{
return getParent() != null ? getParent().getBackground() : startColor;
}
public boolean getSelected()
{
return highLighted;
}
public void setSelected( boolean selected )
{
highLighted = selected;
background = selected ? highLightColor : cold;
repaint();
}
public void setEditable( boolean editable )
{
isEditable = editable;
if( !editable )
{
setMouseOver( false );
}
setEnabled( editable );
setObject( object, selectedOption );
repaint();
}
public boolean isEditable()
{
return isEditable;
}
public void setClickable( boolean clickable )
{
isClickable = clickable;
if( !clickable )
{
setMouseOver( false );
}
repaint();
}
public boolean isClickable()
{
return isClickable;
}
private void setupCollapsedPanel()
{
List<Object> values = ((OrderedMap) object).getValues( selectedOption );
theeze = new ArrayList<JComponent>();
if( values != null )
{
double[] rows = new double[] {
TableLayout.MINIMUM
};
double[] cols = new double[values.size() > 0 ? (values.size() * 2 - 1) : 0];
for( int i = 0; i < cols.length; ++i )
{
cols[i] = (i % 2 == 0) ? TableLayout.FILL : TableLayout.MINIMUM;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setHGap( 5 );
thiz.setLayout( layout );
for( int i = 0, a = 0; i < cols.length; ++i )
{
JComponent comp = null;
if( i % 2 == 0 )
{
Object value = values.get( a++ );
comp = new JLabel( value == null ? " " : value.toString() );
theeze.add( comp );
}
else
{
comp = new JSeparator( JSeparator.VERTICAL );
}
thiz.add( comp, new TableLayoutConstraints( i, 0 ) );
}
}
}
private void setupUncollapsedPanel()
{
theeze = new ArrayList<JComponent>();
OrderedMap<Object> map = (OrderedMap<Object>) object;
double[] rows = new double[map.rows() > 0 ? (map.rows() * 2 - 1) : 0];
double[] cols = new double[map.columns() > 0 ? (map.columns() * 2 - 1) : 0];
for( int i = 0; i < rows.length; ++i )
{
rows[i] = (i % 2 == 0) ? TableLayout.MINIMUM : TableLayout.MINIMUM;
}
for( int i = 0; i < cols.length; ++i )
{
cols[i] = (i % 2 == 0) ? TableLayout.FILL : TableLayout.MINIMUM;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setHGap( 5 );
thiz.setLayout( layout );
for( int i = 0, a = 0; i < rows.length; ++i )
{
if( i % 2 == 0 )
{
List<Object> values = map.getRow( a++ );
for( int j = 0, b = 0; j < cols.length; ++j )
{
JComponent comp = null;
if( j % 2 == 0 )
{
Object value = values.get( b++ );
LeafInputField<Object> leaf;
if( value instanceof LeafInputField )
{
leaf = (LeafInputField<Object>) value;
}
else
{
leaf = new LeafInputField<Object>();
leaf.setObject( value );
if( j > 1 )
{
leaf.setEditable( isEditable );
}
}
comp = leaf;
theeze.add( comp );
}
else
{
JSeparator sep = new JSeparator( JSeparator.VERTICAL );
sep.setForeground( cold );
comp = sep;
}
thiz.add( comp, new TableLayoutConstraints( j, i ) );
}
}
else
{
JSeparator sep = new JSeparator();
sep.setForeground( cold );
thiz.add( sep, new TableLayoutConstraints( 0, i, cols.length - 1, i ) );
}
}
}
private void setSelectedObject( Object key )
{
selectedOption = key;
if( object != null && thiz != null )
{
if( object instanceof Map )
{
Object value = null;
value = ((Map) object).get( selectedOption );
String text = value == null ? " " : value.toString();
if( thiz instanceof JTextArea )
{
((JTextArea) thiz).setText( text );
}
else if( thiz instanceof JTextField )
{
((JTextField) thiz).setText( text );
}
else if( thiz instanceof JLabel )
{
((JLabel) thiz).setText( text );
}
}
else if( object instanceof OrderedMap )
{
if( thiz instanceof JPanel && collapseOptions )
{
setupCollapsedPanel();
}
else if( thiz instanceof JPanel && !collapseOptions )
{
setupUncollapsedPanel();
}
}
}
}
public Object getSelectedObject()
{
return selectedOption;
}
public void setObject( ObjClass object, Object selected )
{
this.selectedOption = selected;
setObject( object );
}
public void setObject( ObjClass object )
{
this.object = object;
if( object != null )
{
if( object instanceof Date )
{
Date date = (Date) object;
String text = date.getTime() == 0 ? "" : sdf.format( object );
thiz = isEditable ? new JLabel( text ) : new JTextArea( text );
thiz.setEnabled( false );
}
else if( object instanceof Map )
{
thiz = isEditable ? new JLabel( " " ) : new JTextArea( " " );
setSelectedObject( selectedOption );
thiz.setEnabled( false );
}
else if( object instanceof OrderedMap && collapseOptions )
{
thiz = new JPanel();
setSelectedObject( selectedOption );
}
else if( object instanceof OrderedMap && !collapseOptions )
{
thiz = new JPanel();
setSelectedObject( selectedOption );
}
else if( object instanceof LeafInputField )
{
setObject( (ObjClass) ((LeafInputField) object).getObject(), ((LeafInputField) object).getSelectedObject() );
}
else if( object instanceof String )
{
JTextArea textArea = new JTextArea();
textArea.setEditable( false );
textArea.setText( object == null ? "" : object.toString() );
thiz = textArea;
}
else
{
String toString = object.toString();
if( "".equals( toString ) )
{
toString = " ";
}
thiz = new JTextArea( toString );
}
}
else
{
thiz = new JLabel( " " );
}
reListen();
reLayout();
}
public ObjClass getObject()
{
return this.object;
}
private void reListen()
{
removeListeners();
if( theeze != null && !collapseOptions && !theeze.isEmpty() )
{
for( JComponent current : theeze )
{
if( current instanceof LeafInputField )
{
current.addFocusListener( (LeafInputField) current );
current.addMouseListener( (LeafInputField) current );
current.addPropertyChangeListener( PROPERTY_CHANGED_CONSTANT, this );
}
}
}
else
{
thiz.addFocusListener( this );
thiz.addMouseListener( this );
}
}
private void removeListeners()
{
removeListerensFrom( thiz );
if( theeze != null )
{
for( JComponent comp : theeze )
{
removeListerensFrom( comp );
}
}
}
private void removeListerensFrom( JComponent comp )
{
if( comp != null )
{
FocusListener[] allFocus = thiz.getFocusListeners();
if( allFocus != null )
{
for( FocusListener focusListener : allFocus )
{
comp.removeFocusListener( focusListener );
}
}
MouseListener[] allMouse = thiz.getMouseListeners();
if( allMouse != null )
{
for( MouseListener mouseListener : allMouse )
{
comp.removeMouseListener( mouseListener );
}
}
}
}
private void reLayout()
{
if( thiz != null )
{
SwingUtilities.invokeLater( new Runnable()
{
@Override
public void run()
{
if( layout == null )
{
layout = new TableLayout( new double[] {
TableLayout.FILL
}, new double[] {
TableLayout.FILL
} );
LeafInputField.this.setLayout( layout );
}
else
{
removeAll();
}
LeafInputField.this.add( thiz, new TableLayoutConstraints( 0, 0 ) );
revalidate();
repaint();
}
} );
size = thiz.getPreferredSize();
thiz.setOpaque( false );
}
}
@Override
public void focusLost( FocusEvent e )
{
repaint();
}
@Override
public void focusGained( FocusEvent e )
{
repaint();
}
@Override
public void mouseReleased( MouseEvent e )
{
}
@Override
public void mousePressed( MouseEvent e )
{
Object old = null;
if( object != null && isEditable )
{
if( object instanceof Date )
{
old = object;
ObjClass newDate = (ObjClass) getDateFromUser();
if( newDate != null )
{
setObject( newDate );
firePropertyChange( PROPERTY_CHANGED_CONSTANT, old, object );
}
}
else if( object instanceof Map && collapseOptions )
{
old = selectedOption;
ObjClass out = (ObjClass) getOptionFromUser();
setObject( object, out );
firePropertyChange( PROPERTY_CHANGED_CONSTANT, old, selectedOption );
}
else if( object instanceof OrderedMap && collapseOptions )
{
old = selectedOption;
ObjClass out = (ObjClass) getOptionFromUser();
setObject( object, out );
firePropertyChange( PROPERTY_CHANGED_CONSTANT, old, object );
}
else if( object instanceof OrderedMap && !collapseOptions )
{
// old = selectedOption;
// ObjClass out = (ObjClass) getOptionFromUser();
// setObject( object, out );
// firePropertyChange( PROPERTY_CHANGED_CONSTANT, old, object );
}
else if( object instanceof String )
{
old = object;
setObject( (ObjClass) getStringFromUser() );
firePropertyChange( PROPERTY_CHANGED_CONSTANT, old, object );
}
}
if( isClickable )
{
firePropertyChange( PROPERTY_CHANGED_CLICK, false, true );
}
// setObject( object, selectedOption );
}
@Override
public void mouseExited( MouseEvent e )
{
setMouseOver( false );
repaint();
}
@Override
public void mouseEntered( MouseEvent e )
{
setMouseOver( true );
repaint();
}
@Override
public void mouseClicked( MouseEvent e )
{
}
private void setMouseOver( boolean mouseOver )
{
if( mouseOver )
{
background = (!highLighted && (isEditable || isClickable)) ? hot : background;
}
else
{
background = (!highLighted && (isEditable || isClickable)) ? cold : background;
}
}
@Override
public void propertyChange( PropertyChangeEvent evt )
{
firePropertyChange( PROPERTY_CHANGED_CONSTANT, evt.getOldValue(), evt.getNewValue() );
}
}

@ -0,0 +1,103 @@
package leaf.ui;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
public class LeafLogic
{
/**
* Declares an Action
*
* @author tsimao
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface Action
{
/**
* true - this action saves data to de database from the components
* false - this action reads from the database to the components
*/
boolean isSave();
}
/**
* Binds a UI method with an action
*
* @author tsimao
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface LeafUIActionBinding
{
/**
* The name of the action this method binds to
*/
String [] action();
}
/**
* Binds a logic methods with a group of actions
*
* @author tsimao
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface LeafLogicActionBinding
{
/**
* The name of the action this method binds to
*/
String [] actions();
}
@Action(isSave = false)
public static final String ACTION_STARTUP = "ACTION_STARTUP";
@Action(isSave = false)
public static final String ACTION_CANCEL = "ACTION_CANCEL";
private List<LeafWindow> registeredWindows = new ArrayList<LeafWindow>();
public void addWindow(LeafWindow window)
{
registeredWindows .add(window);
}
public void runAction( String actionName )
{
runAction( actionName, null );
}
public void runAction( String actionName, Object argument )
{
for( LeafWindow window : registeredWindows )
{
window.runAction( actionName, argument );
}
}
public void runActionLater( String actionName )
{
for( LeafWindow window : registeredWindows )
{
window.runActionLater( actionName );
}
}
public void runActionLater( String actionName, Object argument )
{
for( LeafWindow window : registeredWindows )
{
window.runActionLater( actionName, argument );
}
}
}

@ -0,0 +1,22 @@
package leaf.ui;
import javax.swing.plaf.metal.MetalLookAndFeel;
public class LeafLookAndFeel extends MetalLookAndFeel
{
private static final long serialVersionUID = 1L;
@Override
public String getName()
{
return "LEAF";
}
@Override
public String getDescription()
{
return "Evolute's LEAF Look And Feel";
}
}

@ -0,0 +1,298 @@
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.ScrollPaneConstants;
import leaf.data.OrderedMap;
public class LeafOptionDialog<KeyClass extends Object> extends JDialog
{
private Dimension OPTION_SIZE = new Dimension( 200, 20 );
private Dimension BUTTON_SIZE = new Dimension( 200, 20 );
private int MAX_VISIBLE_OPTIONS = 20;
private static final long serialVersionUID = 1L;
private String CANCEL_LABEL = "Cancelar";
private String okLabel = null;
private final JLabel labelMessage = new JLabel();
private final JPanel optionsPanel = new JPanel();
private final JScrollPane optionsScrollPane = new JScrollPane();
private boolean cancelActive = true;
private LeafInputField<String> submitButton = new LeafInputField<String>();
private Map<KeyClass, ? extends Object> map = null;
private OrderedMap<KeyClass> orderedMap = null;
private List<KeyClass> selected = new ArrayList<KeyClass>();
private Map<KeyClass, Boolean> mapEnabledForKey = null;
private Map<KeyClass, Boolean> mapChosenForKey = null;
private String message = null;
private boolean ordered = false;
public LeafOptionDialog( LeafWindow owner, Map<KeyClass, ? extends Object> map, String message)
{
super( owner );
this.mapEnabledForKey = new HashMap<KeyClass, Boolean>();
this.mapChosenForKey = new HashMap<KeyClass, Boolean>();
this.message = message;
cancelActive = false;
for( KeyClass key : map.keySet() )
{
mapEnabledForKey.put( key, true );
}
startup( map, null );
}
public LeafOptionDialog( LeafWindow owner, OrderedMap<KeyClass> orderedMap, Map<KeyClass, Boolean> chosen, Map<KeyClass, Boolean> enabled, String message, String okButton)
{
super( owner );
ordered = true;
this.message = message;
okLabel = okButton;
cancelActive = okButton != null;
this.mapChosenForKey = chosen == null ? new HashMap<KeyClass, Boolean>() : chosen;
this.mapEnabledForKey = enabled == null ? new HashMap<KeyClass, Boolean>() : chosen;
if( chosen != null )
{
for( KeyClass key : chosen.keySet() )
{
Boolean isChosen = chosen.get( key );
if( isChosen != null && isChosen )
{
selected.add( key );
}
}
}
startup( null, orderedMap );
}
private void startup( Map<KeyClass, ? extends Object> map, OrderedMap<KeyClass> orderedMap )
{
if( map == null )
{
this.map = new HashMap<KeyClass, Object>();
}
else
{
this.map = map;
}
if( orderedMap == null )
{
this.orderedMap = new OrderedMap<KeyClass>();
}
else
{
this.orderedMap = orderedMap;
}
setupComponents( map == null ? orderedMap.iterator() : map.keySet().iterator(), map == null ? orderedMap.rows() : map.keySet().size(), map == null ? true : false );
setUndecorated( true );
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
setSize( getLayout().minimumLayoutSize( getRootPane() ) );
setLocationRelativeTo( getParent() );
setModal( true );
setVisible( true );
}
private void setupComponents( Iterator<KeyClass> iterator, Integer size, boolean ordered )
{
double[] cols = new double[] {
TableLayout.PREFERRED
};
double[] rows = new double[(message == null ? 0 : 2) + 1 + (cancelActive ? 2 : 0)];
for( int i = 0; i < rows.length; ++i )
{
rows[i] = TableLayout.PREFERRED;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setVGap( 3 );
setContentPane( new LeafGradientPanel() );
getContentPane().setLayout( layout );
int shift = 0;
if( message != null )
{
labelMessage.setText( message );
getContentPane().add( labelMessage, new TableLayoutConstraints( 0, shift++ ) );
getContentPane().add( new JSeparator(), new TableLayoutConstraints( 0, shift++ ) );
}
setupOptionsComponents( iterator, size );
getContentPane().add( optionsScrollPane, new TableLayoutConstraints( 0, shift++ ) );
if( cancelActive )
{
getContentPane().add( new JSeparator(), new TableLayoutConstraints( 0, shift++ ) );
submitButton.setObject( ordered ? okLabel : CANCEL_LABEL );
submitButton.setClickable( true );
submitButton.setPreferredSize( BUTTON_SIZE );
getContentPane().add( submitButton, new TableLayoutConstraints( 0, shift++ ) );
addListenerToComponent( submitButton );
}
((JComponent) getContentPane()).setBorder( BorderFactory.createRaisedBevelBorder() );
}
private void setupOptionsComponents( Iterator<KeyClass> iterator, Integer size )
{
int maxWidth = OPTION_SIZE.width;
double[] cols = new double[] {
TableLayout.PREFERRED
};
double[] rows = new double[size];
for( int i = 0; i < rows.length; ++i )
{
rows[i] = TableLayout.PREFERRED;
}
TableLayout layout = new TableLayout( cols, rows );
layout.setVGap( 3 );
optionsPanel.setLayout( layout );
KeyClass current = null;
for( int i = 0; i < size && iterator.hasNext(); ++i )
{
current = iterator.next();
LeafInputField<Object> component = new LeafInputField<Object>();
Object value;
if( ordered )
{
List<Object> values = orderedMap.getValues( current );
value = (values == null || values.size() == 0) ? null : values.get( 0 );
}
else
{
value = map.get( current );
}
component.setObject( value );
Boolean isChosen = mapChosenForKey.get( current );
component.setSelected( isChosen != null && isChosen );
Boolean isEnabled = mapEnabledForKey.get( current );
component.setClickable( isEnabled == null || isEnabled );
if(component.size != null && component.size.width > maxWidth )
{
maxWidth = component.size.width;
}
optionsPanel.add( component, new TableLayoutConstraints( 0, i ) );
addListenerToComponent( component );
}
optionsScrollPane.setViewportView( optionsPanel );
optionsScrollPane.setHorizontalScrollBarPolicy( ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER );
JScrollBar verticalScrollBar = optionsScrollPane.getVerticalScrollBar();
verticalScrollBar.setUnitIncrement( (int) OPTION_SIZE.getHeight() + 3 );
optionsScrollPane.setVerticalScrollBar( verticalScrollBar );
optionsScrollPane.setVerticalScrollBarPolicy( size > MAX_VISIBLE_OPTIONS ? ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS : ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER );
optionsScrollPane.setPreferredSize( new Dimension( maxWidth + 30 , size > MAX_VISIBLE_OPTIONS ? (MAX_VISIBLE_OPTIONS * ((int) (OPTION_SIZE.getHeight() + 3 )) ) : (size * ((int) (OPTION_SIZE.getHeight() + 3 )) ) ));
}
private KeyClass getKeyForValue( Object value )
{
if( value != null && map.containsValue( value ) )
{
for( KeyClass key : map.keySet() )
{
if( map.get( key ).equals( value ) )
{
return key;
}
}
}
else if( ordered )
{
return orderedMap.getKeyForValue( value );
}
return null;
}
private void addListenerToComponent( JComponent component )
{
component.addPropertyChangeListener( new PropertyChangeListener()
{
@Override
public void propertyChange( PropertyChangeEvent e )
{
if( e.getSource() instanceof LeafInputField )
{
LeafInputField<Object> source = (LeafInputField<Object>) e.getSource();
if( LeafInputField.PROPERTY_CHANGED_CLICK.equals( e.getPropertyName() ) )
{
if( !source.equals( submitButton ) )
{
Object value = source.getObject();
if( value != null )
{
KeyClass key = getKeyForValue( value );
if( selected.contains( key ) )
{
selected.remove( key );
source.setSelected( false );
}
else
{
selected.add( key );
source.setSelected( true );
}
}
}
if( okLabel == null || source.equals( submitButton ) )
{
close();
}
}
}
}
} );
}
public KeyClass getOption()
{
return selected.isEmpty() ? null : selected.get( 0 );
}
public List<KeyClass> getSelected()
{
return selected;
}
public void close()
{
setVisible( false );
dispose();
}
}

@ -0,0 +1,18 @@
package leaf.ui;
public class LeafRuntimeException extends RuntimeException
{
private static final long serialVersionUID = 1L;
private boolean abort = false;
public LeafRuntimeException( boolean all )
{
this.abort = all;
}
public boolean isAbort()
{
return abort;
}
}

@ -0,0 +1,16 @@
package leaf.ui;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
public class LeafScrollBar extends JScrollPane
{
private static final long serialVersionUID = 1L;
public void paintComponent()
{
System.out.println("");
}
}

@ -0,0 +1,179 @@
package leaf.ui;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import leaf.data.OrderedMap;
import siprp.database.cayenne.objects.TrabalhadoresEcd;
import com.evolute.utils.tables.BaseTableModel;
import com.evolute.utils.tables.models.SortableModel;
public class LeafTableModel extends BaseTableModel
{
private static final long serialVersionUID = 1L;
private OrderedMap<Object> map = new OrderedMap<Object>();
public LeafTableModel(String n[])
{
super( n, null );
setChangeable( false );
}
public void clearAll()
{
int i = map.rows();
if( i > 0 )
{
map.clear();
fireTableRowsDeleted( 0, i - 1 );
}
}
@Override
public int innerGetRowCount()
{
return map == null ? 0 : map.rows();
}
@Override
public Object innerGetValueAt( int row, int col )
{
return map.getValueAt( row, col );
}
@Override
public void deleteRow( int row )
{
map.deleteRow( row );
}
public Object getKey( int row )
{
Object result = null;
if( row < map.rows() )
{
result = map.getKeyForRow( row );
}
return result;
}
public void setValues( Collection<? extends Object> v )
{
Iterator<? extends Object> iterator = v.iterator();
while( iterator.hasNext() )
{
Object value = iterator.next();
map.putLast( value, value.toString() );
}
fireTableDataChanged();
}
public void setValues( OrderedMap<? extends Object> map )
{
this.map = (OrderedMap<Object>) map;
fireTableDataChanged();
}
public void order(int ... colNumber )
{
if(colNumber != null)
{
map.order(colNumber);
fireTableDataChanged();
}
}
@Override
public void appendEmptyRow()
{
map.putLast( map.rows(), (Object) null );
}
@Override
public void innerSetValueAt( Object obj, int row, int col )
{
if( isCellEditable( row, col ) && map.getValueAt( row, col ) != null )
{
map.setValueAt( row, col, obj );
}
}
@Override
public boolean isRowEmpty( int row )
{
List<Object> line = map.getRow( row );
return line != null && line.size() > 0;
}
@Override
public boolean innerIsCellEditable( int row, int col )
{
return false;
}
public void printContents()
{
for( int r = 0; r < getRowCount(); r++ )
{
for( int c = 0; c < getColumnCount(); c++ )
{
Object val = getValueAt( r, c );
if( val != null )
{
System.out.print( val.toString() + "\t" );
}
}
System.out.println( "" );
}
}
// public void insertRowAt( Object rowObj, int row )
// {
// values.add( row, rowObj );
// fireTableDataChanged();
// }
//
// public void removeRowAt( int row )
// {
// values.remove( row );
// fireTableDataChanged();
// }
//
// public Object getRowAt( int row )
// {
// return values.elementAt( row );
// }
// public void swapRows( int row1, int row2 )
// {
// if( row1 == row2 || row1 < 0 || row2 < 0 || row1 >= getRowCount() || row2
// >= getRowCount() )
// {
// return;
// }
// // Collections.swap( values, row1, row2 );
// Object row1Data = getRowAt( row1 );
// Object row2Data = getRowAt( row2 );
// if( row1 < row2 )
// {
// removeRowAt( row2 );
// removeRowAt( row1 );
// insertRowAt( row2Data, row1 );
// insertRowAt( row1Data, row2 );
// }
// else
// {
// removeRowAt( row1 );
// removeRowAt( row2 );
// insertRowAt( row1Data, row2 );
// insertRowAt( row2Data, row1 );
// }
// }
}

@ -0,0 +1,169 @@
package leaf.ui;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.JTextArea;
public class LeafTextDialog extends JDialog
{
private static final long serialVersionUID = 1L;
private static final Dimension buttonSize = new Dimension( 30, 20 );
private static final Dimension textSize = new Dimension( 200, 20 );
private static final Dimension expandedTextSize = new Dimension( 300, 200 );
private String text = null;
private String defaultText = null;
private boolean expanded = true;
private final JTextArea textArea = new JTextArea();
private final LeafButton expandButton = new LeafButton( "+" );
private final LeafButton okButton = new LeafButton( "Ok" );
private final LeafButton cancelButton = new LeafButton( "X" );
private TableLayout layout = null;
private TableLayout expandedLayout = null;
/** Creates a new instance of JCalendarDialog */
public LeafTextDialog( LeafWindow parentFrame, JComponent parent, String defaultText, boolean expanded )
{
super( parentFrame );
this.defaultText = defaultText == null ? "" : defaultText;
this.text = this.defaultText;
setModal( true );
setContentPane( new LeafGradientPanel() );
textArea.setText( text );
expandButton.setPreferredSize( buttonSize );
cancelButton.setPreferredSize( buttonSize );
okButton.setPreferredSize( buttonSize );
setupLayout();
setUndecorated( true );
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
setLocationRelativeTo( null );
this.expanded = expanded;
expand( expanded );
addListeners();
setVisible( true );
}
private void setupLayout()
{
double[] cols = new double[] {
TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED
};
double[] rows = new double[] {
TableLayout.PREFERRED
};
layout = new TableLayout( cols, rows );
cols = new double[] {
TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED
};
rows = new double[] {
TableLayout.PREFERRED, TableLayout.FILL
};
expandedLayout = new TableLayout( cols, rows );
}
private void placeComponents(boolean expand)
{
if(expand)
{
getContentPane().add( expandButton, new TableLayoutConstraints( 0, 0 ) );
getContentPane().add( new JPanel(), new TableLayoutConstraints( 0, 1 ) );
getContentPane().add( textArea, new TableLayoutConstraints( 1, 0,1,1 ) );
getContentPane().add( okButton, new TableLayoutConstraints( 2, 0 ) );
getContentPane().add( cancelButton, new TableLayoutConstraints( 3, 0 ) );
getContentPane().add( new JPanel(), new TableLayoutConstraints( 2, 1,3,1 ) );
}
else
{
getContentPane().add( expandButton, new TableLayoutConstraints( 0, 0 ) );
getContentPane().add( textArea, new TableLayoutConstraints( 1, 0 ) );
getContentPane().add( okButton, new TableLayoutConstraints( 2, 0 ) );
getContentPane().add( cancelButton, new TableLayoutConstraints( 3, 0 ) );
}
((JComponent) getContentPane()).setBorder( BorderFactory.createRaisedBevelBorder() );
// setSize( expand ? expandedLayout.preferredLayoutSize( this.getContentPane() ) : layout.preferredLayoutSize( this.getContentPane() ) );
setSize( getLayout().preferredLayoutSize( getRootPane() ) );
}
private void setupComponents(boolean expand)
{
getContentPane().setLayout( expand ? expandedLayout : layout);
textArea.setPreferredSize( expand ? expandedTextSize : textSize );
expandButton.setText( expand ? "-" : "+" );
placeComponents(expand);
}
private void expand( boolean expand )
{
setupComponents(expand);
setResizable( expand );
}
private void addListeners()
{
expandButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
expanded = !expanded;
expand( expanded );
}
} );
okButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
text = textArea.getText();
close();
}
} );
cancelButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
text = defaultText;
close();
}
} );
}
public String getText()
{
return text;
}
public void close()
{
setVisible( false );
dispose();
}
}

@ -0,0 +1,47 @@
package leaf.ui;
import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;
public class LeafTransparentPanel extends JPanel
{
private static final long serialVersionUID = 1L;
private BufferedImage background = null;
public LeafTransparentPanel()
{
updateBackground();
}
private void updateBackground()
{
try
{
Robot rbt = new Robot();
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension dim = tk.getScreenSize();
background = rbt.createScreenCapture( new Rectangle( 0, 0, (int) dim.getWidth(), (int) dim.getHeight() ) );
} catch( AWTException ex )
{
ex.printStackTrace();
}
}
@Override
public void paintComponent( Graphics g )
{
Point pos = this.getLocationOnScreen();
Point offset = new Point( -pos.x, -pos.y );
g.drawImage( background, offset.x, offset.y, null );
}
}

@ -0,0 +1,937 @@
package leaf.ui;
import static info.clearthought.layout.TableLayoutConstants.FILL;
import static leaf.ui.LeafLogic.ACTION_CANCEL;
import static leaf.ui.LeafLogic.ACTION_STARTUP;
import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import javax.swing.BorderFactory;
import javax.swing.DefaultListSelectionModel;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.table.TableModel;
import leaf.data.Pair;
import leaf.ui.LeafLogic.Action;
import leaf.ui.LeafLogic.LeafLogicActionBinding;
import leaf.ui.LeafLogic.LeafUIActionBinding;
import com.evolute.utils.tables.BaseTable;
import com.evolute.utils.tables.ColumnizedMappable;
import com.evolute.utils.tables.VectorTableModel;
import com.evolute.utils.tracker.TrackableWindow;
public class LeafWindow extends JFrame implements TrackableWindow, ListSelectionListener, TreeSelectionListener, ActionListener, PropertyChangeListener
{
private static final long serialVersionUID = 1L;
private static final int DEFAULT_HEIGHT = 480;
private static final int DEFAULT_WIDTH = 640;
/**
* Registers DataComponent in a list of actions
*
* @author tsimao
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface ActionActivation
{
/**
* Array of actions to execute when a select is listened in this
* JComponent
*
* @return
*/
String[] onSelect();
/**
* Array of actions to execute when a change is listened in this
* JComponent
*
* @return
*/
String[] onChange();
}
/**
* Binds an Object to actions
*
* @author tsimao
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface LeafObject
{
/**
* Actions that use this field
*/
String[] useWith();
}
/**
* Declares a JPanel as a leaf
*
* @author tsimao
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface LeafPanel
{
}
/**
* This window's logic controller
*/
private final LeafLogic logicController;
private List<JPanel> subPanels = new ArrayList<JPanel>();
/**
* Actions
*/
private Map<String, Action> mapActionByName = new HashMap<String, Action>();
/**
* Fields
*/
private Map<String, List<Object>> mapWindowOnSelectFieldByActionName = new HashMap<String, List<Object>>();
private Map<String, List<Object>> mapWindowOnChangeFieldByActionName = new HashMap<String, List<Object>>();
private Map<String, Field> mapLeafObjectByActionName = new HashMap<String, Field>();
private Map<Field, Object> mapInstanceByField = new HashMap<Field, Object>();
/**
* Methods
*/
private Map<String, List<Method>> mapWindowMethodsByActionName = new HashMap<String, List<Method>>();
private Map<String, Method> mapLogicMethodByActionName = new HashMap<String, Method>();
private Map<Method, Object> mapInstanceByMethod = new HashMap<Method, Object>();
/**
* Meta-info
*/
private Map<Object, Annotation> mapAnnotationByObject = new HashMap<Object, Annotation>();
/**
* Run later actions
*/
private Queue<Pair<String, Object>> listRunLater = new LinkedList<Pair<String, Object>>();
/**
* Creates a new LeafWindow binded with given 'logicController'
*
* @param logicController
* @throws IllegalArgumentException
* @throws IllegalAccessException
*/
public LeafWindow(LeafLogic logicController)
{
super();
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
this.logicController = logicController;
if( logicController != null )
{
logicController.addWindow( this );
}
}
@Override
public void open()
{
setVisible( true );
}
public void close()
{
SwingUtilities.invokeLater( new Runnable()
{
public void run()
{
setVisible( false );
dispose();
}
} );
}
@Override
public boolean closeIfPossible()
{
close();
return true;
}
@Override
public void refresh()
{
}
/**
* Aborts current action. Aborts pending actions as well if 'all' is true
*
* @param all
*/
public void abortAction( boolean all )
{
runGivenAction( ACTION_CANCEL, null );
throw new LeafRuntimeException( all );
}
protected boolean runAction( String actionName )
{
return runAction( actionName, null );
}
/**
* Returns false if an error occurred
*
* @param actionName
* @param argument
* @return
*/
protected boolean runAction( String actionName, Object argument )
{
boolean ok = true;
if( argument == null )
{
Field field = mapLeafObjectByActionName.get( actionName );
if(field != null)
{
Object instance = mapInstanceByField.get( field );
if( instance != null)
{
try
{
argument = field.get( instance );
} catch( IllegalArgumentException e )
{
e.printStackTrace(System.out);
} catch( IllegalAccessException e )
{
e.printStackTrace( System.out);
}
}
}
}
try
{
runGivenAction( actionName, argument );
} catch( LeafRuntimeException leafRuntimeException )
{
ok = !leafRuntimeException.isAbort();
}
if( ok )
{
runPendingActions();
}
else
{
listRunLater.clear();
}
return ok;
}
public void runActionLater( String action )
{
runActionLater( action, null );
}
public void runActionLater( String action, Object argument )
{
if( action != null && mapActionByName.containsKey( action ) )
{
listRunLater.add( new Pair<String, Object>( action, argument ) );
}
}
public void completeSetup()
{
try
{
loadLeafs();
loadActions();
loadFields();
loadMethods();
runAction( ACTION_STARTUP, null );
setVisible( true );
} catch( Exception e )
{
e.printStackTrace( System.out );
}
}
public static void setupTopBottomSimpleActionsPanel(JPanel where, JPanel top, JPanel bottom)
{
TableLayout layout = new TableLayout(new double[]{TableLayout.FILL}, new double[]{TableLayout.MINIMUM, TableLayout.FILL,TableLayout.MINIMUM});
where.setLayout( layout );
where.add( top, new TableLayoutConstraints(0,0) );
where.add( new JPanel(), new TableLayoutConstraints(0,1) );
where.add( bottom, new TableLayoutConstraints(0,2) );
}
public static void setupSimpleDataPanel( JPanel where, String name, JComponent... field )
{
double[] cols = new double[] {
FILL
};
double[] rows = new double[field.length];
for( int i = 0; i < field.length; rows[i++] = TableLayout.PREFERRED )
;
rows[rows.length - 1] = FILL;
TableLayout layout = new TableLayout( cols, rows );
layout.setHGap( 5 );
layout.setVGap( 5 );
where.setLayout( layout );
if( name != null )
{
where.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), name ) );
}
for( int i = 0; i < field.length; ++i )
{
where.add( field[i], new TableLayoutConstraints( 0, i ) );
}
}
private void loadLeafs() throws IllegalArgumentException, IllegalAccessException
{
Field fields[] = this.getClass().getDeclaredFields();
if( fields != null )
{
for( Field field : fields )
{
if( field.getAnnotation( LeafPanel.class ) != null && field.get( this ) != null )
{
subPanels.add( (JPanel) field.get( this ) );
}
}
}
}
private void loadActions() throws IllegalArgumentException, IllegalAccessException
{
Field[] allLogicFields = this.logicController.getClass().getFields();
for( Field field : allLogicFields )
{
Action action = field.getAnnotation( Action.class );
if( action != null )
{
String value = (String) field.get( this );
if( value != null )
{
mapActionByName.put( value, action );
mapWindowMethodsByActionName.put( value, new ArrayList<Method>() );
mapWindowOnSelectFieldByActionName.put( value, new ArrayList<Object>() );
mapWindowOnChangeFieldByActionName.put( value, new ArrayList<Object>() );
}
}
}
}
private void loadFields( Field[] fields, Object instance )
{
try
{
for( Field field : fields )
{
ActionActivation componentBehaviour = field.getAnnotation( ActionActivation.class );
if( componentBehaviour != null )
{
String[] allChanges = componentBehaviour.onChange();
if( allChanges != null )
{
for( String onChange : allChanges )
{
if( mapActionByName.containsKey( onChange ) )
{
// valid action
mapAnnotationByObject.put( field.get( instance ), componentBehaviour );
mapWindowOnChangeFieldByActionName.get( onChange ).add( field.get( instance ) );
if( !mapInstanceByField.containsKey( field ) )
{
addListenerForField( componentBehaviour, field, instance );
mapInstanceByField.put( field, instance );
}
}
}
}
String[] allSelect = componentBehaviour.onSelect();
if( allSelect != null )
{
for( String onSelect : allSelect )
{
if( mapActionByName.containsKey( onSelect ) )
{
// valid action
mapAnnotationByObject.put( field.get( instance ), componentBehaviour );
mapWindowOnSelectFieldByActionName.get( onSelect ).add( field.get( instance ) );
if( !mapInstanceByField.containsKey( field ) )
{
addListenerForField( componentBehaviour, field, instance );
mapInstanceByField.put( field, instance );
}
}
}
}
}
LeafObject leafObject = field.getAnnotation( LeafObject.class );
if( leafObject != null )
{
String[] useWith = leafObject.useWith();
if( useWith != null )
{
for( String current : useWith )
{
if( mapActionByName.containsKey( current ) )
{
// valid action
mapLeafObjectByActionName.put( current, field );
mapInstanceByField.put( field, instance );
}
}
}
}
}
} catch( IllegalAccessException exception )
{
exception.printStackTrace( System.out );
}
}
private void loadFields()
{
Field[] allFields = this.getClass().getDeclaredFields();
if( allFields != null )
{
loadFields( allFields, this );
}
allFields = logicController.getClass().getDeclaredFields();
if( allFields != null )
{
loadFields( allFields, logicController );
}
for( JPanel panel : subPanels )
{
allFields = panel.getClass().getDeclaredFields();
if( allFields != null )
{
loadFields( allFields, panel );
}
}
}
private void loadWindowMethods( Method[] windowMethods, Object instance )
{
for( Method method : windowMethods )
{
LeafUIActionBinding actionBinding = method.getAnnotation( LeafUIActionBinding.class );
if( actionBinding != null )
{
String[] actions = actionBinding.action();
for( String actionName : actions )
{
if( mapActionByName.containsKey( actionName ) )
{
// valid action
mapWindowMethodsByActionName.get( actionName ).add( method );
mapAnnotationByObject.put( method, actionBinding );
mapInstanceByMethod.put( method, instance );
}
}
}
}
}
private void loadLogicMethods()
{
Method[] allLogicMethods = this.logicController.getClass().getDeclaredMethods();
if( allLogicMethods != null )
{
for( Method method : allLogicMethods )
{
LeafLogicActionBinding actionBinding = method.getAnnotation( LeafLogicActionBinding.class );
if( actionBinding != null )
{
String[] actions = actionBinding.actions();
if( actions != null )
{
for( String actionName : actions )
{
if( mapActionByName.containsKey( actionName ) )
{
// valid action
mapAnnotationByObject.put( method, actionBinding );
mapLogicMethodByActionName.put( actionName, method );
mapInstanceByMethod.put( method, logicController );
}
}
}
}
}
}
}
private void loadMethods()
{
loadLogicMethods();
Method[] allWindowMethods = this.getClass().getDeclaredMethods();
if( allWindowMethods != null )
{
loadWindowMethods( allWindowMethods, this );
}
for( JPanel panel : subPanels )
{
allWindowMethods = panel.getClass().getDeclaredMethods();
if( allWindowMethods != null )
{
loadWindowMethods( allWindowMethods, panel );
}
}
}
private Object getObjectForAction( String actionName )
{
Object result = null;
Field field = mapLeafObjectByActionName.get( actionName );
if( field != null )
{
Object instance = mapInstanceByField.get( field );
if( instance != null )
{
try
{
result = field.get( instance );
} catch( IllegalArgumentException e )
{
e.printStackTrace();
} catch( IllegalAccessException e )
{
e.printStackTrace();
}
}
}
return result;
}
public void runPendingActions()
{
while( listRunLater.size() > 0 )
{
Pair<String, Object > p = listRunLater.poll();
runAction( p.getCar(), p.getCdr() );
}
}
/**
* Executes given action
*/
private void runGivenAction( String actionName, Object argument )
{
System.out.println( "Running: " + actionName );
try
{
this.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
if( actionName != null && mapActionByName.containsKey( actionName ) )
{
Action action = mapActionByName.get( actionName );
if( action.isSave() )
{
Object windowArgument = getObjectForAction( actionName );
if( windowArgument == null )
{
windowArgument = argument;
}
Object logicArgument = windowArgument;
for( Method currentWindowMethod : mapWindowMethodsByActionName.get( actionName ) )
{
Object currentLogicArgument = runWindowMethod( currentWindowMethod, windowArgument != null ? windowArgument : argument );
logicArgument = logicArgument == null ? currentLogicArgument : logicArgument;
}
runLogicMethod( mapLogicMethodByActionName.get( actionName ), logicArgument );
}
else
{
Object windowArgument = runLogicMethod( mapLogicMethodByActionName.get( actionName ), argument );
for( Method currentWindowMethod : mapWindowMethodsByActionName.get( actionName ) )
{
runWindowMethod( currentWindowMethod, windowArgument != null ? windowArgument : argument );
}
}
}
} finally
{
this.setCursor( Cursor.getDefaultCursor() );
}
}
private Object runLogicMethod( Method logicMethod, Object argument ) throws LeafRuntimeException
{
Object result = null;
try
{
if( logicMethod != null )
{
if( logicMethod.getParameterTypes().length > 0 )
{
result = logicMethod.invoke( logicController, argument );
}
else
{
result = logicMethod.invoke( logicController );
}
}
} catch( IllegalArgumentException e )
{
System.out.println("Error in: " + logicMethod.getName() );
System.out.println("Got: " + argument + " expected: " + (logicMethod.getParameterTypes().length > 0 ? logicMethod.getParameterTypes()[0].getCanonicalName() : "(nothing)"));
e.printStackTrace( System.out );
} catch( IllegalAccessException e )
{
e.printStackTrace( System.out );
} catch( InvocationTargetException e )
{
if( e.getCause() instanceof LeafRuntimeException )
{
throw (LeafRuntimeException) e.getCause();
}
else
{
e.printStackTrace( System.out );
}
}
return result;
}
private Object runWindowMethod( Method windowMethod, Object argument ) throws LeafRuntimeException
{
Object result = null;
try
{
if( windowMethod != null )
{
if( windowMethod.getParameterTypes().length > 0 )
{
result = windowMethod.invoke( mapInstanceByMethod.get( windowMethod ), argument );
}
else
{
result = windowMethod.invoke( mapInstanceByMethod.get( windowMethod ) );
}
}
} catch( IllegalArgumentException e )
{
System.out.println("Error in: " + windowMethod.getName() );
System.out.println("Got: " + argument + " expected: " + (windowMethod.getParameterTypes().length > 0 ? windowMethod.getParameterTypes()[0].getCanonicalName() : "(nothing)"));
e.printStackTrace( System.out );
} catch( IllegalAccessException e )
{
e.printStackTrace( System.out );
} catch( InvocationTargetException e )
{
if( e.getCause() instanceof LeafRuntimeException )
{
throw (LeafRuntimeException) e.getCause();
}
else
{
e.printStackTrace( System.out );
}
}
return result;
}
private void addListenerForField( ActionActivation annotation, Field field, Object instance )
{
if( instance instanceof JFrame || instance instanceof JPanel )
{
try
{
Object value = field.get( instance );
if( value instanceof BaseTable )
{
((BaseTable) value).getSelectionModel().addListSelectionListener( this );
}
else if( value instanceof JTree )
{
((JTree) value).addTreeSelectionListener( this );
}
else if( value instanceof JButton )
{
((JButton) value).addActionListener( this );
}
else if( value instanceof LeafInputField )
{
((LeafInputField) value).addPropertyChangeListener( this );
}
} catch( IllegalAccessException e )
{
e.printStackTrace( System.out );
} catch( NullPointerException e )
{
e.printStackTrace( System.out );
}
}
}
private Object getArgumentListSelectionEvent( String actionName, ListSelectionEvent event )
{
Object source = event.getSource();
List<Object> allComponents = mapWindowOnSelectFieldByActionName.get( actionName );
for( Object component : allComponents )
{
if( component instanceof BaseTable && ((BaseTable) component).getSelectionModel().equals( source ) )
{
int [] indexes = ((BaseTable) component).getSelectedRows();
if( indexes != null && indexes.length > 0 )
{
TableModel model = ((BaseTable) component).getModel();
if( model instanceof VectorTableModel )
{
if(indexes.length == 1 && indexes[0] > -1)
{
return ((ColumnizedMappable) ((VectorTableModel) model).getRowAt( indexes[0] )).getID();
}
else
{
List<Object> allSelected = new ArrayList<Object>();
for(int i = 0; i < indexes.length; ++i)
{
allSelected.add( ((ColumnizedMappable) ((VectorTableModel) model).getRowAt( indexes[0] )).getID() );
}
return allSelected;
}
}
else if( model instanceof LeafTableModel )
{
if(indexes.length == 1 && indexes[0] > -1)
{
return ((LeafTableModel) model).getKey( indexes[0] );
}
else
{
List<Object> allSelected = new ArrayList<Object>();
for(int i = 0; i < indexes.length; ++i)
{
allSelected.add( ((LeafTableModel) model).getKey( indexes[0] ));
}
return allSelected;
}
}
}
}
}
return null;
}
private List<String> getActionListSelectionEvent( ListSelectionEvent event )
{
List<String> result = new ArrayList<String>();
if( event.getSource() instanceof DefaultListSelectionModel )
{
DefaultListSelectionModel model = (DefaultListSelectionModel) event.getSource();
BaseTable table = null;
for( List<Object> allComponents : mapWindowOnSelectFieldByActionName.values() )
{
// for each registered table
for( Object component : allComponents )
{
if( component instanceof BaseTable && ((BaseTable) component).getSelectionModel().equals( model ) )
{
table = (BaseTable) component;
}
if( table != null )
{
break;
}
}
if( table != null )
{
break;
}
}
Annotation an = mapAnnotationByObject.get( table );
if( an != null && an instanceof ActionActivation )
{
String[] actions = ((ActionActivation) an).onSelect();
for( String actionName : actions )
{
result.add( actionName );
}
}
}
return result;
}
// returns selected node
private Object getArgumentTreeSelectionEvent( String actionName, TreeSelectionEvent event )
{
List<Object> components = mapWindowOnSelectFieldByActionName.get( actionName );
for( Object component : components )
{
if( component instanceof JTree && event.getPath() != null )
{
Object[] nodes = event.getPath().getPath();
if( nodes != null && nodes.length > 0 )
{
return nodes[nodes.length - 1];
}
}
}
return null;
}
private List<String> getActionTreeSelectionEvent( TreeSelectionEvent event )
{
List<String> result = new ArrayList<String>();
Annotation an = mapAnnotationByObject.get( event.getSource() );
if( an != null && an instanceof ActionActivation )
{
String[] actions = ((ActionActivation) an).onSelect();
for( String actionName : actions )
{
result.add( actionName );
}
}
return result;
}
private List<String> getActionActionEvent( ActionEvent event )
{
List<String> result = new ArrayList<String>();
Annotation an = mapAnnotationByObject.get( event.getSource() );
if( an != null && an instanceof ActionActivation )
{
String[] actions = ((ActionActivation) an).onSelect();
for( String actionName : actions )
{
result.add( actionName );
}
}
return result;
}
private List<String> getActionsForPropertyChangeEvent( PropertyChangeEvent evt )
{
List<String> result = new ArrayList<String>();
Annotation an = mapAnnotationByObject.get( evt.getSource() );
if( an != null )
{
if( an instanceof ActionActivation )
{
if( evt.getSource() instanceof LeafInputField )
{
if( LeafInputField.PROPERTY_CHANGED_CONSTANT.equals( evt.getPropertyName() ) )
{
String[] actions = ((ActionActivation) an).onChange();
for( String actionName : actions )
{
result.add( actionName );
}
}
}
}
}
return result;
}
@Override
public void valueChanged( TreeSelectionEvent event )
{
List<String> actions = getActionTreeSelectionEvent( event );
for( String action : actions )
{
Object argument = getArgumentTreeSelectionEvent( action, event );
if( !runAction( action, argument ) )
{
break;
}
}
}
/**
* Listens to ListSelectionEvents
*/
@Override
public void valueChanged( ListSelectionEvent event )
{
if( !event.getValueIsAdjusting() )
{
List<String> actionNames = getActionListSelectionEvent( event );
for( String action : actionNames )
{
Object argument = getArgumentListSelectionEvent( action, event );
if( !runAction( action, argument ) )
{
break;
}
}
}
}
@Override
public void actionPerformed( ActionEvent event )
{
List<String> actionNames = getActionActionEvent( event );
if( actionNames.size() > 0 )
{
for( int i = 1; i < actionNames.size(); ++i )
{
runActionLater( actionNames.get( i ) );
}
runAction( actionNames.get( 0 ) );
}
}
@Override
public void propertyChange( PropertyChangeEvent evt )
{
List<String> actionNames = getActionsForPropertyChangeEvent( evt );
if( actionNames.size() > 0 )
{
for( int i = 1; i < actionNames.size(); ++i )
{
runActionLater( actionNames.get( i ) );
}
runAction( actionNames.get( 0 ) );
}
}
}

@ -0,0 +1,82 @@
/*
* MedicinaConstants.java
*
* Created on 6 de Julho de 2006, 15:22
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp;
import com.evolute.utils.Singleton;
/**
*
* @author fpalma
*/
public interface MedicinaConstants
{
public static final int MOTIVO_ADMISSAO = 1;
public static final Integer MOTIVO_ADMISSAO_INTEGER = new Integer( MOTIVO_ADMISSAO );
public static final String MOTIVO_ADMISSAO_STR = "Admiss\u00e3o";
public static final int MOTIVO_PERIODICO = 2;
public static final Integer MOTIVO_PERIODICO_INTEGER = new Integer( MOTIVO_PERIODICO );
public static final String MOTIVO_PERIODICO_STR = "Peri\u00f3dico";
public static final int MOTIVO_OCASIONAL = 3;
public static final Integer MOTIVO_OCASIONAL_INTEGER = new Integer( MOTIVO_OCASIONAL );
public static final String MOTIVO_OCASIONAL_STR = "Ocasional";
public static final int MOTIVO_PERIODICO_INICIAL = 5;
public static final Integer MOTIVO_PERIODICO_INICIAL_INTEGER = new Integer( MOTIVO_PERIODICO_INICIAL );
public static final String MOTIVO_PERIODICO_INICIAL_STR = "Peri\u00f3dico inicial";
public static final int SUB_MOTIVO_APOS_DOENCA = 1;
public static final Integer SUB_MOTIVO_APOS_DOENCA_INTEGER = new Integer( SUB_MOTIVO_APOS_DOENCA );
public static final String SUB_MOTIVO_APOS_DOENCA_STR = "Ap\u00f3s doen\u00e7a";
public static final int SUB_MOTIVO_APOS_ACIDENTE = 2;
public static final Integer SUB_MOTIVO_APOS_ACIDENTE_INTEGER = new Integer( SUB_MOTIVO_APOS_ACIDENTE );
public static final String SUB_MOTIVO_APOS_ACIDENTE_STR = "Ap\u00f3s acidente";
public static final int SUB_MOTIVO_PEDIDO_TRABALHADOR = 3;
public static final Integer SUB_MOTIVO_PEDIDO_TRABALHADOR_INTEGER = new Integer( SUB_MOTIVO_PEDIDO_TRABALHADOR );
public static final String SUB_MOTIVO_PEDIDO_TRABALHADOR_STR = "A pedido do trabalhador";
public static final int SUB_MOTIVO_PEDIDO_SERVICO = 4;
public static final Integer SUB_MOTIVO_PEDIDO_SERVICO_INTEGER = new Integer( SUB_MOTIVO_PEDIDO_SERVICO );
public static final String SUB_MOTIVO_PEDIDO_SERVICO_STR = "A pedido do servi\u00e7o";
public static final int SUB_MOTIVO_MUDANCA_FUNCAO = 5;
public static final Integer SUB_MOTIVO_MUDANCA_FUNCAO_INTEGER = new Integer( SUB_MOTIVO_MUDANCA_FUNCAO );
public static final String SUB_MOTIVO_MUDANCA_FUNCAO_STR = "Por mudan\u00e7a de fun\u00e7\u00e3o";
public static final int SUB_MOTIVO_ALTERACAO_CONDICOES = 6;
public static final Integer SUB_MOTIVO_ALTERACAO_CONDICOES_INTEGER = new Integer( SUB_MOTIVO_ALTERACAO_CONDICOES );
public static final String SUB_MOTIVO_ALTERACAO_CONDICOES_STR = "Por altera\u00e7\u00e3o das condi\u00e7\u00f5es de trabalho";
public static final int SUB_MOTIVO_OUTRO = 10;
public static final Integer SUB_MOTIVO_OUTRO_INTEGER = new Integer( SUB_MOTIVO_OUTRO );
public static final String SUB_MOTIVO_OUTRO_STR = "Outro";
public static final int ESTADO_POR_REALIZAR = 0;
public static final int ESTADO_PARCIALMENTE_REALIZADO = 1;
public static final int ESTADO_REALIZADO = 2;
public static final int ESTADO_DESMARCADO_TRABALHADOR = 3;
public static final int ESTADO_DESMARCADO_EMPRESA = 4;
public static final int ESTADO_FALTOU = 5;
public static final int ESTADO_ANULADO = 6;
public static final int ESTADO_POR_MARCAR = 7;
public static final String ESTADOS_CONSULTA_STR[] =
new String[]{ "Por Realizar", "Parcialmente Realizada", "Realizada",
"Desmarcada pelo Trabalhador", "Desmarcada pela " + Singleton.getInstance( SingletonConstants.COMPANY_ACRONYM ),
"Trabalhador Faltou", "Anulada", "Por Marcar" };
public static final String ESTADOS_EXAME_STR[] =
new String[]{ "Por Realizar", "Parcialmente Realizados", "Realizados",
"Desmarcados pelo Trabalhador", "Desmarcados pela " + Singleton.getInstance( SingletonConstants.COMPANY_ACRONYM ),
"Trabalhador Faltou", "Anulado", "Por Marcar" };
public static final String ESTADOS_STR[][] =
new String[][]{ ESTADOS_EXAME_STR, ESTADOS_CONSULTA_STR };
public static final String LEMBRETE_DESMARCOU_SIPRP_STRING = "SIPRP Desmarcou";
public static final String LEMBRETE_DESMARCOU_TRABALHADOR_STRING = "Trabalhador Desmarcou";
public static final String LEMBRETE_FALTOU_TRABALHADOR_STRING = "Trabalhador Faltou";
public static final String LEMBRETE_RENOVACAO_FICHA_APTIDAO_STRING = "Marcar novos Exames";
}

@ -0,0 +1,42 @@
/*
* ProcessoConstants.java
*
* Created on May 14, 2007, 10:08 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package siprp;
import java.util.HashMap;
/**
*
* @author fpalma
*/
public interface ProcessoConstants
{
public static final int TIPO_ECDS = 0;
public static final int TIPO_CONSULTA = 1;
public static final int TIPO_FICHA_APTIDAO = 2;
public static final String PROCESSO_ABERTO_CODE = "a";
public static final String PROCESSO_FECHADO_CODE = "f";
public static final String PROCESSO_CANCELADO_CODE = "c";
public static final String PROCESSO_ABERTO_DESCRIPTION = "Aberto";
public static final String PROCESSO_FECHADO_DESCRIPTION = "Fechado";
public static final String PROCESSO_CANCELADO_DESCRIPTION = "Cancelado";
public static final String PROCESSO_POR_ABRIR_DESCRIPTION = "Por Abrir";
public static final String ECDS_ICON_PATH = "siprp/medicina/processo/icons/ecds.png";
public static final String CONSULTA_ICON_PATH = "siprp/medicina/processo/icons/consulta.png";
public static final String FICHA_APTIDAO_ICON_PATH = "siprp/medicina/processo/icons/fichaaptidao.png";
public static final String FECHAR_ICON_PATH = "siprp/medicina/processo/icons/lock.png";
public static final String DATA_ICON_PATH = "siprp/medicina/processo/estrutura/icons/data.png";
public static final HashMap<String,String> ESTADO_PROCESSO_BY_CODE =
new HashMap<String,String>();
}

@ -0,0 +1,61 @@
/*
* SingletonConstants.java
*
* Created on 25 de Maio de 2004, 13:34
*/
package siprp;
/**
*
* @author fpalma
*/
public class SingletonConstants
{
public static final String PERSISTENCE_MANAGER = "PERSISTENCE_MANAGER";
public static final String SOFTWARE_NAME = "software_name";
public static final String COMPANY_NAME = "company_name";
public static final String COMPANY_LOGO = "company_logo";
public static final String COMPANY_ACRONYM = "company_acronym";
public static final String SUBJECT_CONSULTA = "subject_consulta";
public static final String LETTER_CONSULTA = "letter_consulta";
public static final String SUBJECT_CONSULTA_VACINAS = "subject_consulta_vacinas";
public static final String LETTER_CONSULTA_VACINAS = "letter_consulta_vacinas";
public static final String SUBJECT_EXAMES = "subject_exames";
public static final String LETTER_EXAMES = "letter_exames";
public static final String SUBJECT_VISITA = "subject_visita";
public static final String LETTER_VISITA = "letter_visita";
public static final String USES_HOUR = "uses_hour";
public static final String CODIGO_EMPRESA_FORMAT = "codigo_empresa_format";
public static final String FICHA_MARCA_EXAMES = "ficha_marca_exames";
public static final String EXCEL_FORMAT = "excel_format";
public static final String EXCEL_FORMAT_DEMISSAO = "excel_format_demissao";
public static final String MODULE_FICHA = "module_ficha";
public static final String MODULE_CLIENTES = "module_clientes";
public static final String WEB_AWARE = "web_aware";
public static final String MODULE_RELATORIO = "module_relatorio";
public static final String MODULE_LISTAGENS = "module_listagens";
public static final String WEB_USER = "web_user";
public static final String WEB_PASSWORD = "web_password";
public static final String WEB_URL_PREFIX = "web_url_prefix";
public static final String WEB_URL = "web_url";
public static final String WEB_DB_NAME = "web_db_name";
public static final String WEB_DRIVER_NAME = "web_driver_name";
public static final String LOCAL_USER = "local_user";
public static final String LOCAL_PASSWORD = "local_password";
public static final String LOCAL_URL_PREFIX = "local_url_prefix";
public static final String LOCAL_URL = "local_url";
public static final String LOCAL_DB_NAME = "local_db_name";
public static final String LOCAL_DRIVER_NAME = "local_driver_name";
public static final String SIPRP_TRACKER = "SIPRP_TRACKER";
/** Creates a new instance of SingletonConstants */
private SingletonConstants()
{
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Avisos;
public class Avisos extends _Avisos {
}

@ -0,0 +1,56 @@
package siprp.database.cayenne.objects;
import java.text.DateFormat;
import java.util.Locale;
import org.apache.cayenne.CayenneDataObject;
import org.apache.cayenne.PersistenceState;
import siprp.database.cayenne.providers.MedicinaDAO;
import com.evolute.utils.strings.UnicodeChecker;
public class BaseObject extends CayenneDataObject
{
static {
UnicodeChecker.setUseDoubleSlash( true );
}
private static final long serialVersionUID = 1L;
protected static MedicinaDAO medicinaProvider = new MedicinaDAO();
protected static final DateFormat sdf = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
protected static final String isNewMessage = " ";
public boolean isNew()
{
return getPersistenceState() == PersistenceState.NEW;
}
public boolean isCommited()
{
return getPersistenceState() == PersistenceState.COMMITTED;
}
public boolean isModified()
{
return getPersistenceState() == PersistenceState.MODIFIED;
}
protected String parseToUnicode( String string )
{
String result = UnicodeChecker.parseToUnicode( string );
return result.replaceAll( "\\\\\\\\", "\\\\" );
}
protected String parseFromUnicode( String string )
{
return UnicodeChecker.parseFromUnicode( string );
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Contactos;
public class Contactos extends _Contactos {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._EcdOficial;
public class EcdOficial extends _EcdOficial {
}

@ -0,0 +1,12 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._EmailPlanoDeActuacao;
public class EmailPlanoDeActuacao extends _EmailPlanoDeActuacao {
@Override
public String toString()
{
return getDescription() == null ? "" : getDescription();
}
}

@ -0,0 +1,74 @@
package siprp.database.cayenne.objects;
import java.util.Collections;
import java.util.List;
import siprp.database.cayenne.objects.auto._Empresas;
import com.evolute.utils.strings.UnicodeChecker;
public class Empresas extends _Empresas {
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
@Override
public String getDesignacaoSocial()
{
String currentName = super.getDesignacaoSocial();
if( name == null || !name.equals( currentName ))
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setDesignacaoSocial( String nome )
{
super.setDesignacaoSocial( parseToUnicode( name ) );
getDesignacaoSocial();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
@Override
public String toString()
{
return getDesignacaoSocial();
}
@Override
public List<Estabelecimentos> getEstabelecimentosArray()
{
List<Estabelecimentos> result = super.getEstabelecimentosArray();
for(int i = 0; i < result.size(); ++i)
{
Estabelecimentos current = result.get(i);
if( current == null || "y".equals(current.getInactivo()))
{
result.remove( i );
--i;
}
}
Collections.sort(result);
return result;
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Errors;
public class Errors extends _Errors {
}

@ -0,0 +1,87 @@
package siprp.database.cayenne.objects;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import siprp.database.cayenne.objects.auto._Estabelecimentos;
public class Estabelecimentos extends _Estabelecimentos implements Comparable<Estabelecimentos>
{
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
@Override
public String getNome()
{
String currentName = super.getNome();
if( name == null || !name.equals( currentName ) )
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setNome( String nome )
{
super.setNome( parseToUnicode( name ) );
getNome();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
@Override
public String toString()
{
return getNome();
}
@Override
public List<Trabalhadores> getTrabalhadoresArray()
{
List<Trabalhadores> result = super.getTrabalhadoresArray();
for(int i = 0; i < result.size(); ++i)
{
Trabalhadores current = result.get(i);
if( current == null || "y".equals(current.getInactivo()))
{
result.remove( i );
--i;
}
}
Collections.sort( result );
return result;
}
@Override
public int compareTo( Estabelecimentos estabelecimento )
{
if( estabelecimento == null)
{
return 1;
}
if( this.getNomePlain() == null )
{
return (estabelecimento.getNomePlain() != null) ? -1 : 0;
}
return (-1) * estabelecimento.getNomePlain().compareTo( getNomePlain() );
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Etiquetas;
public class Etiquetas extends _Etiquetas {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Exames;
public class Exames extends _Exames {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._ExamesPerfis;
public class ExamesPerfis extends _ExamesPerfis {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HistoricoEstabelecimento;
public class HistoricoEstabelecimento extends _HistoricoEstabelecimento {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsArea;
public class HsArea extends _HsArea {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsEquipamentoMedicao;
public class HsEquipamentoMedicao extends _HsEquipamentoMedicao {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsLegislacao;
public class HsLegislacao extends _HsLegislacao {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsLegislacaoCategoria;
public class HsLegislacaoCategoria extends _HsLegislacaoCategoria {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsLegislacaoEmpresa;
public class HsLegislacaoEmpresa extends _HsLegislacaoEmpresa {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsLegislacaoEstabelecimento;
public class HsLegislacaoEstabelecimento extends _HsLegislacaoEstabelecimento {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsMedida;
public class HsMedida extends _HsMedida {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsMedidaClassificacao;
public class HsMedidaClassificacao extends _HsMedidaClassificacao {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsNormalizacao;
public class HsNormalizacao extends _HsNormalizacao {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsPosto;
public class HsPosto extends _HsPosto {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsRelatorio;
public class HsRelatorio extends _HsRelatorio {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsRelatorioMedida;
public class HsRelatorioMedida extends _HsRelatorioMedida {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsRelatorioRisco;
public class HsRelatorioRisco extends _HsRelatorioRisco {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsRisco;
public class HsRisco extends _HsRisco {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsRiscoMedida;
public class HsRiscoMedida extends _HsRiscoMedida {
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._HsRiscoTema;
public class HsRiscoTema extends _HsRiscoTema {
}

@ -0,0 +1,12 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Image;
public class Image extends _Image {
@Override
public String toString()
{
return getName() == null ? "" : getName();
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Lembretes;
public class Lembretes extends _Lembretes {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._LembretesTipos;
public class LembretesTipos extends _LembretesTipos {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._MarcacoesEmpresa;
public class MarcacoesEmpresa extends _MarcacoesEmpresa {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._MarcacoesEstabelecimento;
public class MarcacoesEstabelecimento extends _MarcacoesEstabelecimento {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._MarcacoesGruposRealizados;
public class MarcacoesGruposRealizados extends _MarcacoesGruposRealizados {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._MarcacoesTecnicosHst;
public class MarcacoesTecnicosHst extends _MarcacoesTecnicosHst {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._MarcacoesTrabalhador;
public class MarcacoesTrabalhador extends _MarcacoesTrabalhador {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._MarcacoesTrabalhadorEstados;
public class MarcacoesTrabalhadorEstados extends _MarcacoesTrabalhadorEstados {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._Medicos;
public class Medicos extends _Medicos {
}

@ -0,0 +1,75 @@
package siprp.database.cayenne.objects;
import java.util.List;
import siprp.database.cayenne.objects.auto._Prestadores;
import com.evolute.utils.strings.UnicodeChecker;
public class Prestadores extends _Prestadores {
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
public static final Prestadores prestadorNulo = new Prestadores();
static {
prestadorNulo.setNome( "SIPRP" );
}
@Override
public String getNome()
{
String currentName = super.getNome();
if( name == null || !name.equals( currentName ))
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setNome( String nome )
{
super.setNome( parseToUnicode( nome ) );
getNome();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
// public static Prestadores getDefaultPrestador()
// {
// return medicinaProvider.getDefaultPrestador();
// }
public static List<Prestadores> getAllPrestadores()
{
List<Prestadores> result = medicinaProvider.getAllPrestadores();
result.add( 0, prestadorNulo);
return result;
}
@Override
public String toString()
{
return getNome();
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._PrestadoresGruposProtocolo;
public class PrestadoresGruposProtocolo extends _PrestadoresGruposProtocolo {
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._PrtElementosProtocolo;
public class PrtElementosProtocolo extends _PrtElementosProtocolo {
}

@ -0,0 +1,55 @@
package siprp.database.cayenne.objects;
import com.evolute.utils.strings.UnicodeChecker;
import siprp.database.cayenne.objects.auto._PrtGruposProtocolo;
public class PrtGruposProtocolo extends _PrtGruposProtocolo {
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
@Override
public String getDescricao()
{
String currentName = super.getDescricao();
if( name == null || !name.equals( currentName ))
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setDescricao( String nome )
{
super.setDescricao( parseToUnicode( name ) );
getDescricao();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
@Override
public String toString()
{
return getDescricao() == null ? "" : getDescricao();
}
}

@ -0,0 +1,17 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._PrtTiposElementosProtocolo;
public class PrtTiposElementosProtocolo extends _PrtTiposElementosProtocolo {
private static final long serialVersionUID = 1L;
@Override
public String toString()
{
return getDescricao();
}
}

@ -0,0 +1,10 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._TiposExamesComp;
public class TiposExamesComp extends _TiposExamesComp {
}

@ -0,0 +1,99 @@
package siprp.database.cayenne.objects;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import siprp.database.cayenne.objects.auto._Trabalhadores;
import com.evolute.utils.strings.UnicodeChecker;
public class Trabalhadores extends _Trabalhadores implements Comparable<Trabalhadores>
{
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
public String getDataNascimentoString()
{
return getDataNascimento() == null ? "" : sdf.format( getDataNascimento() );
}
@Override
public List<TrabalhadoresProcesso> getTrabalhadoresProcessoArray()
{
List<TrabalhadoresProcesso> allProcessos = super.getTrabalhadoresProcessoArray();
List<TrabalhadoresProcesso> result = new ArrayList<TrabalhadoresProcesso>();
for( TrabalhadoresProcesso current : allProcessos )
{
if("y".equals( current.getActivo() ))
{
result.add( current );
}
}
return result;
}
@Override
public String getNome()
{
String currentName = super.getNome();
if( name == null || !name.equals( currentName ))
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setNome( String nome )
{
super.setNome( parseToUnicode( name ) );
getNome();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
public HashMap<String, String> getSexos()
{
HashMap<String, String> result = new HashMap<String, String>();
result.put("f", "Feminino");
result.put( "m", "Masculino" );
return result;
}
@Override
public String toString()
{
return getNome();
}
@Override
public int compareTo( Trabalhadores trabalhador )
{
if( trabalhador == null)
{
return 1;
}
if( this.getNomePlain() == null )
{
return (trabalhador.getNomePlain() != null) ? -1 : 0;
}
return (-1) * trabalhador.getNomePlain().compareTo( getNomePlain() );
}
}

@ -0,0 +1,27 @@
package siprp.database.cayenne.objects;
import siprp.MedicinaConstants;
import siprp.database.cayenne.objects.auto._TrabalhadoresConsultas;
public class TrabalhadoresConsultas extends _TrabalhadoresConsultas implements MedicinaConstants
{
private static final long serialVersionUID = 1L;
public String getEstadoString()
{
return isNew() ? isNewMessage : ((getEstado() == null || ESTADOS_CONSULTA_STR.length <= getEstado()) ? "" : ESTADOS_CONSULTA_STR[getEstado().intValue()]);
}
public String getDataString()
{
return getData() == null ? "(sem data definida)" : sdf.format( getData() );
}
@Override
public String toString()
{
return "Consulta de " + getDataString() + ": " + getEstadoString();
}
}

@ -0,0 +1,48 @@
package siprp.database.cayenne.objects;
import java.util.Date;
import siprp.MedicinaConstants;
import siprp.database.cayenne.objects.auto._TrabalhadoresConsultasDatas;
public class TrabalhadoresConsultasDatas extends _TrabalhadoresConsultasDatas implements MedicinaConstants
{
private static final long serialVersionUID = 1L;
public String getDataString()
{
return getData() == null ? "" : sdf.format( getData() );
}
public String getEstadoString()
{
return getEstado() == null || getEstado() >= ESTADOS_CONSULTA_STR.length ? "" : ESTADOS_CONSULTA_STR[ getEstado() ];
}
@Override
public String toString()
{
return getDataString() + ": " + getEstadoString();
}
@Override
public void setData( Date date )
{
if( date != null && this.getToTrabalhadoresConsultas() != null && this.getEstado() != null && new Integer(ESTADO_POR_REALIZAR).equals(this.getEstado()))
{
this.getToTrabalhadoresConsultas().setData( date );
}
super.setData( date );
}
@Override
public void setEstado( Integer estado )
{
if( estado != null && this.getToTrabalhadoresConsultas() != null && (new Integer(ESTADO_POR_REALIZAR).equals( this.getEstado() ) || new Integer(ESTADO_POR_REALIZAR).equals( estado )))
{
this.getToTrabalhadoresConsultas().setEstado( !(estado.equals( ESTADO_POR_REALIZAR ) || estado.equals( ESTADO_REALIZADO )) ? ESTADO_POR_MARCAR : estado );
}
super.setEstado( estado );
}
}

@ -0,0 +1,21 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._TrabalhadoresConsultasDatasEmails;
public class TrabalhadoresConsultasDatasEmails extends _TrabalhadoresConsultasDatasEmails {
private static final long serialVersionUID = 1L;
public String getDataString()
{
return getData() == null ? "" : sdf.format( getData() );
}
@Override
public String toString()
{
return getSubject();
}
}

@ -0,0 +1,56 @@
package siprp.database.cayenne.objects;
import com.evolute.utils.strings.UnicodeChecker;
import siprp.database.cayenne.objects.auto._TrabalhadoresConsultasDatasObservacoes;
public class TrabalhadoresConsultasDatasObservacoes extends _TrabalhadoresConsultasDatasObservacoes {
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
@Override
public String toString()
{
return getObservacao();
}
@Override
public String getObservacao()
{
String currentName = super.getObservacao();
if( name == null || !name.equals( currentName ))
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setObservacao( String nome )
{
super.setObservacao( nome != null ? parseToUnicode( nome ) : null );
getObservacao();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
}

@ -0,0 +1,28 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcd;
public class TrabalhadoresEcd extends _TrabalhadoresEcd {
private static final long serialVersionUID = 1L;
@Override
public String toString()
{
PrtTiposElementosProtocolo exame = getToPrtTiposElementosProtocolo();
String exameNome = exame == null ? null : exame.getDescricao();
EcdOficial exameOficial = getToEcdOficial();
String exameOficialNome = exameOficial == null ? null : exameOficial.getDescricao();
String result = "";
if(exameNome == null && exameOficialNome != null)
{
result = exameOficialNome + " [oficial]";
}else if( exameNome != null )
{
result = exameNome;
}
return result;
}
}

@ -0,0 +1,171 @@
package siprp.database.cayenne.objects;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import leaf.data.OrderedMap;
import siprp.MedicinaConstants;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcds;
public class TrabalhadoresEcds extends _TrabalhadoresEcds implements MedicinaConstants
{
private static final long serialVersionUID = 1L;
public String getDataString()
{
return getData() == null ? "(sem data definida)" : sdf.format( getData() );
}
public String getEstadoString()
{
return isNew() ? isNewMessage : (getEstado() == null || getEstado() >= ESTADOS_EXAME_STR.length ? "" : ESTADOS_EXAME_STR[getEstado()]);
}
public HashMap<Integer, String> getEstados()
{
HashMap<Integer, String> result = new HashMap<Integer, String>();
for( int i = 0; i < ESTADOS_EXAME_STR.length; ++i )
{
if( ESTADOS_EXAME_STR[i] != null )
{
result.put( new Integer( i ), ESTADOS_EXAME_STR[i] );
}
}
return result;
}
@Override
public String toString()
{
return getDataString() + ": " + getEstadoString();
}
public OrderedMap<PrtGruposProtocolo> getGruposExamesForPerfil()
{
OrderedMap<PrtGruposProtocolo> grupos = new OrderedMap<PrtGruposProtocolo>();
Trabalhadores trabalhador = this.getToTrabalhadores();
Integer perfil = trabalhador.getPerfil();
if( perfil != null )
{
Empresas empresa = trabalhador.getToEstabelecimentos().getToEmpresas();
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo>) empresa.getPrtElementosProtocoloArray();
for( PrtElementosProtocolo ecdPerfil : ecdsPerfil )
{
if( perfil.equals( ecdPerfil.getNumeroPerfil() ) )
{
PrtTiposElementosProtocolo ecd = ecdPerfil.getToPrtTiposElementosProtocolo();
if( ecd != null )
{
PrtGruposProtocolo grupoEcd = ecd.getToPrtGruposProtocolo();
if( grupoEcd != null )
{
String descricao = grupoEcd.getDescricao();
if( descricao != null && !grupos.containsKey( grupoEcd ) )
{
grupos.putLast( grupoEcd, descricao );
Integer estado = getEstadoForGrupoEcd( grupoEcd );
grupos.putLast( grupoEcd, estado != null ? MedicinaConstants.ESTADOS_EXAME_STR[estado] : " " );
}
}
}
}
}
}
List<Integer> estados = new ArrayList<Integer>();
List<TrabalhadoresEcdsDatas> marcacoes = getTrabalhadoresEcdsDatasArray();
if( marcacoes != null )
{
for( TrabalhadoresEcdsDatas marcacao : marcacoes )
{
Integer estado = marcacao.getEstado();
if( !estados.contains( estado ) )
{
estados.add( estado );
}
}
}
if( estados.size() == 1 )
{
// if( estadosSoFar.contains( new Integer( ESTADO_ANULADO ) ) || estadosSoFar.contains( new Integer( ESTADO_REALIZADO ) ) )
// {
setEstado( estados.get( 0 ) );
// }
// else if( estadosSoFar.contains( new Integer( ESTADO_POR_REALIZAR ) ) )
// {
// setEstado( ESTADO_POR_REALIZAR );
// }
// else
// {
// setEstado( ESTADO_POR_MARCAR );
// }
}
else if( estados.size() == 2 )
{
if( estados.contains( new Integer( ESTADO_ANULADO ) ) && estados.contains( new Integer( ESTADO_REALIZADO ) ) )
{
setEstado( ESTADO_REALIZADO );
}
else if( estados.contains( new Integer( ESTADO_POR_MARCAR ) ) )
{
setEstado( ESTADO_POR_MARCAR );
}
else if( estados.contains( new Integer( ESTADO_ANULADO ) ) || estados.contains( new Integer( ESTADO_REALIZADO ) ) )
{
setEstado( ESTADO_PARCIALMENTE_REALIZADO );
}
else
{
setEstado( ESTADO_POR_REALIZAR );
}
}
else
{
if( estados.contains( new Integer( ESTADO_POR_MARCAR ) ) )
{
setEstado( ESTADO_POR_MARCAR );
}
else if( estados.contains( new Integer( ESTADO_ANULADO ) ) && estados.contains( new Integer( ESTADO_REALIZADO ) ) )
{
setEstado( ESTADO_PARCIALMENTE_REALIZADO );
}
else
{
setEstado( ESTADO_POR_REALIZAR );
}
}
grupos.order();
return grupos;
}
private Integer getEstadoForGrupoEcd( PrtGruposProtocolo grupoEcd )
{
Integer estado = null;
List<TrabalhadoresEcdsDatas> marcacoes = getTrabalhadoresEcdsDatasArray();
if( marcacoes != null )
{
for( TrabalhadoresEcdsDatas marcacao : marcacoes )
{
List<TrabalhadoresEcd> ecds = marcacao.getTrabalhadoresEcdArray();
for( TrabalhadoresEcd ecd : ecds )
{
if( ecd.getToPrtTiposElementosProtocolo().getToPrtGruposProtocolo().equals( grupoEcd ) )
{
if( new Integer( ESTADO_REALIZADO ).equals( ecd.getEstado() ) || new Integer( ESTADO_ANULADO ).equals( ecd.getEstado() ) )
{
return ecd.getEstado();
}
else if( new Integer( ESTADO_POR_REALIZAR ).equals( ecd.getEstado() ) )
{
estado = ecd.getEstado();
break;
}
}
}
}
}
return estado == null ? ESTADO_POR_MARCAR : estado;
}
}

@ -0,0 +1,7 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsAnalise;
public class TrabalhadoresEcdsAnalise extends _TrabalhadoresEcdsAnalise {
}

@ -0,0 +1,204 @@
package siprp.database.cayenne.objects;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import leaf.data.OrderedMap;
import siprp.MedicinaConstants;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsDatas;
public class TrabalhadoresEcdsDatas extends _TrabalhadoresEcdsDatas implements MedicinaConstants
{
private static final long serialVersionUID = 1L;
public String getDataString()
{
return getData() == null ? "" : sdf.format( getData() );
}
public String getEstadoString()
{
return getEstado() == null || getEstado() >= ESTADOS_EXAME_STR.length ? "" : ESTADOS_EXAME_STR[getEstado()];
}
public HashMap<Integer, String> getEstados()
{
HashMap<Integer, String> result = new HashMap<Integer, String>();
for( int i = 0; i < ESTADOS_EXAME_STR.length; ++i )
{
if( ESTADOS_EXAME_STR[i] != null )
{
result.put( new Integer( i ), ESTADOS_EXAME_STR[i] );
}
}
return result;
}
@Override
public void setData( Date date )
{
if( date != null && this.getToTrabalhadoresEcds() != null && this.getEstado() != null && new Integer( ESTADO_POR_REALIZAR ).equals( this.getEstado() ) )
{
this.getToTrabalhadoresEcds().setData( date );
}
super.setData( date );
}
@Override
public String toString()
{
return getDataString() + ": " + getEstadoString();
}
public OrderedMap<PrtGruposProtocolo> getStatesForeGruposExames()
{
OrderedMap<PrtGruposProtocolo> grupos = new OrderedMap<PrtGruposProtocolo>();
List<TrabalhadoresEcd> exames = this.getTrabalhadoresEcdArray();
if( exames != null )
{
for( TrabalhadoresEcd exame : exames )
{
String estadoString = MedicinaConstants.ESTADOS_EXAME_STR[exame.getEstado()];
PrtGruposProtocolo grupo = exame.getToPrtTiposElementosProtocolo().getToPrtGruposProtocolo();
if( !grupos.containsKey( grupo ) )
{
grupos.putLast( grupo, grupo.getDescricao() );
grupos.putLast( grupo, estadoString );
}
}
}
grupos.order();
return grupos;
}
private List<PrtTiposElementosProtocolo> getAllEcdForGrupoForThisMarcacao( PrtGruposProtocolo grupo )
{
List<PrtTiposElementosProtocolo> result = new ArrayList<PrtTiposElementosProtocolo>();
for( TrabalhadoresEcd ecd : (List<TrabalhadoresEcd>) getTrabalhadoresEcdArray() )
{
if( grupo.equals( ecd.getToPrtTiposElementosProtocolo().getToPrtGruposProtocolo() ) )
{
result.add( ecd.getToPrtTiposElementosProtocolo() );
}
}
return result;
}
private List<PrtTiposElementosProtocolo> getAllEcdForGrupoAndCurrentPerfil( PrtGruposProtocolo grupo )
{
Trabalhadores trabalhador = getToTrabalhadoresEcds().getToTrabalhadores();
List<PrtTiposElementosProtocolo> result = new ArrayList<PrtTiposElementosProtocolo>();
Integer perfil = trabalhador.getPerfil();
if( perfil != null )
{
Empresas empresa = trabalhador.getToEstabelecimentos().getToEmpresas();
List<PrtElementosProtocolo> ecdsPerfil = (List<PrtElementosProtocolo>) empresa.getPrtElementosProtocoloArray();
for( PrtElementosProtocolo ecdPerfil : ecdsPerfil )
{
if( perfil.equals( ecdPerfil.getNumeroPerfil() ) )
{
PrtTiposElementosProtocolo ecd = ecdPerfil.getToPrtTiposElementosProtocolo();
if( ecd != null )
{
if( ecd.getToPrtGruposProtocolo().equals( grupo ) && !result.contains( ecd ) )
{
result.add( ecd );
}
}
}
}
}
return result;
}
public void marcarGrupoExames( PrtGruposProtocolo grupo )
{
for( PrtTiposElementosProtocolo ecd : getAllEcdForGrupoAndCurrentPerfil( grupo ) )
{
TrabalhadoresEcd trabEcd = new TrabalhadoresEcd();
trabEcd.setEstado( MedicinaConstants.ESTADO_POR_REALIZAR );
trabEcd.setToPrtTiposElementosProtocolo( ecd );
trabEcd.setToTrabalhadoresEcdsDatas( this );
addToTrabalhadoresEcdArray( trabEcd );
}
getToTrabalhadoresEcds().getGruposExamesForPerfil();
}
public void setStateForGrupoProtocolo( PrtGruposProtocolo grupo, Integer estado )
{
List<PrtTiposElementosProtocolo> group = getAllEcdForGrupoForThisMarcacao( grupo );
for(TrabalhadoresEcd ecd : (List<TrabalhadoresEcd>) getTrabalhadoresEcdArray())
{
if(group.contains( ecd.getToPrtTiposElementosProtocolo()))
{
ecd.setEstado( estado );
}
}
}
public void setStateForGrupoProtocolo( PrtGruposProtocolo grupo, String estado )
{
for( int i = 0; i < ESTADOS_EXAME_STR.length; ++i )
{
String currentEstado = ESTADOS_EXAME_STR[i];
if( currentEstado != null && new Integer( i ).equals( estado ) )
{
setStateForGrupoProtocolo( grupo, i );
break;
}
}
}
public void anular()
{
setEstadoForAllEcd( MedicinaConstants.ESTADO_ANULADO );
}
public void realizar()
{
setEstadoForAllEcd( MedicinaConstants.ESTADO_REALIZADO );
}
public void porRealizar()
{
setEstadoForAllEcd( MedicinaConstants.ESTADO_POR_REALIZAR );
}
public void desmarcarSIPRP()
{
setEstadoForAllEcd( MedicinaConstants.ESTADO_DESMARCADO_EMPRESA );
}
public void desmarcarTrabalhador()
{
setEstadoForAllEcd( MedicinaConstants.ESTADO_DESMARCADO_TRABALHADOR );
}
public void faltou()
{
setEstadoForAllEcd( MedicinaConstants.ESTADO_FALTOU );
}
public void setEstadoForAllEcd( Integer estado )
{
List<TrabalhadoresEcd> allEcd = (List<TrabalhadoresEcd>) getTrabalhadoresEcdArray();
if(allEcd != null)
{
for(TrabalhadoresEcd ecd : allEcd )
{
ecd.setEstado( estado );
}
}
super.setEstado( estado );
getToTrabalhadoresEcds().getGruposExamesForPerfil();
}
@Override
public void setEstado( Integer estado ){
super.setEstado( estado );
getToTrabalhadoresEcds().getGruposExamesForPerfil();
}
}

@ -0,0 +1,22 @@
package siprp.database.cayenne.objects;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsDatasEmails;
public class TrabalhadoresEcdsDatasEmails extends _TrabalhadoresEcdsDatasEmails {
private static final long serialVersionUID = 1L;
public String getDataString()
{
return getData() == null ? "" : sdf.format( getData() );
}
@Override
public String toString()
{
return getSubject();
}
}

@ -0,0 +1,56 @@
package siprp.database.cayenne.objects;
import com.evolute.utils.strings.UnicodeChecker;
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsDatasObservacoes;
public class TrabalhadoresEcdsDatasObservacoes extends _TrabalhadoresEcdsDatasObservacoes {
private static final long serialVersionUID = 1L;
private String name = null;
private String convertedName = null;
@Override
public String toString()
{
return getObservacao();
}
@Override
public String getObservacao()
{
String currentName = super.getObservacao();
if( name == null || !name.equals( currentName ))
{
name = currentName;
convertedName = null;
}
return convertName();
}
@Override
public void setObservacao( String nome )
{
super.setObservacao( nome != null ? parseToUnicode( nome ) : null );
getObservacao();
}
private String convertName()
{
if( name == null )
{
convertedName = null;
}
else
{
convertedName = parseFromUnicode( name );
}
return convertedName;
}
}

@ -0,0 +1,56 @@
package siprp.database.cayenne.objects;
import java.util.Date;
import siprp.database.cayenne.objects.auto._TrabalhadoresFichasAptidao;
public class TrabalhadoresFichasAptidao extends _TrabalhadoresFichasAptidao {
private static final long serialVersionUID = 1L;
@Override
public String toString()
{
String result = "";
Exames exame = getToExames();
if( exame != null )
{
Date data = exame.getProximoExame();
if( data != null )
{
result = sdf.format( data );
}
}
return result + ": " + getEstadoString();
}
private String getEstadoString()
{
String result = "";
Exames exame = getToExames();
if( exame != null )
{
Integer resultadoCodigo = exame.getResultado();
if( resultadoCodigo != null )
{
switch( resultadoCodigo.intValue() )
{
case 1:
result += "Apto";
break;
case 2:
result += "Apto (cond)";
break;
case 3:
result += "Inapto (temp)";
break;
case 4:
result += "Inapto (def)";
break;
}
}
}
return result;
}
}

@ -0,0 +1,74 @@
package siprp.database.cayenne.objects;
import java.util.HashMap;
import siprp.MedicinaConstants;
import siprp.ProcessoConstants;
import siprp.database.cayenne.objects.auto._TrabalhadoresProcesso;
public class TrabalhadoresProcesso extends _TrabalhadoresProcesso implements ProcessoConstants {
private static final long serialVersionUID = 1L;
private static final HashMap<Integer,String> MOTIVOS_BY_ID = new HashMap<Integer,String>();
static
{
MOTIVOS_BY_ID.put( MedicinaConstants.MOTIVO_ADMISSAO_INTEGER, MedicinaConstants.MOTIVO_ADMISSAO_STR );
MOTIVOS_BY_ID.put( MedicinaConstants.MOTIVO_PERIODICO_INTEGER, MedicinaConstants.MOTIVO_PERIODICO_STR );
MOTIVOS_BY_ID.put( MedicinaConstants.MOTIVO_OCASIONAL_INTEGER, MedicinaConstants.MOTIVO_OCASIONAL_STR );
MOTIVOS_BY_ID.put( MedicinaConstants.MOTIVO_PERIODICO_INICIAL_INTEGER, MedicinaConstants.MOTIVO_PERIODICO_INICIAL_STR );
}
private String getDescricaoEstadoProcessoByCodigo()
{
return ESTADO_PROCESSO_BY_CODE.get( getEstado() );
}
private String getMotivoString()
{
return getMotivo() == null ? "" : MOTIVOS_BY_ID.get( getMotivo() );
}
private String getDataInicioString()
{
return getDataInicio() == null ? "" : sdf.format( getDataInicio() );
}
@Override
public String toString()
{
return getDataInicioString() + ": " + getMotivoString() + " : " + getDescricaoEstadoProcessoByCodigo();
}
public HashMap<String, String> getEstados()
{
HashMap<String,String> result = new HashMap<String, String>();
result.put( PROCESSO_ABERTO_CODE, PROCESSO_ABERTO_DESCRIPTION );
result.put( PROCESSO_CANCELADO_CODE, PROCESSO_CANCELADO_DESCRIPTION );
result.put( PROCESSO_FECHADO_CODE, PROCESSO_FECHADO_DESCRIPTION );
return result;
}
public HashMap<Integer, String> getMotivos()
{
HashMap<Integer,String> result = new HashMap<Integer, String>();
result.put( MedicinaConstants.MOTIVO_ADMISSAO_INTEGER, MedicinaConstants.MOTIVO_ADMISSAO_STR);
result.put( MedicinaConstants.MOTIVO_OCASIONAL_INTEGER, MedicinaConstants.MOTIVO_OCASIONAL_STR);
result.put( MedicinaConstants.MOTIVO_PERIODICO_INICIAL_INTEGER, MedicinaConstants.MOTIVO_PERIODICO_INICIAL_STR);
result.put( MedicinaConstants.MOTIVO_PERIODICO_INTEGER, MedicinaConstants.MOTIVO_PERIODICO_STR);
return result;
}
public boolean isEmpty()
{
boolean noConsultas = (getTrabalhadoresConsultasArray() == null || getTrabalhadoresConsultasArray().size() == 0);
boolean noExames= ( getTrabalhadoresEcdsArray() == null || getTrabalhadoresEcdsArray().size() == 0);
boolean noFicha = ( getTrabalhadoresFichasAptidaoArray() == null || getTrabalhadoresFichasAptidaoArray().size() == 0);
return noConsultas && noExames && noFicha;
}
}

@ -0,0 +1,96 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos;
/**
* Class _Avisos was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Avisos extends BaseObject {
public static final String DATA_AVISO_PROPERTY = "dataAviso";
public static final String DATA_EVENTO_PROPERTY = "dataEvento";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String EVENTO_ID_PROPERTY = "eventoId";
public static final String ID_PROPERTY = "id";
public static final String TIPO_PROPERTY = "tipo";
public static final String TRABALHADOR_ID_PROPERTY = "trabalhadorId";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
public static final String ID_PK_COLUMN = "id";
public void setDataAviso(Date dataAviso) {
writeProperty("dataAviso", dataAviso);
}
public Date getDataAviso() {
return (Date)readProperty("dataAviso");
}
public void setDataEvento(Date dataEvento) {
writeProperty("dataEvento", dataEvento);
}
public Date getDataEvento() {
return (Date)readProperty("dataEvento");
}
public void setDescricao(String descricao) {
writeProperty("descricao", descricao);
}
public String getDescricao() {
return (String)readProperty("descricao");
}
public void setEventoId(Integer eventoId) {
writeProperty("eventoId", eventoId);
}
public Integer getEventoId() {
return (Integer)readProperty("eventoId");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setTipo(Integer tipo) {
writeProperty("tipo", tipo);
}
public Integer getTipo() {
return (Integer)readProperty("tipo");
}
public void setTrabalhadorId(Integer trabalhadorId) {
writeProperty("trabalhadorId", trabalhadorId);
}
public Integer getTrabalhadorId() {
return (Integer)readProperty("trabalhadorId");
}
public void setToEmpresas(Empresas toEmpresas) {
setToOneTarget("toEmpresas", toEmpresas, true);
}
public Empresas getToEmpresas() {
return (Empresas)readProperty("toEmpresas");
}
public void setToEstabelecimentos(Estabelecimentos toEstabelecimentos) {
setToOneTarget("toEstabelecimentos", toEstabelecimentos, true);
}
public Estabelecimentos getToEstabelecimentos() {
return (Estabelecimentos)readProperty("toEstabelecimentos");
}
}

@ -0,0 +1,129 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.Estabelecimentos;
import siprp.database.cayenne.objects.Prestadores;
/**
* Class _Contactos was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Contactos extends BaseObject {
public static final String CARGO_PROPERTY = "cargo";
public static final String EMAIL_PROPERTY = "email";
public static final String FAX_PROPERTY = "fax";
public static final String ID_PROPERTY = "id";
public static final String NOME_PROPERTY = "nome";
public static final String TELEFONE_PROPERTY = "telefone";
public static final String TELEMOVEL_PROPERTY = "telemovel";
public static final String EMPRESAS_ARRAY_PROPERTY = "empresasArray";
public static final String EMPRESAS_ARRAY1_PROPERTY = "empresasArray1";
public static final String ESTABELECIMENTOS_ARRAY_PROPERTY = "estabelecimentosArray";
public static final String PRESTADORES_ARRAY_PROPERTY = "prestadoresArray";
public static final String ID_PK_COLUMN = "id";
public void setCargo(String cargo) {
writeProperty("cargo", cargo);
}
public String getCargo() {
return (String)readProperty("cargo");
}
public void setEmail(String email) {
writeProperty("email", email);
}
public String getEmail() {
return (String)readProperty("email");
}
public void setFax(String fax) {
writeProperty("fax", fax);
}
public String getFax() {
return (String)readProperty("fax");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setNome(String nome) {
writeProperty("nome", nome);
}
public String getNome() {
return (String)readProperty("nome");
}
public void setTelefone(String telefone) {
writeProperty("telefone", telefone);
}
public String getTelefone() {
return (String)readProperty("telefone");
}
public void setTelemovel(String telemovel) {
writeProperty("telemovel", telemovel);
}
public String getTelemovel() {
return (String)readProperty("telemovel");
}
public void addToEmpresasArray(Empresas obj) {
addToManyTarget("empresasArray", obj, true);
}
public void removeFromEmpresasArray(Empresas obj) {
removeToManyTarget("empresasArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Empresas> getEmpresasArray() {
return (List<Empresas>)readProperty("empresasArray");
}
public void addToEmpresasArray1(Empresas obj) {
addToManyTarget("empresasArray1", obj, true);
}
public void removeFromEmpresasArray1(Empresas obj) {
removeToManyTarget("empresasArray1", obj, true);
}
@SuppressWarnings("unchecked")
public List<Empresas> getEmpresasArray1() {
return (List<Empresas>)readProperty("empresasArray1");
}
public void addToEstabelecimentosArray(Estabelecimentos obj) {
addToManyTarget("estabelecimentosArray", obj, true);
}
public void removeFromEstabelecimentosArray(Estabelecimentos obj) {
removeToManyTarget("estabelecimentosArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Estabelecimentos> getEstabelecimentosArray() {
return (List<Estabelecimentos>)readProperty("estabelecimentosArray");
}
public void addToPrestadoresArray(Prestadores obj) {
addToManyTarget("prestadoresArray", obj, true);
}
public void removeFromPrestadoresArray(Prestadores obj) {
removeToManyTarget("prestadoresArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Prestadores> getPrestadoresArray() {
return (List<Prestadores>)readProperty("prestadoresArray");
}
}

@ -0,0 +1,72 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.TrabalhadoresEcd;
/**
* Class _EcdOficial was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _EcdOficial extends BaseObject {
public static final String ACTIVO_PROPERTY = "activo";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String DESCRICAO_PLAIN_PROPERTY = "descricaoPlain";
public static final String ID_PROPERTY = "id";
public static final String ORDEM_PROPERTY = "ordem";
public static final String TRABALHADORES_ECD_ARRAY_PROPERTY = "trabalhadoresEcdArray";
public static final String ID_PK_COLUMN = "id";
public void setActivo(String activo) {
writeProperty("activo", activo);
}
public String getActivo() {
return (String)readProperty("activo");
}
public void setDescricao(String descricao) {
writeProperty("descricao", descricao);
}
public String getDescricao() {
return (String)readProperty("descricao");
}
public void setDescricaoPlain(String descricaoPlain) {
writeProperty("descricaoPlain", descricaoPlain);
}
public String getDescricaoPlain() {
return (String)readProperty("descricaoPlain");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setOrdem(Integer ordem) {
writeProperty("ordem", ordem);
}
public Integer getOrdem() {
return (Integer)readProperty("ordem");
}
public void addToTrabalhadoresEcdArray(TrabalhadoresEcd obj) {
addToManyTarget("trabalhadoresEcdArray", obj, true);
}
public void removeFromTrabalhadoresEcdArray(TrabalhadoresEcd obj) {
removeToManyTarget("trabalhadoresEcdArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<TrabalhadoresEcd> getTrabalhadoresEcdArray() {
return (List<TrabalhadoresEcd>)readProperty("trabalhadoresEcdArray");
}
}

@ -0,0 +1,36 @@
package siprp.database.cayenne.objects.auto;
import org.apache.cayenne.CayenneDataObject;
import siprp.database.cayenne.objects.Estabelecimentos;
/**
* Class _EmailPlanoDeActuacao was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _EmailPlanoDeActuacao extends CayenneDataObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void setToEstabelecimentos(Estabelecimentos toEstabelecimentos) {
setToOneTarget("toEstabelecimentos", toEstabelecimentos, true);
}
public Estabelecimentos getToEstabelecimentos() {
return (Estabelecimentos)readProperty("toEstabelecimentos");
}
}

@ -0,0 +1,449 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import java.util.List;
import siprp.database.cayenne.objects.Avisos;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Contactos;
import siprp.database.cayenne.objects.Estabelecimentos;
import siprp.database.cayenne.objects.Image;
import siprp.database.cayenne.objects.Lembretes;
import siprp.database.cayenne.objects.MarcacoesEmpresa;
import siprp.database.cayenne.objects.PrtElementosProtocolo;
/**
* Class _Empresas was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Empresas extends BaseObject {
public static final String A_CONSULTAS_PROPERTY = "aConsultas";
public static final String A_EXAMES_PROPERTY = "aExames";
public static final String ACTIVIDADE_PROPERTY = "actividade";
public static final String ACTUALIZACAO_PROPERTY = "actualizacao";
public static final String B_CONSULTAS_PROPERTY = "bConsultas";
public static final String B_EXAMES_PROPERTY = "bExames";
public static final String CAE_PROPERTY = "cae";
public static final String CODIGO1_PROPERTY = "codigo1";
public static final String CODIGO2_PROPERTY = "codigo2";
public static final String CODIGO3_PROPERTY = "codigo3";
public static final String CODIGO_POSTAL_PROPERTY = "codigoPostal";
public static final String CONCELHO_PROPERTY = "concelho";
public static final String CONTRIBUINTE_PROPERTY = "contribuinte";
public static final String DATA_ACEITACAO_PROPERTY = "dataAceitacao";
public static final String DATA_CANCELAMENTO_PROPERTY = "dataCancelamento";
public static final String DATA_ENVIO_CONTRATO_PROPERTY = "dataEnvioContrato";
public static final String DATA_ENVIO_IDICT_PROPERTY = "dataEnvioIdict";
public static final String DATA_PROPOSTA_PROPERTY = "dataProposta";
public static final String DATA_RECEPCAO_CONTRATO_PROPERTY = "dataRecepcaoContrato";
public static final String DATA_RELATORIO_ANUAL_PROPERTY = "dataRelatorioAnual";
public static final String DESIGNACAO_SOCIAL_PROPERTY = "designacaoSocial";
public static final String DESIGNACAO_SOCIAL_PLAIN_PROPERTY = "designacaoSocialPlain";
public static final String DISTRITO_PROPERTY = "distrito";
public static final String DURACAO_PROPERTY = "duracao";
public static final String ID_PROPERTY = "id";
public static final String INACTIVO_PROPERTY = "inactivo";
public static final String INICIO_CONTRATO_PROPERTY = "inicioContrato";
public static final String LOCALIDADE_PROPERTY = "localidade";
public static final String MORADA_PROPERTY = "morada";
public static final String NUMERO_TRABALHADORES_PROPERTY = "numeroTrabalhadores";
public static final String PERFIL1_PROPERTY = "perfil1";
public static final String PERFIL2_PROPERTY = "perfil2";
public static final String PERIODICIDADE_PROPERTY = "periodicidade";
public static final String PRECO_HIGIENE_PROPERTY = "precoHigiene";
public static final String PRECO_MEDICINA_PROPERTY = "precoMedicina";
public static final String SEGURANCA_SOCIAL_PROPERTY = "segurancaSocial";
public static final String SERVICO_HIGIENE_DESIGNACAO_PROPERTY = "servicoHigieneDesignacao";
public static final String SERVICO_HIGIENE_TIPO_PROPERTY = "servicoHigieneTipo";
public static final String SERVICO_SAUDE_DESIGNACAO_PROPERTY = "servicoSaudeDesignacao";
public static final String SERVICO_SAUDE_TIPO_PROPERTY = "servicoSaudeTipo";
public static final String SERVICOS_PROPERTY = "servicos";
public static final String AVISOS_ARRAY_PROPERTY = "avisosArray";
public static final String ESTABELECIMENTOS_ARRAY_PROPERTY = "estabelecimentosArray";
public static final String LEMBRETES_ARRAY_PROPERTY = "lembretesArray";
public static final String MARCACOES_EMPRESA_ARRAY_PROPERTY = "marcacoesEmpresaArray";
public static final String PRT_ELEMENTOS_PROTOCOLO_ARRAY_PROPERTY = "prtElementosProtocoloArray";
public static final String TO_CONTACTOS_PROPERTY = "toContactos";
public static final String TO_CONTACTOS1_PROPERTY = "toContactos1";
public static final String TO_LOGOTIPO_PROPERTY = "toLogotipo";
public static final String ID_PK_COLUMN = "id";
public void setAConsultas(String aConsultas) {
writeProperty("aConsultas", aConsultas);
}
public String getAConsultas() {
return (String)readProperty("aConsultas");
}
public void setAExames(String aExames) {
writeProperty("aExames", aExames);
}
public String getAExames() {
return (String)readProperty("aExames");
}
public void setActividade(String actividade) {
writeProperty("actividade", actividade);
}
public String getActividade() {
return (String)readProperty("actividade");
}
public void setActualizacao(Date actualizacao) {
writeProperty("actualizacao", actualizacao);
}
public Date getActualizacao() {
return (Date)readProperty("actualizacao");
}
public void setBConsultas(String bConsultas) {
writeProperty("bConsultas", bConsultas);
}
public String getBConsultas() {
return (String)readProperty("bConsultas");
}
public void setBExames(String bExames) {
writeProperty("bExames", bExames);
}
public String getBExames() {
return (String)readProperty("bExames");
}
public void setCae(String cae) {
writeProperty("cae", cae);
}
public String getCae() {
return (String)readProperty("cae");
}
public void setCodigo1(String codigo1) {
writeProperty("codigo1", codigo1);
}
public String getCodigo1() {
return (String)readProperty("codigo1");
}
public void setCodigo2(String codigo2) {
writeProperty("codigo2", codigo2);
}
public String getCodigo2() {
return (String)readProperty("codigo2");
}
public void setCodigo3(String codigo3) {
writeProperty("codigo3", codigo3);
}
public String getCodigo3() {
return (String)readProperty("codigo3");
}
public void setCodigoPostal(String codigoPostal) {
writeProperty("codigoPostal", codigoPostal);
}
public String getCodigoPostal() {
return (String)readProperty("codigoPostal");
}
public void setConcelho(String concelho) {
writeProperty("concelho", concelho);
}
public String getConcelho() {
return (String)readProperty("concelho");
}
public void setContribuinte(String contribuinte) {
writeProperty("contribuinte", contribuinte);
}
public String getContribuinte() {
return (String)readProperty("contribuinte");
}
public void setDataAceitacao(Date dataAceitacao) {
writeProperty("dataAceitacao", dataAceitacao);
}
public Date getDataAceitacao() {
return (Date)readProperty("dataAceitacao");
}
public void setDataCancelamento(Date dataCancelamento) {
writeProperty("dataCancelamento", dataCancelamento);
}
public Date getDataCancelamento() {
return (Date)readProperty("dataCancelamento");
}
public void setDataEnvioContrato(Date dataEnvioContrato) {
writeProperty("dataEnvioContrato", dataEnvioContrato);
}
public Date getDataEnvioContrato() {
return (Date)readProperty("dataEnvioContrato");
}
public void setDataEnvioIdict(Date dataEnvioIdict) {
writeProperty("dataEnvioIdict", dataEnvioIdict);
}
public Date getDataEnvioIdict() {
return (Date)readProperty("dataEnvioIdict");
}
public void setDataProposta(Date dataProposta) {
writeProperty("dataProposta", dataProposta);
}
public Date getDataProposta() {
return (Date)readProperty("dataProposta");
}
public void setDataRecepcaoContrato(Date dataRecepcaoContrato) {
writeProperty("dataRecepcaoContrato", dataRecepcaoContrato);
}
public Date getDataRecepcaoContrato() {
return (Date)readProperty("dataRecepcaoContrato");
}
public void setDataRelatorioAnual(Date dataRelatorioAnual) {
writeProperty("dataRelatorioAnual", dataRelatorioAnual);
}
public Date getDataRelatorioAnual() {
return (Date)readProperty("dataRelatorioAnual");
}
public void setDesignacaoSocial(String designacaoSocial) {
writeProperty("designacaoSocial", designacaoSocial);
}
public String getDesignacaoSocial() {
return (String)readProperty("designacaoSocial");
}
public void setDesignacaoSocialPlain(String designacaoSocialPlain) {
writeProperty("designacaoSocialPlain", designacaoSocialPlain);
}
public String getDesignacaoSocialPlain() {
return (String)readProperty("designacaoSocialPlain");
}
public void setDistrito(String distrito) {
writeProperty("distrito", distrito);
}
public String getDistrito() {
return (String)readProperty("distrito");
}
public void setDuracao(Integer duracao) {
writeProperty("duracao", duracao);
}
public Integer getDuracao() {
return (Integer)readProperty("duracao");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setInactivo(String inactivo) {
writeProperty("inactivo", inactivo);
}
public String getInactivo() {
return (String)readProperty("inactivo");
}
public void setInicioContrato(Date inicioContrato) {
writeProperty("inicioContrato", inicioContrato);
}
public Date getInicioContrato() {
return (Date)readProperty("inicioContrato");
}
public void setLocalidade(String localidade) {
writeProperty("localidade", localidade);
}
public String getLocalidade() {
return (String)readProperty("localidade");
}
public void setMorada(String morada) {
writeProperty("morada", morada);
}
public String getMorada() {
return (String)readProperty("morada");
}
public void setNumeroTrabalhadores(Integer numeroTrabalhadores) {
writeProperty("numeroTrabalhadores", numeroTrabalhadores);
}
public Integer getNumeroTrabalhadores() {
return (Integer)readProperty("numeroTrabalhadores");
}
public void setPerfil1(String perfil1) {
writeProperty("perfil1", perfil1);
}
public String getPerfil1() {
return (String)readProperty("perfil1");
}
public void setPerfil2(String perfil2) {
writeProperty("perfil2", perfil2);
}
public String getPerfil2() {
return (String)readProperty("perfil2");
}
public void setPeriodicidade(String periodicidade) {
writeProperty("periodicidade", periodicidade);
}
public String getPeriodicidade() {
return (String)readProperty("periodicidade");
}
public void setPrecoHigiene(Double precoHigiene) {
writeProperty("precoHigiene", precoHigiene);
}
public Double getPrecoHigiene() {
return (Double)readProperty("precoHigiene");
}
public void setPrecoMedicina(Double precoMedicina) {
writeProperty("precoMedicina", precoMedicina);
}
public Double getPrecoMedicina() {
return (Double)readProperty("precoMedicina");
}
public void setSegurancaSocial(String segurancaSocial) {
writeProperty("segurancaSocial", segurancaSocial);
}
public String getSegurancaSocial() {
return (String)readProperty("segurancaSocial");
}
public void setServicoHigieneDesignacao(String servicoHigieneDesignacao) {
writeProperty("servicoHigieneDesignacao", servicoHigieneDesignacao);
}
public String getServicoHigieneDesignacao() {
return (String)readProperty("servicoHigieneDesignacao");
}
public void setServicoHigieneTipo(Integer servicoHigieneTipo) {
writeProperty("servicoHigieneTipo", servicoHigieneTipo);
}
public Integer getServicoHigieneTipo() {
return (Integer)readProperty("servicoHigieneTipo");
}
public void setServicoSaudeDesignacao(String servicoSaudeDesignacao) {
writeProperty("servicoSaudeDesignacao", servicoSaudeDesignacao);
}
public String getServicoSaudeDesignacao() {
return (String)readProperty("servicoSaudeDesignacao");
}
public void setServicoSaudeTipo(Integer servicoSaudeTipo) {
writeProperty("servicoSaudeTipo", servicoSaudeTipo);
}
public Integer getServicoSaudeTipo() {
return (Integer)readProperty("servicoSaudeTipo");
}
public void setServicos(Integer servicos) {
writeProperty("servicos", servicos);
}
public Integer getServicos() {
return (Integer)readProperty("servicos");
}
public void addToAvisosArray(Avisos obj) {
addToManyTarget("avisosArray", obj, true);
}
public void removeFromAvisosArray(Avisos obj) {
removeToManyTarget("avisosArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Avisos> getAvisosArray() {
return (List<Avisos>)readProperty("avisosArray");
}
public void addToEstabelecimentosArray(Estabelecimentos obj) {
addToManyTarget("estabelecimentosArray", obj, true);
}
public void removeFromEstabelecimentosArray(Estabelecimentos obj) {
removeToManyTarget("estabelecimentosArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Estabelecimentos> getEstabelecimentosArray() {
return (List<Estabelecimentos>)readProperty("estabelecimentosArray");
}
public void addToLembretesArray(Lembretes obj) {
addToManyTarget("lembretesArray", obj, true);
}
public void removeFromLembretesArray(Lembretes obj) {
removeToManyTarget("lembretesArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Lembretes> getLembretesArray() {
return (List<Lembretes>)readProperty("lembretesArray");
}
public void addToMarcacoesEmpresaArray(MarcacoesEmpresa obj) {
addToManyTarget("marcacoesEmpresaArray", obj, true);
}
public void removeFromMarcacoesEmpresaArray(MarcacoesEmpresa obj) {
removeToManyTarget("marcacoesEmpresaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<MarcacoesEmpresa> getMarcacoesEmpresaArray() {
return (List<MarcacoesEmpresa>)readProperty("marcacoesEmpresaArray");
}
public void addToPrtElementosProtocoloArray(PrtElementosProtocolo obj) {
addToManyTarget("prtElementosProtocoloArray", obj, true);
}
public void removeFromPrtElementosProtocoloArray(PrtElementosProtocolo obj) {
removeToManyTarget("prtElementosProtocoloArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<PrtElementosProtocolo> getPrtElementosProtocoloArray() {
return (List<PrtElementosProtocolo>)readProperty("prtElementosProtocoloArray");
}
public void setToContactos(Contactos toContactos) {
setToOneTarget("toContactos", toContactos, true);
}
public Contactos getToContactos() {
return (Contactos)readProperty("toContactos");
}
public void setToContactos1(Contactos toContactos1) {
setToOneTarget("toContactos1", toContactos1, true);
}
public Contactos getToContactos1() {
return (Contactos)readProperty("toContactos1");
}
public void setToLogotipo(Image toLogotipo) {
setToOneTarget("toLogotipo", toLogotipo, true);
}
public Image getToLogotipo() {
return (Image)readProperty("toLogotipo");
}
}

@ -0,0 +1,58 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import siprp.database.cayenne.objects.BaseObject;
/**
* Class _Errors was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Errors extends BaseObject {
public static final String DATE_PROPERTY = "date";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String ENVIRONMENT_PROPERTY = "environment";
public static final String ID_PROPERTY = "id";
public static final String TYPE_PROPERTY = "type";
public static final String ID_PK_COLUMN = "id";
public void setDate(Date date) {
writeProperty("date", date);
}
public Date getDate() {
return (Date)readProperty("date");
}
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void setEnvironment(String environment) {
writeProperty("environment", environment);
}
public String getEnvironment() {
return (String)readProperty("environment");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setType(String type) {
writeProperty("type", type);
}
public String getType() {
return (String)readProperty("type");
}
}

@ -0,0 +1,237 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import java.util.List;
import siprp.database.cayenne.objects.Avisos;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Contactos;
import siprp.database.cayenne.objects.EmailPlanoDeActuacao;
import siprp.database.cayenne.objects.Empresas;
import siprp.database.cayenne.objects.HistoricoEstabelecimento;
import siprp.database.cayenne.objects.Lembretes;
import siprp.database.cayenne.objects.MarcacoesEstabelecimento;
import siprp.database.cayenne.objects.Medicos;
import siprp.database.cayenne.objects.Prestadores;
import siprp.database.cayenne.objects.Trabalhadores;
/**
* Class _Estabelecimentos was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Estabelecimentos extends BaseObject {
public static final String ACTUALIZACAO_PROPERTY = "actualizacao";
public static final String CODIGO_POSTAL_PROPERTY = "codigoPostal";
public static final String CONTACTO_BACKUP_PROPERTY = "contactoBackup";
public static final String HISTORICO_PROPERTY = "historico";
public static final String ID_PROPERTY = "id";
public static final String INACTIVO_PROPERTY = "inactivo";
public static final String LOCALIDADE_PROPERTY = "localidade";
public static final String MORADA_PROPERTY = "morada";
public static final String NOME_PROPERTY = "nome";
public static final String NOME_PLAIN_PROPERTY = "nomePlain";
public static final String AVISOS_ARRAY_PROPERTY = "avisosArray";
public static final String EMAIL_PLANO_DE_ACTUACAO_ARRAY_PROPERTY = "emailPlanoDeActuacaoArray";
public static final String HISTORICO_ESTABELECIMENTO_ARRAY_PROPERTY = "historicoEstabelecimentoArray";
public static final String LEMBRETES_ARRAY_PROPERTY = "lembretesArray";
public static final String MARCACOES_ESTABELECIMENTO_ARRAY_PROPERTY = "marcacoesEstabelecimentoArray";
public static final String TO_CONTACTOS_PROPERTY = "toContactos";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
public static final String TO_MEDICOS_PROPERTY = "toMedicos";
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
public static final String TO_PRESTADORES1_PROPERTY = "toPrestadores1";
public static final String TRABALHADORES_ARRAY_PROPERTY = "trabalhadoresArray";
public static final String ID_PK_COLUMN = "id";
public void setActualizacao(Date actualizacao) {
writeProperty("actualizacao", actualizacao);
}
public Date getActualizacao() {
return (Date)readProperty("actualizacao");
}
public void setCodigoPostal(String codigoPostal) {
writeProperty("codigoPostal", codigoPostal);
}
public String getCodigoPostal() {
return (String)readProperty("codigoPostal");
}
public void setContactoBackup(String contactoBackup) {
writeProperty("contactoBackup", contactoBackup);
}
public String getContactoBackup() {
return (String)readProperty("contactoBackup");
}
public void setHistorico(String historico) {
writeProperty("historico", historico);
}
public String getHistorico() {
return (String)readProperty("historico");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setInactivo(String inactivo) {
writeProperty("inactivo", inactivo);
}
public String getInactivo() {
return (String)readProperty("inactivo");
}
public void setLocalidade(String localidade) {
writeProperty("localidade", localidade);
}
public String getLocalidade() {
return (String)readProperty("localidade");
}
public void setMorada(String morada) {
writeProperty("morada", morada);
}
public String getMorada() {
return (String)readProperty("morada");
}
public void setNome(String nome) {
writeProperty("nome", nome);
}
public String getNome() {
return (String)readProperty("nome");
}
public void setNomePlain(String nomePlain) {
writeProperty("nomePlain", nomePlain);
}
public String getNomePlain() {
return (String)readProperty("nomePlain");
}
public void addToAvisosArray(Avisos obj) {
addToManyTarget("avisosArray", obj, true);
}
public void removeFromAvisosArray(Avisos obj) {
removeToManyTarget("avisosArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Avisos> getAvisosArray() {
return (List<Avisos>)readProperty("avisosArray");
}
public void addToEmailPlanoDeActuacaoArray(EmailPlanoDeActuacao obj) {
addToManyTarget("emailPlanoDeActuacaoArray", obj, true);
}
public void removeFromEmailPlanoDeActuacaoArray(EmailPlanoDeActuacao obj) {
removeToManyTarget("emailPlanoDeActuacaoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<EmailPlanoDeActuacao> getEmailPlanoDeActuacaoArray() {
return (List<EmailPlanoDeActuacao>)readProperty("emailPlanoDeActuacaoArray");
}
public void addToHistoricoEstabelecimentoArray(HistoricoEstabelecimento obj) {
addToManyTarget("historicoEstabelecimentoArray", obj, true);
}
public void removeFromHistoricoEstabelecimentoArray(HistoricoEstabelecimento obj) {
removeToManyTarget("historicoEstabelecimentoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HistoricoEstabelecimento> getHistoricoEstabelecimentoArray() {
return (List<HistoricoEstabelecimento>)readProperty("historicoEstabelecimentoArray");
}
public void addToLembretesArray(Lembretes obj) {
addToManyTarget("lembretesArray", obj, true);
}
public void removeFromLembretesArray(Lembretes obj) {
removeToManyTarget("lembretesArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Lembretes> getLembretesArray() {
return (List<Lembretes>)readProperty("lembretesArray");
}
public void addToMarcacoesEstabelecimentoArray(MarcacoesEstabelecimento obj) {
addToManyTarget("marcacoesEstabelecimentoArray", obj, true);
}
public void removeFromMarcacoesEstabelecimentoArray(MarcacoesEstabelecimento obj) {
removeToManyTarget("marcacoesEstabelecimentoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<MarcacoesEstabelecimento> getMarcacoesEstabelecimentoArray() {
return (List<MarcacoesEstabelecimento>)readProperty("marcacoesEstabelecimentoArray");
}
public void setToContactos(Contactos toContactos) {
setToOneTarget("toContactos", toContactos, true);
}
public Contactos getToContactos() {
return (Contactos)readProperty("toContactos");
}
public void setToEmpresas(Empresas toEmpresas) {
setToOneTarget("toEmpresas", toEmpresas, true);
}
public Empresas getToEmpresas() {
return (Empresas)readProperty("toEmpresas");
}
public void setToMedicos(Medicos toMedicos) {
setToOneTarget("toMedicos", toMedicos, true);
}
public Medicos getToMedicos() {
return (Medicos)readProperty("toMedicos");
}
public void setToPrestadores(Prestadores toPrestadores) {
setToOneTarget("toPrestadores", toPrestadores, true);
}
public Prestadores getToPrestadores() {
return (Prestadores)readProperty("toPrestadores");
}
public void setToPrestadores1(Prestadores toPrestadores1) {
setToOneTarget("toPrestadores1", toPrestadores1, true);
}
public Prestadores getToPrestadores1() {
return (Prestadores)readProperty("toPrestadores1");
}
public void addToTrabalhadoresArray(Trabalhadores obj) {
addToManyTarget("trabalhadoresArray", obj, true);
}
public void removeFromTrabalhadoresArray(Trabalhadores obj) {
removeToManyTarget("trabalhadoresArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<Trabalhadores> getTrabalhadoresArray() {
return (List<Trabalhadores>)readProperty("trabalhadoresArray");
}
}

@ -0,0 +1,128 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
/**
* Class _Etiquetas was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Etiquetas extends BaseObject {
public static final String ALTURA_PROPERTY = "altura";
public static final String ALTURA_FOLHA_PROPERTY = "alturaFolha";
public static final String COLUNAS_PROPERTY = "colunas";
public static final String CONTINUA_PROPERTY = "continua";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String DESCRICAO_PLAIN_PROPERTY = "descricaoPlain";
public static final String ID_PROPERTY = "id";
public static final String LARGURA_PROPERTY = "largura";
public static final String LARGURA_FOLHA_PROPERTY = "larguraFolha";
public static final String LINHAS_PROPERTY = "linhas";
public static final String MARGEM_CIMA_PROPERTY = "margemCima";
public static final String MARGEM_ESQUERDA_PROPERTY = "margemEsquerda";
public static final String MARGEM_HORIZONTAL_FOLHA_PROPERTY = "margemHorizontalFolha";
public static final String MARGEM_VERTICAL_FOLHA_PROPERTY = "margemVerticalFolha";
public static final String ID_PK_COLUMN = "id";
public void setAltura(Float altura) {
writeProperty("altura", altura);
}
public Float getAltura() {
return (Float)readProperty("altura");
}
public void setAlturaFolha(Float alturaFolha) {
writeProperty("alturaFolha", alturaFolha);
}
public Float getAlturaFolha() {
return (Float)readProperty("alturaFolha");
}
public void setColunas(Integer colunas) {
writeProperty("colunas", colunas);
}
public Integer getColunas() {
return (Integer)readProperty("colunas");
}
public void setContinua(String continua) {
writeProperty("continua", continua);
}
public String getContinua() {
return (String)readProperty("continua");
}
public void setDescricao(String descricao) {
writeProperty("descricao", descricao);
}
public String getDescricao() {
return (String)readProperty("descricao");
}
public void setDescricaoPlain(String descricaoPlain) {
writeProperty("descricaoPlain", descricaoPlain);
}
public String getDescricaoPlain() {
return (String)readProperty("descricaoPlain");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setLargura(Float largura) {
writeProperty("largura", largura);
}
public Float getLargura() {
return (Float)readProperty("largura");
}
public void setLarguraFolha(Float larguraFolha) {
writeProperty("larguraFolha", larguraFolha);
}
public Float getLarguraFolha() {
return (Float)readProperty("larguraFolha");
}
public void setLinhas(Integer linhas) {
writeProperty("linhas", linhas);
}
public Integer getLinhas() {
return (Integer)readProperty("linhas");
}
public void setMargemCima(Float margemCima) {
writeProperty("margemCima", margemCima);
}
public Float getMargemCima() {
return (Float)readProperty("margemCima");
}
public void setMargemEsquerda(Float margemEsquerda) {
writeProperty("margemEsquerda", margemEsquerda);
}
public Float getMargemEsquerda() {
return (Float)readProperty("margemEsquerda");
}
public void setMargemHorizontalFolha(Float margemHorizontalFolha) {
writeProperty("margemHorizontalFolha", margemHorizontalFolha);
}
public Float getMargemHorizontalFolha() {
return (Float)readProperty("margemHorizontalFolha");
}
public void setMargemVerticalFolha(Float margemVerticalFolha) {
writeProperty("margemVerticalFolha", margemVerticalFolha);
}
public Float getMargemVerticalFolha() {
return (Float)readProperty("margemVerticalFolha");
}
}

@ -0,0 +1,172 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Medicos;
import siprp.database.cayenne.objects.TrabalhadoresFichasAptidao;
/**
* Class _Exames was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _Exames extends BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String FO_PROPERTY = "fo";
public static final String ID_PROPERTY = "id";
public static final String INACTIVO_PROPERTY = "inactivo";
public static final String OCASIONAL_PROPERTY = "ocasional";
public static final String OUTRA_FUNCAO1_PROPERTY = "outraFuncao1";
public static final String OUTRA_FUNCAO2_PROPERTY = "outraFuncao2";
public static final String OUTRA_FUNCAO3_PROPERTY = "outraFuncao3";
public static final String OUTRA_FUNCAO4_PROPERTY = "outraFuncao4";
public static final String OUTRAS_RECOMENDACOES_PROPERTY = "outrasRecomendacoes";
public static final String OUTRO_TIPO_PROPERTY = "outroTipo";
public static final String PDF_PROPERTY = "pdf";
public static final String PROXIMO_EXAME_PROPERTY = "proximoExame";
public static final String RESULTADO_PROPERTY = "resultado";
public static final String TIPO_PROPERTY = "tipo";
public static final String TRABALHADOR_ID_PROPERTY = "trabalhadorId";
public static final String TO_MEDICOS_PROPERTY = "toMedicos";
public static final String TRABALHADORES_FICHAS_APTIDAO_ARRAY_PROPERTY = "trabalhadoresFichasAptidaoArray";
public static final String ID_PK_COLUMN = "id";
public void setData(Date data) {
writeProperty("data", data);
}
public Date getData() {
return (Date)readProperty("data");
}
public void setFo(byte[] fo) {
writeProperty("fo", fo);
}
public byte[] getFo() {
return (byte[])readProperty("fo");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setInactivo(String inactivo) {
writeProperty("inactivo", inactivo);
}
public String getInactivo() {
return (String)readProperty("inactivo");
}
public void setOcasional(Integer ocasional) {
writeProperty("ocasional", ocasional);
}
public Integer getOcasional() {
return (Integer)readProperty("ocasional");
}
public void setOutraFuncao1(String outraFuncao1) {
writeProperty("outraFuncao1", outraFuncao1);
}
public String getOutraFuncao1() {
return (String)readProperty("outraFuncao1");
}
public void setOutraFuncao2(String outraFuncao2) {
writeProperty("outraFuncao2", outraFuncao2);
}
public String getOutraFuncao2() {
return (String)readProperty("outraFuncao2");
}
public void setOutraFuncao3(String outraFuncao3) {
writeProperty("outraFuncao3", outraFuncao3);
}
public String getOutraFuncao3() {
return (String)readProperty("outraFuncao3");
}
public void setOutraFuncao4(String outraFuncao4) {
writeProperty("outraFuncao4", outraFuncao4);
}
public String getOutraFuncao4() {
return (String)readProperty("outraFuncao4");
}
public void setOutrasRecomendacoes(String outrasRecomendacoes) {
writeProperty("outrasRecomendacoes", outrasRecomendacoes);
}
public String getOutrasRecomendacoes() {
return (String)readProperty("outrasRecomendacoes");
}
public void setOutroTipo(String outroTipo) {
writeProperty("outroTipo", outroTipo);
}
public String getOutroTipo() {
return (String)readProperty("outroTipo");
}
public void setPdf(byte[] pdf) {
writeProperty("pdf", pdf);
}
public byte[] getPdf() {
return (byte[])readProperty("pdf");
}
public void setProximoExame(Date proximoExame) {
writeProperty("proximoExame", proximoExame);
}
public Date getProximoExame() {
return (Date)readProperty("proximoExame");
}
public void setResultado(Integer resultado) {
writeProperty("resultado", resultado);
}
public Integer getResultado() {
return (Integer)readProperty("resultado");
}
public void setTipo(Integer tipo) {
writeProperty("tipo", tipo);
}
public Integer getTipo() {
return (Integer)readProperty("tipo");
}
public void setTrabalhadorId(Integer trabalhadorId) {
writeProperty("trabalhadorId", trabalhadorId);
}
public Integer getTrabalhadorId() {
return (Integer)readProperty("trabalhadorId");
}
public void setToMedicos(Medicos toMedicos) {
setToOneTarget("toMedicos", toMedicos, true);
}
public Medicos getToMedicos() {
return (Medicos)readProperty("toMedicos");
}
public void addToTrabalhadoresFichasAptidaoArray(TrabalhadoresFichasAptidao obj) {
addToManyTarget("trabalhadoresFichasAptidaoArray", obj, true);
}
public void removeFromTrabalhadoresFichasAptidaoArray(TrabalhadoresFichasAptidao obj) {
removeToManyTarget("trabalhadoresFichasAptidaoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<TrabalhadoresFichasAptidao> getTrabalhadoresFichasAptidaoArray() {
return (List<TrabalhadoresFichasAptidao>)readProperty("trabalhadoresFichasAptidaoArray");
}
}

@ -0,0 +1,42 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import siprp.database.cayenne.objects.BaseObject;
/**
* Class _ExamesPortaria was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _ExamesPortaria extends BaseObject {
public static final String DATA_ENTRADA_PROPERTY = "dataEntrada";
public static final String ID_PROPERTY = "id";
public static final String PORTARIA_PROPERTY = "portaria";
public static final String ID_PK_COLUMN = "id";
public void setDataEntrada(Date dataEntrada) {
writeProperty("dataEntrada", dataEntrada);
}
public Date getDataEntrada() {
return (Date)readProperty("dataEntrada");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setPortaria(String portaria) {
writeProperty("portaria", portaria);
}
public String getPortaria() {
return (String)readProperty("portaria");
}
}

@ -0,0 +1,53 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.Estabelecimentos;
/**
* Class _HistoricoEstabelecimento was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HistoricoEstabelecimento extends BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String ID_PROPERTY = "id";
public static final String TEXTO_PROPERTY = "texto";
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
public static final String ID_PK_COLUMN = "id";
public void setData(Date data) {
writeProperty("data", data);
}
public Date getData() {
return (Date)readProperty("data");
}
public void setId(Integer id) {
writeProperty("id", id);
}
public Integer getId() {
return (Integer)readProperty("id");
}
public void setTexto(String texto) {
writeProperty("texto", texto);
}
public String getTexto() {
return (String)readProperty("texto");
}
public void setToEstabelecimentos(Estabelecimentos toEstabelecimentos) {
setToOneTarget("toEstabelecimentos", toEstabelecimentos, true);
}
public Estabelecimentos getToEstabelecimentos() {
return (Estabelecimentos)readProperty("toEstabelecimentos");
}
}

@ -0,0 +1,48 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsPosto;
/**
* Class _HsArea was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsArea extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String EMPRESA_ID_PROPERTY = "empresaId";
public static final String HS_POSTO_ARRAY_PROPERTY = "hsPostoArray";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void setEmpresaId(Integer empresaId) {
writeProperty("empresaId", empresaId);
}
public Integer getEmpresaId() {
return (Integer)readProperty("empresaId");
}
public void addToHsPostoArray(HsPosto obj) {
addToManyTarget("hsPostoArray", obj, true);
}
public void removeFromHsPostoArray(HsPosto obj) {
removeToManyTarget("hsPostoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsPosto> getHsPostoArray() {
return (List<HsPosto>)readProperty("hsPostoArray");
}
}

@ -0,0 +1,24 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
/**
* Class _HsEquipamentoMedicao was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsEquipamentoMedicao extends BaseObject {
public static final String NOME_PROPERTY = "nome";
public static final String ID_PK_COLUMN = "id";
public void setNome(String nome) {
writeProperty("nome", nome);
}
public String getNome() {
return (String)readProperty("nome");
}
}

@ -0,0 +1,65 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsLegislacaoCategoria;
import siprp.database.cayenne.objects.HsLegislacaoEmpresa;
import siprp.database.cayenne.objects.HsLegislacaoEstabelecimento;
/**
* Class _HsLegislacao was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsLegislacao extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_LEGISLACAO_EMPRESA_ARRAY_PROPERTY = "hsLegislacaoEmpresaArray";
public static final String HS_LEGISLACAO_ESTABELECIMENTO_ARRAY_PROPERTY = "hsLegislacaoEstabelecimentoArray";
public static final String TO_HS_LEGISLACAO_CATEGORIA_PROPERTY = "toHsLegislacaoCategoria";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void addToHsLegislacaoEmpresaArray(HsLegislacaoEmpresa obj) {
addToManyTarget("hsLegislacaoEmpresaArray", obj, true);
}
public void removeFromHsLegislacaoEmpresaArray(HsLegislacaoEmpresa obj) {
removeToManyTarget("hsLegislacaoEmpresaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsLegislacaoEmpresa> getHsLegislacaoEmpresaArray() {
return (List<HsLegislacaoEmpresa>)readProperty("hsLegislacaoEmpresaArray");
}
public void addToHsLegislacaoEstabelecimentoArray(HsLegislacaoEstabelecimento obj) {
addToManyTarget("hsLegislacaoEstabelecimentoArray", obj, true);
}
public void removeFromHsLegislacaoEstabelecimentoArray(HsLegislacaoEstabelecimento obj) {
removeToManyTarget("hsLegislacaoEstabelecimentoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsLegislacaoEstabelecimento> getHsLegislacaoEstabelecimentoArray() {
return (List<HsLegislacaoEstabelecimento>)readProperty("hsLegislacaoEstabelecimentoArray");
}
public void setToHsLegislacaoCategoria(HsLegislacaoCategoria toHsLegislacaoCategoria) {
setToOneTarget("toHsLegislacaoCategoria", toHsLegislacaoCategoria, true);
}
public HsLegislacaoCategoria getToHsLegislacaoCategoria() {
return (HsLegislacaoCategoria)readProperty("toHsLegislacaoCategoria");
}
}

@ -0,0 +1,40 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsLegislacao;
/**
* Class _HsLegislacaoCategoria was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsLegislacaoCategoria extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_LEGISLACAO_ARRAY_PROPERTY = "hsLegislacaoArray";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void addToHsLegislacaoArray(HsLegislacao obj) {
addToManyTarget("hsLegislacaoArray", obj, true);
}
public void removeFromHsLegislacaoArray(HsLegislacao obj) {
removeToManyTarget("hsLegislacaoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsLegislacao> getHsLegislacaoArray() {
return (List<HsLegislacao>)readProperty("hsLegislacaoArray");
}
}

@ -0,0 +1,28 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsLegislacao;
/**
* Class _HsLegislacaoEmpresa was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsLegislacaoEmpresa extends BaseObject {
public static final String TO_HS_LEGISLACAO_PROPERTY = "toHsLegislacao";
public static final String EMPRESA_ID_PK_COLUMN = "empresa_id";
public static final String LEGISLACAO_ID_PK_COLUMN = "legislacao_id";
public void setToHsLegislacao(HsLegislacao toHsLegislacao) {
setToOneTarget("toHsLegislacao", toHsLegislacao, true);
}
public HsLegislacao getToHsLegislacao() {
return (HsLegislacao)readProperty("toHsLegislacao");
}
}

@ -0,0 +1,28 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsLegislacao;
/**
* Class _HsLegislacaoEstabelecimento was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsLegislacaoEstabelecimento extends BaseObject {
public static final String TO_HS_LEGISLACAO_PROPERTY = "toHsLegislacao";
public static final String ESTABELECIMENTO_ID_PK_COLUMN = "estabelecimento_id";
public static final String LEGISLACAO_ID_PK_COLUMN = "legislacao_id";
public void setToHsLegislacao(HsLegislacao toHsLegislacao) {
setToOneTarget("toHsLegislacao", toHsLegislacao, true);
}
public HsLegislacao getToHsLegislacao() {
return (HsLegislacao)readProperty("toHsLegislacao");
}
}

@ -0,0 +1,48 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsRiscoMedida;
/**
* Class _HsMedida was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsMedida extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String REQUESITOS_LEGAIS_PROPERTY = "requesitosLegais";
public static final String HS_RISCO_MEDIDA_ARRAY_PROPERTY = "hsRiscoMedidaArray";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void setRequesitosLegais(String requesitosLegais) {
writeProperty("requesitosLegais", requesitosLegais);
}
public String getRequesitosLegais() {
return (String)readProperty("requesitosLegais");
}
public void addToHsRiscoMedidaArray(HsRiscoMedida obj) {
addToManyTarget("hsRiscoMedidaArray", obj, true);
}
public void removeFromHsRiscoMedidaArray(HsRiscoMedida obj) {
removeToManyTarget("hsRiscoMedidaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsRiscoMedida> getHsRiscoMedidaArray() {
return (List<HsRiscoMedida>)readProperty("hsRiscoMedidaArray");
}
}

@ -0,0 +1,40 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsRelatorioMedida;
/**
* Class _HsMedidaClassificacao was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsMedidaClassificacao extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_RELATORIO_MEDIDA_ARRAY_PROPERTY = "hsRelatorioMedidaArray";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void addToHsRelatorioMedidaArray(HsRelatorioMedida obj) {
addToManyTarget("hsRelatorioMedidaArray", obj, true);
}
public void removeFromHsRelatorioMedidaArray(HsRelatorioMedida obj) {
removeToManyTarget("hsRelatorioMedidaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsRelatorioMedida> getHsRelatorioMedidaArray() {
return (List<HsRelatorioMedida>)readProperty("hsRelatorioMedidaArray");
}
}

@ -0,0 +1,40 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
/**
* Class _HsNormalizacao was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsNormalizacao extends BaseObject {
public static final String CODIGO_PROPERTY = "codigo";
public static final String DESCRICAO_PROPERTY = "descricao";
public static final String PORTUGUESA_PROPERTY = "portuguesa";
public static final String ID_PK_COLUMN = "id";
public void setCodigo(String codigo) {
writeProperty("codigo", codigo);
}
public String getCodigo() {
return (String)readProperty("codigo");
}
public void setDescricao(String descricao) {
writeProperty("descricao", descricao);
}
public String getDescricao() {
return (String)readProperty("descricao");
}
public void setPortuguesa(Boolean portuguesa) {
writeProperty("portuguesa", portuguesa);
}
public Boolean getPortuguesa() {
return (Boolean)readProperty("portuguesa");
}
}

@ -0,0 +1,35 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsArea;
/**
* Class _HsPosto was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsPosto extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String TO_HS_AREA_PROPERTY = "toHsArea";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void setToHsArea(HsArea toHsArea) {
setToOneTarget("toHsArea", toHsArea, true);
}
public HsArea getToHsArea() {
return (HsArea)readProperty("toHsArea");
}
}

@ -0,0 +1,49 @@
package siprp.database.cayenne.objects.auto;
import java.util.Date;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsRelatorioRisco;
/**
* Class _HsRelatorio was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsRelatorio extends BaseObject {
public static final String DATA_PROPERTY = "data";
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String HS_RELATORIO_RISCO_ARRAY_PROPERTY = "hsRelatorioRiscoArray";
public static final String ID_PK_COLUMN = "id";
public void setData(Date data) {
writeProperty("data", data);
}
public Date getData() {
return (Date)readProperty("data");
}
public void setDeletedDate(Date deletedDate) {
writeProperty("deletedDate", deletedDate);
}
public Date getDeletedDate() {
return (Date)readProperty("deletedDate");
}
public void addToHsRelatorioRiscoArray(HsRelatorioRisco obj) {
addToManyTarget("hsRelatorioRiscoArray", obj, true);
}
public void removeFromHsRelatorioRiscoArray(HsRelatorioRisco obj) {
removeToManyTarget("hsRelatorioRiscoArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsRelatorioRisco> getHsRelatorioRiscoArray() {
return (List<HsRelatorioRisco>)readProperty("hsRelatorioRiscoArray");
}
}

@ -0,0 +1,70 @@
package siprp.database.cayenne.objects.auto;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsMedidaClassificacao;
import siprp.database.cayenne.objects.HsRelatorioRisco;
/**
* Class _HsRelatorioMedida was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsRelatorioMedida extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String PROBABILIDADE_PROPERTY = "probabilidade";
public static final String REQUESITOS_LEGAIS_PROPERTY = "requesitosLegais";
public static final String SEVERIDADE_PROPERTY = "severidade";
public static final String TO_HS_MEDIDA_CLASSIFICACAO_PROPERTY = "toHsMedidaClassificacao";
public static final String TO_HS_RELATORIO_RISCO_PROPERTY = "toHsRelatorioRisco";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void setProbabilidade(Integer probabilidade) {
writeProperty("probabilidade", probabilidade);
}
public Integer getProbabilidade() {
return (Integer)readProperty("probabilidade");
}
public void setRequesitosLegais(String requesitosLegais) {
writeProperty("requesitosLegais", requesitosLegais);
}
public String getRequesitosLegais() {
return (String)readProperty("requesitosLegais");
}
public void setSeveridade(Integer severidade) {
writeProperty("severidade", severidade);
}
public Integer getSeveridade() {
return (Integer)readProperty("severidade");
}
public void setToHsMedidaClassificacao(HsMedidaClassificacao toHsMedidaClassificacao) {
setToOneTarget("toHsMedidaClassificacao", toHsMedidaClassificacao, true);
}
public HsMedidaClassificacao getToHsMedidaClassificacao() {
return (HsMedidaClassificacao)readProperty("toHsMedidaClassificacao");
}
public void setToHsRelatorioRisco(HsRelatorioRisco toHsRelatorioRisco) {
setToOneTarget("toHsRelatorioRisco", toHsRelatorioRisco, true);
}
public HsRelatorioRisco getToHsRelatorioRisco() {
return (HsRelatorioRisco)readProperty("toHsRelatorioRisco");
}
}

@ -0,0 +1,51 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsRelatorio;
import siprp.database.cayenne.objects.HsRelatorioMedida;
/**
* Class _HsRelatorioRisco was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsRelatorioRisco extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_RELATORIO_MEDIDA_ARRAY_PROPERTY = "hsRelatorioMedidaArray";
public static final String TO_HS_RELATORIO_PROPERTY = "toHsRelatorio";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void addToHsRelatorioMedidaArray(HsRelatorioMedida obj) {
addToManyTarget("hsRelatorioMedidaArray", obj, true);
}
public void removeFromHsRelatorioMedidaArray(HsRelatorioMedida obj) {
removeToManyTarget("hsRelatorioMedidaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsRelatorioMedida> getHsRelatorioMedidaArray() {
return (List<HsRelatorioMedida>)readProperty("hsRelatorioMedidaArray");
}
public void setToHsRelatorio(HsRelatorio toHsRelatorio) {
setToOneTarget("toHsRelatorio", toHsRelatorio, true);
}
public HsRelatorio getToHsRelatorio() {
return (HsRelatorio)readProperty("toHsRelatorio");
}
}

@ -0,0 +1,51 @@
package siprp.database.cayenne.objects.auto;
import java.util.List;
import siprp.database.cayenne.objects.BaseObject;
import siprp.database.cayenne.objects.HsRiscoMedida;
import siprp.database.cayenne.objects.HsRiscoTema;
/**
* Class _HsRisco was generated by Cayenne.
* It is probably a good idea to avoid changing this class manually,
* since it may be overwritten next time code is regenerated.
* If you need to make any customizations, please use subclass.
*/
public abstract class _HsRisco extends BaseObject {
public static final String DESCRIPTION_PROPERTY = "description";
public static final String HS_RISCO_MEDIDA_ARRAY_PROPERTY = "hsRiscoMedidaArray";
public static final String TO_HS_RISCO_TEMA_PROPERTY = "toHsRiscoTema";
public static final String ID_PK_COLUMN = "id";
public void setDescription(String description) {
writeProperty("description", description);
}
public String getDescription() {
return (String)readProperty("description");
}
public void addToHsRiscoMedidaArray(HsRiscoMedida obj) {
addToManyTarget("hsRiscoMedidaArray", obj, true);
}
public void removeFromHsRiscoMedidaArray(HsRiscoMedida obj) {
removeToManyTarget("hsRiscoMedidaArray", obj, true);
}
@SuppressWarnings("unchecked")
public List<HsRiscoMedida> getHsRiscoMedidaArray() {
return (List<HsRiscoMedida>)readProperty("hsRiscoMedidaArray");
}
public void setToHsRiscoTema(HsRiscoTema toHsRiscoTema) {
setToOneTarget("toHsRiscoTema", toHsRiscoTema, true);
}
public HsRiscoTema getToHsRiscoTema() {
return (HsRiscoTema)readProperty("toHsRiscoTema");
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save