rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but you can only edit one at a time."); } else if (selection...
if (evt.getActionCommand().equals(ArchitectSwingConstants.ACTION_COMMAND_SRC_PLAYPEN)) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You h...
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but y...
JTabbedPane tabbedPane = new JTabbedPane();
JButton okButton = new JButton("Ok"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { editPanel.applyChanges(); d.setVisible(false); } }); buttonPanel.add(okButton); JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { pub...
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but y...
final JDialog d = new JDialog(ArchitectFrame.getMainInstance(), "Table Properties"); JPanel tt = new JPanel(new BorderLayout(12,12)); tt.setBorder(BorderFactory.createEmptyBorder(12,12,12,12)); final TableEditPanel editPanel = new TableEditPanel(tp.getModel()); tt.add(editPanel, BorderLayout.CENTER); tabbedPane.addTa...
} else if (evt.getActionCommand().equals(ArchitectSwingConstants.ACTION_COMMAND_SRC_DBTREE)) {
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but y...
String[] columnNames = {"SourceDB", "Source Table", "Source Column", "Source Column Type", "Target Column", "Target Column Type"}; SQLTable tTable = (SQLTable)tp.getModel(); try { int colnum = tTable.getColumnsFolder().getChildCount(); for (int i=0;i<=(colnum-1);i++) { SQLColumn tCol = (SQLColumn) tTable.getColumn(i);...
} else { }
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but y...
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton okButton = new JButton("Ok"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { editPanel.applyChanges(); d.setVisible(false); } }); buttonPanel.add(okButton); JButton cancelButton = new JButton(...
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but y...
List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a column (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but you can only edit one at a time."); } else if (selectio...
if (evt.getActionCommand().equals(ArchitectSwingConstants.ACTION_COMMAND_SRC_PLAYPEN)) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a column (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You ...
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a column (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but ...
} catch (ArchitectException e) { JOptionPane.showMessageDialog(tp, "Error finding the selected column"); logger.error("Error finding the selected column", e);
} else { JOptionPane.showMessageDialog(pp, "The selected item type is not recognised");
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a column (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but ...
JOptionPane.showMessageDialog(pp, "The selected item type is not recognised"); cleanup(); }
}
public void actionPerformed(ActionEvent evt) { List selection = pp.getSelectedItems(); if (selection.size() < 1) { JOptionPane.showMessageDialog(pp, "Select a column (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but ...
public void inherit(int pos, SQLTable source) throws ArchitectException { SQLColumn c; boolean addToPK; int pkSize = pkSize(); int sourceSize = source.columnsFolder.children.size(); int originalSize = columnsFolder.children.size(); if (originalSize == 0 || pos < pkSize) { addToPK = true; normalizePrimaryKey(); for (in...
public void inherit(SQLTable source) throws ArchitectException { inherit(columnsFolder.children.size(), source);
public void inherit(int pos, SQLTable source) throws ArchitectException { SQLColumn c; boolean addToPK; int pkSize = pkSize(); int sourceSize = source.columnsFolder.children.size(); int originalSize = columnsFolder.children.size(); if (originalSize == 0 || pos < pkSize) { addToPK = true; normalizePrimaryKey(...
public void removeColumn(SQLColumn col) throws LockedColumnException { columnsFolder.removeChild(col); normalizePrimaryKey();
public void removeColumn(int index) throws LockedColumnException { removeColumn((SQLColumn) columnsFolder.children.get(index));
public void removeColumn(SQLColumn col) throws LockedColumnException {// List keys = keysOfColumn(col);// if (keys.isEmpty()) {// columnsFolder.removeChild(col);// normalizePrimaryKey();// } else {// throw new LockedColumnException("This column can't be removed because it belongs to the "+keys.get(0)+" ...
Database db = ODMG.getODMGDatabase();
public static PhotoInfo create() { PhotoInfo photo = new PhotoInfo(); ODMGXAWrapper txw = new ODMGXAWrapper(); Database db = ODMG.getODMGDatabase(); // db.makePersistent( photo ); txw.lock( photo, Transaction.WRITE ); txw.commit(); return photo; }
Implementation odmg = ODMG.getODMGImplementation();
ODMGXAWrapper txw = new ODMGXAWrapper();
public void delete() { Implementation odmg = ODMG.getODMGImplementation(); Database db = ODMG.getODMGDatabase(); ODMGXAWrapper txw = new ODMGXAWrapper(); // First delete all instances for ( int i = 0; i < instances.size(); i++ ) { ImageInstance f = (ImageInstanc...
ODMGXAWrapper txw = new ODMGXAWrapper();
public void delete() { Implementation odmg = ODMG.getODMGImplementation(); Database db = ODMG.getODMGDatabase(); ODMGXAWrapper txw = new ODMGXAWrapper(); // First delete all instances for ( int i = 0; i < instances.size(); i++ ) { ImageInstance f = (ImageInstanc...
if ( obj.getClass() != this.getClass() ) {
if ( obj == null || obj.getClass() != this.getClass() ) {
public boolean equals( Object obj ) { if ( obj.getClass() != this.getClass() ) { return false; } PhotoInfo p = (PhotoInfo)obj; ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.READ ); txw.lock( p, Transaction.READ ); txw.commit(); ...
return lastModified;
return lastModified != null ? (java.util.Date) lastModified.clone() : null;
public final java.util.Date getLastModified() { return lastModified; }
return shootTime;
return shootTime != null ? (java.util.Date) shootTime.clone() : null;
public java.util.Date getShootTime() { ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.READ ); txw.commit(); return shootTime; }
this.lastModified = newDate;
this.lastModified = (newDate != null) ? (java.util.Date) newDate.clone() : null;
public void setLastModified(final java.util.Date newDate) { ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); this.lastModified = newDate; modified(); txw.commit(); }
this.shootTime = v;
this.shootTime = (v != null) ? (java.util.Date) v.clone() : null;
public void setShootTime(java.util.Date v) { ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); this.shootTime = v; modified(); txw.commit(); }
public static ImageInstance create( VolumeBase volume, File imageFile, PhotoInfo photo ) { log.debug( "Creating instance, volume = " + volume.getName() + " photo = " + photo.getUid() + " image file = " + imageFile.getName() );
public static ImageInstance create ( VolumeBase vol, File imgFile ) {
public static ImageInstance create( VolumeBase volume, File imageFile, PhotoInfo photo ) { log.debug( "Creating instance, volume = " + volume.getName() + " photo = " + photo.getUid() + " image file = " + imageFile.getName() ); // Initialize transaction context ODMGXAWrapper txw = new ODMGXAWrapper(); ImageInst...
ImageInstance f = new ImageInstance(); f.volume = volume; f.volumeId = volume.getName(); f.imageFile = imageFile; f.fname = volume.mapFileToVolumeRelativeName( imageFile ); txw.lock( f, Transaction.WRITE ); log.debug( "locked instance" ); f.photoUid = photo.getUid();
ImageInstance i = new ImageInstance(); i.volume = vol; i.volumeId = vol.getName(); i.imageFile = imgFile; i.fileSize = imgFile.length(); i.mtime = imgFile.lastModified(); i.fname = vol.mapFileToVolumeRelativeName( imgFile ); txw.lock( i, Transaction.WRITE ); i.calcHash();
public static ImageInstance create( VolumeBase volume, File imageFile, PhotoInfo photo ) { log.debug( "Creating instance, volume = " + volume.getName() + " photo = " + photo.getUid() + " image file = " + imageFile.getName() ); // Initialize transaction context ODMGXAWrapper txw = new ODMGXAWrapper(); ImageInst...
f.readImageFile();
i.readImageFile();
public static ImageInstance create( VolumeBase volume, File imageFile, PhotoInfo photo ) { log.debug( "Creating instance, volume = " + volume.getName() + " photo = " + photo.getUid() + " image file = " + imageFile.getName() ); // Initialize transaction context ODMGXAWrapper txw = new ODMGXAWrapper(); ImageInst...
f.calcHash(); txw.commit(); return f;
i.checkTime = new java.util.Date(); txw.commit(); return i;
public static ImageInstance create( VolumeBase volume, File imageFile, PhotoInfo photo ) { log.debug( "Creating instance, volume = " + volume.getName() + " photo = " + photo.getUid() + " image file = " + imageFile.getName() ); // Initialize transaction context ODMGXAWrapper txw = new ODMGXAWrapper(); ImageInst...
if(args[i].equals("-n") || args[i].equals("-h") || args[i].equals("-help")) {
if(args[i].equals("-nogui") || args[i].equals("-n") || args[i].equals("-h") || args[i].equals("-help")) {
public static void main(String[] args) { boolean nogui = false; //HaploView window; for(int i = 0;i<args.length;i++) { if(args[i].equals("-n") || args[i].equals("-h") || args[i].equals("-help")) { nogui = true; } } if(nogui) { HaploT...
public Cell(GridBagConstraints constraints, Component component) { this.constraints = constraints; this.component = component;
public Cell() {
public Cell(GridBagConstraints constraints, Component component) { this.constraints = constraints; this.component = component; }
setDynaBean( new WrapDynaBean(task) );
setDynaBean( new ConvertingWrapDynaBean(task) );
public void setTask(Task task) { this.task = task; setDynaBean( new WrapDynaBean(task) ); }
public Iterator evaluateAsIterator(Context context);
public Iterator evaluateAsIterator(JellyContext context);
public Iterator evaluateAsIterator(Context context);
public BSFExpression(String text, BSFEngine engine, BSFManager manager, ContextRegistry registry) {
public BSFExpression(String text, BSFEngine engine, BSFManager manager, JellyContextRegistry registry) {
public BSFExpression(String text, BSFEngine engine, BSFManager manager, ContextRegistry registry) { this.text = text; this.engine = engine; this.manager = manager; this.registry = registry; }
if (e.getChildren() != null)
if (e.getChildren().length > 0)
public void createToolTip() { if (e.getChildren() != null) { if (e.getChildren()[0] instanceof SQLTable) { toolTip = "Add table"; } if (e.getChildren()[0] instanceof SQLColumn) { toolTip = "Add column"; } if (e.getChildren()[0] instanceof SQLRelationship) { toolTip = "Add relation"; } if...
throw new IllegalStateException("could not create JVMResourceSamplerWorker");
throw new IllegalStateException("could not create JVMResourceSamplerWorker", e);
public JVMResourceSampler(String host, int port, PostageRunnerResult results) { Class workerClass; Constructor constructor; try { // the class is only present, when the package _was compiled_ with at least Java 5 (see build script) workerClass = Class.forName("org.apache.j...
m_connectMethod = workerClass.getMethod("connectRemoteJamesJMXServer", (Class)null); m_doSampleMethod = workerClass.getMethod("doSample", (Class)null);
m_connectMethod = workerClass.getMethod("connectRemoteJamesJMXServer", VOID_ARGUMENT_LIST); m_doSampleMethod = workerClass.getMethod("doSample", VOID_ARGUMENT_LIST);
public JVMResourceSampler(String host, int port, PostageRunnerResult results) { Class workerClass; Constructor constructor; try { // the class is only present, when the package _was compiled_ with at least Java 5 (see build script) workerClass = Class.forName("org.apache.j...
throw new IllegalStateException("could not access delegation methods");
throw new IllegalStateException("could not access delegation methods", e);
public JVMResourceSampler(String host, int port, PostageRunnerResult results) { Class workerClass; Constructor constructor; try { // the class is only present, when the package _was compiled_ with at least Java 5 (see build script) workerClass = Class.forName("org.apache.j...
m_connectMethod.invoke(jvmResourceSampleWorker, (Class)null);
m_connectMethod.invoke(jvmResourceSampleWorker, VOID_ARGUMENT_LIST);
public void connectRemoteJamesJMXServer() throws SamplingException { if(jvmResourceSampleWorker == null) throw new SamplingException("JSE specific features not present. (compile the project with JSE 5)"); try { m_connectMethod.invoke(jvmResourceSampleWorker, (Class)null); } catch (Ex...
m_doSampleMethod.invoke(jvmResourceSampleWorker, (Class)null);
m_doSampleMethod.invoke(jvmResourceSampleWorker, VOID_ARGUMENT_LIST);
public void doSample() throws SamplingException { if(jvmResourceSampleWorker == null) throw new SamplingException("JSE specific features not present. (compile the project with JSE 5)"); try { m_doSampleMethod.invoke(jvmResourceSampleWorker, (Class)null); } catch (Exception e) { ...
model.removeSQLObjectListener(tableListModel);
model.getColumnsFolder().removeSQLObjectListener(tableListModel);
public void setModel(SQLTable newModel) { if (model != null) { model.removeSQLObjectListener(tableListModel); } model = newModel; tableListModel = new SQLTableListModel(model); model.addSQLObjectListener(tableListModel); try { for (int i = 0; i < model.getChildCount(); i++) { model.getChild(i).addSQLObjec...
model.addSQLObjectListener(tableListModel);
model.getColumnsFolder().addSQLObjectListener(tableListModel);
public void setModel(SQLTable newModel) { if (model != null) { model.removeSQLObjectListener(tableListModel); } model = newModel; tableListModel = new SQLTableListModel(model); model.addSQLObjectListener(tableListModel); try { for (int i = 0; i < model.getChildCount(); i++) { model.getChild(i).addSQLObjec...
for (int i = 0; i < model.getChildCount(); i++) { model.getChild(i).addSQLObjectListener(tableListModel);
for (int i = 0; i < model.getColumnsFolder().getChildCount(); i++) { model.getColumnsFolder().getChild(i).addSQLObjectListener(tableListModel);
public void setModel(SQLTable newModel) { if (model != null) { model.removeSQLObjectListener(tableListModel); } model = newModel; tableListModel = new SQLTableListModel(model); model.addSQLObjectListener(tableListModel); try { for (int i = 0; i < model.getChildCount(); i++) { model.getChild(i).addSQLObjec...
File file = new File(name); if (file.exists()) { return file.toURL();
URL url = this.getClass().getClassLoader().getResource(name); if (url != null) { return url;
protected URL resolveURL(String name) throws MalformedURLException { File file = new File(name); if (file.exists()) { return file.toURL(); } return new URL(name); }
return new URL(name);
else { File file = new File(name); if (file.exists()) { return file.toURL(); } return new URL(name); }
protected URL resolveURL(String name) throws MalformedURLException { File file = new File(name); if (file.exists()) { return file.toURL(); } return new URL(name); }
if (!(new File(scriptFile)).exists()) {
if (url == null && !(new File(scriptFile)).exists()) {
public void invokeCommandLineJelly(String[] args) throws JellyException { CommandLine cmdLine = null; try { cmdLine = parseCommandLineOptions(args); } catch (ParseException e) { throw new JellyException(e); } // get the -script option. If there isn't one then...
getBody().run(context, output);
invokeBody(output);
public void doTag(XMLOutput output) throws Exception { if (select != null) { Iterator iter = select.selectNodes( getXPathContext() ).iterator(); while (iter.hasNext()) { iterationValue = iter.next(); if (var != null) { context.setVariable...
broker = PersistenceBrokerFactory.createPersistenceBroker();
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
public void doTag(XMLOutput output) throws Exception { if ( var == null ) { var = "org.apache.commons.jelly.ojb.Broker"; } if ( broker != null ) { context.setVariable(var, broker); invokeBody(output); } else { ...
broker.clearCache(); PersistenceBrokerFactory.releaseInstance(broker);
broker.close();
public void doTag(XMLOutput output) throws Exception { if ( var == null ) { var = "org.apache.commons.jelly.ojb.Broker"; } if ( broker != null ) { context.setVariable(var, broker); invokeBody(output); } else { ...
table.getColumnModel().getColumn(2).setMinWidth(60);
public CheckDataPanel(HaploData hd, boolean disp) throws IOException, PedFileException{ STATUS_COL = 8; setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); pedfile = hd.getPedFile(); theData = hd; Vector result = pedfile.getResults(); int numResults = result.size(); Vec...
JMenuItem exportItem = new JMenuItem( "Export image...", KeyEvent.VK_E ); exportItem.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { exportSelected(); } }); fileMenu.add( exportItem );
protected void createUI() { setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); tabPane = new JTabbedPane(); queryPane = new QueryPane(); treePane = new PhotoFolderTree(); tabPane.addTab( "Query", queryPane ); tabPane.addTab( "Folders", treePane ); // viewPane = new TableCollectionView(); viewPane = new PhotoColle...
System.exit( 0 );
exportSelected();
public void actionPerformed( ActionEvent e ) { System.exit( 0 ); }
attributes.put( "jelly.body", getBody() );
public void run(Context context, XMLOutput output) throws Exception { log.info( "Invoking dynamic tag with attributes: " + attributes ); // create new context based on current attributes Context newContext = context.newContext( attributes ); getTemplate().run( newContext,...
propertiesToIgnore.add("ignoreReset");
propertiesToIgnore.add("playPenDatabase");
public void testSaveCoversAllDatabaseProperties() throws Exception { testLoad(); DBTree dbTree = project.getSourceDatabases(); DBTreeModel dbTreeModel = (DBTreeModel) dbTree.getModel(); ArchitectDataSource fakeDataSource = new ArchitectDataSource(); SQLDatabase db = new SQLDatabase() { @Override public Conn...
propertiesToIgnore.add("zoomInAction"); propertiesToIgnore.add("zoomOutAction");
public void testSaveCoversAllDatabaseProperties() throws Exception { testLoad(); DBTree dbTree = project.getSourceDatabases(); DBTreeModel dbTreeModel = (DBTreeModel) dbTree.getModel(); ArchitectDataSource fakeDataSource = new ArchitectDataSource(); SQLDatabase db = new SQLDatabase() { @Override public Conn...
put(PL_LOGICAL, argDisplayName);
putImpl(PL_LOGICAL, argDisplayName, "displayName");
public void setDisplayName(String argDisplayName){ put(PL_LOGICAL, argDisplayName); }
put(DBCS_DRIVER_CLASS, argDriverClass);
putImpl(DBCS_DRIVER_CLASS, argDriverClass, "driverClass");
public void setDriverClass(String argDriverClass){ put(DBCS_DRIVER_CLASS, argDriverClass); }
public void setUser(String argUser){ put(PL_UID, argUser);
public void setUser(String argUser) { putImpl(PL_UID, argUser, "user");
public void setUser(String argUser){ put(PL_UID, argUser); }
put(PL_PWD, argPass);
putImpl(PL_PWD, argPass, "pass");
public void setPass(String argPass){ put(PL_PWD, argPass); }
put(DBCS_URL, argUrl);
putImpl(DBCS_URL, argUrl, "url");
public void setUrl(String argUrl) { put(DBCS_URL, argUrl); }
public SQLCatalog(SQLDatabase parent, String name) { this.parent = parent; setName(name); this.children = new LinkedList(); this.nativeTerm = "catalog";
public SQLCatalog() { this(null, null);
public SQLCatalog(SQLDatabase parent, String name) { this.parent = parent; setName(name); this.children = new LinkedList(); this.nativeTerm = "catalog"; }
public void save(PrintWriter out, String encoding) throws IOException, ArchitectException { objectIdMap = new HashMap(); dbcsIdMap = new HashMap(); indent = 0;
public void save(ProgressMonitor pm) throws IOException, ArchitectException { if (file.exists() && !file.canWrite()) { throw new ArchitectException("problem saving project -- " + "cannot write to architect file: " + file.getAbsolutePath()); }
public void save(PrintWriter out, String encoding) throws IOException, ArchitectException { objectIdMap = new HashMap(); dbcsIdMap = new HashMap(); indent = 0; try { println(out, "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>"); println(out, "<architect-...
println(out, "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>"); println(out, "<architect-project version=\"1.0\" appversion=\""+ArchitectUtils.APP_VERSION+"\">"); indent++; println(out, "<project-name>"+ArchitectUtils.escapeXML(name)+"</project-name>"); saveDataSources(out); saveSourceDatabases(out); saveTargetDatab...
out = new PrintWriter(tempFile,encoding); } catch (IOException e) { throw new ArchitectException("Unable to create output file for save operation, data NOT saved.\n" + e, e);
public void save(PrintWriter out, String encoding) throws IOException, ArchitectException { objectIdMap = new HashMap(); dbcsIdMap = new HashMap(); indent = 0; try { println(out, "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>"); println(out, "<architect-...
progress = 0; this.pm = pm; if (pm != null) { int pmMax = 0; pm.setMinimum(0); if (savingEntireSource) { pmMax = ArchitectUtils.countTablesSnapshot((SQLObject) sourceDatabases.getModel().getRoot()); } else { pmMax = ArchitectUtils.countTables((SQLObject) sourceDatabases.getModel().getRoot()); } logger.error("Setting pr...
public void save(PrintWriter out, String encoding) throws IOException, ArchitectException { objectIdMap = new HashMap(); dbcsIdMap = new HashMap(); indent = 0; try { println(out, "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>"); println(out, "<architect-...
if (! loadedProperties) { loadedProperties = true; loadJellyProperties(); }
public Script compileScript() throws Exception { XMLParser parser = new XMLParser(); parser.setContext(getJellyContext()); Script script = parser.parse(getUrl().openStream()); script = script.compile(); if (log.isDebugEnabled()) { log.debug("Compiled script: " + getUrl(...
public static XMLOutput createXMLOutput(Writer writer) { return createXMLOutput(writer, DEFAULT_ESCAPE_TEXT);
public static XMLOutput createXMLOutput(XMLReader xmlReader) { XMLOutput output = new XMLOutput(xmlReader.getContentHandler()); for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) { try { Object value = xmlReader.getProperty(LEXICAL_HANDLER_NAMES[i]); if (value instanceof LexicalHandler) { output.setLexicalHandler...
public static XMLOutput createXMLOutput(Writer writer) { return createXMLOutput(writer, DEFAULT_ESCAPE_TEXT); }
public Volume( String volName, String volBaseDir ) { super( volName, volBaseDir );
public Volume() {
public Volume( String volName, String volBaseDir ) { super( volName, volBaseDir ); }
SQLColumn col = (SQLColumn) columnsFolder.getChild(oldIdx); removeColumn(oldIdx); addColumn(newIdx, col);
SQLColumn col = (SQLColumn) columnsFolder.children.remove(oldIdx); columnsFolder.fireDbChildRemoved(oldIdx, col); columnsFolder.children.add(newIdx, col); if (newIdx == 0 || ((SQLColumn) columnsFolder.children.get(newIdx-1)).primaryKeySeq != null) { col.primaryKeySeq = new Integer(1); } normalizePrimaryKey(); columnsFo...
public void changeColumnIndex(int oldIdx, int newIdx) throws ArchitectException { // this old way didn't cause any events// SQLColumn col = (SQLColumn) columnsFolder.children.remove(oldIdx);// columnsFolder.children.add(newIdx, col);// if (newIdx == 0// || ((SQLColumn) columnsFolder.children.get(newIdx-1)).p...
public SQLSchema(SQLObject parent, String name) { this.parent = parent; this.schemaName = name; this.children = new LinkedList(); this.nativeTerm = "schema";
public SQLSchema() { this(null, null);
public SQLSchema(SQLObject parent, String name) { this.parent = parent; this.schemaName = name; this.children = new LinkedList(); this.nativeTerm = "schema"; }
/* TODO This is not used to be replace with an XML format later
/* TODO This is not used. To be replace with an XML format later
static void addColumnsToTable(SQLTable addTo, String catalog, String schema, String tableName) throws SQLException, DuplicateColumnException, ArchitectException { Connection con = null; ResultSet rs = null; try { con = addTo.getParentDatabase().getConnection(); DatabaseMetaData d...
col.primaryKeySeq = new Integer(rs.getInt(5)); addTo.setPrimaryKeyName(rs.getString(6));
if (col != null ){ col.primaryKeySeq = new Integer(rs.getInt(5)); addTo.setPrimaryKeyName(rs.getString(6)); } else { SQLException exception = new SQLException("Column "+rs.getString(4)+ " not found in "+addTo); throw exception; }
static void addColumnsToTable(SQLTable addTo, String catalog, String schema, String tableName) throws SQLException, DuplicateColumnException, ArchitectException { Connection con = null; ResultSet rs = null; try { con = addTo.getParentDatabase().getConnection(); DatabaseMetaData d...
public boolean removeChild(SQLObject child) { int childIdx = children.indexOf(child); if (childIdx >= 0) { children.remove(childIdx); fireDbChildRemoved(childIdx, child); } return childIdx >= 0;
public SQLObject removeChild(int index) { SQLObject removedChild = (SQLObject) children.remove(index); if (removedChild != null) fireDbChildRemoved(index, removedChild); return removedChild;
public boolean removeChild(SQLObject child) { int childIdx = children.indexOf(child); if (childIdx >= 0) { children.remove(childIdx); fireDbChildRemoved(childIdx, child); } return childIdx >= 0; }
public LockedColumnException(SQLRelationship lockingRelationship) {
public LockedColumnException(SQLRelationship lockingRelationship, SQLColumn col) {
public LockedColumnException(SQLRelationship lockingRelationship) { super("Locked column belongs to relationship "+lockingRelationship); this.lockingRelationship = lockingRelationship; }
this.col = col;
public LockedColumnException(SQLRelationship lockingRelationship) { super("Locked column belongs to relationship "+lockingRelationship); this.lockingRelationship = lockingRelationship; }
if (logger.isDebugEnabled()) { logger.debug("Sending dbObjectChanged event "+e+" to " +getSQLObjectListeners().size()+" listeners: " +getSQLObjectListeners()); }
protected void fireDbObjectChanged(String propertyName) { SQLObjectEvent e = new SQLObjectEvent(this, propertyName); Iterator it = getSQLObjectListeners().iterator(); while (it.hasNext()) { ((SQLObjectListener) it.next()).dbObjectChanged(e); } }
SQLDatabase mydb = new SQLDatabase(ds); Connection conn = null; Statement stmt = null; String lastSQL = null; try { conn = mydb.getConnection(); stmt = conn.createStatement(); try { stmt.executeUpdate("DROP TABLE PROFILE_TEST1"); stmt.executeUpdate("DROP TABLE PROFILE_TEST2"); stmt.executeUpdate("DROP TABLE PROFILE_T...
public void testProfileManager() throws IOException { ArchitectFrame.getMainInstance(); // creates an ArchitectFrame, which loads settings //FIXME: a better approach would be to have an initialsation method // in the business model, which does not depend on the init routine in Architec...
String tagName,
TagScript tagScript,
public Expression createExpression( ExpressionFactory factory, String tagName, String attributeName, String attributeValue) throws Exception { // #### may need to include some namespace URI information in the XPath instance? if (attributeName.equals("xpath")) { ...
return new XPathExpression(xpath);
return new XPathExpression(xpath, tagScript);
public Expression createExpression( ExpressionFactory factory, String tagName, String attributeName, String attributeValue) throws Exception { // #### may need to include some namespace URI information in the XPath instance? if (attributeName.equals("xpath")) { ...
return super.createExpression(factory, tagName, attributeName, attributeValue);
return super.createExpression(factory, tagScript, attributeName, attributeValue);
public Expression createExpression( ExpressionFactory factory, String tagName, String attributeName, String attributeValue) throws Exception { // #### may need to include some namespace URI information in the XPath instance? if (attributeName.equals("xpath")) { ...
System.out.println(TITLE_STRING + " command line options\n" + "-h, -help print this message\n" + "-n command line output only\n" + "-q quiet mode- doesnt print any warnings or information to screen\n" + "-p <pedfile> specify an i...
System.out.println(HELP_OUTPUT);
private void argHandler(String[] args){ //TODO: -specify values from HaplotypeDisplayController (min hap percentage etc) // -want to be able to output haps file from pedfile boolean nogui = false; String batchMode = ""; String hapsFileName = ""; String pedFileName = ""...
textData.prepareMarkerInput(infoFile,maxDistance,textData.getPedFile().getHMInfo());
if (result != null){ textData.prepareMarkerInput(infoFile,maxDistance,textData.getPedFile().getHMInfo()); }else{ textData.prepareMarkerInput(infoFile,maxDistance,null); }
private void processFile(String fileName,int fileType,String infoFileName){ System.out.println(TITLE_STRING); try { int outputType; long maxDistance; HaploData textData; File OutputFile; File inputFile; inputFile = new File(fileName); ...
for(int i=0;i<forceIncludeTags.size();i++) { if(snpsByName.containsKey(forceIncludeTags.get(i))) { whiteListedCustomMarkers.add(snpsByName.get(forceIncludeTags.get(i)));
if(forceIncludeTags != null) { for(int i=0;i<forceIncludeTags.size();i++) { if(snpsByName.containsKey(forceIncludeTags.get(i))) { whiteListedCustomMarkers.add(snpsByName.get(forceIncludeTags.get(i))); }
private void processFile(String fileName, int fileType, String infoFileName){ try { HaploData textData; File OutputFile; File inputFile; AssociationTestSet customAssocSet; if(!quietMode && fileName != null){ System.out.println("Using data ...
if ( place1 != null ) { res = place1.compareTo( place2 ); }
res = place1.compareTo( place2 );
public int compare( Object o1, Object o2 ) { PhotoInfo p1 = (PhotoInfo) o1; PhotoInfo p2 = (PhotoInfo) o2; String place1 = p1.getShootingPlace(); String place2 = p2.getShootingPlace(); if ( place1 == null ) { place1 = ""; } if ( place2 == null ) { ...
subject.setPhysicalName(null);
public void setNewValue(Object newValue) { logger.debug("Setting logical name of "+subject+" to "+newValue); subject.setName(newValue == null ? null : newValue.toString()); }
dbDir.delete();
private void createDatabase() { File dbDir = null; try { dbDir = File.createTempFile("pv_junit_derby_instance", ""); } catch (IOException ex) { ex.printStackTrace(); } dbDir.delete(); PVDatabase pvd = new PVDatabase(); pvd.setInstanceType( PVDat...
Finding the real cause of the error needs a bit of guesswork: first lets find the root cause
Finding the real reason for the error needs a bit of guesswork: first lets find the original exception
public static void initODMG( String user, String passwd, PVDatabase dbDesc ) throws PhotovaultException { getODMGImplementation(); // Find the connection repository info ConnectionRepository cr = MetadataManager.getInstance().connectionRepository(); PBKey connKey = cr.getStandardPBKeyFor...
System.out.println( platform.getAlterTablesSql( con, dbModel, false, true, true ) );
log.info( platform.getAlterTablesSql( con, dbModel, false, true, true ) );
public void upgradeDatabase() { fireStatusChangeEvent( new SchemaUpdateEvent( PHASE_ALTERING_SCHEMA, 0 ) ); int oldVersion = db.getSchemaVersion(); // Find needed information fr DdlUtils ConnectionRepository cr = MetadataManager.getInstance().connectionRepository(); ...
public void addDatabase(PVDatabase db) {
public void addDatabase(PVDatabase db) throws PhotovaultException {
public void addDatabase(PVDatabase db) { databases.addDatabase( db ); }
public static Vector calcTrioTDT(PedFile pf){
public static Vector calcTrioTDT(PedFile pf) throws PedFileException{
public static Vector calcTrioTDT(PedFile pf){ Vector results = new Vector(); int numMarkers = Chromosome.getUnfilteredSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getUnfilteredMarker(i)); Vector indList = pf.getOrder(); ...
Individual mom = null; Individual dad = null; try{ mom = currentFam.getMember(currentInd.getMomID()); dad = currentFam.getMember(currentInd.getDadID()); }catch (PedFileException pfe){ }
Individual mom = currentFam.getMember(currentInd.getMomID()); Individual dad = currentFam.getMember(currentInd.getDadID());
public static Vector calcTrioTDT(PedFile pf){ Vector results = new Vector(); int numMarkers = Chromosome.getUnfilteredSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getUnfilteredMarker(i)); Vector indList = pf.getOrder(); ...
String input = args[0];
Jelly jelly = new Jelly(); jelly.setScript( args[0] );
public static void main(String[] args) throws Exception { if ( args.length <= 0 ) { System.out.println( "Usage: Jelly scriptFile [outputFile]" ); return; } String input = args[0]; /* // later we might wanna add some command line arguments // checking ...
Context context = new Context(); context.setVariable( "args", args ); XMLParser parser = new XMLParser(); parser.setContext( context ); Script script = parser.parse( input ); script = script.compile(); if ( log.isDebugEnabled() ) { log.debug( "Compiled script: " + script ); }
Script script = jelly.compileScript();
public static void main(String[] args) throws Exception { if ( args.length <= 0 ) { System.out.println( "Usage: Jelly scriptFile [outputFile]" ); return; } String input = args[0]; /* // later we might wanna add some command line arguments // checking ...
Context context = jelly.getContext(); context.setVariable( "args", args );
public static void main(String[] args) throws Exception { if ( args.length <= 0 ) { System.out.println( "Usage: Jelly scriptFile [outputFile]" ); return; } String input = args[0]; /* // later we might wanna add some command line arguments // checking ...
String photoId = "02120108000000001";
int photoId = 1;
public void testRetrievalSuccess() { String photoId = "02120108000000001"; try { PhotoInfo photo = PhotoInfo.retrievePhotoInfo( photoId ); assertTrue(photo != null ); } catch (PhotoNotFoundException e) { fail( "Photo " + photoId + " not found" ); } // TODO: check some other properties of the object }
Thumbnail thumb = photo.getThumbnail(); assertNotNull( thumb ); assertFalse( "Thumbnail exists, should not return default thumbnail", thumb == Thumbnail.getDefaultThumbnail() ); assertEquals( "Thumbnail exists, getThumbnail should not create a new instance", instanceCount+1, photo.getNumInstances() );
public void testThumbnailCreate() { String testImgDir = "c:\\java\\photovault\\testfiles"; String fname = "test1.jpg"; File f = new File( testImgDir, fname ); PhotoInfo photo = null; try { photo = PhotoInfo.addToDB( f ); } catch ( PhotoNotFoundException e ) { fail( "Could not find photo: " + e.getMessage() ...
new File(CoreUtils.getLogDir()).mkdirs();
public static void main(String[] args) throws Exception{ Runtime.getRuntime().addShutdownHook(new Thread(){ public void run(){ logger.info("jManage shutting down..."); DBUtils.shutdownDB(); } }); if (System.getSecurityManager() == null) { ...
addApplication(appConfig);
if(!appConfig.isCluster()) addApplication(appConfig);
public void start() { for (ApplicationConfig appConfig : ApplicationConfigManager .getAllApplications()) { addApplication(appConfig); } // TODO: perfect dependency to be injected via Spring framework --rk EventSystem eventSystem = EventSystem.getInstance...
dPrimeDisplay.revalidate();
public void stateChanged(ChangeEvent e) { if (tabs.getSelectedIndex() != -1){ window.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); String title = tabs.getTitleAt(tabs.getSelectedIndex()); if (title.equals(VIEW_DPRIME) || title.equals(VIEW_HAPL...
bestObsPanel.setMaximumSize(bestObsPanel.getPreferredSize());
bestObsPanel.setMaximumSize(new Dimension(400,bestObsPanel.getPreferredSize().height));
public PermutationTestPanel(PermutationTestSet pts) { if(pts == null) { throw new NullPointerException(); } testSet = pts; this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); JPanel permCountPanel = new JPanel(); JPanel selectionPanel = new JPanel(); sel...
bestPermPanel.setMaximumSize(bestPermPanel.getPreferredSize());
bestPermPanel.setMaximumSize(new Dimension(400,bestPermPanel.getPreferredSize().height));
public PermutationTestPanel(PermutationTestSet pts) { if(pts == null) { throw new NullPointerException(); } testSet = pts; this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); JPanel permCountPanel = new JPanel(); JPanel selectionPanel = new JPanel(); sel...
if ( (parentTask == null || parentTask instanceof TaskContainer) && project.getTaskDefinitions().containsKey( tagName )) {
Object nested = null; if (parentObject != null && !( parentTask instanceof TaskContainer) ) { nested = createNestedObject( parentObject, tagName ); } if (nested == null) { task = createTask( tagName );
public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); Object parentTask = findParentTaskObject(); // lets assume that Task instances are not nested inside other Task instances ...
if ( log.isDebugEnabled() ) { log.debug( "Creating an ant Task for name: " + tagName );
if (task != null) { if ( log.isDebugEnabled() ) { log.debug( "Creating an ant Task for name: " + tagName ); } if ( task instanceof TaskAdapter ) { setObject( ((TaskAdapter)task).getProxy() ); } else { setObject( task ); } Object id = getAttributes().remove( "id" ); if ( id != null ) { project.addReference( (St...
public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); Object parentTask = findParentTaskObject(); // lets assume that Task instances are not nested inside other Task instances ...
task = createTask( tagName ); if ( task instanceof TaskAdapter ) { setObject( ((TaskAdapter)task).getProxy() );
} if (task == null) { if (nested == null) { if ( log.isDebugEnabled() ) { log.debug( "Trying to create a data type for tag: " + tagName ); } nested = createDataType( tagName );
public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); Object parentTask = findParentTaskObject(); // lets assume that Task instances are not nested inside other Task instances ...
setObject( task ); } Object id = getAttributes().remove( "id" ); if ( id != null ) { project.addReference( (String) id, task ); } task.init(); String body = getBodyText(); setBeanProperties(); Method method = MethodUtils.getAccessibleMethod( task.getClass(), "addText", addTaskParamTypes ); if (method != nul...
if ( log.isDebugEnabled() ) { log.debug( "Created nested property tag: " + tagName ); }
public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); Object parentTask = findParentTaskObject(); // lets assume that Task instances are not nested inside other Task instances ...
log.warn("Could not convert tag: " + tagName + " into an Ant task, data type or property");
public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); Object parentTask = findParentTaskObject(); // lets assume that Task instances are not nested inside other Task instances ...
return AntTagLibrary.getProject(context);
Project project = AntTagLibrary.getProject(context); if (project == null) { throw new NullPointerException("No Ant Project object is available"); } return project;
public Project getAntProject() { return AntTagLibrary.getProject(context); }
tag.getBody().run(context, output);
tag.invokeBody(output);
public void doTag(XMLOutput output) throws Exception { // Try find find the body from the reserved 'org.apache.commons.jelly.body' variable Script script = (Script) context.getVariable("org.apache.commons.jelly.body"); if (script != null) { script.run(context, output); } ...