Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Zellige-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IdA Public
Zellige-core
Merge requests
!25
Resolve "Display of program state on GUI"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Display of program state on GUI"
6-display-of-program-state-on-gui
into
dev
Overview
0
Commits
1
Pipelines
3
Changes
2
Merged
Céline TREBEAU
requested to merge
6-display-of-program-state-on-gui
into
dev
3 years ago
Overview
0
Commits
1
Pipelines
3
Changes
2
Expand
Closes
#6 (closed)
Edited
3 years ago
by
Céline TREBEAU
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
87a47939
1 commit,
3 years ago
2 files
+
23
−
48
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/main/java/fr/pasteur/ida/zellige/gui/MainAppFrame.java
+
23
−
0
Options
@@ -28,6 +28,8 @@
*/
package
fr.pasteur.ida.zellige.gui
;
import
ch.qos.logback.classic.LoggerContext
;
import
ch.qos.logback.classic.encoder.PatternLayoutEncoder
;
import
fr.pasteur.ida.zellige.steps.selection.exception.DataValidationException
;
import
javafx.application.Platform
;
import
javafx.embed.swing.JFXPanel
;
@@ -74,11 +76,32 @@ public class MainAppFrame extends JFrame
this
.
fxPanel
=
new
JFXPanel
();
this
.
add
(
this
.
fxPanel
);
this
.
setVisible
(
true
);
setLogStatus
();
// The call to runLater() avoid a mix between JavaFX thread and Swing
// thread.
Platform
.
runLater
(
this
::
initFX
);
}
/**
* Creates a new LogAppender to display the program state in the GUI.
*/
public
void
setLogStatus
()
{
LoggerContext
lc
=
(
LoggerContext
)
LoggerFactory
.
getILoggerFactory
();
PatternLayoutEncoder
ple
=
new
PatternLayoutEncoder
();
ple
.
setPattern
(
"%msg%n"
);
ple
.
setContext
(
lc
);
ple
.
start
();
LogAppender
appender
=
new
LogAppender
();
appender
.
setContext
(
lc
);
appender
.
start
();
ch
.
qos
.
logback
.
classic
.
Logger
logbackLogger
=
(
ch
.
qos
.
logback
.
classic
.
Logger
)
LoggerFactory
.
getLogger
(
Logger
.
ROOT_LOGGER_NAME
);
logbackLogger
.
addAppender
(
appender
);
}
public
<
T
extends
RealType
<
T
>
&
NativeType
<
T
>
>
void
initFX
()
{
// Init the root layout
Loading