Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Diffractometer
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
Gui
Diffractometer
Commits
af52784d
Commit
af52784d
authored
Jun 21, 2023
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
code readapted to changes in ProjectUtilities (SCAN-918)
parent
77c8c1cb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
capoeira/src/main/java/fr/soleil/gui/capoeira/Capoeira.java
+39
-34
39 additions, 34 deletions
capoeira/src/main/java/fr/soleil/gui/capoeira/Capoeira.java
with
39 additions
and
34 deletions
capoeira/src/main/java/fr/soleil/gui/capoeira/Capoeira.java
+
39
−
34
View file @
af52784d
...
...
@@ -36,7 +36,7 @@ import fr.soleil.lib.project.application.logging.LogbackUtils;
public
class
Capoeira
extends
Application
{
private
static
final
long
serialVersionUID
=
-
3959003027950888176
L
;
private
static
final
long
serialVersionUID
=
-
8547340813419757953
L
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
Capoeira
.
class
);
private
static
final
LogViewer
LOG_VIEWER
=
LogbackUtils
.
getConfiguredLogViewer
(
Capoeira
.
class
.
getName
(),
true
);
...
...
@@ -61,14 +61,13 @@ public class Capoeira extends Application {
private
DiffractometerBean
hklPanel
=
null
;
protected
CapoeiraModel
model
=
null
;
private
Preferences
prefs
=
Preferences
.
userNodeForPackage
(
Capoeira
.
class
);
/**
* This is the default constructor
*/
public
Capoeira
()
{
super
();
initialize
();
initialize
Capoeira
();
}
private
void
clearGUI
()
{
...
...
@@ -156,7 +155,7 @@ public class Capoeira extends Application {
*
* @return void
*/
private
void
initialize
()
{
private
void
initialize
Capoeira
()
{
this
.
initializeDocumentationMenu
();
this
.
getContentPane
().
setLayout
(
new
BorderLayout
());
...
...
@@ -198,43 +197,49 @@ public class Capoeira extends Application {
}
}
@Override
protected
Preferences
recoverPreferences
()
{
return
Preferences
.
userNodeForPackage
(
Capoeira
.
class
);
}
@Override
protected
void
savePreferences
()
{
if
(
this
.
prefs
!=
null
)
{
this
.
prefs
.
putInt
(
"state"
,
this
.
getExtendedState
());
this
.
setExtendedState
(
Frame
.
NORMAL
);
final
Rectangle
bounds
=
this
.
getBounds
();
this
.
prefs
.
putInt
(
"x"
,
(
int
)
bounds
.
getX
());
this
.
prefs
.
putInt
(
"y"
,
(
int
)
bounds
.
getY
());
this
.
prefs
.
putInt
(
"w"
,
(
int
)
bounds
.
getWidth
());
this
.
prefs
.
putInt
(
"h"
,
(
int
)
bounds
.
getHeight
());
this
.
getHklPanel
().
savePreferences
(
this
.
prefs
);
this
.
prefs
.
put
(
DIFFRACTOMETER_DEVICE
,
this
.
model
.
getDiffractometer
());
this
.
prefs
.
put
(
DIFFRACTOMETER_PREPARE_DEVICE
,
this
.
getHklPanel
().
getModel
());
// this.prefs.put(COMPTER_DEVICE, this.model.getCounter());
this
.
prefs
.
put
(
GAP_REFLEXION
,
this
.
model
.
getGap
().
toString
());
this
.
prefs
.
put
(
URL_DOCUMENTATION
,
this
.
model
.
getUrl
());
super
.
savePreferences
();
if
(
prefs
!=
null
)
{
prefs
.
putInt
(
"state"
,
this
.
getExtendedState
());
setExtendedState
(
Frame
.
NORMAL
);
Rectangle
bounds
=
this
.
getBounds
();
prefs
.
putInt
(
"x"
,
(
int
)
bounds
.
getX
());
prefs
.
putInt
(
"y"
,
(
int
)
bounds
.
getY
());
prefs
.
putInt
(
"w"
,
(
int
)
bounds
.
getWidth
());
prefs
.
putInt
(
"h"
,
(
int
)
bounds
.
getHeight
());
getHklPanel
().
savePreferences
(
prefs
);
prefs
.
put
(
DIFFRACTOMETER_DEVICE
,
this
.
model
.
getDiffractometer
());
prefs
.
put
(
DIFFRACTOMETER_PREPARE_DEVICE
,
this
.
getHklPanel
().
getModel
());
// prefs.put(COMPTER_DEVICE, model.getCounter());
prefs
.
put
(
GAP_REFLEXION
,
model
.
getGap
().
toString
());
prefs
.
put
(
URL_DOCUMENTATION
,
model
.
getUrl
());
}
}
@Override
protected
void
loadPreferences
()
{
if
(
this
.
prefs
!=
null
)
{
final
int
x
=
this
.
prefs
.
getInt
(
"x"
,
DEFAULT_WINDOW_X
);
final
int
y
=
this
.
prefs
.
getInt
(
"
y
"
,
DEFAULT_WINDOW_
Y
);
thi
s
.
s
et
Location
(
x
,
y
);
final
int
w
=
this
.
prefs
.
getInt
(
"w"
,
DEFAULT_WINDOW_WIDTH
);
final
int
h
=
this
.
prefs
.
getInt
(
"
h
"
,
DEFAULT_WINDOW_
HEIGHT
);
thi
s
.
s
et
Size
(
w
,
h
);
final
int
state
=
this
.
prefs
.
getInt
(
"state"
,
Frame
.
NORMAL
);
this
.
setExtendedState
(
state
);
this
.
getHklPanel
().
loadPreferences
(
this
.
prefs
);
final
double
gap
=
this
.
prefs
.
getDouble
(
GAP_REFLEXION
,
Double
.
NaN
);
this
.
model
.
setGap
(
gap
);
final
String
url
=
this
.
prefs
.
get
(
URL_DOCUMENTATION
,
DEFAULT_DOC_URL
);
this
.
model
.
setUrl
(
url
);
// getM
odel
()
.set
Diffractometer(prefs.get(DIFFRACTOMETER_DEVICE,"not
// initialized"));
super
.
loadPreferences
();
if
(
prefs
!=
null
)
{
final
int
x
=
prefs
.
getInt
(
"
x
"
,
DEFAULT_WINDOW_
X
);
final
int
y
=
pref
s
.
g
et
Int
(
"y"
,
DEFAULT_WINDOW_Y
);
setLocation
(
x
,
y
);
final
int
w
=
prefs
.
getInt
(
"
w
"
,
DEFAULT_WINDOW_
WIDTH
);
final
int
h
=
pref
s
.
g
et
Int
(
"h"
,
DEFAULT_WINDOW_HEIGHT
);
setSize
(
w
,
h
);
final
int
state
=
prefs
.
getInt
(
"state"
,
Frame
.
NORMAL
);
setExtendedState
(
state
);
getHklPanel
().
loadPreferences
(
prefs
);
final
double
gap
=
prefs
.
getDouble
(
GAP_REFLEXION
,
Double
.
NaN
);
model
.
setGap
(
gap
);
final
String
url
=
prefs
.
get
(
URL_DOCUMENTATION
,
DEFAULT_DOC_URL
);
m
odel
.
set
Url
(
url
);
//
getModel().setDiffractometer(prefs.get(DIFFRACTOMETER_DEVICE,"not
initialized"));
}
}
...
...
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