rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (connection != null && !connection.isClosed()) return; connection = (Connection) dbConnections.get(connectionSpec); if (connection != null && !connection.isClosed()) return;
public synchronized void connect() throws ArchitectException { if (connection != null) return; connection = (Connection) dbConnections.get(connectionSpec); if (connection != null) return; try { Class.forName(connectionSpec.getDriverClass()); logger.info("Driver Class "+connectionSpec.getDriverClass()+" loaded ...
if (connection == null && connectionSpec != null) connect();
if (connectionSpec != null) { connect(); }
public Connection getConnection() throws ArchitectException { if (connection == null && connectionSpec != null) connect(); return this.connection; }
col1 = new SQLColumn(table,"Column 1",1,2,3); col2 = new SQLColumn(table,"Column 2",2,3,4); col3 = new SQLColumn(table,"Column 3",1,2,3); col4 = new SQLColumn(table,"Column 4",1,2,3);
col1 = new SQLColumn(null,"Column 1",1,2,3); col2 = new SQLColumn(null,"Column 2",2,3,4); col3 = new SQLColumn(null,"Column 3",1,2,3); col4 = new SQLColumn(null,"Column 4",1,2,3);
protected void setUp() throws Exception { db = new SQLDatabase(); table = new SQLTable(db,"Table1","remark1","Table",true); table2 = new SQLTable(db,"Table2","remark2","Table",true); db.addChild(0,table); col1 = new SQLColumn(table,"Column 1",1,2,3); col2 = new SQLColumn(table,"Column 2",2,3,4); col3 = new SQLC...
col2.setNullable(0);
col2.setNullable(DatabaseMetaData.columnNoNulls);
protected void setUp() throws Exception { db = new SQLDatabase(); table = new SQLTable(db,"Table1","remark1","Table",true); table2 = new SQLTable(db,"Table2","remark2","Table",true); db.addChild(0,table); col1 = new SQLColumn(table,"Column 1",1,2,3); col2 = new SQLColumn(table,"Column 2",2,3,4); col3 = new SQLC...
panel = new ColumnEditPanel(table,1);
panel = new ColumnEditPanel(table,table.getColumnIndex(col2));
protected void setUp() throws Exception { db = new SQLDatabase(); table = new SQLTable(db,"Table1","remark1","Table",true); table2 = new SQLTable(db,"Table2","remark2","Table",true); db.addChild(0,table); col1 = new SQLColumn(table,"Column 1",1,2,3); col2 = new SQLColumn(table,"Column 2",2,3,4); col3 = new SQLC...
public void testEditColumn() {
public void testEditColumn() throws ArchitectException { assertEquals(null, col1.getPrimaryKeySeq()); assertEquals(1, table.getColumnIndex(col2)); assertEquals("The column we're editing is not in PK", null, col2.getPrimaryKeySeq());
public void testEditColumn() { assertEquals("Wrong column name",col2.getName(),panel.getColName().getText()); assertEquals("Wrong Precision",col2.getPrecision(),((Integer) (panel.getColPrec().getValue())).intValue()); assertEquals("Wrong type",2,((SQLType)(panel.getColType().getSelectedItem())).getType()); assertE...
ColumnEditPanel editPanel = new ColumnEditPanel(table,0);
int previousIdx = table.getColumnIndex(table.getColumnByName("PKColumn 1")); ColumnEditPanel editPanel = new ColumnEditPanel(table, previousIdx);
public void testPKColumnMoveRegression() throws ArchitectException{ SQLColumn c1 = new SQLColumn(table,"PKColumn 1",1,2,3); SQLColumn c2 = new SQLColumn(table,"PKColumn 2",1,2,3); table.addColumn(c1); table.addColumn(c2); c1.setPrimaryKeySeq(0); c2.setPrimaryKeySeq(1); assertEquals (5, table.getColumns().size...
assertEquals (0, table.getColumnIndex(table.getColumnByName("PKColumn 1")));
assertEquals (previousIdx, table.getColumnIndex(table.getColumnByName("PKColumn 1")));
public void testPKColumnMoveRegression() throws ArchitectException{ SQLColumn c1 = new SQLColumn(table,"PKColumn 1",1,2,3); SQLColumn c2 = new SQLColumn(table,"PKColumn 2",1,2,3); table.addColumn(c1); table.addColumn(c2); c1.setPrimaryKeySeq(0); c2.setPrimaryKeySeq(1); assertEquals (5, table.getColumns().size...
ComponentTag tag = (ComponentTag) findAncestorWithClass( ComponentTag.class ); if ( tag != null ) { tag.setBorder(border); } else {
if (var == null) {
public void doTag(final XMLOutput output) throws Exception { Border border = createBorder(); // allow some nested tags to set properties invokeBody(output); if (var != null) { context.setVariable(var, border); } else { ComponentTag tag ...
"Added application with ID "+config.getApplicationId());
"Added application "+ "\""+config.getName()+"\"");
public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { ApplicationForm appForm = ...
public void doAssociationTests(Vector affStatus, boolean[] permuteInd) {
public void doAssociationTests(Vector affStatus, Vector permuteInd) {
public void doAssociationTests(Vector affStatus, boolean[] permuteInd) { if(superprob == null || superdata == null || realAffectedStatus == null) { return; } if(affStatus == null){ affStatus = realAffectedStatus; } if(permuteInd == null) { permuteI...
permuteInd = new boolean[superdata.length]; Arrays.fill(permuteInd, false);
permuteInd = new Vector(); for (int i = 0; i < superdata.length; i++){ permuteInd.add(new Boolean(false)); }
public void doAssociationTests(Vector affStatus, boolean[] permuteInd) { if(superprob == null || superdata == null || realAffectedStatus == null) { return; } if(affStatus == null){ affStatus = realAffectedStatus; } if(permuteInd == null) { permuteI...
for (int i = numFileteredTrios*2; i < superdata.length; i++){
for (int i = numFilteredTrios*2; i < superdata.length; i++){
public void doAssociationTests(Vector affStatus, boolean[] permuteInd) { if(superprob == null || superdata == null || realAffectedStatus == null) { return; } if(affStatus == null){ affStatus = realAffectedStatus; } if(permuteInd == null) { permuteI...
for (int i=0; i<numFileteredTrios*2; i+=2) {
for (int i=0; i<numFilteredTrios*2; i+=2) {
public void doAssociationTests(Vector affStatus, boolean[] permuteInd) { if(superprob == null || superdata == null || realAffectedStatus == null) { return; } if(affStatus == null){ affStatus = realAffectedStatus; } if(permuteInd == null) { permuteI...
if(permuteInd[i]) {
if(((Boolean)permuteInd.get(i)).booleanValue()) {
public void doAssociationTests(Vector affStatus, boolean[] permuteInd) { if(superprob == null || superdata == null || realAffectedStatus == null) { return; } if(affStatus == null){ affStatus = realAffectedStatus; } if(permuteInd == null) { permuteI...
numFileteredTrios = inputHaploTrios.size() / 4;
numFilteredTrios = inputHaploTrios.size() / 4;
public void doEM(int[] theBlock) throws HaploViewException{ //break up large blocks if needed int[] block_size; if (theBlock.length < 9){ block_size = new int[1]; block_size[0] = theBlock.length; } else { //some base-8 arithmetic int ones = the...
kidConsistentCache = new boolean[numFileteredTrios][][]; for(int i=0;i<numFileteredTrios*2;i+=2) {
kidConsistentCache = new boolean[numFilteredTrios][][]; for(int i=0;i<numFilteredTrios*2;i+=2) {
private void full_em_breakup( byte[][] input_haplos, int[] block_size, Vector affStatus) throws HaploViewException{ int num_poss, iter;//, maxk, numk; double total;//, maxprob; int block, start_locus, end_locus, biggest_block_size; int poss_full;//, best, h1, h2; int num_indivs=0;...
public Object getVariableValue( String namespaceURI, String prefix, String localName ) { return context.getVariable( localName );
public Object getVariableValue( String namespaceURI, String prefix, String localName) { Object value = context.getVariable(localName); return value;
public Object getVariableValue( String namespaceURI, String prefix, String localName ) { return context.getVariable( localName ); }
private SQLColumn() {
public SQLColumn() { logger.debug("NEW COLUMN (noargs) @"+hashCode());
private SQLColumn() { }
XMLOutput newOutput = XMLOutput.createXMLOutput(new FileOutputStream(name));
XMLOutput newOutput = createXMLOutput();
public void doTag(final XMLOutput output) throws Exception { if ( name == null ) { throw new MissingAttributeException( "name" ); } XMLOutput newOutput = XMLOutput.createXMLOutput(new FileOutputStream(name)); try { newOutput.startDocument(); invokeBody(ne...
float newScale = getScale();
public void createUI() { setLayout( new BorderLayout() ); imageView = new JAIPhotoView(); scrollPane = new JScrollPane( imageView ); scrollPane.setPreferredSize( new Dimension( 500, 500 ) ); add( scrollPane, BorderLayout.CENTER ); // Listen fot resize events of the scroll area so that fitted image can ...
float newScale = getScale();
public void actionPerformed( ActionEvent ev ) { JComboBox cb = (JComboBox) ev.getSource(); String selected = (String)cb.getSelectedItem(); log.debug( "Selected: " + selected ); isFit = false; // Parse the pattern DecimalFormat percentFormat = new DecimalFormat( "#####.#%" ); if ( se...
finally { if ( ! context.isCacheTags() ) { clearTag(); } }
public void run(JellyContext context, XMLOutput output) throws Exception { Tag tag = getTag(); if ( tag == null ) { return; } tag.setContext(context); // initialize all the properties of the tag before its used // if there is a problem abort this tag ...
logger.debug("SQLDatabase: populate finished");
public synchronized void populate() throws ArchitectException { if (populated) return; int oldSize = children.size(); Connection con = null; ResultSet rs = null; try { con = getConnection(); DatabaseMetaData dbmd = con.getMetaData(); rs = dbmd.getCatalogs(); while (rs.next()) { String catName = rs.ge...
select.onChange("handleEvent(''" + getId() + "'', ''onChange'', this.options[this.selectedIndex].value);");
final String dashboardId = context.getDashboardConfig().getDashboardId(); select.onChange("handleEvent(''" + dashboardId + "'', ''" + getId() + "'', ''onChange'', this.options[this.selectedIndex].value);");
public void drawInternal(DashboardContext context, StringBuffer output) { Map<String, String> data = getData(context.getWebContext()); Select select = new Select("dummy", size, true); //select.onChange("alert(''test'');"); select.onChange("handleEvent(''" + getId() + "'', ''onChange'', t...
getBody().run(context, output);
invokeBody(output);
public void doTag(XMLOutput output) throws Exception { Task task = getTask(); // setDynaBean( new ConvertingWrapDynaBean( task ) ); // if the task has an addText() Method method = MethodUtils.getAccessibleMethod( taskType, "addText", addTaskParamTypes ); ...
return creationDate;
return creationDate != null ? (Date) creationDate.clone() : null;
public Date getCreationDate() { return creationDate; }
if ( db.getSchemaVersion() < db.CURRENT_SCHEMA_VERSION ) {
int schemaVersion = db.getSchemaVersion(); if ( schemaVersion < db.CURRENT_SCHEMA_VERSION ) {
private boolean login( LoginDlg ld ) { boolean success = false; String user = ld.getUsername(); String passwd = ld.getPassword(); String dbName = ld.getDb(); log.debug( "Using configuration " + dbName ); settings.setConfiguration( dbName ); PVDatabase db = settings.getDatabase( dbName ); String...
if (bean instanceof Tag) { Tag tag = (Tag) bean; tag.setBody(getBody()); tag.setContext(getContext()); tag.setParent(getParent()); ((Tag) bean).doTag(output); return; }
public void doTag(XMLOutput output) throws Exception { // lets find any attributes that are not set and for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) { Attribute attribute = (Attribute) iter.next(); String name = attribute.getName(); if ( ! s...
System.out.println("applied changes:"+columnEditPanel.getColName().getText());
private void makeDialog(SQLTable st, int colIdx) throws ArchitectException { if (editDialog != null) { columnEditPanel.setModel(st); columnEditPanel.selectColumn(colIdx); editDialog.setTitle("Column Properties of "+st.getName()); editDialog.setVisible(true); //editDialog.requestFocus(); } else { ...
System.out.println("applied changes:"+columnEditPanel.getColName().getText());
public void actionPerformed(ActionEvent e) { columnEditPanel.applyChanges();System.out.println("applied changes:"+columnEditPanel.getColName().getText()); EditColumnAction.this.putValue(SHORT_DESCRIPTION, "Editting "+columnEditPanel.getColName().getText() ); }
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...
tp.getModel().addColumn(idx, new SQLColumn());
} else if (evt.getActionCommand().equals(ArchitectSwingConstants.ACTION_COMMAND_SRC_DBTREE)) { TreePath [] selections = dbt.getSelectionPaths(); logger.debug("selections length is: " + selections.length); if (selections.length != 1) { JOptionPane.showMessageDialog(dbt, "To indicate where you would like to insert a colu...
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...
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 table (by clicking on it) and try again."); } else if (selection.size() > 1) { JOptionPane.showMessageDialog(pp, "You have selected multiple items, but y...
FolderNode fn = (FolderNode) treeNode.getUserObject(); fn.removeAllPhotos();
public void removeAllFromFolder( PhotoFolder f ) { addedToFolders.remove( f ); removedFromFolders.add( f ); // Remove the folder from the tree DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) folderNodes.get( f ); DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) treeNode.getParent(); ...
JPanel cp = new JPanel(new BorderLayout(12,12)); cp.setBorder(BorderFactory.createEmptyBorder(12,12,12,12));
JPanel tt = new JPanel(new BorderLayout(12,12)); tt.setBorder(BorderFactory.createEmptyBorder(12,12,12,12));
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...
cp.add(editPanel, BorderLayout.CENTER);
tt.add(editPanel, BorderLayout.CENTER); tabbedPane.addTab("TableProperties",tt);
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("...
JPanel mt = new JPanel(new BorderLayout(12,12)); mt.setBorder(BorderFactory.createEmptyBorder(12,12,12,12));
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...
mcp.add(scrollpMap,BorderLayout.NORTH); JPanel buttonMapPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton okMapButton = new JButton("Ok"); okMapButton.addActionListener(new ActionListener() {
mt.add(scrollpMap, BorderLayout.CENTER); tabbedPane.addTab("Column Mappings",mt); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton okButton = new JButton("Ok"); okButton.addActionListener(new ActionListener() {
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...
editPanel.applyChanges(); d.setVisible(false);
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...
buttonMapPanel.add(okMapButton);
buttonPanel.add(okButton);
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...
JButton cancelMapButton = new JButton("Cancel"); cancelMapButton.addActionListener(new ActionListener() {
JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() {
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...
editPanel.discardChanges(); d.setVisible(false);
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...
buttonMapPanel.add(cancelMapButton); mcp.add(buttonMapPanel, BorderLayout.SOUTH); tabbedPane.addTab("Column Mappings",mcp);
buttonPanel.add(cancelButton);
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...
d.setContentPane(tabbedPane);
d.getContentPane().add(buttonPanel, BorderLayout.SOUTH); d.getContentPane().add(tabbedPane, BorderLayout.CENTER);
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...
void dropTableNoFail(Connection con, String tableName) throws SQLException {
private static void dropTableNoFail(Connection con, String tableName) throws SQLException {
void dropTableNoFail(Connection con, String tableName) throws SQLException { Statement stmt = null; try { stmt = con.createStatement(); stmt.executeUpdate("DROP TABLE "+tableName); } catch (SQLException e) { System.out.println("Ignoring SQLException. Assuming it means the table we tried to drop didn't exist....
SQLDatabase mydb = new SQLDatabase(db.getDataSource()); Connection con = mydb.getConnection(); Statement stmt = con.createStatement(); dropTableNoFail(con, "SQL_COLUMN_TEST_1PK"); dropTableNoFail(con, "SQL_COLUMN_TEST_3PK"); dropTableNoFail(con, "SQL_COLUMN_TEST_0PK"); stmt.executeUpdate("CREATE TABLE SQL_COLUMN_TEST...
protected void setUp() throws Exception { super.setUp(); SQLDatabase mydb = new SQLDatabase(db.getDataSource()); Connection con = mydb.getConnection(); Statement stmt = con.createStatement(); dropTableNoFail(con, "SQL_COLUMN_TEST_1PK"); dropTableNoFail(con, "SQL_COLUMN_TEST_3PK"); dropTableNoFail(con, "SQL_...
stmt.close();
protected void setUp() throws Exception { super.setUp(); SQLDatabase mydb = new SQLDatabase(db.getDataSource()); Connection con = mydb.getConnection(); Statement stmt = con.createStatement(); dropTableNoFail(con, "SQL_COLUMN_TEST_1PK"); dropTableNoFail(con, "SQL_COLUMN_TEST_3PK"); dropTableNoFail(con, "SQL_...
return getNewFname( photo.getShootTime(), strExtension );
java.util.Date d = photo.getShootTime(); if ( d == null ) { d = new java.util.Date(); } return getNewFname( d, strExtension );
public File getInstanceName( PhotoInfo photo, String strExtension ) { return getNewFname( photo.getShootTime(), strExtension ); }
ApplicationConfigManager.checkAppNameAlreadyPresent(appForm.getName());
public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ...
textData.prepareMarkerInput(maybeInfo);
textData.prepareMarkerInput(maybeInfo,arg_distance);
private void processTextOnly(){ try { String fileName; int outputType; long maxDistance; HaploData textData; File OutputFile; File inputFile; //we use this boolean to keep track of the type of file we're processing (haps or ped) ...
final Dimension size = frame.getSize(); final int windowHeight = size.height;
if ( input.getItemCount() <= 0 ) return; final int windowHeight = frame.getSize().height;
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
final int rowsPerSubMenu = (windowHeight/ preferredHeight) - FUDGE; if (totalRows < rowsPerSubMenu) {
int rowsPerSubMenu = (windowHeight/ preferredHeight) - FUDGE; if ( rowsPerSubMenu < 3 ) rowsPerSubMenu = 3; if (totalRows <= rowsPerSubMenu) {
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
JMenu subMenu = new JMenu("More");
JMenu subMenu = new JMenu("More..."); parentMenu.add(subMenu);
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
int fudge = 0; while (input.getItemCount() > rowsPerSubMenu + fudge) {
while (input.getItemCount() > rowsPerSubMenu + 1) {
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
subMenu.add(item); int n = subMenu.getItemCount(); if (n >= rowsPerSubMenu) { parentMenu.add(subMenu);
subMenu.add(item); if (subMenu.getItemCount() >= rowsPerSubMenu && input.getItemCount() > rowsPerSubMenu + 1 ) {
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
subMenu = new JMenu("More"); fudge = 1;
subMenu = new JMenu("More..."); parentMenu.add(subMenu);
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
if (subMenu.getItemCount() > 0) { parentMenu.add(subMenu); }
public static void breakLongMenu(final Window frame, final JMenu input) { final Dimension size = frame.getSize(); final int windowHeight = size.height; final int totalRows = input.getItemCount(); final int preferredHeight = input.getItem(0).getPreferredSize().height; final int FUDGE = 3; // XXX find a better way ...
if (BETA_VERSION > 0){
if (BETA_VERSION > 0 && VERSION == uc.getNewVersion()){
public UpdateDisplayDialog(HaploView h, String title, UpdateChecker uc) { super(h, title); JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); Font bigguns = new Font("Default", Font.PLAIN, 14); JTextArea announceArea = new JTextArea(); ...
logger.debug(e.getStackTrace());
public final void run() { try { doStuff(); } catch (Exception e) { doStuffException = e; } SwingUtilities.invokeLater(new Runnable() { public void run() { try { cleanup(); if (nextProcess != null) { nextProcess.setCancelled(cancelled); new Thread(nextProcess).start(); } } cat...
db.setDbName( "pc_testest"); Volume vol = new Volume( "testvolume", dbDir.getAbsolutePath() ); db.addVolume( vol );
db.setInstanceType( PVDatabase.TYPE_EMBEDDED ); db.setEmbeddedDirectory( dbDir );
public void testCreateDB() { File confFile = null; File dbDir = null; // Create an empty configuration file & volume directory try { confFile = File.createTempFile( "photovault_settings_", ".xml" ); confFile.delete(); dbDir = File.createTempFile( "photova...
MockJDBCResultSet rs = new MockJDBCResultSet(null, 2); rs.setColumnName(1, "TABLE_SCHEM"); rs.setColumnName(2, "TABLE_CATALOG");
Map<String,String> schemas = new TreeMap<String,String>();
public ResultSet getSchemas() throws SQLException { String catalogList = connection.getProperties().getProperty("catalogs"); MockJDBCResultSet rs = new MockJDBCResultSet(null, 2); rs.setColumnName(1, "TABLE_SCHEM"); rs.setColumnName(2, "TABLE_CATALOG"); if (getSchemaTerm() == null) { logger.debug("getSchemas:...
rs.addRow(); rs.updateObject(1, schName); rs.updateObject(2, null); if (logger.isDebugEnabled()) logger.debug("getSchemas: added '"+schName+"'");
schemas.put(schName, null); if (logger.isDebugEnabled()) logger.debug("getSchemas: put '"+schName+"'");
public ResultSet getSchemas() throws SQLException { String catalogList = connection.getProperties().getProperty("catalogs"); MockJDBCResultSet rs = new MockJDBCResultSet(null, 2); rs.setColumnName(1, "TABLE_SCHEM"); rs.setColumnName(2, "TABLE_CATALOG"); if (getSchemaTerm() == null) { logger.debug("getSchemas:...
rs.addRow(); rs.updateObject(1, schName); rs.updateObject(2, catName); if (logger.isDebugEnabled()) logger.debug("getSchemas: added '"+catName+"'.'"+schName+"'");
schemas.put(schName, catName); if (logger.isDebugEnabled()) logger.debug("getSchemas: put '"+catName+"'.'"+schName+"'");
public ResultSet getSchemas() throws SQLException { String catalogList = connection.getProperties().getProperty("catalogs"); MockJDBCResultSet rs = new MockJDBCResultSet(null, 2); rs.setColumnName(1, "TABLE_SCHEM"); rs.setColumnName(2, "TABLE_CATALOG"); if (getSchemaTerm() == null) { logger.debug("getSchemas:...
} MockJDBCResultSet rs = new MockJDBCResultSet(null, 2); rs.setColumnName(1, "TABLE_SCHEM"); rs.setColumnName(2, "TABLE_CATALOG"); for (Map.Entry<String,String> e : schemas.entrySet()) { rs.addRow(); rs.updateObject(1, e.getKey()); rs.updateObject(2, e.getValue());
public ResultSet getSchemas() throws SQLException { String catalogList = connection.getProperties().getProperty("catalogs"); MockJDBCResultSet rs = new MockJDBCResultSet(null, 2); rs.setColumnName(1, "TABLE_SCHEM"); rs.setColumnName(2, "TABLE_CATALOG"); if (getSchemaTerm() == null) { logger.debug("getSchemas:...
T.add(cancel, 2, 1);
T.add(cancel, 3, 1);
private PresentationObject getButtonsBelowTable(IWContext iwc) { Table T = new Table(); T.setCellpadding(0); T.setCellspacing(0); SubmitButton send,cancel; if (submitImage != null) { send = new SubmitButton(submitImage, "nl_send"); } else { send = new SubmitButton(iwrb.getLocalizedImageButton("su...
T.add(getButtonsBelowTable(iwc),1,row);
if(_submitBelowTopics) T.add(getButtonsBelowTable(iwc),1,row);
public void main(IWContext iwc) { //debugParameters(iwc); iwb = getBundle(iwc); core = iwc.getIWMainApplication().getCoreBundle(); iwrb = getResourceBundle(iwc); Table T = new Table(); T.setCellpaddingAndCellspacing(0); T.setColor(_bgColor); int row = 1; int categoryID = getCategoryId()...
if ((evt.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && evt.getClickCount() == 2) {
if ((evt.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) {
public void mouseClicked(MouseEvent evt) { if ((evt.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && evt.getClickCount() == 2) { TablePane tp = (TablePane) evt.getSource(); if (tp.isSelected()) { ArchitectFrame af = ArchitectFrame.getMainInstance(); int selectedColIndex = tp.getSelectedColumnIndex(); ...
if (tp.isSelected()) { ArchitectFrame af = ArchitectFrame.getMainInstance(); int selectedColIndex = tp.getSelectedColumnIndex(); if (selectedColIndex == COLUMN_INDEX_NONE) { af.editTableAction.actionPerformed (new ActionEvent(tp, ActionEvent.ACTION_PERFORMED, "DoubleClick")); } else if (selectedColIndex >= 0) { af.edit...
if (evt.getClickCount() == 2) { if (tp.isSelected()) { ArchitectFrame af = ArchitectFrame.getMainInstance(); int selectedColIndex = tp.getSelectedColumnIndex(); if (selectedColIndex == COLUMN_INDEX_NONE) { af.editTableAction.actionPerformed (new ActionEvent(tp, ActionEvent.ACTION_PERFORMED, "DoubleClick")); } else if (...
public void mouseClicked(MouseEvent evt) { if ((evt.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && evt.getClickCount() == 2) { TablePane tp = (TablePane) evt.getSource(); if (tp.isSelected()) { ArchitectFrame af = ArchitectFrame.getMainInstance(); int selectedColIndex = tp.getSelectedColumnIndex(); ...
TablePane tp = (TablePane) evt.getSource();
public void mousePressed(MouseEvent evt) { evt.getComponent().requestFocus(); if ((evt.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0) { try { // table/column selection TablePane tp = (TablePane) evt.getComponent(); PlayPen pp = (PlayPen) tp.getPlayPen(); int clickCol = tp.pointToColumnIndex...
TablePane tp = (TablePane) evt.getComponent();
public void mousePressed(MouseEvent evt) { evt.getComponent().requestFocus(); if ((evt.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0) { try { // table/column selection TablePane tp = (TablePane) evt.getComponent(); PlayPen pp = (PlayPen) tp.getPlayPen(); int clickCol = tp.pointToColumnIndex...
int clickCol = tp.pointToColumnIndex(evt.getPoint()); if ( (evt.getModifiersEx() & (InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK)) == 0) { pp.selectNone(); }
int clickCol = tp.pointToColumnIndex(evt.getPoint());
public void mousePressed(MouseEvent evt) { evt.getComponent().requestFocus(); if ((evt.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0) { try { // table/column selection TablePane tp = (TablePane) evt.getComponent(); PlayPen pp = (PlayPen) tp.getPlayPen(); int clickCol = tp.pointToColumnIndex...
Point handle = getPlayPen().zoomPoint(new Point(evt.getPoint())); new PlayPen.FloatingTableListener(getPlayPen(), this, handle); }
Iterator it = getPlayPen().getSelectedTables().iterator(); logger.debug("event point: " + evt.getPoint()); logger.debug("zoomed event point: " + getPlayPen().zoomPoint(evt.getPoint())); while (it.hasNext()) { TablePane t3 = (TablePane)it.next(); logger.debug("(" + t3.getModel().getTableName() + ") zoomed selected tabl...
public void mousePressed(MouseEvent evt) { evt.getComponent().requestFocus(); if ((evt.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0) { try { // table/column selection TablePane tp = (TablePane) evt.getComponent(); PlayPen pp = (PlayPen) tp.getPlayPen(); int clickCol = tp.pointToColumnIndex...
} catch ( Exception e ) {
} catch ( Throwable e ) {
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...
throw new PhotovaultException( "Unknown error while starting database:\n" );
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...
} catch (ODMGException e ) {
} catch ( Exception e ) {
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...
if ( !success ) { throw new PhotovaultException( "Unknown exception while starting database" ); }
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...
public Individual(int numLines) { this.markers = new Vector(numLines); this.zeroed = new boolean[numLines];
public Individual(int numMarkers) { markersa = new byte[numMarkers]; markersb = new byte[numMarkers]; this.zeroed = new boolean[numMarkers];
public Individual(int numLines) { this.markers = new Vector(numLines); //this.zeroed = new Vector(numLines); this.zeroed = new boolean[numLines]; this.currMarker = 0; }
public void addMarker(byte[] marker){ this.markers.add(marker); this.zeroed[currMarker] = false; this.currMarker++; if (!(marker[0] == 0 || marker[1] == 0)){
public void addMarker(byte markera, byte markerb) { markersa[currMarker] = markera; markersb[currMarker] = markerb; zeroed[currMarker] = false; currMarker++; if (!(markera == 0 || markerb == 0)){
public void addMarker(byte[] marker){ this.markers.add(marker); //this.zeroed.add(new Boolean(false)); this.zeroed[currMarker] = false; this.currMarker++; if (!(marker[0] == 0 || marker[1] == 0)){ numGoodMarkers++; } }
return numGoodMarkers/markers.size();
return numGoodMarkers/markersa.length;
public double getGenoPC(){ return numGoodMarkers/markers.size(); }
return markers;
return null;
public Vector getMarkers() { return markers; }
return this.markers.size();
return this.markersa.length;
public int getNumMarkers(){ return this.markers.size(); }
public void setMarkers(Vector m){ markers = m;
public void setMarkers(byte[] ma, byte[] mb){ markersa = ma; markersb = mb;
public void setMarkers(Vector m){ markers = m; }
throw new JellyException(e, columnNumber, lineNumber);
throw new JellyException(e, fileName, elementName, columnNumber, lineNumber);
protected void handleException(Exception e) throws Exception { log.error( "Caught exception: " + e, e ); throw new JellyException(e, columnNumber, lineNumber); }
configureTagScript(script);
protected TagScript createStaticTag( final String namespaceURI, final String localName, final String qName, Attributes list) throws SAXException { try { StaticTag tag = new StaticTag( namespaceURI, localName, qName ); StaticTagScript script = new Stati...
localName,
script,
protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam...
TagScript parentTagScript = tagScript; tagScript = createTag(namespaceURI, localName, list); if (tagScript == null) { tagScript = createStaticTag(namespaceURI, localName, qName, list);
TagScript newTagScript = createTag(namespaceURI, localName, list); if (newTagScript == null) { newTagScript = createStaticTag(namespaceURI, localName, qName, list);
public void startElement( String namespaceURI, String localName, String qName, Attributes list) throws SAXException { try { // add check to ensure namespace URI is "" for no namespace if ( namespaceURI == null ) { ...
tagScript.setParent(parentTagScript); if ( elementNamespaces != null ) { tagScript.setNamespacesMap( elementNamespaces ); elementNamespaces = null; }
public void startElement( String namespaceURI, String localName, String qName, Attributes list) throws SAXException { try { // add check to ensure namespace URI is "" for no namespace if ( namespaceURI == null ) { ...
addComponentListener(new ResizeListener());
public HaploView(){ try{ fc = new JFileChooser(System.getProperty("user.dir")); }catch(NullPointerException n){ try{ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); fc = new JFileChooser(System.getProperty("user.dir")); ...
dPrimeDisplay.refresh();
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == READ_GENOTYPES){ ReadDataDialog readDialog = new ReadDataDialog("Open new data", this); readDialog.pack(); readDialog.setVisible(true); } else if (command == READ_...
if(applicationId != null){ request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Edit Cluster"); }else{ request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Add Cluster"); }
public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ...
return;
public void drop(DropTargetDropEvent dtde) { TablePane tp = (TablePane) dtde.getDropTargetContext().getComponent(); logger.debug("Drop target drop event on "+tp.getName()+": "+dtde); Transferable t = dtde.getTransferable(); DataFlavor importFlavor = bestImportFlavor(tp, t.getTransferDataFlavors()); if (impo...
Tag newTag = dynaLib.createTag( tag.getLocalName() );
Tag newTag = dynaLib.createTag( tag.getLocalName(), getSaxAttributes() );
protected Tag findDynamicTag(JellyContext context, StaticTag tag) throws Exception { // lets see if there's a tag library for this URI... TagLibrary taglib = context.getTagLibrary( tag.getUri() ); if ( taglib instanceof DynamicTagLibrary ) { DynamicTagLibrary dynaLib = (DynamicTagLib...
}
} ASUtils.breakLongMenu(ArchitectFrame.getMainInstance(),connectionsMenu);
protected JPopupMenu refreshMenu(TreePath p) { logger.debug("refreshMenu is being called."); JPopupMenu newMenu = new JPopupMenu(); newMenu.add(connectionsMenu = new JMenu("Add Source Connection")); connectionsMenu.add(new JMenuItem(newDBCSAction)); connectionsMenu.addSeparator(); // populate for (Arch...
log.warn( "getShootingTime" );
public Date getShootTime( ) { return (Date) shootingDayField.getValue(); }
ctrl.viewChanged( this, (String) field );
Object value = ((JFormattedTextField) src).getValue(); if ( value != null ) { log.warn( "Property changed: " + (String) field ); System.out.println( "Property changed: " + (String) field ); ctrl.viewChanged( this, (String) field ); }
public void propertyChange( PropertyChangeEvent ev ) { if ( ev.getPropertyName().equals( "value" ) ) { Object src = ev.getSource(); if ( src.getClass() == JFormattedTextField.class ) { Object field = ((JFormattedTextField) src).getClientProperty( FIELD_NAME ); ctrl.viewChanged( this, (String) field ); ...
log.warn( "setShootingTime: " + newValue );
public void setShootTime( Date newValue ) { shootingDayField.setValue( newValue ); }
if (((String)h.getPhasedSelection().get(2)).equals("CEU")){
if (((String)h.getPhasedSelection().get(2)).equals("YRI")){
public ReadDataDialog(String title, HaploView h){ super(h, title); //Ped Panel... pedFileField = new JTextField("",20); JButton browsePedFileButton = new JButton("Browse"); browsePedFileButton.setActionCommand(BROWSE_GENO); browsePedFileButton.addActionListener(this); ...
if (markerid.equals("marker")){
if (markerid.equals("rs")){
public void parsePhasedData(String[] info) throws IOException, PedFileException{ if (info[4].equals("")){ Chromosome.setDataChrom("none"); }else{ Chromosome.setDataChrom("chr" + info[4]); } Chromosome.setDataBuild("ncbi_b35"); Vector sampleData = new Vector()...
for(int i=0; i < columns; i++){ ind.addMarker(byteDataT[i], byteDataU[i]);
if (ind.getGender() == Individual.MALE && Chromosome.getDataChrom().equalsIgnoreCase("chrx")){ for(int i=0; i < columns; i++){ ind.addMarker(byteDataT[i], byteDataT[i]); } }else{ for(int i=0; i < columns; i++){ ind.addMarker(byteDataT[i], byteDataU[i]); }
public void parsePhasedData(String[] info) throws IOException, PedFileException{ if (info[4].equals("")){ Chromosome.setDataChrom("none"); }else{ Chromosome.setDataChrom("chr" + info[4]); } Chromosome.setDataBuild("ncbi_b35"); Vector sampleData = new Vector()...