Examples of Alignment


Examples of align.Alignment

    Iterator<Alignment> rightIterator = rightAlignmentList.iterator();
    int leftSourceCharNr = 0;
    int leftTargetCharNr = 0;
    int rightSourceCharNr = 0;
    int rightTargetCharNr = 0;
    Alignment leftAlignment = null;
    Alignment rightAlignment = null;
    String leftMergedSourceSegment = null;
    String leftMergedTargetSegment = null;
    String rightMergedSourceSegment = null;
    String rightMergedTargetSegment = null;
   
    while(leftIterator.hasNext() && rightIterator.hasNext()) {
      //Przechodzi po obu tylko jeśli source i target są równe.
      //W przeciwnym wypadku przechodzi po tym co ma mniejsze source
      //a gdy są równe to target.
      boolean moveLeft = (leftSourceCharNr < rightSourceCharNr) ||
          (leftSourceCharNr == rightSourceCharNr &&
          leftTargetCharNr <= rightTargetCharNr);
      boolean moveRight = (leftSourceCharNr > rightSourceCharNr) ||
          (leftSourceCharNr == rightSourceCharNr &&
          leftTargetCharNr >= rightTargetCharNr);
      if (moveLeft) {
        leftAlignment = leftIterator.next();
        leftMergedSourceSegment =
            merger.merge(leftAlignment.getSourceSegmentList());
        leftMergedTargetSegment =
            merger.merge(leftAlignment.getTargetSegmentList());
        leftSourceCharNr += leftMergedSourceSegment.length();
        leftTargetCharNr += leftMergedTargetSegment.length();
      }
      if (moveRight) {
        rightAlignment = rightIterator.next();
        rightMergedSourceSegment =
            merger.merge(rightAlignment.getSourceSegmentList());
        rightMergedTargetSegment =
            merger.merge(rightAlignment.getTargetSegmentList());
        rightSourceCharNr += rightMergedSourceSegment.length();
        rightTargetCharNr += rightMergedTargetSegment.length();
      }
      if ((leftMergedSourceSegment.equals(rightMergedSourceSegment)) &&
          (leftMergedTargetSegment.equals(rightMergedTargetSegment))) {
View Full Code Here

Examples of align.data.Alignment

    Aligner aligner = new AlignerMock();   
    SimpleTask task =
      new SimpleTask(sourceSplitter, targetSplitter, aligner);
    List<Alignment> alignmentList = task.run("abcd", "efgh");
    assertEquals(1, alignmentList.size());
    Alignment alignment = alignmentList.get(0);
    assertListEquals(new String[]{"a", "b", "c", "d",},
        alignment.getSourceSegmentList());
    assertListEquals(new String[]{"ef", "gh",},
        alignment.getTargetSegmentList());
  }
View Full Code Here

Examples of boids.physics.Alignment

        //addComponent(new VBOModel2D(LINES, vertices, colors(color, 2)));
        addBehavior(ellipse(color, 16, 16, 10));
        addBehavior(new RigidBody());
       
        cohesion = new Cohesion(this, Boids.BOID_COHESION, IntensityModel.INVERSE);
        alignment = new Alignment(this, Boids.BOID_ALIGNMENT, IntensityModel.INVERSE);
        separation = new Cohesion(this, -Boids.BOID_SEPARATION, IntensityModel.INVERSE_SQUARE);
       
        pos.x = getCanvasWidth() * (float)Math.random();
        pos.y = getCanvasHeight() * (float)Math.random();
       
View Full Code Here

Examples of cbcb.kmulus.util.Alignment

      kmerLength = config.getInt(KMER_LEN_ATTR, DEF_KMER_LEN);
    }
   
    @Override
    protected LongWritable compareItems(Text a, Text b) {
      Alignment alignment;
     
      switch (compareType) {
      case LOCAL:
        alignment = LocalAlignment.getLocalAlignment(
          a, b, matchScore, mismatchScore, gapScore, gapExtScore);
        break;
       
      case GLOBAL:
        alignment = GlobalAlignment.getGlobalAlignment(
          a, b, matchScore, mismatchScore, gapScore);
        break;
       
      case KMER:
        // Drop through.
      default:
        alignment = KmerDistance.getKmerAlignment(a, b, kmerLength);
      }

      return new LongWritable(alignment.getDistance());
    }
