-
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.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.dua3.fx.util; | ||
|
||
import com.dua3.utility.logging.LogBuffer; | ||
import javafx.scene.Scene; | ||
import javafx.stage.Stage; | ||
|
||
/** | ||
* The FxLogWindow class represents a JavaFX window that displays log entries in a table view. | ||
* It extends the Stage class. | ||
*/ | ||
public class FxLogWindow extends Stage { | ||
|
||
private final LogBuffer logBuffer; | ||
private final FxLogPane logPane; | ||
|
||
/** | ||
* Create a new FxLogWindow instance with a new {@link LogBuffer} using the default capacity; | ||
*/ | ||
public FxLogWindow() { | ||
this(new LogBuffer()); | ||
} | ||
|
||
/** | ||
* Constructs a new instance of {@code FxLogWindow} with the specified maximum number of lines. | ||
* | ||
* @param maxLines the maximum number of lines to display in the log window | ||
*/ | ||
public FxLogWindow(int maxLines) { | ||
this(new LogBuffer(maxLines)); | ||
} | ||
|
||
/** | ||
* Constructs a new instance of {@code FxLogWindow} using the provided {@link LogBuffer}. | ||
* | ||
* @param logBuffer the LogBuffer to use | ||
*/ | ||
public FxLogWindow(LogBuffer logBuffer) { | ||
this.logBuffer = logBuffer; | ||
logPane = new FxLogPane(this.logBuffer); | ||
Scene scene = new Scene(logPane, 800, 400); | ||
setScene(scene); | ||
setTitle("Log"); | ||
} | ||
} |