Package k8.util

Examples of k8.util.LinkedList$Node


    this.top = (int) this.T[11] - HALFWIDTH;
    this.right = (int) this.T[3] + HALFWIDTH;
    this.bottom = (int) this.T[11] + HALFWIDTH;
   
    // Make a flat surface out of two Triangles
    Triangle triangle = new Triangle();
    triangle.setVertices(-Tile.HALFWIDTH , 0, Tile.HALFWIDTH,
        Tile.HALFWIDTH , 0, Tile.HALFWIDTH,
        Tile.HALFWIDTH, 0, -Tile.HALFWIDTH);
    triangle.setTexture(0, 1, 1, 1, 1, 0);
    triangle.setTexture(TileTexture.getInstance());
    this.add(triangle);

    triangle = new Triangle();
    triangle.setVertices(-Tile.HALFWIDTH, 0, Tile.HALFWIDTH,
        Tile.HALFWIDTH, 0, -Tile.HALFWIDTH,
        -Tile.HALFWIDTH, 0, -Tile.HALFWIDTH);
    triangle.setTexture(0, 1, 1, 0, 0, 0);
    triangle.setTexture(TileTexture.getInstance());
    this.add(triangle);
   
    Client.logger.info("tile at " + this.T[3] + ", " + this.T[11] + " - " + Tile.HALFWIDTH);
  }
View Full Code Here


    // Set the text scaling proportional to width
    textScale = layer.getWidth() / 5000;

    // Position
    position = new Text();
    position.setScale(textScale);
    position.moveRight(layer.getWidth() / 2);
    position.moveUp(0.001f);
    layer.add(position);

    // FPS Counter
    fps = new Text();
    fps.setScale(textScale);
    fps.moveRight(0.001f);
    fps.moveUp(0.001f);
    layer.add(fps);
   
View Full Code Here

  }

  /** Sets the depth */
  public void setDepth(float depth)
  {
    Camera camera = Camera.getInstance();
    float aspect = camera.getAspectRatio();
    int fov = camera.getFOV();
   
    this.depth = depth;
    this.width = (float) (depth * (fov / RadDeg));
    this.height = width / aspect;

View Full Code Here

    int h = Texture.nearestPower(height);
    if (h > maxSize)
      h = maxSize;

    // Get current glPixelStore state
    PixelStoreState pss = new PixelStoreState();

    // set pixel packing
    GL11.glPixelStorei(GL11.GL_PACK_ROW_LENGTH, 0);
    GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
    GL11.glPixelStorei(GL11.GL_PACK_SKIP_ROWS, 0);
    GL11.glPixelStorei(GL11.GL_PACK_SKIP_PIXELS, 0);

    ByteBuffer image;
    boolean done = false;

    if (w != width || h != height)
    {
      // Must rescale image to get "top" mipmap texture image
      image = BufferUtils.createByteBuffer((w + 4) * h * bpp);
     
      if (!Texture.gluScaleImage(format, width, height, type, data, w, h,
          type, image))
        done = true;

      /* set pixel unpacking */
      GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
      GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
      GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
      GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
    } else
    {
      image = data;
    }

    ByteBuffer bufferA = null;
    ByteBuffer bufferB = null;

    int level = 0;
    while (!done)
    {
      if (image != data)
      {
        /* set pixel unpacking */
        GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
        GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
        GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
        GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
      }

      GL11.glTexImage2D(target, level, components, w, h, 0, format, type,
          image);

      if (w == 1 && h == 1)
        break;

      final int newW = (w < 2) ? 1 : w >> 1;
      final int newH = (h < 2) ? 1 : h >> 1;

      final ByteBuffer newImage;

      if (bufferA == null)
        newImage = (bufferA = BufferUtils.createByteBuffer((newW + 4)
            * newH * bpp));
      else if (bufferB == null)
        newImage = (bufferB = BufferUtils.createByteBuffer((newW + 4)
            * newH * bpp));
      else
        newImage = bufferB;

      if (!Texture.gluScaleImage(format, w, h, type, image, newW, newH,
          type, newImage))
        done = true;

      image = newImage;
      if (bufferB != null)
        bufferB = bufferA;

      w = newW;
      h = newH;
      level++;
    }

    // Restore original glPixelStore state
    pss.save();
  }
