Skip to content

Commit

Permalink
more formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Starlight220 committed Feb 19, 2023
1 parent bca2e06 commit 24d3b55
Showing 1 changed file with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ final class TabGenerator {
public void start() {
// Make sure all tabs exist if they're defined, even if they're empty
NetworkTable rootMetaTable = inst.getTable(METADATA_TABLE_NAME);
tabsSubscriber = rootMetaTable.getStringArrayTopic(TABS_ENTRY_KEY).subscribe(new String[]{});
tabsSubscriber = rootMetaTable.getStringArrayTopic(TABS_ENTRY_KEY).subscribe(new String[] {});
tabsListener = inst.addListener(tabsSubscriber,
EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate), event -> {
for (String tabName : event.valueData.value.getStringArray()) {
tabs.getTab(tabName);
}
tabs.dirty();
});
});

metadataListener = inst.addListener(
new String[] {METADATA_TABLE_NAME + "/"},
EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate),
this::metadataChanged);
new String[] {METADATA_TABLE_NAME + "/"},
EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate),
this::metadataChanged);
dataListener = inst.addListener(
new String[] {ROOT_TABLE_NAME + "/"},
EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate),
this::dataChanged);
new String[] {ROOT_TABLE_NAME + "/"},
EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate),
this::dataChanged);
}

/**
Expand Down Expand Up @@ -276,10 +276,10 @@ private void updateStructure(List<String> hierarchy) {
private MappableSupplier<? extends DataSource<?>> sourceForPath(String path) {
Topic[] topics = inst.getTopics("/", NetworkTableType.kString.getValue());
Optional<String> customUri = Stream.of(topics)
.filter(t -> t.getName().equals(path + "/.ShuffleboardURI"))
.map(t -> inst.getEntry(t.getName()).getString(null))
.filter(Objects::nonNull)
.findFirst();
.filter(t -> t.getName().equals(path + "/.ShuffleboardURI"))
.map(t -> inst.getEntry(t.getName()).getString(null))
.filter(Objects::nonNull)
.findFirst();
if (customUri.isPresent()) {
return () -> SourceTypes.getDefault().forUri(customUri.get());
} else {
Expand Down Expand Up @@ -354,15 +354,15 @@ private Map<String, Object> properties(String realPath) {
private void updateWidget(ParentModel parent, String path) {
var sourceSupplier = sourceForPath(path);
WidgetModel widget = parent.getOrCreate(
path,
sourceSupplier,
preferredComponent(
path,
sourceSupplier
.map(source -> source.preferredWidget()
.or(() -> componentRegistry.defaultComponentNameFor(source.getDataType()))
)
.map(Optional::orElseThrow)
path,
sourceSupplier,
preferredComponent(
path,
sourceSupplier
.map(source -> source.preferredWidget()
.or(() -> componentRegistry.defaultComponentNameFor(source.getDataType()))
)
.map(Optional::orElseThrow)
),
properties(path));
setSizeAndPosition(path, widget);
Expand Down

0 comments on commit 24d3b55

Please sign in to comment.