Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ProjectUtilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Libraries
java
ProjectUtilities
Commits
ca0abf69
Commit
ca0abf69
authored
Jul 1, 2024
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
Added the possibility to customize Splash
parent
2dd70155
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ApplicationUtilities/src/main/java/fr/soleil/lib/project/application/Application.java
+33
-12
33 additions, 12 deletions
...n/java/fr/soleil/lib/project/application/Application.java
with
33 additions
and
12 deletions
ApplicationUtilities/src/main/java/fr/soleil/lib/project/application/Application.java
+
33
−
12
View file @
ca0abf69
...
@@ -55,7 +55,7 @@ import fr.soleil.lib.project.swing.panel.ImagePanel;
...
@@ -55,7 +55,7 @@ import fr.soleil.lib.project.swing.panel.ImagePanel;
*/
*/
public
abstract
class
Application
extends
FullScreenFrame
{
public
abstract
class
Application
extends
FullScreenFrame
{
private
static
final
long
serialVersionUID
=
-
6841781794087456496
L
;
private
static
final
long
serialVersionUID
=
6160764574607958515
L
;
private
static
MessageManager
messageManager
;
private
static
MessageManager
messageManager
;
protected
static
final
String
STATE
=
"state"
;
protected
static
final
String
STATE
=
"state"
;
...
@@ -88,42 +88,63 @@ public abstract class Application extends FullScreenFrame {
...
@@ -88,42 +88,63 @@ public abstract class Application extends FullScreenFrame {
* Creates a new {@link Application}.
* Creates a new {@link Application}.
*/
*/
public
Application
()
{
public
Application
()
{
this
(
null
,
true
);
this
(
null
,
null
,
true
);
}
}
/**
/**
* Creates a new {@link Application}, setting it splash icon.
* Creates a new {@link Application}, setting it
s
splash icon.
*
*
* @param imageIcon The splash icon.
* @param imageIcon The splash icon.
*/
*/
public
Application
(
ImageIcon
imageIcon
)
{
public
Application
(
ImageIcon
imageIcon
)
{
this
(
imageIcon
,
true
);
this
(
imageIcon
,
null
,
true
);
}
}
/**
/**
* Creates a new {@link Application}, setting it splash icon.
* Creates a new {@link Application}, setting it
s
splash icon.
*
*
* @param imageIcon The splash icon.
* @param imageIcon The splash icon.
* @param initialize Whether {@link #initialize()} should be called in this constructor.
* @param initialize Whether {@link #initialize()} should be called in this constructor.
* @param initialize Whether to immediately call {@link #initialize()} method.
*/
*/
protected
Application
(
ImageIcon
imageIcon
,
boolean
initialize
)
{
protected
Application
(
ImageIcon
imageIcon
,
boolean
initialize
)
{
this
(
imageIcon
,
null
,
initialize
);
}
/**
* Creates a new {@link Application}, setting its splash and splash icon.
*
* @param imageIcon The splash icon.
* @param splash The splash.
* @param initialize Whether to immediately call {@link #initialize()} method.
*/
protected
Application
(
ImageIcon
imageIcon
,
Splash
splash
,
boolean
initialize
)
{
super
();
super
();
messageManager
=
getMessageManager
(
getClass
().
getClassLoader
());
messageManager
=
getMessageManager
(
getClass
().
getClassLoader
());
prefs
=
recoverPreferences
();
prefs
=
recoverPreferences
();
if
(
splash
==
null
)
{
ImageIcon
icon
=
imageIcon
;
ImageIcon
icon
=
imageIcon
;
if
(
icon
==
null
)
{
if
(
icon
==
null
)
{
icon
=
getSplashImage
();
icon
=
getSplashImage
();
}
}
splash
=
new
Splash
(
icon
,
getSplashForeground
());
Splash
tmp
=
new
Splash
(
icon
,
getSplashForeground
());
setupSplash
(
tmp
);
this
.
splash
=
tmp
;
}
else
{
this
.
splash
=
splash
;
}
if
(
initialize
)
{
initialize
();
}
}
protected
void
setupSplash
(
Splash
splash
)
{
splash
.
initProgress
();
splash
.
initProgress
();
splash
.
setMaxProgress
(
getMaxProgress
());
splash
.
setMaxProgress
(
getMaxProgress
());
splash
.
setTitle
(
getApplicationTitle
());
splash
.
setTitle
(
getApplicationTitle
());
splash
.
setCopyright
(
getCopyright
());
splash
.
setCopyright
(
getCopyright
());
splash
.
progress
(
0
);
splash
.
progress
(
0
);
splash
.
setMessage
(
messageManager
.
getMessage
(
"Application.progressMessage0"
));
splash
.
setMessage
(
messageManager
.
getMessage
(
"Application.progressMessage0"
));
if
(
initialize
)
{
initialize
();
}
}
}
protected
Preferences
recoverPreferences
()
{
protected
Preferences
recoverPreferences
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment