Examples of Chunk


Examples of com.lowagie.text.Chunk

  protected Chunk getChunk(Map attributes, String text, Locale locale)
  {
    // underline and strikethrough are set on the chunk below
    Font font = getFont(attributes, locale, false);

    Chunk chunk = new Chunk(text, font);
   
    if (hasUnderline(attributes))
    {
      // using the same values as sun.font.Fond2D
      chunk.setUnderline(null, 0, 1f / 18, 0, -1f / 12, 0);
    }
   
    if (hasStrikethrough(attributes))
    {
      // using the same thickness as sun.font.Fond2D.
      // the position is calculated in Fond2D based on the ascent, defaulting
      // to iText default position which depends on the font size
      chunk.setUnderline(null, 0, 1f / 18, 0, 1f / 3, 0);
    }

    Color backcolor = (Color)attributes.get(TextAttribute.BACKGROUND);
    if (backcolor != null)
    {
      chunk.setBackground(backcolor);
    }

    Object script = attributes.get(TextAttribute.SUPERSCRIPT);
    if (script != null)
    {
      if (TextAttribute.SUPERSCRIPT_SUPER.equals(script))
      {
        chunk.setTextRise(font.getCalculatedLeading(1f)/2);
      }
      else if (TextAttribute.SUPERSCRIPT_SUB.equals(script))
      {
        chunk.setTextRise(-font.getCalculatedLeading(1f)/2);
      }
    }

    if (splitCharacter != null)
    {
      //TODO use line break offsets if available?
      chunk.setSplitCharacter(splitCharacter);
    }

    return chunk;
  }
View Full Code Here

Examples of com.lowagie.text.Chunk

Date now = new Date();
System.out.println("date--> " + now);
DateFormat df = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
String s1 = df.format(now);
         
Chunk CONNECT = new Chunk(new LineSeparator(5.5f, 95, Color.BLUE, Element.ALIGN_CENTER, 3.5f));
  //  LineSeparator UNDERLINE =new LineSeparator(1, 100, null, Element.ALIGN_CENTER, -2);

//public HeaderFooter getMyHeader(String titulo) throws ServletException { 
//    Phrase p= new Phrase(); 
//    Chunk chunkTemp = new Chunk("My Company Name\n", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL); 
View Full Code Here

Examples of com.lowagie.text.Chunk

                } else if ("SEPERATOR_LINE".equals(questionType) || "SEPERATOR_TEXT".equals(questionType)) {
                    // not really a question; ingore completely
                } else {
                    value = surveyResponseAnswer.getString("textResponse");
                }
                Chunk chunk = new Chunk(surveyQuestion.getString("question") + ": " + value);
                Paragraph p = new Paragraph(chunk);
                document.add(p);
            }
            ByteBuffer outByteBuffer = ByteBuffer.wrap(baos.toByteArray());
            results.put("outByteBuffer", outByteBuffer);
View Full Code Here

