rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Connection con = null; SQLDatabase target = architectFrame.playpen.getDatabase(); try { con = target.getConnection(); statements = ddlg.generateDDLStatements(target); Set conflicts = new TreeSet(); Iterator it = statements.iterator(); while (it.hasNext()) { DDLStatement stmt = (DDLStatement) it.next(); conflicts.addA...
public void prepareToStart() { finished = false; cancelled = false; }
(dialog, "Couldn't connect to target database: "+fex.getMessage() +"\nPlease check the connection settings and try again.");
(dialog, "You have to specify a target database connection" +"\nbefore executing this script.");
public void run() { JOptionPane.showMessageDialog (dialog, "Couldn't connect to target database: "+fex.getMessage() +"\nPlease check the connection settings and try again."); ArchitectFrame.getMainInstance().playpen.showDbcsDialog(); }
logger.debug("Finding conflicts for TABLE '"+t.getCatalogName()+"'.'"+t.getSchemaName()+"'.'"+t.getName()+"'");
logger.debug("Finding conflicts for TABLE '"+cat+"'.'"+sch+"'.'"+t.getName()+"'");
public static List findConflicting(Connection con, DDLStatement ddlStmt) throws SQLException { List conflicts = new ArrayList(); SQLObject so = ddlStmt.getObject(); Class clazz = so.getClass(); if (clazz.equals(SQLTable.class)) { SQLTable t = (SQLTable) so; DatabaseMetaData dbmd = con.getMetaData(); if (logg...
ResultSet rs = dbmd.getTables(t.getCatalogName(), t.getSchemaName(), t.getName(), null);
ResultSet rs = dbmd.getTables(cat, sch, t.getName(), null);
public static List findConflicting(Connection con, DDLStatement ddlStmt) throws SQLException { List conflicts = new ArrayList(); SQLObject so = ddlStmt.getObject(); Class clazz = so.getClass(); if (clazz.equals(SQLTable.class)) { SQLTable t = (SQLTable) so; DatabaseMetaData dbmd = con.getMetaData(); if (logg...
qualName.insert(0, rs.getString("TABLE_TYPE")); conflicts.add(qualName);
qualName.insert(0, rs.getString("TABLE_TYPE")+" "); conflicts.add(qualName.toString());
public static List findConflicting(Connection con, DDLStatement ddlStmt) throws SQLException { List conflicts = new ArrayList(); SQLObject so = ddlStmt.getObject(); Class clazz = so.getClass(); if (clazz.equals(SQLTable.class)) { SQLTable t = (SQLTable) so; DatabaseMetaData dbmd = con.getMetaData(); if (logg...
if (logger.isDebugEnabled()) logger.debug("Found conflicts: "+conflicts);
public static List findConflicting(Connection con, DDLStatement ddlStmt) throws SQLException { List conflicts = new ArrayList(); SQLObject so = ddlStmt.getObject(); Class clazz = so.getClass(); if (clazz.equals(SQLTable.class)) { SQLTable t = (SQLTable) so; DatabaseMetaData dbmd = con.getMetaData(); if (logg...
public static void dropConflicting(Connection con, List objectNames) throws SQLException {
public static void dropConflicting(Connection con, Collection objectNames) throws SQLException {
public static void dropConflicting(Connection con, List objectNames) throws SQLException { Iterator it = objectNames.iterator(); Statement stmt = null; try { while (it.hasNext()) { String objectName = (String) it.next(); stmt = con.createStatement(); stmt.executeUpdate("DROP "+objectName); } } finally...
propertiesToIgnore.add("zoomInAction"); propertiesToIgnore.add("zoomOutAction");
public void testAllSettersAreUndoable() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ArchitectException { SQLObject so = getSQLObjectUnderTest(); Set<String>propertiesToIgnore = new HashSet<String>(); propertiesToIgnore.add("populated"); propertie...
propertiesToIgnore.add("secondaryChangeMode");
propertiesToIgnore.add("secondaryChangeMode"); propertiesToIgnore.add("zoomInAction"); propertiesToIgnore.add("zoomOutAction");
public void testAllSettersGenerateEvents() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { SQLObject so = getSQLObjectUnderTest(); Set<String>propertiesToIgnore = new HashSet<String>(); propertiesToIgnore.add("populated"); propertiesToIgnore.add("S...
thumbnail = Thumbnail.createThumbnail( this, thumbnailFile );
protected void createThumbnail( Volume volume ) { // Find the original image to use as a staring point ImageInstance original = null; if ( instances == null ) { getInstances(); } for ( int n = 0; n < instances.size(); n++ ) { ImageInstance instance = (ImageInstance) instances.get( n ); if ( instance.get...
if (command == "Open Haplotype File" || command == "Open Linkage File"){
String shortHapInputFileName; if (command == "Open Linkage File"){
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open Haplotype File" || command == "Open Linkage File"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File inputFile = fc.getSelected...
File inputFile = fc.getSelectedFile(); if (command == "Open Linkage File"){ JFrame checkWindow = new JFrame(); CheckDataPanel checkPanel = new CheckDataPanel(inputFile); checkWindow.setTitle("Checking markers..."); checkWindow.add(checkPanel); checkWindow.add(new JButton("FOO")); checkWindow.pack(); checkWindow.setVis...
shortHapInputFileName = fc.getSelectedFile().getName();
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open Haplotype File" || command == "Open Linkage File"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File inputFile = fc.getSelected...
theData = new HaploData(inputFile); infileName = inputFile.getName(); progressMonitor = new ProgressMonitor(this, "Computing " + theData.getToBeCompleted() + " values of D prime","", 0, theData.getToBeCompleted()); progressMonitor.setProgress(0); progressMonitor.setMillisToDecideToPopup(2000); final SwingWorker work...
hapInputFileName = fc.getSelectedFile().getCanonicalPath();
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open Haplotype File" || command == "Open Linkage File"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File inputFile = fc.getSelected...
}catch (RuntimeException rtexec){ JOptionPane.showMessageDialog(this, "An error has occured. It is probably related to file format:\n"+rtexec.toString(), "Error", JOptionPane.ERROR_MESSAGE);
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open Haplotype File" || command == "Open Linkage File"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File inputFile = fc.getSelected...
}else if (command == "Export LD Picture to JPG"){
}else if (command == "Export LD Picture to PNG"){
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open Haplotype File" || command == "Open Linkage File"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File inputFile = fc.getSelected...
}else if (command == "Save Haplotypes to JPG"){
}else if (command == "Save Haplotypes to PNG"){
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command == "Open Haplotype File" || command == "Open Linkage File"){ fc.setSelectedFile(null); int returnVal = fc.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File inputFile = fc.getSelected...
"Four Gamete Rule",
void defineBlocks(){ String[] methodStrings = {"95% of informative pairwise comparisons show strong LD via confidence intervals (SFS)", "Solid block of strong LD via D prime (MJD)"}; JComboBox methodList = new JComboBox(methodStrings); JOptionPane.showMessageDialog(window, methodList, "Select...
checkPanel = new CheckDataPanel(theData);
checkPanel = new CheckDataPanel(theData, true);
void readGenotypes(String[] inputOptions, int type){ //input is a 3 element array with //inputOptions[0] = ped file //inputOptions[1] = info file ("" if none) //inputOptions[2] = max comparison distance (don't compute d' if markers are greater than this dist apart) //type is eithe...
checkPanel = new CheckDataPanel(theData);
checkPanel = new CheckDataPanel(theData, true);
void readMarkers(File inputFile, String[][] hminfo){ try { theData.prepareMarkerInput(inputFile, maxCompDist, hminfo); if (theData.infoKnown){ analysisItem.setEnabled(true); }else{ analysisItem.setEnabled(false); } if (check...
suite.addTestSuite(TestSQLColumn.class);
suite.addTest(TestSQLColumn.suite());
public static Test suite() { TestSuite suite = new TestSuite("Test for regress"); //$JUnit-BEGIN$ suite.addTestSuite(TestSQLDatabase.class); suite.addTestSuite(ArchitectExceptionTest.class); suite.addTestSuite(SaveLoadTest.class); suite.addTestSuite(PLDotIniTest.class); suite.addTestSuite(TestSQLColumn.class); ...
suite.addTestSuite(TestArchitectDataSource.class);
public static Test suite() { TestSuite suite = new TestSuite("Test for regress"); //$JUnit-BEGIN$ suite.addTestSuite(TestSQLDatabase.class); suite.addTestSuite(ArchitectExceptionTest.class); suite.addTestSuite(SaveLoadTest.class); suite.addTestSuite(PLDotIniTest.class); suite.addTestSuite(TestSQLColumn.class); ...
PhotoInfo photo2 = null; try { photo2 = PhotoInfo.retrievePhotoInfo( photo.getUid() ); } catch( PhotoNotFoundException e ) { fail( "Photo not storein into DB" ); } foundThumbnail = false; ImageInstance thumbnail2 = null; for ( int n = 0; n < instanceCount+1; n++ ) { ImageInstance instance = photo2.getInstance( n ); i...
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() ...
public Tag createTag() {
public Tag createTag(String name, Attributes attributes) {
public void doTag(XMLOutput output) throws Exception { invokeBody(output); if (name == null) { throw new MissingAttributeException("name"); } if (className == null) { throw new MissingAttributeException("className"); } Class theClass = null; try { ClassLoader classLoader = getClas...
public Tag createTag() {
public Tag createTag(String name, Attributes attributes) {
public Tag createTag() { return new DynamicBeanTag(beanClass, beanAttributes, varAttribute, invokeMethod); }
Context context = new Context();
JellyContext context = new JellyContext();
public void testArgs() throws Exception { InputStream in = getClass().getResourceAsStream( "testing123.jelly" ); XMLParser parser = new XMLParser(); Script script = parser.parse( in ); script = script.compile(); log.debug( "Found: " + script ); assertTrue( "Script i...
ArchitectSession.getInstance().addDriverJar(path);
ArchitectSessionImpl.getInstance().addDriverJar(path);
public void addDriverJarPath(String path) { ArchitectSession.getInstance().addDriverJar(path); }
SwingUtilities.invokeLater( new Runnable(){ public void run() { genoFileField.requestFocus(); } });
genoFileField.requestFocus(); genoFileField.dispatchEvent( new FocusEvent( genoFileField, FocusEvent.FOCUS_GAINED, false ) );
void load(int ft){ fileType = ft; JPanel contents = new JPanel(); contents.setLayout(new BoxLayout(contents, BoxLayout.Y_AXIS)); JPanel filePanel = new JPanel(); filePanel.setLayout(new BoxLayout(filePanel, BoxLayout.Y_AXIS)); JPanel topFilePanel = new JPanel(); JPan...
boolean startPDP = printDPrimeValues; boolean startPMN = printMarkerNames;
boolean startPD = printDPrimeValues; boolean startMN = printMarkerNames; int startZL = zoomLevel;
public BufferedImage export(int start, int stop, boolean compress){ forExport = true; exportStart = start; if (exportStart < 0){ exportStart = 0; } exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chromosome.getSize(); } ...
printDPrimeValues = startPDP; printMarkerNames = startPMN;
zoomLevel = startZL; printMarkerNames = startMN; printDPrimeValues = startPD;
public BufferedImage export(int start, int stop, boolean compress){ forExport = true; exportStart = start; if (exportStart < 0){ exportStart = 0; } exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chromosome.getSize(); } ...
this.computePreferredSize();
public BufferedImage export(int start, int stop, boolean compress){ forExport = true; exportStart = start; if (exportStart < 0){ exportStart = 0; } exportStop = stop; if (exportStop > Chromosome.getSize()){ exportStop = Chromosome.getSize(); } ...
logWriter = new PrintWriter(new FileWriter(USER_ACTIVITY_LOG_FILE_NAME, true));
File logDir = new File(CoreUtils.getLogDir()); logDir.mkdir(); File logFile = new File(logDir.getPath() + File.separatorChar + USER_ACTIVITY_LOG_FILE_NAME); logWriter = new PrintWriter(new FileWriter(logFile, true));
private UserActivityLogger(){ super(); activities = new Vector(); activityBuffer = new Vector(); /* Open the file to write, and set it to append all new entries */ try{ logWriter = new PrintWriter(new FileWriter(USER_ACTIVITY_LOG_FILE_NAME, ...
JButton closeButton = new JButton(closeAction);
JDefaultButton closeButton = new JDefaultButton(closeAction);
public void doStuff() { if (isCancelled()) return; // now implements Monitorable, so we can ask it how it's doing try { plExport.export(playpen.getDatabase()); // if the user requested, try running the PL Job afterwards if (plExport.getRunPLEngine()) { logger.debug("Running PL Engine"); File...
JButton closeButton = new JButton(closeAction);
JDefaultButton closeButton = new JDefaultButton(closeAction);
public void run() { try { final Process proc = Runtime.getRuntime().exec(commandLine.toString()); // Could in theory make this use ArchitectPanelBuilder, by creating // a JPanel subclass, but may not be worthwhile as it has both an // Abort and a Close button... final JDia...
context.removeVariable(var);
context.removeVariable( var.evaluateAsString(context) );
public void doTag(XMLOutput output) throws MissingAttributeException { if (var != null) { context.removeVariable(var); } else { throw new MissingAttributeException("var"); } }
public void setVar(String var) {
public void setVar(Expression var) {
public void setVar(String var) { this.var = var; }
if ( firstRun ) { firstRun = false; tag = findDynamicTag(context, (StaticTag) tag); }
tag = findDynamicTag(context, (StaticTag) tag);
public void run(JellyContext context, XMLOutput output) throws Exception { startNamespacePrefixes(output); Tag tag = getTag(); if ( firstRun ) { firstRun = false; // lets see if we have a dynamic tag tag = findDynamicTag(c...
}else if("I".equals(user.getStatus())){
}else if(User.STATUS_LOCKED.equals(user.getStatus())){
public void login(ServiceContext context, String username, String password) throws ServiceException{ LoginCallbackHandler callbackHandler = new LoginCallbackHandler(); callbackHandler.setUsername(username); callbackHandler.setPassword(password); ...
user.setStatus("I");
user.setStatus(User.STATUS_LOCKED);
public void login(ServiceContext context, String username, String password) throws ServiceException{ LoginCallbackHandler callbackHandler = new LoginCallbackHandler(); callbackHandler.setUsername(username); callbackHandler.setPassword(password); ...
logger.logActivity(username, user.getName()+" failed to login");
if(user != null) logger.logActivity(username, user.getName()+" failed to login");
public void login(ServiceContext context, String username, String password) throws ServiceException{ LoginCallbackHandler callbackHandler = new LoginCallbackHandler(); callbackHandler.setUsername(username); callbackHandler.setPassword(password); ...
rs.close(); rs = null;
public void populate() throws ArchitectException { if (populated) return; int oldSize = children.size(); synchronized (parent) { ResultSet rs = null; try { Connection con = ((SQLDatabase)parent).getConnection(); DatabaseMetaData dbmd = con.getMetaData(); con.setCatalog(catalogName); rs ...
JToolBar toolbar = new JToolBar(); String[] defaultZooms = { "12%", "25%", "50%", "100%", "Fit" }; JLabel zoomLabel = new JLabel( "Zoom" ); JComboBox zoomCombo = new JComboBox( defaultZooms ); zoomCombo.setEditable( true ); final PhotoViewer viewer = this; zoomCombo.addActionListener( new ActionListener() { public v...
public void createUI() { imageView = new PhotoView(); scrollPane = new JScrollPane( imageView ); scrollPane.setPreferredSize( new Dimension( 500, 500 ) ); add( scrollPane, BorderLayout.CENTER ); }
File f = new File("c:\\java\\photovault\\testfiles\\test1.jpg" ); try { BufferedImage bi = ImageIO.read(f); viewer.setImage( bi ); viewer.setScale( 0.3f ); System.out.println( "Succesfully loaded \""+ f.getPath() + "\"" ); } catch (IOException e ) { System.out.println( "Error loading image \""+ f.getPath() + "\"" );
PhotoInfo photo = null; if ( args.length == 2 ) { if ( args[0].equals( "-id" ) ) { try { int id = Integer.parseInt( args[1] ); System.err.println( "Getting photo " + id ); photo = PhotoInfo.retrievePhotoInfo( id ); viewer.setPhoto( photo ); } catch ( Exception e ) { System.err.println( e.getMessage() ); e.printStackTra...
public static void main( String args[] ) { JFrame frame = new JFrame( "PhotoInfoEditorTest" ); PhotoViewer viewer = new PhotoViewer(); frame.getContentPane().add( viewer, BorderLayout.CENTER ); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } );...
void setScale( float scale ) {
public void setScale( float scale ) {
void setScale( float scale ) { imageView.setScale(scale); }
protected TagScript createStaticTag( String namespaceURI, String localName, Attributes list ) throws SAXException {
protected TagScript createStaticTag( String namespaceURI, String localName, String qName, Attributes list ) throws SAXException {
protected TagScript createStaticTag( String namespaceURI, String localName, Attributes list ) throws SAXException { try { StaticTag tag = new StaticTag( namespaceURI, localName ); DynaTagScript script = new DynaTagScript( tag ); // now iterate thro...
StaticTag tag = new StaticTag( namespaceURI, localName );
StaticTag tag = new StaticTag( namespaceURI, localName, qName );
protected TagScript createStaticTag( String namespaceURI, String localName, Attributes list ) throws SAXException { try { StaticTag tag = new StaticTag( namespaceURI, localName ); DynaTagScript script = new DynaTagScript( tag ); // now iterate thro...
tagScript = createStaticTag( namespaceURI, localName, list );
tagScript = createStaticTag( namespaceURI, localName, qName, list );
public void startElement( String namespaceURI, String localName, String qName, Attributes list ) throws SAXException { // if this is a tag then create a script to run it // otherwise pass the text to the current body tagScript = createTag( namespaceURI, localName, list ); ...
Tag tag = null;
Tag tag;
public void run(JellyContext context, XMLOutput output) throws JellyTagException { try { startNamespacePrefixes(output); } catch (SAXException e) { throw new JellyTagException("could not start namespace prefixes",e); } Tag tag = null; try { tag = g...
Object value = null;
Object value;
public void run(JellyContext context, XMLOutput output) throws JellyTagException { try { startNamespacePrefixes(output); } catch (SAXException e) { throw new JellyTagException("could not start namespace prefixes",e); } Tag tag = null; try { tag = g...
if(expat.prefix!=null || expat.prefix.length()>0 && tag instanceof StaticTag)
if( expat.prefix != null && expat.prefix.length() > 0 && tag instanceof StaticTag ) {
public void run(JellyContext context, XMLOutput output) throws JellyTagException { try { startNamespacePrefixes(output); } catch (SAXException e) { throw new JellyTagException("could not start namespace prefixes",e); } Tag tag = null; try { tag = g...
}
public void run(JellyContext context, XMLOutput output) throws JellyTagException { try { startNamespacePrefixes(output); } catch (SAXException e) { throw new JellyTagException("could not start namespace prefixes",e); } Tag tag = null; try { tag = g...
assertFalse("year isNullable incorrect", yearCol.isNullable());
assertFalse("year isDefinitelyNullable incorrect", yearCol.isDefinitelyNullable());
public void testPopulateTable() throws ArchitectException { assertFalse("Table should not have been populated already", table.isPopulated()); table.populate(); assertTrue("Table should been populated", table.isPopulated()); // spot-check that expected columns exist SQLColumn yearCol, teamCol, strikeoutsCol; asse...
assertTrue("strikeouts isNullable incorrect", strikeoutsCol.isNullable());
assertTrue("strikeouts isDefinitelyNullable incorrect", strikeoutsCol.isDefinitelyNullable());
public void testPopulateTable() throws ArchitectException { assertFalse("Table should not have been populated already", table.isPopulated()); table.populate(); assertTrue("Table should been populated", table.isPopulated()); // spot-check that expected columns exist SQLColumn yearCol, teamCol, strikeoutsCol; asse...
addComponentListener(new ResizeListener());
public HaploView(){ //menu setup JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenuItem menuItem; //file menu JMenu fileMenu = new JMenu("File"); menuBar.add(fileMenu); menuItem = new JMenuItem(READ_GENOTYPES); setAccelerator(menuItem, 'O', ...
public String getRole() {
public String[] getRole() {
public String getRole() { return role; }
public void setRole(String role) {
public void setRole(String[] role) {
public void setRole(String role) { this.role = role; }
Object value = expression.evaluate(context);
Object value = null; if ( Expression.class.isAssignableFrom( dynaTag.getAttributeType(name) ) ) { value = expression; } else { value = expression.evaluate(context); }
public void run(JellyContext context, XMLOutput output) throws JellyTagException { try { startNamespacePrefixes(output); } catch (SAXException e) { throw new JellyTagException("could not start namespace prefixes",e); } Tag tag = null; try { ...
andMask &= StorableGenerator.PROPERTY_STATE_MASK << ((ordinal & 0xf) * 2);
andMask &= ~(StorableGenerator.PROPERTY_STATE_MASK << ((ordinal & 0xf) * 2));
generateAbstractClass(Class<S> storableClass, boolean isMaster) throws SupportException { EnumSet<MasterFeature> features; if (isMaster) { features = EnumSet.of(MasterFeature.VERSIONING, MasterFeature.UPDATE_FULL, ...
if (dPrimeTable.length == 0){ printDetails = false; }
public void paintComponent(Graphics g){ PairwiseLinkage[][] dPrimeTable = theData.filteredDPrimeTable; Vector blocks = theData.blocks; Rectangle visRect = getVisibleRect(); //deal with zooming if (chartSize.getWidth() > (3*visRect.width)){ showWM = true; }else{ ...
char markerChars[] = nfMarker.format(markerNums[z]+1).toCharArray();
char markerChars[] = nfMarker.format(Chromosome.realIndex[markerNums[z]]+1).toCharArray();
public void paintComponent(Graphics graphics) { if (filteredHaplos == null){ super.paintComponent(graphics); return; } Graphics2D g = (Graphics2D) graphics; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ...
OrderingList<S> unused = score.getUnusedOrdering(); if (unused.size() > 0) { for (OrderedProperty<S> prop : unused) { ChainedProperty<S> chainedProp = prop.getChainedProperty(); Tally tally = superKey.get(chainedProp); if (tally != null) { tally.increment(prop.getDirection()); } } }
private Result buildResult(Filter<S> filter, OrderingList<S> ordering) throws SupportException, RepositoryException { List<IndexedQueryAnalyzer<S>.Result> subResults; if (filter == null) { subResults = Collections.singletonList(mIndexAnalyzer.analyze(filter, ordering)); } e...
private List<Set<ChainedProperty<S>>> getKeys() {
private List<Set<ChainedProperty<S>>> getKeys() throws SupportException, RepositoryException {
private List<Set<ChainedProperty<S>>> getKeys() { StorableInfo<S> info = StorableIntrospector.examine(mIndexAnalyzer.getStorableType()); List<Set<ChainedProperty<S>>> keys = new ArrayList<Set<ChainedProperty<S>>>(); keys.add(stripOrdering(info.getPrimaryKey().getProperties())); for (Stor...
Collection<StorableIndex<S>> indexes = mRepoAccess.storageAccessFor(getStorableType()).getAllIndexes(); for (StorableIndex<S> index : indexes) { if (!index.isUnique()) { continue; } int propCount = index.getPropertyCount(); Set<ChainedProperty<S>> props = new HashSet<ChainedProperty<S>>(propCount); for (int i=0; i<p...
private List<Set<ChainedProperty<S>>> getKeys() { StorableInfo<S> info = StorableIntrospector.examine(mIndexAnalyzer.getStorableType()); List<Set<ChainedProperty<S>>> keys = new ArrayList<Set<ChainedProperty<S>>>(); keys.add(stripOrdering(info.getPrimaryKey().getProperties())); for (Stor...
} if (!result.getCompositeScore().getFilteringScore().hasAnyMatches()) { if (full == null) { full = result; }
splitIntoSubResults(Filter<S> filter, OrderingList<S> ordering) throws SupportException, RepositoryException { // Required for split to work. Filter<S> dnfFilter = filter.disjunctiveNormalForm(); Splitter splitter = new Splitter(ordering); RepositoryException e = dnfFilter....
ctrl.setView( this );
public PhotoInfoEditor( PhotoInfoController ctrl ) { super(); createUI(); this.ctrl = ctrl; }
System.err.println( "exception while saving" + e.getMessage() );
public void actionPerformed( ActionEvent evt ) { if ( evt.getActionCommand().equals( "save" ) ) { System.out.println( "Saving data" ); try { ctrl.save(); } catch ( Exception e ) { } } else if ( evt.getActionCommand().equals( "discard" ) ) { System.out.println( "Discarding data" ); ctrl.disc...
shootingDayDoc = shootingDayField.getDocument(); shootingDayDoc.addDocumentListener( this );
protected void createUI() { // Create the fields & their labels // Photographer field JLabel photographerLabel = new JLabel( "Photographer" ); photographerField = new JTextField( 30 ); photographerDoc = photographerField.getDocument(); photographerDoc.addDocumentListener( this ); // Shooting date field JLabel shoo...
ctrl.setField( changedField, newValue );
ctrl.viewChanged( this, changedField, newValue );
public void insertUpdate( DocumentEvent ev ) { Document changedDoc = ev.getDocument(); String changedField = null; Object newValue = null; if ( changedDoc == photographerDoc ) { changedField = PhotoInfoController.PHOTOGRAPHER; newValue = photographerField.getText(); System.err.println( "New photographer...
finally { if ( ! context.isCacheTags() ) { clearTag(); } }
public void run(JellyContext context, XMLOutput output) throws JellyTagException { try { startNamespacePrefixes(output); } catch (SAXException e) { throw new JellyTagException("could not start namespace prefixes",e); } Tag tag = null; try { ...
dPrimeDisplay.colorDPrime(currentScheme);
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...
out.println(CSVExport.toString(Arrays.asList(ProfileColumn.values())));
ProfileColumn[] columns = ProfileColumn.values(); out.println(CSVExport.toString(Arrays.asList(columns)));
public void format(OutputStream nout, List<ProfileResult> profileResult, ProfileManager pm) throws Exception { PrintWriter out = new PrintWriter(nout); // Print a header out.println(CSVExport.toString(Arrays.asList(ProfileColumn.values()))); DateFor...
DecimalFormat pctFormat = (DecimalFormat) new PercentRendererFactory().getFormat();
public void format(OutputStream nout, List<ProfileResult> profileResult, ProfileManager pm) throws Exception { PrintWriter out = new PrintWriter(nout); // Print a header out.println(CSVExport.toString(Arrays.asList(ProfileColumn.values()))); DateFor...
commonData.add(t.getParentDatabase().getName()); commonData.add(t.getName()); commonData.add(t.getCatalog() != null ? t.getCatalog().getName() : ""); commonData.add(t.getSchema() != null ? t.getSchema().getName() : ""); commonData.add(c.getName()); Date date = new Date(tpr.getCreateStartTime()); commonData.add(dateForm...
for ( ProfileColumn pc : columns ) { switch(pc) { case DATABASE: commonData.add(t.getParentDatabase().getName()); break; case CATALOG: commonData.add(t.getCatalog() != null ? t.getCatalog().getName() : ""); break; case SCHEMA: commonData.add(t.getSchema() != null ? t.getSchema().getName() : ""); break; case TABLE: comm...
public void format(OutputStream nout, List<ProfileResult> profileResult, ProfileManager pm) throws Exception { PrintWriter out = new PrintWriter(nout); // Print a header out.println(CSVExport.toString(Arrays.asList(ProfileColumn.values()))); DateFor...
createDatabase();
private JUnitOJBManager() { System.setProperty( "photovault.configfile", "conf/junittest_config.xml" ); log.error( "Initializing OB for JUnit tests" ); PhotovaultSettings settings = PhotovaultSettings.getSettings(); settings.setConfiguration( "pv_junit" ); PVDatabase db = settings.getDat...
makeOrdering(StorableTestBasic.class, "stringProp");
makeOrdering(StorableTestBasic.class, "-stringProp");
public void testIdentityAndRangeMatch() throws Exception { // These tests are not as exhaustive, as I don't expect the combination // of identity and ranges to interfere with each other. StorableIndex<StorableTestBasic> index; Filter<StorableTestBasic> filter; FilterValues<Storabl...
Connection con = null;
Connection con = null; Connection tCon = null;
public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { logger.debug("Starting export of tables: "+tablesToExport); finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set...
Connection tCon = target.getConnection();
tCon = target.getConnection();
public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { logger.debug("Starting export of tables: "+tablesToExport); finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set...
throw new ArchitectException("Could not find login for: " + repositoryDataSource.get(ArchitectDataSource.PL_UID));
throw new ArchitectException("There is no entry for \"" + repositoryDataSource.get(ArchitectDataSource.PL_UID) + "\" in the PL_USER table");
public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { logger.debug("Starting export of tables: "+tablesToExport); finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set...
Iterator cols = outputTable.getColumns().iterator(); while (cols.hasNext()) { SQLColumn outputCol = (SQLColumn) cols.next();
for (SQLColumn outputCol : outputTable.getColumns()) {
public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { logger.debug("Starting export of tables: "+tablesToExport); finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set...
outputTableNum++;
public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { logger.debug("Starting export of tables: "+tablesToExport); finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set...
logger.error("Couldn't close connection", e);
logger.error("Couldn't close repository connection", e); } try { if (tCon != null) tCon.close(); } catch (SQLException e) { logger.error("Couldn't close target connection", e);
public void export(List<SQLTable> tablesToExport) throws SQLException, ArchitectException { logger.debug("Starting export of tables: "+tablesToExport); finished = false; hasStarted = true; Connection con = null; try { currentDB = tablesToExport; // first, set...
sql.append(",").append(SQL.quote("Generated by POWER*Architect " + PL_GENERATOR_VERSION));
sql.append(",").append(SQL.quote("Generated by Power*Architect " + PL_GENERATOR_VERSION));
public void insertJobDetail(Connection con, int seqNo, String objectType, String objectName) throws SQLException { String status = "Unknown"; StringBuffer sql = new StringBuffer("INSERT INTO "); sql.append(DDLUtils.toQualifiedName(repositoryCatalog, repositorySchema, "JOB_DETAIL")); sql ...
String tagName,
TagScript tagScript,
public Expression createExpression( ExpressionFactory factory, String tagName, String attributeName, String attributeValue) throws Exception { ExpressionFactory myFactory = getExpressionFactory(); if (myFactory == null) { myFactory = factory; } ...
db.addVolume( volume );
try { db.addVolume( volume ); } catch (PhotovaultException ex) { ex.printStackTrace(); }
public void setUp() { String volumeRoot = "c:\\temp\\photoVaultVolumeTest"; volume = new Volume( "testVolume", volumeRoot ); PhotovaultSettings settings = PhotovaultSettings.getSettings(); db = settings.getCurrentDatabase(); db.addVolume( volume ); }
db.addVolume( extVolume );
try { db.addVolume( extVolume ); } catch (PhotovaultException ex) { fail( ex.getMessage() ); }
public void testGetVolumeOfFile() { try { File testVolPath = File.createTempFile( "pv_voltest", "" ); VolumeBase extVolume = new ExternalVolume( "extvol", testVolPath.getAbsolutePath() ); db.addVolume( extVolume ); File test1 = new File( volume.getBaseD...
int response = chooser.showSaveDialog(parent);
File file = null; SaveableFileType type; while ( true ) { int response = chooser.showSaveDialog(parent);
public void actionPerformed(ActionEvent e) { final List<ProfileResult> objectToSave = new ArrayList<ProfileResult>(); TableModelSortDecorator tmsd = (TableModelSortDecorator) viewTable.getModel(); ProfileTableModel model = (ProfileTableModel) tmsd.getTableModel(); if ( viewTable.getSelec...
if (response != JFileChooser.APPROVE_OPTION) { return; } File file = chooser.getSelectedFile(); final FileFilter fileFilter = chooser.getFileFilter(); final SaveableFileType type; String fileName = file.getName(); int x = fileName.lastIndexOf('.'); boolean gotType = false; SaveableFileType ntype = null; if (x != -1) { ...
if (response != JFileChooser.APPROVE_OPTION) {
public void actionPerformed(ActionEvent e) { final List<ProfileResult> objectToSave = new ArrayList<ProfileResult>(); TableModelSortDecorator tmsd = (TableModelSortDecorator) viewTable.getModel(); ProfileTableModel model = (ProfileTableModel) tmsd.getTableModel(); if ( viewTable.getSelec...
switch(type) {
switch(type2) {
public void actionPerformed(ActionEvent e) { final List<ProfileResult> objectToSave = new ArrayList<ProfileResult>(); TableModelSortDecorator tmsd = (TableModelSortDecorator) viewTable.getModel(); ProfileTableModel model = (ProfileTableModel) tmsd.getTableModel(); if ( viewTable.getSelec...
switch(type) {
switch(type2) {
public void run() { OutputStream out = null; try { ProfileFormat prf = null; out = new BufferedOutputStream(new FileOutputStream(file2)); switch(type) { case HTML: final String en...
columns.setSelectedIndex(index);
protected void editColumn(int index) throws ArchitectException { if (index < 0) { return; } try { changingColumns = true; SQLColumn col = model.getColumn(index); if (col.getSourceColumn() == null) { sourceDB.setText("None Specified"); sourceTableCol.setText("None Specified"); } else { StringBuf...
editColumn(0);
editColumn(columns.getSelectedIndex());
public void intervalRemoved(ListDataEvent e) { try { if (model.getColumns().size() == 0) { Component c = getParent(); while ( ! (c instanceof Window)) { c = c.getParent(); } c.setVisible(false); } else { editColumn(0); } } catch (ArchitectException ex) { JOptionPane.showMessageDialog(this,...
if ((zoomLevel == 0) && (!lastSelection.equals("")) && (!forExport)) { g2.setFont(boxFont); int last_descent = g2.getFontMetrics().getDescent(); int last_box_x = (visRect.x + LAST_SELECTION_LEFT) - 2; int last_box_y = (visRect.y - g2.getFontMetrics().getHeight() + LAST_SELECTION_TOP + last_descent) - 1 ; int last_box_...
if (lastSelection != null){ if ((zoomLevel == 0) && (!lastSelection.equals("")) && (!forExport)) { g2.setFont(boxFont); int last_descent = g2.getFontMetrics().getDescent(); int last_box_x = (visRect.x + LAST_SELECTION_LEFT) - 2; int last_box_y = (visRect.y - g2.getFontMetrics().getHeight() + LAST_SELECTION_TOP + last_...
public void paintComponent(Graphics g){ DPrimeTable dPrimeTable = theData.dpTable; if (Chromosome.getSize() < 2){ //if there zero or only one valid marker return; } Vector blocks = theData.blocks; Rectangle visRect = getVisibleRect(); //deal with zoomi...
if (whichMarker >= theTable.length-1) return 0;
public int getLength(int x){ //same as above but for the filtered dataset int whichMarker = Chromosome.realIndex[x]; for (int m = theTable[whichMarker].length+whichMarker; m > whichMarker; m--){ if (Chromosome.filterIndex[m] != -1){ //length of array is one greater tha...
fieldCtrl.setValue( view1, "View2" );
fieldCtrl.viewChanged( view1, "View2" );
public void testFieldModification() { view1.setField( "View1" ); // Generate a bbogus event to demonstrate that this should propagate to view2 but not to view1 fieldCtrl.setValue( view1, "View2" ); assertEquals( "View2 not changed by updating view1", "View2", view2.getField() ); assertEquals( "View1 should not be c...
output.append("<div id=\"" + getId() + "\">");
if(!context.isRefreshRequest()){ output.append("<div id=\"" + getId() + "\">"); }
public final String draw(DashboardContext context) { String applicationId = context.getWebContext().getApplicationConfig().getApplicationId(); StringBuffer output = new StringBuffer(); if(event != null){ output.append("<script>"); output.append("addEventHandler(''"...
output.append("</div>");
if(!context.isRefreshRequest()){ output.append("</div>"); }
public final String draw(DashboardContext context) { String applicationId = context.getWebContext().getApplicationConfig().getApplicationId(); StringBuffer output = new StringBuffer(); if(event != null){ output.append("<script>"); output.append("addEventHandler(''"...
if (single!=null) { if (single.booleanValue()==true) { if(value instanceof List) { List l = (List) value; if (l.size()==0) value=null; else value=l.get(0); } if(asString!=null && asString.booleanValue() && value instanceof Node) value = ((Node) value).getStringValue(); } else { if(! (value instanceof List) ) { List l =...
switch ( determineReturnType() ) { case RETURN_NODE_LIST: value = valueAsList(value); break; case RETURN_FIRST_NODE: value = valueAsSingle(value); break; case RETURN_STRING_LIST: value = nodeListToStringList(valueAsList(value)); break; case RETURN_DELIMITED_STRING_LIST: value = joinDelimitedElements(nodeListToStringLis...
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (var == null) { throw new MissingAttributeException( "var" ); } if (select == null) { throw new MissingAttributeException( "select" ); } Object xpathContext = getXPat...
if(asString) this.single = new Boolean(asString);
public void setAsString(boolean asString) { if(asString) this.single = new Boolean(asString); this.asString = new Boolean(asString); }
Object answer = null;
Object answer = taglibs.get(namespaceURI);
public TagLibrary getTagLibrary(String namespaceURI) { Object answer = null; if ( getInherit() && getParent() != null ) { answer = getParent().getTagLibrary( namespaceURI ); } if ( answer == null ) { answer = taglibs.get(namespaceURI); ...
if ( getInherit() && getParent() != null ) { answer = getParent().getTagLibrary( namespaceURI ); } if ( answer == null ) { answer = taglibs.get(namespaceURI);
if ( answer == null && parent != null ) { answer = parent.getTagLibrary( namespaceURI );
public TagLibrary getTagLibrary(String namespaceURI) { Object answer = null; if ( getInherit() && getParent() != null ) { answer = getParent().getTagLibrary( namespaceURI ); } if ( answer == null ) { answer = taglibs.get(namespaceURI); ...
return taglibs.containsKey( namespaceURI );
boolean answer = taglibs.containsKey( namespaceURI ); if (answer) { return true; } else if ( parent != null ) { return parent.isTagLibraryRegistered(namespaceURI); } else { return false; }
public boolean isTagLibraryRegistered(String namespaceURI) { return taglibs.containsKey( namespaceURI ); }