Package pedro.model

Examples of pedro.model.RecordModel


     * @param recordModelFactory
     * @param microscopeRecordModel
     */
    public void addObjectiveDetails( String n, String l, String m, final RecordModelFactory recordModelFactory, RecordModel microscopeRecordModel )
    {
      final RecordModel objectiveRecordModel = recordModelFactory.createRecordModel( "Objective_Details" ); //$NON-NLS-1$
      objectiveRecordModel.setValue( "name", n, false ); //$NON-NLS-1$
      objectiveRecordModel.setValue( "lensNA", l, false ); //$NON-NLS-1$
      objectiveRecordModel.setValue( "magnification", m, false ); //$NON-NLS-1$
      objectiveRecordModel.updateDisplayName();
     
      microscopeRecordModel.addChild( "Objective_Details", objectiveRecordModel, false ); //$NON-NLS-1$
    }
View Full Code Here


     * @param recordModelFactory
     * @param spotRecordModel
     */
    private void addTrack( final UniqueObject track, final RecordModelFactory recordModelFactory, RecordModel spotRecordModel )
    {
      final RecordModel trackRecordModel = recordModelFactory.createRecordModel( "Track" ); //$NON-NLS-1$
    trackRecordModel.setValue( "id",  track.getId(), false ); //$NON-NLS-1$
    trackRecordModel.setValue( "name",  track.getId(), false ); //$NON-NLS-1$
    trackRecordModel.updateDisplayName();
   
    spotRecordModel.addChild( "Track", trackRecordModel, false ); //$NON-NLS-1$
    spotRecordModel.updateDisplayName();
    }
View Full Code Here

     * @param recordModelFactory
     * @param spotRecordModel
     */
    private void addLaser( final Laser laser, final RecordModelFactory recordModelFactory, RecordModel spotRecordModel )
    {
      final RecordModel excitationMeasurementRecordModel = recordModelFactory.createRecordModel("Excitation_Measurement"); //$NON-NLS-1$
    excitationMeasurementRecordModel.setValue( "value", String.valueOf( laser.getPower() ), false ); //$NON-NLS-1$
    excitationMeasurementRecordModel.setValue( "unit", String.valueOf( "nM "), false ); //$NON-NLS-1$ //$NON-NLS-2$
    excitationMeasurementRecordModel.updateDisplayName();
   
    final RecordModel laserRecordModel = recordModelFactory.createRecordModel( "Laser" ); //$NON-NLS-1$
    laserRecordModel.setValue( "id",  laser.getId(), false ); //$NON-NLS-1$
    laserRecordModel.addChild( "Excitation_Measurement", excitationMeasurementRecordModel, false ); //$NON-NLS-1$
    laserRecordModel.updateDisplayName();
   
    final RecordModel excitationRecordModel = recordModelFactory.createRecordModel( "Excitation" ); //$NON-NLS-1$
    excitationRecordModel.addChild("Excitation_choices", laserRecordModel, false); //$NON-NLS-1$
    excitationRecordModel.updateDisplayName();
   
    spotRecordModel.addChild( "Excitation", excitationRecordModel, false ); //$NON-NLS-1$
    spotRecordModel.updateDisplayName();
    }
