rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
creatingThumbIcon = getIcon( "creating_thumb.png" );
void createUI() { photoTransferHandler = new PhotoCollectionTransferHandler( this ); setTransferHandler( photoTransferHandler ); setAutoscrolls( true ); addMouseListener( this ); addMouseMotionListener( this ); // Create the popup men...
thumbnail = Thumbnail.getDefaultThumbnail();
thumbnail = photo.getOldThumbnail(); if ( thumbnail != null ) { useOldThumbnail = true; } else { thumbnail = Thumbnail.getDefaultThumbnail(); }
private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { log.debug( "paintThumbnail entry " + photo.getUid() ); long startTime = System.currentTimeMillis(); long thumbReadyTime = 0; long thumbDrawnTime = 0; long endTime = 0; ...
if ( useOldThumbnail ) { creatingThumbIcon.paintIcon( this, g2, startx + (columnWidth - creatingThumbIcon.getIconWidth())/(int)2, starty + ( rowHeight - creatingThumbIcon.getIconHeight())/(int)2 ); }
private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { log.debug( "paintThumbnail entry " + photo.getUid() ); long startTime = System.currentTimeMillis(); long thumbReadyTime = 0; long thumbDrawnTime = 0; long endTime = 0; ...
while ( !parentFolderNode.containsPhotos() && parentNode != topNode ) {
while ( !parentFolderNode.containsPhotos() && parentNode.getChildCount() == 0 && parentNode != topNode ) {
public void removeAllFromFolder( PhotoFolder f ) { addedToFolders.remove( f ); removedFromFolders.add( f ); DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) folderNodes.get( f ); FolderNode fn = (FolderNode) treeNode.getUserObject(); fn.removeAllPhotos(); // If this folder has n...
if (rootURL == null) {
URL url = rootURL; if (url == null) {
protected URL createRelativeURL(URL rootURL, String relativeURI) throws MalformedURLException { if (rootURL == null) { File file = new File(System.getProperty("user.dir")); rootURL = file.toURL(); } String urlText = rootURL.toString() + relativeURI; if ( log....
rootURL = file.toURL();
url = file.toURL();
protected URL createRelativeURL(URL rootURL, String relativeURI) throws MalformedURLException { if (rootURL == null) { File file = new File(System.getProperty("user.dir")); rootURL = file.toURL(); } String urlText = rootURL.toString() + relativeURI; if ( log....
String urlText = rootURL.toString() + relativeURI;
String urlText = url.toString() + relativeURI;
protected URL createRelativeURL(URL rootURL, String relativeURI) throws MalformedURLException { if (rootURL == null) { File file = new File(System.getProperty("user.dir")); rootURL = file.toURL(); } String urlText = rootURL.toString() + relativeURI; if ( log....
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader != null) { return (classLoader);
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); if (contextClassLoader != null) { return (contextClassLoader);
public ClassLoader getClassLoader() { if (this.classLoader != null) { return (this.classLoader); } if (this.useContextClassLoader) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader != null) { return (class...
JellyContext parent = getParent(); if (parent != null) { value = parent.getVariable( name );
JellyContext parentContext = getParent(); if (parentContext != null) { value = parentContext.getVariable( name );
public Object getVariable(String name) { Object value = variables.get(name); boolean definedHere = value != null || variables.containsKey(name); if (definedHere) return value; if ( value == null && isInherit() ) { JellyContext parent = getParent(); if (parent != nul...
if ( getInherit() ) { return getParent().findVariable( name );
Object value = variables.get(name); if ( value == null && getInherit() ) { value = getParent().findVariable( name );
public Object getVariable(String name) { if ( getInherit() ) { return getParent().findVariable( name ); } return variables.get(name); }
return variables.get(name);
return value;
public Object getVariable(String name) { if ( getInherit() ) { return getParent().findVariable( name ); } return variables.get(name); }
if ( getExport() ) {
if ( getExport() && getParent() != null ) {
public void setScopedVariable(String name, Object value) { if ( getExport() ) { getParent().setScopedVariable( name, value ); } }
} else { setVariable( name, value );
public void setScopedVariable(String name, Object value) { if ( getExport() ) { getParent().setScopedVariable( name, value ); } }
connections = plini.getConnections();
connections = plini.getConnections(); for (int i = listenerList.size() - 1; i >= 0; i--) { listenerList.get(i).contentsChanged( new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, e.getListIndex(), e.getListIndex())); }
public void databaseAdded(DatabaseListChangeEvent e) { connections = plini.getConnections(); for (int i = listenerList.size() -1 ; i>=0; i--) { listenerList.get(i).contentsChanged(new ListDataEvent(this,ListDataEvent.INTERVAL_ADDED,e.getListIndex(),e.getListIndex())); } }
for (int i = listenerList.size() -1 ; i>=0; i--) { listenerList.get(i).contentsChanged(new ListDataEvent(this,ListDataEvent.INTERVAL_ADDED,e.getListIndex(),e.getListIndex())); } }
}
public void databaseAdded(DatabaseListChangeEvent e) { connections = plini.getConnections(); for (int i = listenerList.size() -1 ; i>=0; i--) { listenerList.get(i).contentsChanged(new ListDataEvent(this,ListDataEvent.INTERVAL_ADDED,e.getListIndex(),e.getListIndex())); } }
public TDTPanel(Vector chromosomes, int t) {
public TDTPanel(PedFile pf, int t) {
public TDTPanel(Vector chromosomes, int t) { type = t; if (type == 1){ result = TDT.calcTrioTDT(chromosomes); }else{ result = TDT.calcCCTDT(chromosomes); } tableColumnNames.add("#"); tableColumnNames.add("Name"); if (type == 1){ table...
result = TDT.calcTrioTDT(chromosomes);
result = TDT.calcTrioTDT(pf);
public TDTPanel(Vector chromosomes, int t) { type = t; if (type == 1){ result = TDT.calcTrioTDT(chromosomes); }else{ result = TDT.calcCCTDT(chromosomes); } tableColumnNames.add("#"); tableColumnNames.add("Name"); if (type == 1){ table...
result = TDT.calcCCTDT(chromosomes);
result = TDT.calcCCTDT(pf);
public TDTPanel(Vector chromosomes, int t) { type = t; if (type == 1){ result = TDT.calcTrioTDT(chromosomes); }else{ result = TDT.calcCCTDT(chromosomes); } tableColumnNames.add("#"); tableColumnNames.add("Name"); if (type == 1){ table...
throw new MissingAttributeException("bean");
BeanSource tag = (BeanSource) findAncestorWithClass(BeanSource.class); if (tag != null) { bean = tag.getBean(); } if (bean == null) { throw new MissingAttributeException("bean"); }
public void doTag(XMLOutput output) throws Exception { Map attributes = getAttributes(); Object bean = attributes.remove( "object" ); if ( bean == null ) { throw new MissingAttributeException("bean"); } setBeanProperties(bean, attributes); }
updateViews( null );
public void setViews( Collection views ) { this.views = views; }
children.add(i,c);
if (c instanceof Relationship) { relations.add(i-children.size(),(Relationship)c); } else { children.add(i,c); }
public void add(PlayPenComponent c, int i) { children.add(i,c); c.addPlayPenComponentListener(playPenComponentEventPassthrough); c.addSelectionListener(getOwner()); c.revalidate(); }
return children.get(i);
if (i < children.size()){ return children.get(i); } else { return relations.get(i-children.size()); }
public PlayPenComponent getComponent(int i) { return children.get(i); }
for (Relationship ppc : relations) { if (ppc.contains(p)) { return (PlayPenComponent) ppc; } }
public PlayPenComponent getComponentAt(Point p) { for (PlayPenComponent ppc : children) { if (ppc.contains(p)) { return ppc; } } return null; }
return children.size();
return children.size()+relations.size();
public int getComponentCount() { return children.size(); }
PlayPenComponent c = children.get(j);
PlayPenComponent c; if (j < children.size()) { c= children.get(j); } else { c = relations.get(j-children.size()); }
public void remove(int j) { PlayPenComponent c = children.get(j); Rectangle r = c.getBounds(); c.removePlayPenComponentListener(playPenComponentEventPassthrough); c.removeSelectionListener(getOwner()); children.remove(j); getOwner().repaint(r); }
children.remove(j);
if (j < children.size()) { children.remove(j); } else { relations.remove(j-children.size()); }
public void remove(int j) { PlayPenComponent c = children.get(j); Rectangle r = c.getBounds(); c.removePlayPenComponentListener(playPenComponentEventPassthrough); c.removeSelectionListener(getOwner()); children.remove(j); getOwner().repaint(r); }
refreshPhotoChangeListeners();
public void photoCollectionChanged( PhotoCollectionChangeEvent e ) { revalidate(); repaint(); }
refreshPhotoChangeListeners();
public void setCollection(PhotoCollection v) { if ( photoCollection != null ) { photoCollection.removePhotoCollectionChangeListener( this ); } photoCollection = v; photoCollection.addPhotoCollectionChangeListener( this ); revalidate(); repaint(); }
CheckDataTableSorter sorter = new CheckDataTableSorter(tableModel);
sorter = new CheckDataTableSorter(tableModel);
public CheckDataPanel(HaploView hv){ this(hv.theData); this.hv = hv; setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); JPanel missingPanel = new JPanel(); JLabel countsLabel; countsLabel = new JLabel("Using " + theData.numSingletons + " singletons and " + theD...
for (int j = 0; j < table.getColumnCount(); j++){ sorter.setSortingStatus(j,TableSorter.NOT_SORTED); }
public void redoRatings(){ try{ Vector result = new CheckData(theData.getPedFile()).check(); for (int i = 0; i < table.getRowCount(); i++){ MarkerResult cur = (MarkerResult)result.get(i); //use this marker as long as it has a good (i.e. positive) rating and...
saveDprimeWriter.write((i+1) + "\t" + (j+1) + "\t" + filteredDPrimeTable[i][j] + "\n");
saveDprimeWriter.write((Chromosome.realIndex[i]+1) + "\t" + (Chromosome.realIndex[j]+1) + "\t" + filteredDPrimeTable[i][j] + "\n");
public void saveDprimeToText(File dumpDprimeFile) throws IOException{ FileWriter saveDprimeWriter = new FileWriter(dumpDprimeFile); if (infoKnown){ saveDprimeWriter.write("L1\tL2\tD'\tLOD\tr^2\tCIlow\tCIhi\tDist\n"); long dist; for (int i = 0; i < filteredDPrimeTable.l...
saveHapsWriter.write(" " + (markerNums[j]+1));
saveHapsWriter.write(" " + (Chromosome.realIndex[markerNums[j]]+1));
public void saveHapsToText(Haplotype[][] finishedHaplos, double[] multidprime, File saveHapsFile) throws IOException{ if (finishedHaplos == null) return; NumberFormat nf = NumberFormat.getInstance(Locale.US); nf.setMinimumFractionDigits(3); nf.setMaximumFrac...
registerWizardDialogTag("wizardDialog", WizardDialogTag.class); registerWizardPageTag("wizardPage", WizardPageTag.class);
public JFaceTagLibrary() { // Viewer tags registerViewerTag("tableViewer", TableViewer.class); registerViewerTag("tableTreeViewer", TableTreeViewer.class); registerViewerTag("treeViewer", TreeViewer.class); registerViewerTag("checkboxTreeViewer", CheckboxTreeViewer.class); ...
List answers = remoteManagerClient.readAnswer();
remoteManagerClient.readAnswer();
private void addUser(RemoteManagerClient remoteManagerClient, String username, String internalPassword) { remoteManagerClient.executeCommand("adduser " + username + " " + internalPassword); List answers = remoteManagerClient.readAnswer(); log.info("user created: " + username); }
throw new StartupException("failed to setup");
throw new StartupException("failed to setup",e);
private void setupForwardedMailInterceptor() throws StartupException { SMTPMailSink smtpMailSink = new SMTPMailSink(); smtpMailSink.setSmtpListenerPort(m_postageConfiguration.getTestserverPortSMTPForwarding()); smtpMailSink.setResults(m_results); try { smtpMailSink.initialize(...
boolean loginSuccess = remoteManagerClient.login();
remoteManagerClient.login();
private void setupInternalUserAccounts() throws StartupException { try { String host = m_postageConfiguration.getTestserverHost(); int remoteManagerPort = m_postageConfiguration.getTestserverRemoteManagerPort(); String remoteManagerUsername = m_postageConfiguration.getTestser...
List answers = remoteManagerClient.readAnswer();
remoteManagerClient.readAnswer();
private void setupInternalUserAccounts() throws StartupException { try { String host = m_postageConfiguration.getTestserverHost(); int remoteManagerPort = m_postageConfiguration.getTestserverRemoteManagerPort(); String remoteManagerUsername = m_postageConfiguration.getTestser...
answers = remoteManagerClient.readAnswer();
remoteManagerClient.readAnswer();
private void setupInternalUserAccounts() throws StartupException { try { String host = m_postageConfiguration.getTestserverHost(); int remoteManagerPort = m_postageConfiguration.getTestserverRemoteManagerPort(); String remoteManagerUsername = m_postageConfiguration.getTestser...
subfolderStructureChanged( this );
protected void addSubfolder( PhotoFolder subfolder ) { subfolders.add( subfolder ); modified(); }
Transaction tx = odmg.newTransaction(); tx.begin();
Transaction tx = odmg.currentTransaction(); boolean mustCommit = false; if ( tx == null ) { tx = odmg.newTransaction(); tx.begin(); mustCommit = true; }
public void delete() { getODMGImplementation(); getODMGDatabase(); Transaction tx = odmg.newTransaction(); tx.begin(); // First make sure that this object is deleted from its parent's subfolders list (if it has a parent) setParentFolder( null ); try { db.deletePersistent( this ); tx.commit(); } catch ( Exce...
try { db.deletePersistent( this );
db.deletePersistent( this ); if ( mustCommit ) {
public void delete() { getODMGImplementation(); getODMGDatabase(); Transaction tx = odmg.newTransaction(); tx.begin(); // First make sure that this object is deleted from its parent's subfolders list (if it has a parent) setParentFolder( null ); try { db.deletePersistent( this ); tx.commit(); } catch ( Exce...
} catch ( Exception e ) { tx.abort(); log.warn( "Error deleteing photo folder: " + e.getMessage() );
public void delete() { getODMGImplementation(); getODMGDatabase(); Transaction tx = odmg.newTransaction(); tx.begin(); // First make sure that this object is deleted from its parent's subfolders list (if it has a parent) setParentFolder( null ); try { db.deletePersistent( this ); tx.commit(); } catch ( Exce...
Transaction tx = odmg.newTransaction(); tx.begin();
Transaction tx = odmg.currentTransaction(); boolean mustCommit = false; if ( tx == null ) { tx = odmg.newTransaction(); tx.begin(); mustCommit = true; }
public static PhotoFolder getRoot() { getODMGImplementation(); getODMGDatabase(); DList folders = null; Transaction tx = odmg.newTransaction(); tx.begin(); try { OQLQuery query = odmg.newOQLQuery(); query.create( "select folders from " + PhotoFolder.class.getName() + " where folderId = 1" ); folders = (...
if ( mustCommit ) { tx.commit(); }
public static PhotoFolder getRoot() { getODMGImplementation(); getODMGDatabase(); DList folders = null; Transaction tx = odmg.newTransaction(); tx.begin(); try { OQLQuery query = odmg.newOQLQuery(); query.create( "select folders from " + PhotoFolder.class.getName() + " where folderId = 1" ); folders = (...
query.create( "select folders from " + PhotoFolder.class.getName() + " where folderId = 0" );
query.create( "select folders from " + PhotoFolder.class.getName() + " where folderId = 1" );
public static void main( String[] args ) { org.apache.log4j.BasicConfigurator.configure(); log.setLevel( org.apache.log4j.Level.DEBUG ); Implementation odmg = getODMGImplementation(); Database db = getODMGDatabase(); Transaction tx = odmg.newTransaction(); tx.begin(); DList folders = null; try { OQLQuery query ...
if ( parent != null ) { parent.subfolderChanged( this ); }
protected void modified() { // Find the current transaction or create a new one Transaction tx = odmg.currentTransaction(); boolean mustCommit = false; if ( tx == null ) { tx = odmg.newTransaction(); tx.begin(); mustCommit = true; } // Add folder to the transaction tx.lock( this, Transaction.WRITE ); /...
subfolderStructureChanged( this );
protected void removeSubfolder( PhotoFolder subfolder ) { subfolders.remove( subfolder ); modified(); }
metaAssoc.remove(1); metaAssoc.add("Haplotypes", new HaploAssocPanel(theData.getHaplotypes()));
htp.makeTable(theData.getHaplotypes());
public void stateChanged(ChangeEvent e) { int tabNum = tabs.getSelectedIndex(); if (tabNum == VIEW_D_NUM || tabNum == VIEW_HAP_NUM){ exportMenuItems[0].setEnabled(true); exportMenuItems[1].setEnabled(true); }else if (tabNum == VIEW_TDT_NUM || tabNum...
if(Options.getAssocTest() != ASSOC_NONE) { JTabbedPane metaAssoc= (JTabbedPane)tabs.getComponentAt(VIEW_TDT_NUM); HaploAssocPanel hasp = (HaploAssocPanel)metaAssoc.getComponent(1); hasp.makeTable(theData.getHaplotypes()); }
public void stateChanged(ChangeEvent e) { int tabNum = tabs.getSelectedIndex(); if (tabNum == VIEW_D_NUM || tabNum == VIEW_HAP_NUM){ exportMenuItems[0].setEnabled(true); exportMenuItems[1].setEnabled(true); }else if (tabNum == VIEW_TDT_NUM || tabNum...
addComponentListener( this );
public void createUI() { setLayout( new BorderLayout() ); imageView = new JAIPhotoView(); scrollPane = new JScrollPane( imageView ); scrollPane.setPreferredSize( new Dimension( 500, 500 ) ); add( scrollPane, BorderLayout.CENTER ); JToolBar toolbar = new JToolBar(); String[] defaultZooms = { "12%", "25%", ...
log.debug( "fit to " + displaySize.getWidth() + ", " + displaySize.getHeight() );
public void fit() { Dimension displaySize = scrollPane.getSize(); imageView.fitToRect( displaySize.getWidth()-4, displaySize.getHeight()-4 ); // int origWidth = imageView.getOrigWidth(); // int origHeight = imageView.getOrigHeight(); // if ( origWidth > 0 && origHeight > 0 ) { // float widthScale = ((float)...
h.fc.setSelectedFile(null);
h.fc.setSelectedFile(new File(""));
void browse(int browseType){ String name; String markerInfoName = ""; HaploView h = (HaploView) this.getParent(); h.fc.setSelectedFile(null); int returned = h.fc.showOpenDialog(this); if (returned != JFileChooser.APPROVE_OPTION) return; File file = h.fc.getSelectedFi...
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("select")) { ...
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("select")) { ...
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("select")) { ...
JTable table = checkPanel.getTable(); checkWindow.dispose(); boolean[] markerResultArray = new boolean[table.getRowCount()]; for (int i = 0; i < table.getRowCount(); i++){ markerResultArray[i] = ((Boolean)table.getValueAt(i,7)).booleanValue(); } try{ new TextMethods().linkageToHaps(markerResultArray,checkPanel.getPedFi...
JTable table = checkPanel.getTable(); checkWindow.dispose(); boolean[] markerResultArray = new boolean[table.getRowCount()]; for (int i = 0; i < table.getRowCount(); i++){ markerResultArray[i] = ((Boolean)table.getValueAt(i,7)).booleanValue(); } try{ new TextMethods().linkageToHaps(markerResultArray,checkPanel.getPedF...
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 == "Conti...
private static void hapsTextOnly(String hapsFile,int outputType){
private static void hapsTextOnly(String hapsFile,int outputType, int maxDistance){
private static void hapsTextOnly(String hapsFile,int outputType){ try { HaploData theData; File OutputFile; File inputFile = new File(hapsFile); if(!inputFile.exists()){ System.out.println("haps input file " + hapsFile + " does not exist"); ...
theData.generateDPrimeTable(maxDist);
private static void hapsTextOnly(String hapsFile,int outputType){ try { HaploData theData; File OutputFile; File inputFile = new File(hapsFile); if(!inputFile.exists()){ System.out.println("haps input file " + hapsFile + " does not exist"); ...
if(outputType == 1 || outputType == 2){ theData.guessBlocks(outputType); }
theData.guessBlocks(outputType);
private static void hapsTextOnly(String hapsFile,int outputType){ try { HaploData theData; File OutputFile; File inputFile = new File(hapsFile); if(!inputFile.exists()){ System.out.println("haps input file " + hapsFile + " does not exist"); ...
try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { }
HaploView window = new HaploView(); window.setTitle("HaploView beta"); window.setSize(800,600);
public static void main(String[] args) {//throws IOException{ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } //setup view object HaploView window = new HaploView(); window.setTitle("HaploView beta"); window.se...
HaploView window = new HaploView(); window.setTitle("HaploView beta"); window.setSize(800,600);
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); window.setLocation((screen.width - window.getWidth()) / 2, (screen.height - window.getHeight()) / 2);
public static void main(String[] args) {//throws IOException{ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } //setup view object HaploView window = new HaploView(); window.setTitle("HaploView beta"); window.se...
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); window.setLocation((screen.width - window.getWidth()) / 2, (screen.height - window.getHeight()) / 2); window.setVisible(true); ReadDataDialog readDialog = new ReadDataDialog("Welcome to HaploView", window); readDialog.pack(); readDialog.setVisible(true);
window.setVisible(true); ReadDataDialog readDialog = new ReadDataDialog("Welcome to HaploView", window); readDialog.pack(); readDialog.setVisible(true); }
public static void main(String[] args) {//throws IOException{ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } //setup view object HaploView window = new HaploView(); window.setTitle("HaploView beta"); window.se...
if (!this.sessionIdSession.containsKey(sessionId)) { this.sessionIdSession.put(sessionId, session);
if (!sessionIdSession.containsKey(sessionId)) { sessionIdSession.put(sessionId, personalId);
public synchronized String addTicket(String personalId) { HttpSession session = IWContext.getInstance().getSession(); String sessionId = session.getId(); if (!this.sessionIdSession.containsKey(sessionId)) { this.sessionIdSession.put(sessionId, session); } return getTicket(personalId, sessionId); }
return getTicket(personalId, sessionId);
return getTicket(sessionId);
public synchronized String addTicket(String personalId) { HttpSession session = IWContext.getInstance().getSession(); String sessionId = session.getId(); if (!this.sessionIdSession.containsKey(sessionId)) { this.sessionIdSession.put(sessionId, session); } return getTicket(personalId, sessionId); }
private String getTicket(String personalId, String sessionId) { int length = personalId.length(); StringBuffer token = new StringBuffer(); token.append(length); token.append(SEPARATOR); token.append(personalId); token.append(sessionId); return token.toString();
private String getTicket(String sessionId) { return sessionId;
private String getTicket(String personalId, String sessionId) { int length = personalId.length(); StringBuffer token = new StringBuffer(); token.append(length); token.append(SEPARATOR); token.append(personalId); token.append(sessionId); return token.toString(); }
public boolean isValid(String ticket) { return (validate(ticket) != null);
public boolean isValid(String personalId, String ticket) { if (StringHandler.isEmpty(personalId)) { return false; } String ticketPersonalId = validate(ticket); return personalId.equals(ticketPersonalId);
public boolean isValid(String ticket) { return (validate(ticket) != null); }
int index = ticket.indexOf(SEPARATOR); if (index < 1) { return null; } String personalId = null; String sessionId = null; try { int lengthOfPersonalId = Integer.parseInt(ticket.substring(0, index)); if (lengthOfPersonalId < 1) { return null; } int startIndexSessionId = index + 1 + lengthOfPersonalId; int ticketLength =...
return (String) sessionIdSession.get(ticket);
public String validate(String ticket) { int index = ticket.indexOf(SEPARATOR); if (index < 1) { return null; } String personalId = null; String sessionId = null; try { int lengthOfPersonalId = Integer.parseInt(ticket.substring(0, index)); if (lengthOfPersonalId < 1) { return null; } int startIndexS...
method.invoke(serviceObject, toObjectArray(parameters, parameterTypes));
method.invoke(serviceObject, args);
public Object execute(String serviceMethod, Vector parameters) throws Exception { try { int index = serviceMethod.indexOf(ServiceProxy.CLASS_METHOD_DELIMITER); final String className = serviceMethod.substring(0, index); final String methodName = serviceMethod.subst...
if(serviceContext.getUser() != null){ UserManager userManager = UserManager.getInstance(); User completeUser = userManager.getUser(serviceContext.getUser().getUsername()); serviceContext.setUser(completeUser); }
private static Object[] toObjectArray(Vector parameters, Class[] parameterTypes){ Object[] args = new Object[parameterTypes.length]; for(int i=0; i<parameterTypes.length; i++){ if(i == 0){ /* first argument must always be ServiceContex...
*/
public void register(AlertHandler handler, String alertId, String alertName){ assert this.handler == null; assert connection == null; this.handler = handler; /* start looking for this notification */ connection = ServerConnector.getS...
JellyContext context = new JellyContext(); context.setRootURL(new File(".").toURL()); StringWriter buffer = new StringWriter(); XMLOutput output = XMLOutput.createXMLOutput(buffer); context.runScript( new File(fileName), output ); String text = buffer.toString().trim(); if (log.isDebugEnabled()) { log.debug("Eval...
return evaluteScriptAsText(fileName, null);
protected String evaluteScriptAsText(String fileName) throws Exception { JellyContext context = new JellyContext(); // allow scripts to refer to any resource inside this project // using an absolute URI like /src/test/org/apache/foo.xml context.setRootURL(new File(".").toURL()); /...
assertEquals("Produces the correct output", "<!DOCTYPE foo PUBLIC \"publicID\" \"foo.dtd\">\n<foo></foo>", text);
assertEquals("Should produce the correct output", "<!DOCTYPE foo PUBLIC \"publicID\" \"foo.dtd\">\n<foo></foo>", text);
public void testDoctype() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/testDoctype.jelly"); assertEquals("Produces the correct output", "<!DOCTYPE foo PUBLIC \"publicID\" \"foo.dtd\">\n<foo></foo>", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testParse() throws Exception { InputStream in = new FileInputStream(testBaseDir + "/example.jelly"); XMLParser parser = new XMLParser(); Script script = parser.parse(in); script = script.compile(); log.debug("Found: " + script); assertTrue("Parsed a Script", scr...
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransform() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformExample.jelly"); assertEquals("Produces the correct output", "It works!", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransformAllInLine() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformExampleAllInLine.jelly"); assertEquals("Produces the correct output", "It works!", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransformParams() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformParamExample.jelly"); assertEquals("Produces the correct output", "It works!", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransformParamsInLine() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformParamExample2.jelly"); assertEquals("Produces the correct output", "It works!", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransformSAXOutput() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformExampleSAXOutput.jelly"); assertEquals("Produces the correct output", "It works!", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransformSAXOutputNestedTransforms() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformExampleSAXOutputNestedTransforms.jelly"); assertEquals("Produces the correct output", "It works!", text); }
assertEquals("Produces the correct output", "Report count=1:assert count=2", text);
assertEquals("Should produce the correct output", "Report count=1:assert count=2", text);
public void testTransformSchematron() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/schematron/transformSchematronExample.jelly"); assertEquals("Produces the correct output", "Report count=1:assert count=2", text); }
assertEquals("Produces the correct output", "It works!", text);
assertEquals("Should produce the correct output", "It works!", text);
public void testTransformXmlVar() throws Exception { String text = evaluteScriptAsText(testBaseDir + "/transformExampleXmlVar.jelly"); assertEquals("Produces the correct output", "It works!", text); }
sourceDatabaseDropdown.addItem(ds);
ArchitectFrame.getMainInstance().getUserSettings().getPlDotIni().addDataSource(ds);
public void testSourceDropDownsWithOnlyCatalog() { ArchitectDataSource ds = new ArchitectDataSource(); ds.setDisplayName("Schemaless Database"); ds.setDriverClass("regress.ca.sqlpower.architect.MockJDBCDriver"); ds.setUser("fake"); ds.setPass("fake"); //this creates a mock jdbc database with only catalogs ds.se...
sourceDatabaseDropdown.addItem(ds);
ArchitectFrame.getMainInstance().getUserSettings().getPlDotIni().addDataSource(ds);
public void testSourceDropDownsWithSchemaAndCatalog() { ArchitectDataSource ds = new ArchitectDataSource(); ds.setDisplayName("Schemaless Database"); ds.setDriverClass("regress.ca.sqlpower.architect.MockJDBCDriver"); ds.setUser("fake"); ds.setPass("fake"); //this creates a mock jdbc database with catalogs and sc...
this.currentContext = rootContext;
public Context() { }
Context answer = new Context( newVariables ); answer.taglibs = this.taglibs;
Context answer = new Context( this ); answer.setVariables( newVariables );
public Context newContext(Map newVariables) { // XXXX: should allow this new context to // XXXX: inherit parent contexts? // XXXX: Or at least publish the parent scope // XXXX: as a Map in this new variable scope? newVariables.put( "parentScope", variables ); Context answe...
markerResults[i] = ((Boolean)table.getValueAt(i,7)).booleanValue();
markerResults[i] = ((Boolean)table.getValueAt(i,8)).booleanValue();
public void stateChanged(ChangeEvent e) { int tabNum = tabs.getSelectedIndex(); if (tabNum == VIEW_D_NUM || tabNum == VIEW_HAP_NUM){ exportMenuItems[0].setEnabled(true); exportMenuItems[1].setEnabled(true); }else if (tabNum == VIEW_TDT_NUM || tabNum...
String cut = hwcut.getText();
String cut = cdc.hwcut.getText();
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_...
cut = genocut.getText();
cut = cdc.genocut.getText();
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_...
cut = mendcut.getText();
cut = cdc.mendcut.getText();
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_...
cut = cdc.mafcut.getText(); if (cut.equals("")){ cut="0"; } CheckData.mafCut = Double.parseDouble(cut);
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_...
window.setTitle("HaploView beta");
window.setTitle(TITLE_STRING);
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")) { nogui = true; } } if(nogui) { HaploText textOnly = new HaploTex...
JPanel failPanel = new JPanel(); failPanel.setLayout(new BoxLayout(failPanel,BoxLayout.Y_AXIS)); JPanel holdPanel = new JPanel(); holdPanel.add(new JLabel("HW p-value cutoff: ")); hwcut = new NumberTextField(String.valueOf(CheckData.hwCut),6,true); holdPanel.add(hwcut); failPanel.add(holdPanel); holdPanel = new JPanel(...
cdc = new CheckDataController(window); metaCheckPanel.add(cdc);
void processData(final String[][] hminfo) { if (inputOptions[2].equals("")){ inputOptions[2] = "0"; } maxCompDist = Long.parseLong(inputOptions[2])*1000; this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); final SwingWorker worker = new SwingWorker(){ ...
JPanel failPanel = new JPanel(); failPanel.setLayout(new BoxLayout(failPanel,BoxLayout.Y_AXIS)); JPanel holdPanel = new JPanel(); holdPanel.add(new JLabel("HW p-value cutoff: ")); hwcut = new NumberTextField(String.valueOf(CheckData.hwCut),6,true); holdPanel.add(hwcut); failPanel.add(holdPanel); holdPanel = new JPanel(...
cdc = new CheckDataController(window); metaCheckPanel.add(cdc);
public Object construct(){ dPrimeDisplay=null; theData.infoKnown = false; if (!(inputOptions[1].equals(""))){ readMarkers(new File(inputOptions[1]), null); } if (hminfo != null){ readMarkers(null...
File pedFile = new File(inputOptions[0]);
File inFile = new File(inputOptions[0]);
void readPedGenotypes(String[] f, int type){ //input is a 3 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //inputOptions[2] = max comparison distance (don't compute d' if markers are greater than this dist apart) //type is either 3 or...
if (pedFile.length() < 1){ throw new HaploViewException("Pedfile is empty or nonexistent: " + pedFile.getName());
if (inFile.length() < 1){ throw new HaploViewException("Pedfile is empty or nonexistent: " + inFile.getName());
void readPedGenotypes(String[] f, int type){ //input is a 3 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //inputOptions[2] = max comparison distance (don't compute d' if markers are greater than this dist apart) //type is either 3 or...
checkPanel = new CheckDataPanel(pedFile, type);
checkPanel = new CheckDataPanel(theData.getPedFile());
void readPedGenotypes(String[] f, int type){ //input is a 3 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //inputOptions[2] = max comparison distance (don't compute d' if markers are greater than this dist apart) //type is either 3 or...
theData = new HaploData(assocTest); JTable table = checkPanel.getTable(); boolean[] markerResultArray = new boolean[table.getRowCount()]; for (int i = 0; i < table.getRowCount(); i++){ markerResultArray[i] = ((Boolean)table.getValueAt(i,7)).booleanValue(); } theData.linkageToChrom(markerResultArray,checkPanel.getPedFi...
void readPedGenotypes(String[] f, int type){ //input is a 3 element array with //inputOptions[0] = ped file //inputOptions[1] = info file (null if none) //inputOptions[2] = max comparison distance (don't compute d' if markers are greater than this dist apart) //type is either 3 or...
System.out.println( "Succesfully loaded \""+ f.getPath() + "\"" );
log.debug( "Succesfully loaded \""+ f.getPath() + "\"" );
public static void main( String args[] ) { JFrame frame = new JFrame( "PhotoInfoEditorTest" ); PhotoView view = new PhotoView(); frame.getContentPane().add( view, BorderLayout.CENTER ); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); File f ...
System.out.println( "Error loading image \""+ f.getPath() + "\"" );
log.debug( "Error loading image \""+ f.getPath() + "\"" );
public static void main( String args[] ) { JFrame frame = new JFrame( "PhotoInfoEditorTest" ); PhotoView view = new PhotoView(); frame.getContentPane().add( view, BorderLayout.CENTER ); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); File f ...
public Tag createTag() throws Exception;
public Tag createTag(String name, Attributes attributes) throws Exception;
public Tag createTag() throws Exception;