Examples of Chunk


Examples of Hexel.chunk.Chunk

    Set<Vector3i> loadedChunks = this.cVisMan.simulatedChunks;
    int minNextSimStep = Integer.MAX_VALUE;
    for (Vector3i pos : loadedChunks) {
      toUpdate.add(pos);
      Chunk chunk = BlockSimulator.this.chunks.getChunk(pos);
      minNextSimStep = Math.min(minNextSimStep, chunk.nextSimStep);
    }
    if (minNextSimStep == Integer.MAX_VALUE)
      LogData.set("minNextSim", Integer.MAX_VALUE);
    else
      LogData.set("minNextSim", (minNextSimStep - engine.time) + " " + minNextSimStep);

    do {
      deltas.clear();
      goAgain = false;
      for (Vector3i pos : toUpdate) {
        Chunk chunk = BlockSimulator.this.chunks.getChunk(pos);
        chunk.beingUpdated = true;
        simChunk(pos, deltas, step);
        if (chunk.nextSimStep == -1){
          goAgain = true;
        }
      }
      for (BlockDelta delta : deltas.values()) {
        BlockSimulator.this.chunks.setBlock(delta.x, delta.y, delta.z, delta.block, tmp3i, tmp2i, null);
        BlockSimulator.this.chunks.setStepsToSim(delta.x, delta.y, delta.z, delta.srcStepsToSim-1, tmp3i);
        if (delta.srcStepsToSim-1 > 0){
          tmp3i.x = (int) Math.floor(delta.x / 32.0);
          tmp3i.y = (int) Math.floor(delta.y / 16.0);
          tmp3i.z = (int) Math.floor(delta.z / 32.0);
          Chunk chunk = BlockSimulator.this.chunks.getChunk(tmp3i);
          if (!fastified.contains(chunk)){
            chunk.fastMode = true;
            fastified.add(chunk);
          }
        }
        delta.recycle();
      }
    } while (goAgain);

    for (Vector3i pos : toUpdate) {
      Chunk chunk = BlockSimulator.this.chunks.getChunk(pos);
      chunk.needFirstSim = false;
      chunk.beingUpdated = false;
    }
    for (Chunk chunk : fastified){
      chunk.fastMode = false;
View Full Code Here

Examples of br.com.caelum.tubaina.Chunk

        + "\n\n[center]Algum texto centralizado\n\nCom várias linhas[/center]\n\n");

    List<Chunk> chunks = chapters.get(0).getSections().get(0).getChunks();
    Assert.assertEquals(1, chunks.size());

    Chunk chunk = chunks.get(0);
    Assert.assertEquals(CenteredParagraphChunk.class, chunk.getClass());
    CenteredParagraphChunk castChunk = (CenteredParagraphChunk) chunk;
    Assert.assertEquals("Algum texto centralizado\n\nCom várias linhas", castChunk.getContent());
  }
View Full Code Here

Examples of ca.odell.glazedlists.impl.pmap.Chunk

    public void listChanged(ListEvent listChanges) {
        // write the change to disc
        try {
            ListEvent listChangesCopy = listChanges.copy();
            Bufferlo listChangesBytes = ListEventToBytes.toBytes(listChangesCopy, byteCoder);
            storage.put(new Integer(nextUpdateId), new Chunk(listChangesBytes));
            nextUpdateId++;

        } catch(IOException e) {
            throw new IllegalStateException(e.getMessage());
        }
View Full Code Here

Examples of com.chenlb.mmseg4j.Chunk

   * @return 返回规则过虑后的结果。
   * @author chenlb 2009-3-16 上午11:33:10
   */
  public List<Chunk> remainChunks() {
    for(Iterator<Chunk> it=chunks.iterator(); it.hasNext();) {
      Chunk chunk = it.next();
      if(isRemove(chunk)) {
        it.remove();
      }
    }
    return chunks;
View Full Code Here

Examples of com.itextpdf.text.Chunk

      if (content.trim().length() == 0 && content.indexOf(' ') < 0) {
        return;
      }
      content = HtmlUtilities.eliminateWhiteSpace(content);
    }
    Chunk chunk = createChunk(content);
    currentParagraph.add(chunk);
  }
View Full Code Here