Examples of com.meapsoft.Chunk

   
  double currentTime = 0.0;
   
  for (int i = 0; i < selectedChunks.size(); i++)
      {
    Chunk oldChunk = null;
    if(playFeatChunks)
        oldChunk = (FeatChunk)selectedChunks.elementAt(i);
    else
        oldChunk = (EDLChunk)selectedChunks.elementAt(i);
View Full Code Here

Examples of com.mojang.minecraft.render.Chunk

      int var2;
      int var4;
      for(var2 = 0; var2 < this.xChunks; ++var2) {
         for(int var3 = 0; var3 < this.yChunks; ++var3) {
            for(var4 = 0; var4 < this.zChunks; ++var4) {
               this.chunkCache[(var4 * this.yChunks + var3) * this.xChunks + var2] = new Chunk(this.level, var2 << 4, var3 << 4, var4 << 4, 16, this.baseListId + var1);
               this.loadQueue[(var4 * this.yChunks + var3) * this.xChunks + var2] = this.chunkCache[(var4 * this.yChunks + var3) * this.xChunks + var2];
               var1 += 2;
            }
         }
      }
View Full Code Here

Examples of com.sk89q.worldedit.world.chunk.Chunk

        errorChunks = new ArrayList<Vector2D>();

        // Now let's start restoring!
        for (Map.Entry<BlockVector2D, ArrayList<Vector>> entry : neededChunks.entrySet()) {
            BlockVector2D chunkPos = entry.getKey();
            Chunk chunk;

            try {
                chunk = chunkStore.getChunk(chunkPos, editSession.getWorld());
                // Good, the chunk could be at least loaded

                // Now just copy blocks!
                for (Vector pos : entry.getValue()) {
                    try {
                        BaseBlock block = chunk.getBlock(pos);
                        editSession.setBlock(pos, block);
                    } catch (DataException e) {
                        // this is a workaround: just ignore for now
                    }
                }
View Full Code Here

Examples of com.x5.template.Chunk

    return componentSet;
  }
 
  private void write(SortedMap<String, List<ArtemisTypeMapping>> mappedSystems, ColumnIndexMapping columnIndices) {
    Theme theme = new Theme();
    Chunk chunk = theme.makeChunk("matrix");
   
    List<ArtemisTypeMapping> mapping = new ArrayList<ArtemisTypeMapping>();
    for (Entry<String,List<ArtemisTypeMapping>> entry : mappedSystems.entrySet()) {
      mapping.add(new ArtemisTypeMapping(entry.getKey()));
      mapping.addAll(entry.getValue());
    }
   
    chunk.set("longestName", findLongestClassName(mappedSystems).replaceAll(".", "_") + "______");
   
    chunk.set("systems", mapping);
    chunk.set("headersComponents", columnIndices.componentColumns);
    chunk.set("componentCount", columnIndices.componentColumns.size());
    chunk.set("headersManagers", columnIndices.managerColumns);
    chunk.set("managerCount", columnIndices.managerColumns.size());
    chunk.set("headersSystems", columnIndices.systemColumns);
    chunk.set("systemCount", columnIndices.systemColumns.size());
    chunk.set("project", projectName);
   
    BufferedWriter out = null;
    try {
      out = new BufferedWriter(new FileWriter(output));
      chunk.render(out);
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      if (out != null) try {
        out.close();
View Full Code Here

Examples of de.lv.jvoxgl.world.Chunk

 
  public Block(World world, int id, int x, int y, int z) {
    super(world,x,y,z);
    this.setId(id);
   
    Chunk chunk = world.getChunkAt(x, z);
    int cx = (int) Math.floor((float)x/(float)world.getChunkWidth());
    int cz = (int) Math.floor((float)z/(float)world.getChunkDepth());
    if(chunk == null){
      chunk = new Chunk(world, cx, cz);
    }
    if(world.getBlockAt(x, y, z) == null)chunk.addBlock(this, Coordinates.WorldToChunkCoordinatesX(world, x), y, Coordinates.WorldToChunkCoordinatesZ(world, z));
  }
View Full Code Here

Examples of difflib.Chunk

    int count1 = 0;
    int count2 = 0;

    for (Delta delta : rev.getDeltas()) {
      Chunk orgChunk = delta.getOriginal();
      Chunk revChunk = delta.getRevised();

      while (count1 != orgChunk.getPosition()) {
        this.handler.match(this.text1.get(count1));
        count1++;
      }
      count1 = orgChunk.getPosition();
      count2 = revChunk.getPosition();

      if (delta instanceof InsertDelta) {
        while (count2 <= revChunk.last()) {
          this.handler.add(this.text2.get(count2));
          count2++;
        }

      } else if (delta instanceof DeleteDelta) {
        while (count1 <= orgChunk.last()) {
          this.handler.delete(this.text1.get(count1));
          count1++;
        }

      } else if (delta instanceof ChangeDelta) {
        while (count1 <= orgChunk.last()) {
          this.handler.delete(this.text1.get(count1));
          count1++;
        }
        while (count2 <= revChunk.last()) {
          this.handler.add(this.text2.get(count2));
          count2++;
        }

      }
      count1 = orgChunk.last() + 1;
      count2 = revChunk.last() + 1;
    }

    while (this.text2.size() > count2) {
      this.handler.match(this.text2.get(count2));
      count2++;
View Full Code Here

Examples of edu.umd.hooka.corpora.Chunk

    }else if (qName.equalsIgnoreCase("s")) {
      String s = tempVal.toString().trim();
      if (s.length() == 0) {
        System.err.println(pchunk.getName() + ": Empty segment for lang=" + lang);
      } else {
        Chunk c = new Chunk(tempVal.toString().trim());
        pchunk.addChunk(lang, c);
        chunkCount++;
        tempVal = null;
      }
    }else if (qName.equalsIgnoreCase("wordalignment")) {
      Chunk sc = pchunk.getChunk(langpair.getSource());
      if (sc == null)
        throw new RuntimeException("PChunk doesn't contain data for lang: " + langpair.getSource() + ".  Note: manual word alignment data must follow the chunk data.");
      Chunk tc = pchunk.getChunk(langpair.getTarget());
      if (tc == null)
        throw new RuntimeException("PChunk doesn't contain data for lang: " + langpair.getTarget() + ".  Note: manual word alignment data must follow the chunk data.");
      ReferenceAlignment r = new ReferenceAlignment(
          sc.getLength(),
          tc.getLength());
      r.addAlignmentPointsPharaoh(tempVal.toString().trim());
      pchunk.addReferenceAlignment(langpair, r);
      refAlignCount++;
      tempVal = null;
    }else if (qName.equalsIgnoreCase("pdoc")) {
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.