/** * 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() ); } }
if ( ( channel == null ) || !channel.isEnabled() )
/** * Returns whether or not this signal element is enabled. * * @return */ public boolean isEnabled() { if ( this.channel != null ) { return this.channel.isEnabled(); } else if ( this.group != null ) { if ( isGroupSummary() ) { return this.group.isShowGroupSummary(); } else if ( isAnalogSignal() ) { return this.group.isShowAnalogSignal(); } else { throw new InternalError( "Unknown signal element?! Type = " + this.type ); } } return false; }
if ( !channel.isEnabled() )