Examples of Fold


Examples of com.asakusafw.vocabulary.operator.Fold

        }
        ShuffleKey foldKey = a.getParameterKey(0);
        if (foldKey == null) {
            a.error("畳み込み演算子の引数には@Key注釈によってグループ化項目を指定する必要があります");
        }
        Fold annotation = context.element.getAnnotation(Fold.class);
        if (annotation == null) {
            a.error("注釈の解釈に失敗しました");
            return null;
        }
        OperatorProcessorUtil.checkPortName(a, new String[] {
                annotation.outputPort(),
        });
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(FlowBoundary.SHUFFLE);
        builder.addAttribute(a.getObservationCount());
        builder.addAttribute(annotation.partialAggregation());
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(1),
                Fold.INPUT,
                a.getParameterType(1).getType(),
                1,
                foldKey);
        builder.addOutput(
                "畳み込みの結果",
                annotation.outputPort(),
                a.getParameterType(0).getType(),
                Fold.INPUT,
                0);
        for (int i = 2, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
View Full Code Here

Examples of com.headius.invokebinder.transform.Fold

     * @param function the function that will process the incoming arguments. Its
     *                 signature must match the current signature's arguments exactly.
     * @return a new Binder
     */
    public Binder fold(MethodHandle function) {
        return new Binder(this, new Fold(function));
    }
View Full Code Here

Examples of org.cspoker.external.pokersource.commands.poker.Fold

  public void fold() throws IllegalActionException, RemoteException {
    if(!isSittingIn) {
      throw new IllegalActionException("Can't act when not sitting in.");
    }
    try {
      conn.sendRemote(new Fold(serial, game_id));
    } catch (JSONException e) {
      throw new IllegalActionException(e);
    }
  }
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

        return folds;
    }

    private void getFolds(List<Fold> folds, RSyntaxTextArea area, Node node, Fold parent) {
        try {
            Fold passItOn = parent;
            int line = node.getPosition().getLine();
            if (line == -1)
                return; // nilnode...
            int offs = area.getLineStartOffset(line);

            // update parents end position...
            if (parent != null) {
                int pend = parent.getEndOffset();
                if (pend == Integer.MAX_VALUE || offs >= pend)
                    parent.setEndOffset(offs);
            }

            // Create new if needed...
            if (isFoldable(node)) {
                if (parent == null) {
                    passItOn = new Fold(FoldType.CODE, area, offs);
                    folds.add(passItOn);
                } else
                    passItOn = parent.createChild(FoldType.CODE, offs);
            }
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

    // TODO: Make cached getOffset() calls for Y_AXIS valid even for
    // folding, to speed this up!
    for (int i=0; i<line; i++) {
      y += getSpan(Y_AXIS, i);
      Fold fold = fm.getFoldForLine(i);
      if (fold!=null && fold.isCollapsed()) {
        i += fold.getCollapsedLineCount();
      }
    }

    childAllocation2(line, y, alloc);
    return alloc;
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

      if (y<curY+span) {
        childAllocation2(line-1, curY, alloc);
        return getView(line-1);
      }
      curY += span;
      Fold fold = fm.getFoldForLine(line-1);
      if (fold!=null && fold.isCollapsed()) {
        line += fold.getCollapsedLineCount();
      }
    }

    // Not found - return last line's view.
    childAllocation2(lineCount - 1, curY, alloc);
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

      if (tempRect.intersects(clip)) {
        View view = getView(i);
        drawView(g2d, alloc, view, fontHeight, tempRect.y+ascent);
      }
      tempRect.y += tempRect.height;
      Fold possibleFold = fm.getFoldForLine(i);
      if (possibleFold!=null && possibleFold.isCollapsed()) {
        i += possibleFold.getCollapsedLineCount();
        // Visible indicator of collapsed lines
        Color c = RSyntaxUtilities.getFoldedLineBottomColor(host);
        if (c!=null) {
          g.setColor(c);
          g.drawLine(x,tempRect.y-1, alloc.width,tempRect.y-1);
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

    int line = linesAbove;
//int count = 0;
    while (y<clip.y+clip.height+lineHeight && line<lineCount) {

      Fold fold = fm.getFoldForLine(line);
      Element lineElement = map.getElement(line);
      int startOffset = lineElement.getStartOffset();
      //int endOffset = (line==lineCount ? lineElement.getEndOffset()-1 :
      //              lineElement.getEndOffset()-1);
      int endOffset = lineElement.getEndOffset()-1; // Why always "-1"?
      h.paintLayeredHighlights(g2d, startOffset, endOffset,
                a, host, this);
 
      // Paint a line of text.
      token = document.getTokenListForLine(line);
      drawLine(token, g2d, x,y);

      if (fold!=null && fold.isCollapsed()) {

        // Visible indicator of collapsed lines
        Color c = RSyntaxUtilities.getFoldedLineBottomColor(host);
        if (c!=null) {
          g.setColor(c);
          g.drawLine(x,y+lineHeight-ascent-1,
              alloc.width,y+lineHeight-ascent-1);
        }

        // Skip to next line to paint, taking extra care for lines with
        // block ends and begins together, e.g. "} else {"
        do {
          int hiddenLineCount = fold.getLineCount();
          if (hiddenLineCount==0) {
            // Fold parser identified a zero-line fold region.
            // This is really a bug, but we'll be graceful here
            // and avoid an infinite loop.
            break;
          }
          line += hiddenLineCount;
          fold = fm.getFoldForLine(line);
        } while (fold!=null && fold.isCollapsed());

      }

      y += lineHeight;
      line++;
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

    protected Fold getClosestFold(RSyntaxTextArea textArea) {
      int offs = textArea.getCaretPosition();
      int line = textArea.getCaretLineNumber();
      FoldManager fm = textArea.getFoldManager();
      Fold fold = fm.getFoldForLine(line);
      if (fold==null) {
        fold = fm.getDeepestOpenFoldContaining(offs);
      }
      return fold;
    }
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.folding.Fold

    }

    public void actionPerformedImpl(ActionEvent e, RTextArea textArea) {
      RSyntaxTextArea rsta = (RSyntaxTextArea)textArea;
      if (rsta.isCodeFoldingEnabled()) {
        Fold fold = getClosestFold(rsta);
        if (fold!=null) {
          fold.toggleCollapsedState();
        }
        possiblyRepaintGutter(textArea);
      }
      else {
        UIManager.getLookAndFeel().provideErrorFeedback(rsta);
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.