Package com.dmissoh.biologic.models

Examples of com.dmissoh.biologic.models.Sequence


    errorLabel.getParent().layout();
  }

  private void restoreSequenceData() {
    if (isReadOnly()) {
      Sequence sequence = getInputAsSequence();
      sequenceEditorTableViewer.setStartTime(TimeUtils
          .formatToTime(sequence.getStartTime()));
      sequence.setFamilies(ModelUtils.spitIntoFamilies(sequence));
    }
  }
View Full Code Here


    public String getColumnText(Object element, int columnIndex) {
      if (element instanceof String) {
        String logName = element.toString();

        Sequence sequence = restoreSequenceFromLog(getLogPathForName(logName));

        if(sequence != null){
          return sequence.getDescription();
        }

        int indexOfPrefix = logName.indexOf("log_") + 4;
        int indexOfSuffix = logName.indexOf(".log");
        String timeStr = logName
View Full Code Here

  private int ypos = (int) GraFixConstants.ySpan;

  @Override
  protected IFigure createFigure() {
    if (getModel() instanceof Sequence) {
      Sequence sequence = (Sequence) getModel();
      IFigure figure = new GraphFigure(sequence);
      return figure;
    }
    return null;
  }
View Full Code Here

   */
  @Override
  protected List<Event> getModelChildren() {
    List<Event> events = new ArrayList<Event>();
    if (getModel() instanceof Sequence) {
      Sequence sequence = (Sequence) getModel();
      long startTime = sequence.getStartTime();
      long endTime = sequence.getEndTime();
      calculateScale(startTime, endTime);

      List<Family> families = sequence.getFamilies();
      for (Family family : families) {

        incrementYPos();
        Color color = getColor();

View Full Code Here

   *
   * @param isLive
   *            the is live
   */
  private SequenceEditorInput(boolean isLive) {
    sequence = new Sequence(isLive);
  }
View Full Code Here

  }

  private void synchronizeSelection(IWorkbenchPart part) {
    if (part instanceof SequenceEditor) {
      SequenceEditor editor = (SequenceEditor) part;
      Sequence sequence = editor.getInputAsSequence();
      long startTime = sequence.getStartTime();
      String logName = "log_" + startTime + ".log";
      viewer.setSelection(new StructuredSelection(logName));
    }
  }
View Full Code Here

            .getLogFolderPath();
        String log = ((IStructuredSelection) event.getSelection())
            .getFirstElement().toString();
        String logPath = logFolderPath + File.separator + log;
        try {
          Sequence sequence = restoreSequenceFromLog(logPath);
          SequenceEditorInput input = new SequenceEditorInput(true,
              sequence.isLive());
          input.setSequence(sequence);
          PlatformUI.getWorkbench().getActiveWorkbenchWindow()
              .getActivePage().openEditor(input,
                  SequenceEditor.class.getName());
        } catch (PartInitException e) {
View Full Code Here

    return logFolderPath + File.separator + logName;
  }

  private Sequence restoreSequenceFromLog(String logPath) {
    File logFile = new File(logPath);
    Sequence sequence = null;
    if (logFile.exists()) {
      SequenceStoreObject sto = ExportUtils.getInstance()
          .restore(logPath);
      sequence = ExportUtils.getInstance().convertStoredToBusiness(sto);
    }
View Full Code Here

    storedSequence.setLive(sequence.isLive());
    return storedSequence;
  }

  public Sequence convertStoredToBusiness(SequenceStoreObject storedSequence) {
    Sequence sequence = new Sequence(false);
    sequence.setDescription(storedSequence.getDescription());
    sequence.setLogEntries(storedSequence.getLogEntries());
    sequence.setStartTime(storedSequence.getStartTime());
    sequence.setEndTime(storedSequence.getEndTime());
    sequence.setLive(storedSequence.isLive());
    return sequence;
  }
View Full Code Here

TOP

Related Classes of com.dmissoh.biologic.models.Sequence

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.