Examples of com.lowagie.text.Chunk

    }
   
    private Phrase composePhrase(String text, BaseFont ufont, Color color, float fontSize) {
        Phrase phrase = null;
        if (extensionFont == null && (substitutionFonts == null || substitutionFonts.isEmpty()))
            phrase = new Phrase(new Chunk(text, new Font(ufont, fontSize, 0, color)));
        else {
            FontSelector fs = new FontSelector();
            fs.addFont(new Font(ufont, fontSize, 0, color));
            if (extensionFont != null)
                fs.addFont(new Font(extensionFont, fontSize, 0, color));
View Full Code Here

Examples of com.lowagie.text.Chunk

                    app.setGrayFill(0);
                else
                    app.setColorFill(textColor);
                app.beginText();
                for (int k = 0; k < phrase.size(); ++k) {
                    Chunk ck = (Chunk)phrase.get(k);
                    BaseFont bf = ck.getFont().getBaseFont();
                    app.setFontAndSize(bf, usize);
                    StringBuffer sb = ck.append("");
                    for (int j = 0; j < sb.length(); ++j) {
                        String c = sb.substring(j, j + 1);
                        float wd = bf.getWidthPoint(c, usize);
                        app.setTextMatrix(extraMarginLeft + start - wd / 2, offsetY - extraMarginTop);
                        app.showText(c);
View Full Code Here

Examples of com.lowagie.text.Chunk

            style &= ~Font.UNDERLINE;
            style &= ~Font.STRIKETHRU;
            f.setStyle(Font.UNDEFINED);
            f.setStyle(style);
        }
        Chunk space = new Chunk(" ", f);
        space.process(this);
        carriageReturn();
        leading = oldleading;
    }
View Full Code Here

Examples of com.lowagie.text.Chunk

                       addLine(line); // add empty line - all cells need some lines even if they are empty
                       line = new PdfLine(currentLeft, currentRight, alignment, currentLineLeading);
                    }
                    else {
                        for (Iterator j = chunks.iterator(); j.hasNext();) {
                            Chunk c = (Chunk) j.next();
                            chunk = new PdfChunk(c, (PdfAction) (allActions.get(aCounter++)));
                            while ((overflow = line.add(chunk)) != null) {
                                addLine(line);
                                line = new PdfLine(currentLeft, currentRight, alignment, currentLineLeading);
                                chunk = overflow;
                            }
                        }
                    }
                    // if the element is a paragraph, section or chapter, we reset the alignment and add the line
                    switch (element.type()) {
                        case Element.PARAGRAPH:
                        case Element.SECTION:
                        case Element.CHAPTER:
                            line.resetAlignment();
                            flushCurrentLine();
                    }
            }
        }
        flushCurrentLine();
        if (lines.size() > cell.getMaxLines()) {
            while (lines.size() > cell.getMaxLines()) {
                removeLine(lines.size() - 1);
            }
            if (cell.getMaxLines() > 0) {
                String more = cell.getShowTruncation();
                if (more != null && more.length() > 0) {
                    // Denote that the content has been truncated
                    lastLine = (PdfLine) lines.get(lines.size() - 1);
                    if (lastLine.size() >= 0) {
                        PdfChunk lastChunk = lastLine.getChunk(lastLine.size() - 1);
                        float moreWidth = new PdfChunk(more, lastChunk).width();
                        while (lastChunk.toString().length() > 0 && lastChunk.width() + moreWidth > right - left) {
                            // Remove characters to leave room for the 'more' indicator
                            lastChunk.setValue(lastChunk.toString().substring(0, lastChunk.length() - 1));
                        }
                        lastChunk.setValue(lastChunk.toString() + more);
                    } else {
                        lastLine.add(new PdfChunk(new Chunk(more), null));
                    }
                }
            }
        }
        // we set some additional parameters
View Full Code Here

Examples of com.lowagie.text.Chunk

        if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) {
            left = right - image.getScaledWidth();
        } else if ((image.getAlignment() & Image.MIDDLE) == Image.MIDDLE) {
            left = left + ((right - left - image.getScaledWidth()) / 2f);
        }
        Chunk imageChunk = new Chunk(image, left, 0);
        imageLine.add(new PdfChunk(imageChunk, null));
        addLine(imageLine);
        return imageLine.height();
    }
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.