Examples of Cursor


Examples of org.htmlparser.lexer.Cursor

     */
    public String toString ()
    {
        int startpos;
        int endpos;
        Cursor start;
        Cursor end;
        char c;
        StringBuffer ret;

        startpos = getStartPosition ();
        endpos = getEndPosition ();
        ret = new StringBuffer (endpos - startpos + 20);
        if (null == mText)
        {
            start = new Cursor (getPage (), startpos);
            end = new Cursor (getPage (), endpos);
            ret.append ("Txt (");
            ret.append (start);
            ret.append (",");
            ret.append (end);
            ret.append ("): ");
View Full Code Here

Examples of org.jdbf.engine.sql.Cursor

    }

    public static void main(String[] args) {
      try{
        SelectSample sample = new SelectSample();
        Cursor results = (Cursor)sample.selectAll("product");
        Product prod = (Product)results.first();
        String xml = prod.marshall();
        System.out.println("===== Marshall =====");
        System.out.println(xml);
        prod = (Product)Product.unmarshall(xml);
      System.out.println("===== UnMarshall =====");
View Full Code Here

Examples of org.lealone.dbobject.index.Cursor

        data.session = systemSession;
        meta = mainSchema.createTable(data);
        IndexColumn[] pkCols = IndexColumn.wrap(new Column[] { columnId });
        metaIdIndex = meta.addIndex(systemSession, "SYS_ID", 0, pkCols, IndexType.createPrimaryKey(false, false), true, null);

        Cursor cursor = metaIdIndex.find(systemSession, null, null);

        ArrayList<MetaRecord> records = New.arrayList();
        while (cursor.next()) {
            MetaRecord rec = new MetaRecord(cursor.get());
            objectIds.set(rec.getId());
            records.add(rec);
        }

        objectIds.set(0);
View Full Code Here

Examples of org.lwjgl.input.Cursor

      for(int l=0; l<cursorHeight; l++) {
        cursorImages.put(0xffffffff);
      }
    }
    cursorImages.flip();
    cursors[0] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
    // ----------------------------------

    // Create 3 piece animation
    // ==================================
    cursorImageCount = 3;
    cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
    cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
    for(int i=0; i<cursorImageCount; i++) {

      // make a colored square with a chocolate center
      int offColor = 0x00000000;
      int onColor = 0xffff0000;

      // change color according to cursor
      if(i == 1) {
        onColor = 0xff00ff00;
      } else if (i == 2) {
        onColor = 0xff0000ff;
      }

      // calculate size of center
      int centerSize  = (cursorWidth / 5) * (i + 1);
      int centerLeft  = cursorWidth / 2 - centerSize / 2;
      int centerRight = cursorWidth / 2 + centerSize / 2;

      // go!
      for(int j=0; j<cursorWidth; j++) {
        for(int l=0; l<cursorHeight; l++) {
          if(j >= centerLeft && j < centerRight && l >= centerLeft && l < centerRight) {
            cursorImages.put(offColor);
          } else {
            cursorImages.put(onColor);
          }
        }
      }
    }
    cursorDelays.put(2000).put(2000).put(2000);
    cursorDelays.flip();
    cursorImages.flip();

    cursors[1] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
    // ----------------------------------


    // Create a 20 piece animation
    // ==================================
    cursorImageCount = 20;
    cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
    cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer();
    cursorDelays.put(
                     new int[] {
                         100, 100, 100, 100, 100,
                        100, 100, 100, 100, 100,
                        100, 100, 100, 100, 100,
                        100, 100, 100, 100, 100
                     });

    float step = 0xffffffff / 20.0f;
    for(int i=0; i<cursorImageCount; i++) {
      for(int j=0; j<cursorWidth; j++) {
        for(int l=0; l<cursorHeight; l++) {
          cursorImages.put((int)step);
        }
      }
      step += step;
    }
    cursorImages.flip();
    cursorDelays.flip();
    cursors[2] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
    // ----------------------------------

    Mouse.setNativeCursor(cursors[0]);
  }
View Full Code Here

Examples of org.sdnplatform.sync.internal.Cursor

    @Override
    protected void handleCursorRequest(CursorRequestMessage request,
                                       Channel channel) {
        try {
            Cursor c = null;
            if (request.isSetCursorId()) {
                c = syncManager.getCursor(request.getCursorId());
            } else {
                c = syncManager.newCursor(request.getStoreName());
            }
            if (c == null) {
                throw new SyncException("Unrecognized cursor");
            }

            CursorResponseMessage m = new CursorResponseMessage();
            AsyncMessageHeader header = new AsyncMessageHeader();
            header.setTransactionId(request.getHeader().getTransactionId());
            m.setHeader(header);
            m.setCursorId(c.getCursorId());

            if (request.isClose()) {
                syncManager.closeCursor(c);
            } else {
                int i = 0;
                while (i < 50 && c.hasNext()) {
                    Entry<ByteArray, List<Versioned<byte[]>>> e = c.next();

                    m.addToValues(TProtocolUtil.getTKeyedValues(e.getKey(),
                                                                e.getValue()));
                    i += 1;
                }
View Full Code Here

Examples of org.simpleframework.transport.Cursor

   public void testNoFinalCRLF() throws Exception {
      byte[] data = SOURCE.getBytes("UTF-8");
      byte[] boundary = "mxvercagiykxaqsdvrfabfhfpaseejrg".getBytes("UTF-8");
      Allocator allocator = new ArrayAllocator();
      FileUploadConsumer consumer = new FileUploadConsumer(allocator, boundary, data.length);     
      Cursor cursor = new StreamCursor(data);
     
      while(!consumer.isFinished()) {
         consumer.consume(cursor);
     
      assertEquals(consumer.getBody().getContent(), SOURCE);
View Full Code Here

Examples of org.sonar.channel.CodeBuffer.Cursor

  @Override
  public boolean consume(CodeReader code, TokenQueue output) {
    if (code.popTo(matcher, tmpBuilder) > 0) {
      // see SONAR-2499
      Cursor previousCursor = code.getPreviousCursor();
      if (normalizationValue != null) {
        output.add(new Token(normalizationValue, previousCursor.getLine(), previousCursor.getColumn()));
      } else {
        output.add(new Token(tmpBuilder.toString(), previousCursor.getLine(), previousCursor.getColumn()));
      }
      // Godin: note that other channels use method delete in order to do the same thing
      tmpBuilder.setLength(0);
      return true;
    }
View Full Code Here

Examples of pivot.wtk.Cursor

    public void lockedChanged(SplitPane splitPane) {
        updateSplitterCursor();
    }

    private void updateSplitterCursor() {
        Cursor cursor = Cursor.DEFAULT;
        SplitPane splitPane = (SplitPane)getComponent();

        if (!splitPane.isLocked()) {
            switch (splitPane.getOrientation()) {
            case HORIZONTAL:
View Full Code Here

Examples of ponkOut.graphics.Cursor

  @Override
  public void init() {
    Lighting.init();
    Camera.init(new Vector3f(0.0f, 0.0f, posZ));

    cursor = new Cursor(new Color(0.4f, 0.5f, 1.0f), new Color(0.7f, 0.6f, 1.0f), 0.0f, 4.5f, -19.5f, 0.5f,
        goManager);
  }
View Full Code Here

Examples of state.classes.Cursor

  private Cursor cursor;

  public DrawingBoard() {
   
    cursor = new Cursor(this);
   
    this.setPreferredSize(new Dimension(1000, 1000));
        this.addMouseMotionListener(this); // Listen to mouse moves, drags.
        this.addMouseListener(this);
   
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.