forked from Coded/SIPRP
Suporte para multiplos analisadores
git-svn-id: https://svn.coded.pt/svn/SIPRP@653 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
parent
604b7b7e51
commit
f235ce51a8
@ -0,0 +1,22 @@
|
||||
package leaf;
|
||||
|
||||
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,18 @@
|
||||
package leaf;
|
||||
|
||||
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;
|
||||
|
||||
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,166 @@
|
||||
package leaf;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import siprp.medicina.processo.ui.OrderedMap;
|
||||
|
||||
import com.evolute.utils.tables.BaseTableModel;
|
||||
|
||||
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<Object> map )
|
||||
{
|
||||
this.map = map;
|
||||
fireTableDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendEmptyRow()
|
||||
{
|
||||
map.putLast( map.rows(), 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,58 @@
|
||||
/*
|
||||
* V8_12_To_V8_3.java
|
||||
*
|
||||
* Created on December 19, 2007, 3:12 PM
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package siprp.update.updates;
|
||||
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.db.DBManager;
|
||||
import com.evolute.utils.db.Executer;
|
||||
import com.evolute.utils.sql.Assignment;
|
||||
import com.evolute.utils.sql.Field;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tsimao
|
||||
*
|
||||
*/
|
||||
public class V8_3_To_V8_4 implements siprp.update.Update
|
||||
{
|
||||
public V8_3_To_V8_4()
|
||||
{
|
||||
}
|
||||
|
||||
public String[] listChanges()
|
||||
{
|
||||
return new String[] {
|
||||
"Adicionado analisador [prestador] por TrabalhadorEcd"
|
||||
};
|
||||
}
|
||||
|
||||
public double getStartVersion()
|
||||
{
|
||||
return 8.3;
|
||||
}
|
||||
|
||||
public double getEndVersion()
|
||||
{
|
||||
return 8.4;
|
||||
}
|
||||
|
||||
public void doUpdate() throws Exception
|
||||
{
|
||||
DBManager dbm = (DBManager) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
|
||||
Executer executer = dbm.getSharedExecuter();
|
||||
com.evolute.utils.sql.Update update = new com.evolute.utils.sql.Update( "ALTER TABLE trabalhadores_ecd ADD COLUMN analisador_id int4;" + "ALTER TABLE trabalhadores_ecd ADD CONSTRAINT analisador_id_fkey FOREIGN KEY(analisador_id) REFERENCES prestadores(id);" );
|
||||
executer.executeQuery( update );
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "v" + getStartVersion() + " para v" + getEndVersion();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue