Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
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
fidentis
Analyst WebApp
Commits
5d6b25ed
There was an error fetching the commit references. Please try again later.
Commit
5d6b25ed
authored
3 years ago
by
Daniel Sokol
Browse files
Options
Downloads
Patches
Plain Diff
Added temporary simple interface to check face with heatmap
parent
83a5a1eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/src/main/java/cz/fidentis/analyst/gui/TestInterface.java
+100
-0
100 additions, 0 deletions
GUI/src/main/java/cz/fidentis/analyst/gui/TestInterface.java
with
100 additions
and
0 deletions
GUI/src/main/java/cz/fidentis/analyst/gui/TestInterface.java
0 → 100644
+
100
−
0
View file @
5d6b25ed
package
cz.fidentis.analyst.gui
;
import
cz.fidentis.analyst.face.HumanFace
;
import
cz.fidentis.analyst.mesh.io.ModelFileFilter
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.io.File
;
import
java.io.IOException
;
/**
* @author Daniel Sokol
* <p>
* Temporary interface to test rendering heatmap.
*/
public
class
TestInterface
{
private
static
final
JFrame
testFrame
=
new
JFrame
();
private
static
HumanFace
comparedModel
;
public
static
void
main
(
String
[]
args
)
{
JButton
addButton
=
new
JButton
(
"Load face to compare"
);
JButton
compareButton
=
new
JButton
(
"Show differences"
);
Canvas
testCanvas
=
new
Canvas
();
ComparisonGLEventListener
colorListener
=
new
ComparisonGLEventListener
(
testCanvas
);
testCanvas
.
setListener
(
colorListener
);
JColorChooser
colorChooserMin
=
new
JColorChooser
(
Color
.
BLUE
);
JColorChooser
colorChooserMax
=
new
JColorChooser
(
Color
.
RED
);
JButton
color1
=
new
JButton
(
"Pick color for smallest distances"
);
JFrame
colorMinFrame
=
new
JFrame
();
colorMinFrame
.
add
(
colorChooserMin
);
colorMinFrame
.
pack
();
JButton
color2
=
new
JButton
(
"Pick color for largest distances"
);
JFrame
colorMaxFrame
=
new
JFrame
();
colorMaxFrame
.
add
(
colorChooserMax
);
colorMaxFrame
.
pack
();
addButton
.
addActionListener
(
e
->
{
try
{
JFileChooser
jFileChooser1
=
new
JFileChooser
();
jFileChooser1
.
setPreferredSize
(
new
Dimension
(
800
,
500
));
jFileChooser1
.
addChoosableFileFilter
(
new
ModelFileFilter
(
new
String
[]{
"obj"
,
"OBJ"
},
"*.obj"
));
jFileChooser1
.
showOpenDialog
(
testFrame
);
if
(
jFileChooser1
.
getSelectedFile
()
==
null
)
{
System
.
out
.
print
(
"No file chosen."
);
}
else
{
comparedModel
=
new
HumanFace
(
new
File
(
jFileChooser1
.
getSelectedFile
().
getPath
()));
colorListener
.
setComparedFace
(
comparedModel
);
addButton
.
setBackground
(
new
Color
(
50
,
200
,
20
));
}
}
catch
(
IOException
ioException
)
{
ioException
.
printStackTrace
();
}
}
);
compareButton
.
addActionListener
(
e
->
colorListener
.
compare
(
colorChooserMin
.
getColor
(),
colorChooserMax
.
getColor
()));
color1
.
addActionListener
(
e
->
colorMinFrame
.
setVisible
(
true
));
color2
.
addActionListener
(
e
->
colorMaxFrame
.
setVisible
(
true
));
testFrame
.
setLayout
(
new
GridBagLayout
());
testFrame
.
setVisible
(
true
);
testFrame
.
setSize
(
1200
,
700
);
GridBagConstraints
c
=
new
GridBagConstraints
();
c
.
fill
=
GridBagConstraints
.
BOTH
;
c
.
gridx
=
0
;
c
.
gridy
=
0
;
c
.
weighty
=
1
;
c
.
weightx
=
1
;
c
.
gridheight
=
6
;
c
.
gridwidth
=
4
;
c
.
weightx
=
4
;
testFrame
.
add
(
testCanvas
,
c
);
c
.
gridheight
=
1
;
c
.
gridwidth
=
2
;
c
.
gridx
=
4
;
c
.
weightx
=
2
;
testFrame
.
add
(
addButton
,
c
);
c
.
gridy
=
1
;
testFrame
.
add
(
compareButton
,
c
);
c
.
gridy
=
2
;
c
.
gridwidth
=
1
;
c
.
weightx
=
1
;
testFrame
.
add
(
color1
,
c
);
c
.
gridx
=
5
;
testFrame
.
add
(
color2
,
c
);
}
}
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