View Full Code Here

    default:
      return false;
    }

    // Get glPixelStore state
    PixelStoreState pss = new PixelStoreState();

    // Unpack the pixel data and convert to floating point
    if (pss.unpackRowLength > 0)
      rowlen = pss.unpackRowLength;
    else
View Full Code Here

  /** Creates an instance of HUD */
  public HUD(float depth)
  {
    // Create the Layer
    layer = new Layer(depth);   

    // Set the text scaling proportional to width
    textScale = layer.getWidth() / 5000;

    // Position
View Full Code Here

    // create list for SortContainers...
    final LinkedList<SortContainer> scl = new LinkedList<SortContainer>();

    // walk through children...
    for (int i = 0; i < node.jjtGetNumChildren(); ++i) {
      Node n = node.jjtGetChild(i); // get current child

      boolean desc = false; // set order ASC as default

      // current node is Order node...
      if (n instanceof ASTAscOrder || n instanceof ASTDescOrder) {
        if (n instanceof ASTDescOrder) // reset order value to DESC...
          desc = true;

        i++; // increase counter to get next child (which is sort
        // condition)
      }

      n = node.jjtGetChild(i); // get next child (which is sort condition)

      // parse node with the filter...
      final SPARQLParserVisitorImplementationDumper filterDumper = new SPARQLParserVisitorImplementationDumper();
      final String sortString = n.accept(filterDumper);

      try {
        final SortContainer sc = new SortContainer(this.prefix, desc,
            sortString); // create SortContainer
View Full Code Here

  @SuppressWarnings("unchecked")
  public Object visit(final ASTTripleSet node, final Object data) {
    final Item[] item = { null, null, null };

    for (int i = 0; i < 3; i++) {
      final Node n = node.jjtGetChild(i);
      item[i] = lupos.sparql1_1.operatorgraph.SPARQLCoreParserVisitorImplementation.getItem(n);
    }

    final HashMap<Item, QueryRDFTerm> rdfHash = (HashMap<Item, QueryRDFTerm>) data;
View Full Code Here

    // if AST exists...
    if (debugViewerCreator!=null && debugViewerCreator instanceof SPARQLDebugViewerCreator
        && ((SPARQLDebugViewerCreator) debugViewerCreator).getAST() != null) {

      final Node ast = ((SPARQLDebugViewerCreator) debugViewerCreator).getAST(); // get AST

      // walk through first level children of AST...
      for (int i = 0; i < ast.jjtGetNumChildren(); ++i) {
        final Node child = ast.jjtGetChild(i); // get current child

        if (child instanceof ASTSelectQuery) {
          final ASTSelectQuery selectChild = (ASTSelectQuery) child;

          // SELECT is not the wildcard *...
          if (!selectChild.isSelectAll()) {
            // walk through select children...
            for (int j = 0; j < selectChild.jjtGetNumChildren(); ++j) {
              final Node selectChildChild = selectChild
              .jjtGetChild(j);

              // child of select is variable...
              if (selectChildChild instanceof ASTVar) {
                final ASTVar var = (ASTVar) selectChildChild;

                // add name of variable to order...
                if (!resultOrder.contains(var.getName())) {
                  resultOrder.add(var.getName());
                }
              } else if (selectChildChild instanceof ASTAs) {
                for (int j1 = 0; j1 < selectChildChild
                .jjtGetNumChildren(); ++j1) {
                  final Node selectChildChildChild = selectChildChild
                  .jjtGetChild(j1);
                  if (selectChildChildChild instanceof ASTVar) {
                    final ASTVar var = (ASTVar) selectChildChildChild;

                    // add name of variable to order...
View Full Code Here

        ret += "\n";
        final String orderByClause = " ORDER BY "
          + toBeSorted.toString() + "\n";
        boolean ORDERBYADDED = false;
        while (i < node.jjtGetNumChildren()) {
          final Node child = node.jjtGetChild(i);
          if (!ORDERBYADDED
              && (child instanceof ASTOrderConditions
                  || child instanceof ASTLimit || child instanceof ASTOffset)) {
            ORDERBYADDED = true;
            ret += orderByClause;
View Full Code Here

TOP

Related Classes of k8.util.LinkedList$Node

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.