Package nl.lxtreme.ols.api.data

Examples of nl.lxtreme.ols.api.data.Cursor


   * @return <code>true</code> if the cursor with the given index is set,
   *         <code>false</code> otherwise.
   */
  protected boolean isCursorSet( final int aCursorIdx )
  {
    final Cursor cursor = getCursor( aCursorIdx );
    if ( cursor == null )
    {
      return false;
    }
    return cursor.isDefined();
  }
View Full Code Here


      final int dataLength = capturedData.getValues().length;
      if ( areCursorsEnabled() )
      {
        if ( isCursorSet( 0 ) )
        {
          final Cursor cursor1 = dataSet.getCursor( 0 );
          startOfDecode = capturedData.getSampleIndex( cursor1.getTimestamp() ) - 1;
        }
        if ( isCursorSet( 1 ) )
        {
          final Cursor cursor2 = dataSet.getCursor( 1 );
          endOfDecode = capturedData.getSampleIndex( cursor2.getTimestamp() ) + 1;
        }
      }
      else
      {
        startOfDecode = 0;
View Full Code Here

  private long getCursorJumpPosition( final long refTimestamp )
  {
    List<Cursor> cursors = new ArrayList<Cursor>( Arrays.asList( getSignalDiagramModel().getDefinedCursors() ) );
    Collections.sort( cursors, new CursorComparator() );

    Cursor foundCursor = null;
    for ( Cursor cursor : cursors )
    {
      long timestamp = cursor.getTimestamp();
      if ( this.direction.isLeft() )
      {
        if ( timestamp < refTimestamp )
        {
          foundCursor = cursor;
        }
        else
        {
          break;
        }
      }
      else
      {
        if ( timestamp > refTimestamp )
        {
          foundCursor = cursor;
          break;
        }
      }
    }

    if ( foundCursor != null )
    {
      return foundCursor.getTimestamp();
    }

    return -1L;
  }
View Full Code Here

          }
        }

        if ( model.isCursorMode() )
        {
          final Cursor hoveredCursor = findCursor( point );
          if ( hoveredCursor != null )
          {
            setMouseCursor( aEvent, CURSOR_MOVE_CURSOR );
            aEvent.consume();
          }
View Full Code Here

    if ( ( channel == null ) || !channel.isEnabled() )
    {
      return false;
    }

    Cursor selectedCursorA = ( Cursor )this.cursorA.getSelectedItem();
    if ( ( selectedCursorA != null ) && !selectedCursorA.isDefined() )
    {
      return false;
    }

    Cursor selectedCursorB = ( Cursor )this.cursorB.getSelectedItem();
    if ( ( selectedCursorB != null ) && !selectedCursorB.isDefined() )
    {
      return false;
    }

    if ( ( selectedCursorA != null ) && ( selectedCursorB != null ) )
View Full Code Here

        if ( ( this.signalMeasurerWorker == null ) || this.signalMeasurerWorker.isDone() )
        {
          this.indicator.setVisible( true );

          Channel channel = ( Channel )MeasurementView.this.measureChannel.getSelectedItem();
          Cursor cursorA = ( Cursor )MeasurementView.this.cursorA.getSelectedItem();
          Cursor cursorB = ( Cursor )MeasurementView.this.cursorB.getSelectedItem();

          this.signalMeasurerWorker = new SignalMeasurerWorker( channel, cursorA, cursorB );
          this.signalMeasurerWorker.execute();
        }
      }
View Full Code Here

        final boolean aIsSelected, final boolean aCellHasFocus )
    {
      String text;
      if ( ( aValue != null ) && ( aValue instanceof Cursor ) )
      {
        final Cursor cursor = ( Cursor )aValue;
        text = CursorFlagTextFormatter.getCursorFlagText( getSignalDiagramModel(), cursor, LabelStyle.LABEL_TIME );
      }
      else if ( aValue != null )
      {
        text = String.valueOf( aValue );
View Full Code Here

   *          the index of the cursor to retrieve the color for.
   * @return a cursor color, never <code>null</code>.
   */
  public Color getCursorColor( final int aCursorIndex )
  {
    final Cursor cursor = getSignalDiagramModel().getCursor( aCursorIndex );
    return cursor.getColor();
  }
View Full Code Here

   *          the style of the cursor flag text, cannot be <code>null</code>.
   * @return a cursor flag text, never <code>null</code>.
   */
  public String getCursorFlagText( final int aCursorIndex, final LabelStyle aStyle )
  {
    final Cursor cursor = getSignalDiagramModel().getCursor( aCursorIndex );
    return this.cursorFlagRender.getCursorFlagText( cursor, aStyle );
  }
View Full Code Here

   * @return the screen X-position of the cursor with the given index, or -1 if
   *         the cursor is not defined.
   */
  public int getCursorScreenCoordinate( final int aCursorIndex )
  {
    Cursor cursorTimestamp = getSignalDiagramModel().getCursor( aCursorIndex );
    if ( !cursorTimestamp.isDefined() )
    {
      return -1;
    }
    return timestampToCoordinate( cursorTimestamp.getTimestamp() );
  }
View Full Code Here

TOP

Related Classes of nl.lxtreme.ols.api.data.Cursor

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.