/** * Shows the reliability of all {@link CommDevice}s by drawing them in color * ranging from red (0% reliability) to green (100% reliability). For using * different colors see {@link #withReliabilityColors(RGB, RGB)}. * @return A new builder instance. */ @CheckReturnValue public Builder withReliabilityColors() { return create(this, ViewOptions.RELIABILITY_COLOR); }
/** * Shows the message counts for every {@link CommDevice} on the map. The * format for display is as follows: <code>XX(Y)</code> where * <code>XX</code> is the total number of received messages and * <code>Y</code> is the number of unread messages. * @return A new builder instance. */ @CheckReturnValue public Builder withMessageCount() { return create(this, ViewOptions.MSG_COUNT); }
/** * @return A new {@link Builder} for creating a {@link CommRenderer}. */ @CheckReturnValue public static Builder builder() { return Builder.create(); }
/** * Shows the reliability of all {@link CommDevice}s by drawing them in color * ranging from unreliable color (0% reliability) to reliable color (100% * reliability). For using the default colors red and green see * {@link #withReliabilityColors()}. * @param unreliable The color that will be used as the negative extreme. * @param reliable The color that will be used as the positive extreme. * @return A new builder instance. */ @CheckReturnValue public Builder withReliabilityColors(RGB unreliable, RGB reliable) { return create( copy(reliable), copy(unreliable), ImmutableSet.<ViewOptions>builder() .addAll(viewOptions()) .add(ViewOptions.RELIABILITY_COLOR) .build()); }
static Builder create(Builder b, ViewOptions opt) { return create(b.reliableColor(), b.unreliableColor(), ImmutableSet.<ViewOptions>builder() .addAll(b.viewOptions()) .add(opt) .build()); }
/** * Shows the reliability as a percentage for every {@link CommDevice} on the * map. * @return A new builder instance. */ @CheckReturnValue public Builder withReliabilityPercentage() { return create(this, ViewOptions.RELIABILITY_PERC); }
/** * Draws the toString() representation of the {@link CommUser} near its * location. * @return A new builder instance. */ @CheckReturnValue public Builder withToString() { return create(this, ViewOptions.TO_STRING); }
static Builder create() { return create(defaultReliableColor(), defaultUnreliableColor(), ImmutableSet.<ViewOptions>of()); } }