View Full Code Here

   * (non-Javadoc)
   * @see org.mcisb.pedro.beacon.ResultsParser#getFileInfoRecordModel()
   */
  protected RecordModel getFileInfoRecordModel()
  {
    final RecordModel fileInfoRecordModel = recordModelFactory.createRecordModel( "File_Info" ); //$NON-NLS-1$
   
    // Get the FileInfo
    final Element fileInfoElement = XmlUtils.getFirstElement( root, "File_Info" ); //$NON-NLS-1$

    if( fileInfoElement != null )
View Full Code Here

   * (non-Javadoc)
   * @see org.mcisb.pedro.beacon.ResultsParser#getTimeSeriesRecordModel()
   */
  protected RecordModel getTimeSeriesRecordModel()
  {
    final RecordModel timeSeriesRecordModel = recordModelFactory.createRecordModel( "ResultTimeSeries" ); //$NON-NLS-1$

    // Get the actual results timeseries
    final Element timeSeriesElement = XmlUtils.getFirstElement( root, "ResultTimeSeries" ); //$NON-NLS-1$
   
    if( timeSeriesElement != null )
    {
      final NodeList resultStates = timeSeriesElement.getElementsByTagName( "ResultState" ); //$NON-NLS-1$
       
        for( int i = 0; i < resultStates.getLength(); i++ )
        {
        final Element resultStateElement = (Element)resultStates.item( i );
        final RecordModel resultStateRecordModel = recordModelFactory.createRecordModel("ResultState"); //$NON-NLS-1$
       
        pedroUtils.addElement( resultStateElement, resultStateRecordModel, "TimeStamp" ); //$NON-NLS-1$
 
        // Cells at this Timestamp
        final NodeList cells = resultStateElement.getElementsByTagName( "Cell" ); //$NON-NLS-1$
       
        for( int j = 0; j < cells.getLength(); j++ )
        {
            final Element cellElement = (Element)cells.item( j );
            final RecordModel cellRecordModel = recordModelFactory.createRecordModel( "Cell" ); //$NON-NLS-1$
 
            pedroUtils.addElement( cellElement, cellRecordModel, "name" ); //$NON-NLS-1$
 
            // Cellular compartments
            final NodeList cellularCompartments = cellElement.getElementsByTagName( "CellularCompartment" ); //$NON-NLS-1$
           
            for( int k = 0; k < cellularCompartments.getLength(); k++ )
            {
            final Element cellularCompartmentElement = (Element)cellularCompartments.item( k );
            final RecordModel cellularCompartmentRecordModel = recordModelFactory.createRecordModel( "CellularCompartment" ); //$NON-NLS-1$
         
            pedroUtils.addElement( cellularCompartmentElement, cellularCompartmentRecordModel, "name" ); //$NON-NLS-1$
            pedroUtils.addElement( cellularCompartmentElement, cellularCompartmentRecordModel, "Centroid" ); //$NON-NLS-1$
   
            // Cell Properties
            final NodeList cellProperties = cellElement.getElementsByTagName( "CellProperty" ); //$NON-NLS-1$
           
            if( cellProperties != null )
            {
                for( int l = 0; l < cellProperties.getLength(); l++ )
                {
                final Element cellPropertyElement = (Element)cellProperties.item(l);
                final RecordModel cellPropertyRecordModel = recordModelFactory.createRecordModel( "CellProperty" ); //$NON-NLS-1$
               
                pedroUtils.addElement( cellPropertyElement, cellPropertyRecordModel, "property_name" ); //$NON-NLS-1$
                pedroUtils.addElements( cellPropertyElement, cellPropertyRecordModel, recordModelFactory, "Channel", Arrays.asList( new String[] { "channel_name", "channel_intensity" } ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     
                cellularCompartmentRecordModel.addChild( "CellProperty", cellPropertyRecordModel, false ); //$NON-NLS-1$
                cellularCompartmentRecordModel.updateDisplayName()
                }
            }
   
            // Polygon
            final Element polygon = XmlUtils.getFirstElement( cellularCompartmentElement, "Polygon" ); //$NON-NLS-1$
           
            if( polygon != null )
            {
              final Element exteriorElement = XmlUtils.getFirstElement( polygon, "exterior" ); //$NON-NLS-1$
              final Element linearRingElement = XmlUtils.getFirstElement( exteriorElement, "LinearRing" ); //$NON-NLS-1$
                final RecordModel linearRingRecordModel = recordModelFactory.createRecordModel( "LinearRing" ); //$NON-NLS-1$
               
                pedroUtils.addElement( linearRingElement, linearRingRecordModel, "coordinates" ); //$NON-NLS-1$
             
                final RecordModel exteriorRecordModel = recordModelFactory.createRecordModel( "exterior" ); //$NON-NLS-1$
                exteriorRecordModel.addChild( "LinearRing", linearRingRecordModel, false ); //$NON-NLS-1$
               
                final RecordModel polygonRecordModel = recordModelFactory.createRecordModel( "Polygon" ); //$NON-NLS-1$
                polygonRecordModel.addChild( "exterior", exteriorRecordModel, false ); //$NON-NLS-1$
               
                cellularCompartmentRecordModel.addChild( "Polygon", polygonRecordModel, false ); //$NON-NLS-1$
           
   
            cellRecordModel.addChild( "CellularCompartment", cellularCompartmentRecordModel, false ); //$NON-NLS-1$
View Full Code Here

    }
    PlasmidChannelMatchDialog pcmd = new PlasmidChannelMatchDialog();
    String[] channelNames = (String[])cnames.toArray(new String[cnames.size()]);
    String[] plasmidOrder = pcmd.getPlasmidOrder(channelNames, plasmidNames);

    final RecordModel analysisResultsRecordModel = recordModelFactory.createRecordModel("AnalysisResults");
    for (int i=0; i<ar.getAnalysedCell().size(); i++) {
      //for each analysed cell...
      AnalysedCell ac = ar.getAnalysedCell().get(i);
      RecordModel analysedCellRecordModel = recordModelFactory.createRecordModel("AnalysedCell");
      analysedCellRecordModel.setValue("CellName", ac.getCellName(), false);
      if (ac.getPreStimPeriod()!=null) {
        analysedCellRecordModel.setValue("PreStimPeriod", ac.getPreStimPeriod().toString(),false);
      }
      for (int j=0; j<ac.getAnalysedChannel().size(); j++) {
        //for each analysed channel...
        AnalysedChannel aCh = ac.getAnalysedChannel().get(j);
        RecordModel analysedChannelRecordModel = recordModelFactory.createRecordModel("AnalysedChannel");
        analysedChannelRecordModel.setValue("ChannelName", aCh.getChannelName(), false);
        analysedChannelRecordModel.setValue("PlasmidName", plasmidOrder[j], false);
        for (int k=0; k<aCh.getPeak().size(); k++) {
          //For each peak...
          org.mcisb.beacon.model.Peak peak =aCh.getPeak().get(k);
          RecordModel peakRecordModel = recordModelFactory.createRecordModel("Peak");
          peakRecordModel.setValue("time", Double.toString(peak.getTime()), false);
          peakRecordModel.setValue("value", Double.toString(peak.getValue()), false);
          peakRecordModel.updateDisplayName();
          analysedChannelRecordModel.addChild("Peak", peakRecordModel, false);
          analysedChannelRecordModel.updateDisplayName();
        }
        if (aCh.getMaxPeak()!=null) {
          analysedChannelRecordModel.setValue("MaxPeak", aCh.getMaxPeak().toString(), false);
View Full Code Here

TOP

Related Classes of pedro.model.RecordModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.