/** * {@inheritDoc} */ @Override public int compareTo( final Channel aChannel ) { return ( this.index - aChannel.getIndex() ); }
/** * {@inheritDoc} */ @Override public int compareTo( final Channel aChannel ) { return this.index - aChannel.getIndex(); }
/** * @return */ private String getColorKey() { Integer groupIdx = Integer.valueOf( ( this.group.getIndex() % 4 ) + 1 ); // Issue #121: channel can be null for non-digital channels... if ( this.channel != null ) { Integer channelIdx = Integer.valueOf( ( this.channel.getIndex() % 8 ) + 1 ); return String.format( "ols.channelgroup%d.channel%d.default.color", groupIdx, channelIdx ); } return String.format( "ols.channelgroup%d.default.color", groupIdx ); }
@Override public Component getListCellRendererComponent( final JList aList, final Object aValue, final int aIndex, final boolean aIsSelected, final boolean aCellHasFocus ) { StringBuilder sb = new StringBuilder(); if ( ( aValue != null ) && ( aValue instanceof Channel ) ) { final Channel channel = ( Channel )aValue; sb.append( channel.getIndex() ); if ( channel.hasName() ) { sb.append( ", " ).append( channel.getLabel() ); } } return super.getListCellRendererComponent( aList, sb.toString(), aIndex, aIsSelected, aCellHasFocus ); } }
int v = ( aValue & channel.getMask() ) >> channel.getIndex(); aStream.print( this.colSeparator ); aStream.print( v );
/** * Creates a new {@link SignalMeasurerWorker} instance. * * @param aChannel * the channel to measure; * @param aCursorA * the cursor denoting the start of measurement; * @param aCursorB * the cursor denoting the end of measurement. */ public SignalMeasurerWorker( final Channel aChannel, final Cursor aCursorA, final Cursor aCursorB ) { this.index = aChannel.getIndex(); this.startTimestamp = aCursorA != null ? aCursorA.getTimestamp() : -1L; this.endTimestamp = aCursorB != null ? aCursorB.getTimestamp() : -1L; }
/** * Creates a new SignalHoverInfo instance. * * @param aElement * the signal element for which this object is created; * @param aRefTime * the time stamp of this hover, based on the mouse position. */ public MeasurementInfo( final SignalElement aElement, final double aRefTime ) { this.channelIdx = aElement.getChannel().getIndex(); this.channelLabel = aElement.getLabel(); this.rectangle = new Rectangle(); this.startTimestamp = null; this.transitionTimestamp = null; this.endTimestamp = null; this.refTime = aRefTime; this.totalTime = null; this.highTime = null; this.midSamplePos = null; this.hasTimingData = false; }
/** * Crafts a default channel name for use when a channel has no label set. * * @return a channel name, never <code>null</code>. */ private String getDefaultName() { int index = 0; String name = ""; if ( this.channel != null ) { index = this.channel.getIndex(); name = this.group.getName(); } else if ( this.group != null ) { index = this.group.getIndex(); name = this.group.getName(); } return String.format( "%s-%d", name, Integer.valueOf( index + 1 ) ); } }
/** * Returns the signal element that represents the digital channel with the * given index. * * @param aChannelIndex * the index of the channel to retrieve the corresponding signal * element for. * @return a signal element matching the given channel index, or * <code>null</code> if no such element was found. */ public SignalElement getDigitalSignalByChannelIndex( final int aChannelIndex ) { synchronized ( this.elements ) { for ( SignalElement element : this.elements ) { if ( element.isDigitalSignal() && ( element.getChannel().getIndex() == aChannelIndex ) ) { return element; } } } return null; }
/** * Creates a new {@link ChannelImpl} instance based on a given channel. * * @param aChannel * the channel to copy, cannot be <code>null</code>; * @param aRetainAnnotation * <code>true</code> if any annotations should be retained, * <code>false</code> otherwise. */ public ChannelImpl( final Channel aChannel, final boolean aRetainAnnotation ) { if ( aChannel == null ) { throw new IllegalArgumentException( "Channel cannot be null!" ); } this.propertyChangeSupport = new PropertyChangeSupport( this ); this.index = aChannel.getIndex(); this.mask = aChannel.getMask(); this.label = aChannel.hasName() ? aChannel.getLabel() : null; this.enabled = aChannel.isEnabled(); this.annotations = new CopyOnWriteArrayList<Annotation<?>>(); if ( aRetainAnnotation ) { this.annotations.addAll( aChannel.getAnnotations() ); } }
final double aSampleRate ) this.channelIdx = aElement.getChannel().getIndex(); this.channelLabel = aElement.getLabel();
final long aEndState, final double aRefState, final double aZoomFactor, final double aSampleRate ) this.channelIdx = aElement.getChannel().getIndex(); this.channelLabel = aElement.getLabel();
/** * Returns whether or not the given signal element is the current selected on * (by hovering the mouse over it). * * @param aElement * @param aModel * @return <code>true</code> if the given element is the selected element, * <code>false</code> otherwise. */ private boolean isSelectedElement( final IUIElement aElement, final ChannelLabelsViewModel aModel ) { if ( !( aElement instanceof SignalElement ) ) { return false; } SignalElement signalElement = ( SignalElement )aElement; return signalElement.isDigitalSignal() && ( aModel.getSelectedChannelIndex() == signalElement.getChannel().getIndex() ); }
if ( aElement.isDigitalSignal() && aModel.isShowChannelIndex() ) index = Integer.toString( aElement.getChannel().getIndex() );
&& ( aInitialValues[j].getIndex() == i ) )
newIndex = signalElement.getChannel().getIndex();