-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(github): add kotlin and refactor lifecycle
- Loading branch information
Showing
73 changed files
with
499 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
visual-app/src/main/java/org/visual/app/api/HistoryRepository.java
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
visual-app/src/main/java/org/visual/app/command/CompileCommand.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
visual-app/src/main/java/org/visual/app/command/OpenCommand.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
visual-app/src/main/java/org/visual/app/command/PicoFactory.java
This file was deleted.
Oops, something went wrong.
45 changes: 19 additions & 26 deletions
45
visual-app/src/main/java/org/visual/app/command/VisualCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,37 @@ | ||
package org.visual.app.command; | ||
|
||
import com.google.common.util.concurrent.ServiceManager; | ||
import io.smallrye.mutiny.Uni; | ||
import io.avaje.inject.PostConstruct; | ||
import io.smallrye.mutiny.infrastructure.Infrastructure; | ||
import io.vertx.mutiny.core.net.NetClient; | ||
import jakarta.inject.Singleton; | ||
import javafx.application.Application; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.visual.app.context.DIContext; | ||
import org.visual.app.lifecycle.Lifecycle; | ||
import org.visual.app.util.SPI; | ||
import org.visual.app.view.VisualUI; | ||
import picocli.CommandLine; | ||
|
||
@CommandLine.Command( | ||
name = "Visual", | ||
mixinStandardHelpOptions = true, | ||
helpCommand = true, | ||
subcommands = {OpenCommand.class, CompileCommand.class}) | ||
import static io.smallrye.mutiny.Multi.createFrom; | ||
|
||
@Singleton | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class VisualCommand implements Runnable { | ||
private final String[] args; | ||
|
||
@Override | ||
public void run() { | ||
Uni.createFrom().item(DIContext.INSTANCE) | ||
.map((context) -> context.get(ServiceManager.class)) | ||
|
||
@PostConstruct | ||
void init() { | ||
createFrom() | ||
.iterable(SPI.load(Lifecycle.class)) | ||
.emitOn(Infrastructure.getDefaultExecutor()) | ||
.log() | ||
.invoke(ServiceManager::startAsync) | ||
.onItem() | ||
.invoke(Lifecycle::onStart) | ||
.subscribe().with(t -> { | ||
log.atInfo().log(t.toString()); | ||
}); | ||
DIContext.INSTANCE.get(NetClient.class) | ||
.connect(19090, "localhost") | ||
.subscribe().with(t -> { | ||
t.handler(buffer -> { | ||
log.atInfo().log(buffer.toString()); | ||
}); | ||
}) | ||
; | ||
Application.launch(VisualUI.class, args); | ||
} | ||
|
||
@Override | ||
public void run() { | ||
Application.launch(VisualUI.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
visual-app/src/main/java/org/visual/app/constant/PreferencesKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.visual.app.constant; | ||
|
||
public interface PreferencesKey { | ||
String STAGE_WIDTH = "stageWidth"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...rc/main/java/org/visual/api/ObjectDI.java → ...java/org/visual/app/context/ObjectDI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package org.visual.api; | ||
package org.visual.app.context; | ||
|
||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
visual-app/src/main/java/org/visual/app/context/TabContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.visual.app.context; | ||
|
||
import it.unimi.dsi.fastutil.objects.ObjectArrayList; | ||
import jakarta.inject.Singleton; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import java.util.List; | ||
|
||
@Singleton | ||
@Slf4j | ||
public class TabContext { | ||
|
||
private final List<String> tabs = new ObjectArrayList<String>(); | ||
|
||
public void add() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.