View Full Code Here

Examples of com.google.gwt.layout.client.Layout.Alignment

    @Override
    public void update(final PTInstruction update, final UIService uiService) {
        if (update.containsKey(PROPERTY.HORIZONTAL_ALIGNMENT)) {
            final Widget w = asWidget(update.getLong(PROPERTY.WIDGET), uiService);
            final Alignment alignment = getAlignement(PROPERTY.HORIZONTAL_ALIGNMENT, update);
            uiObject.setWidgetHorizontalPosition(w, alignment);
        } else if (update.containsKey(PROPERTY.VERTICAL_ALIGNMENT)) {
            final Widget w = asWidget(update.getLong(PROPERTY.WIDGET), uiService);
            final Alignment alignment = getAlignement(PROPERTY.VERTICAL_ALIGNMENT, update);
            uiObject.setWidgetVerticalPosition(w, alignment);
        } else if (update.containsKey(PROPERTY.UNIT)) {
            final Widget w = asWidget(update.getLong(PROPERTY.WIDGET), uiService);
            final Unit unit = getUnit(update);
View Full Code Here

Examples of com.intellij.formatting.Alignment

    @Override
    protected List<Block> buildChildren() {
        List<Block> children = new ArrayList<Block>();
        int newLinesAfterLastField = 0;
        int newLinesAfterLastComment = 0;
        Alignment fieldAlignment = null;
        Alignment commentAlignment = null;
        boolean needAlignComment = isNodeOfType(myNode.getPsi(), ALIGN_COMMENT_STATEMENTS);

        // Whether there is a field definition in current line.
        // We should only align those comments that after a field definition.
        boolean fieldInCurrentLine = false;
View Full Code Here

Examples of com.puppetlabs.xtext.dommodel.formatter.css.Alignment

   * @param context
   */
  private void formatTokenInternal(StyleSet styleSet, IDomNode node, ITextFlow output, ILayoutContext context) {
    String text = styleSet.getStyleValue(TokenTextStyle.class, node, functions.textOfNode());

    Alignment alignment = styleSet.getStyleValue(AlignmentStyle.class, node);
    boolean verbatim = styleSet.getStyleValue(VerbatimStyle.class, node, Boolean.FALSE);
    final boolean defaultAlignment = alignment == null;
    if(defaultAlignment)
      alignment = Alignment.left;
    final int textLength = text.length();
View Full Code Here

Examples of com.vaadin.ui.Alignment

    private void populateLayout(Layout layout) {
        layout.setSizeFull();
        for (int i = 0; i < 9; i++) {
            Label l = new Label("M");
            Alignment a = alignments[i];
            l.setCaption(a.getHorizontalAlignment() + " "
                    + a.getVerticalAlignment() + " " + a.getBitMask());
            layout.addComponent(l);
            ((AlignmentHandler) layout).setComponentAlignment(l, a);
        }

    }
View Full Code Here

Examples of com.vaadin.ui.Alignment

        };

        layout.addComponent(first);
        layout.addComponent(second);

        Alignment alignment = Alignment.BOTTOM_RIGHT;
        layout.setComponentAlignment(first, alignment);
        layout.setComponentAlignment(second, Alignment.MIDDLE_CENTER);

        AbstractComponent replace = new AbstractComponent() {
        };
View Full Code Here

Examples of com.vaadin.ui.Alignment

        for (AlignmentInfo horizontal : new AlignmentInfo[] {
                AlignmentInfo.LEFT, AlignmentInfo.CENTER, AlignmentInfo.RIGHT }) {
            for (AlignmentInfo vertical : new AlignmentInfo[] {
                    AlignmentInfo.TOP, AlignmentInfo.MIDDLE,
                    AlignmentInfo.BOTTOM }) {
                Alignment a = new Alignment(horizontal.getBitMask()
                        + vertical.getBitMask());
                alignmentOptions.put(
                        a.getHorizontalAlignment() + " "
                                + a.getVerticalAlignment(), a);

            }

        }
        Command<Form, Alignment> footerComponentAlignmentCommand = new Command<Form, Alignment>() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.