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
54537962
There was an error fetching the commit references. Please try again later.
Commit
54537962
authored
3 years ago
by
Matej Kovár
Browse files
Options
Downloads
Patches
Plain Diff
loading models to the project class (not only to the list of models)
parent
3dcc80d3
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/core/ProjectTopComp.java
+21
-20
21 additions, 20 deletions
...rc/main/java/cz/fidentis/analyst/core/ProjectTopComp.java
with
21 additions
and
20 deletions
GUI/src/main/java/cz/fidentis/analyst/core/ProjectTopComp.java
+
21
−
20
View file @
54537962
...
...
@@ -21,6 +21,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.swing.JOptionPane
;
import
javax.swing.filechooser.FileNameExtensionFilter
;
import
org.openide.filesystems.FileChooserBuilder
;
...
...
@@ -57,8 +58,6 @@ public final class ProjectTopComp extends TopComponent {
private
final
Project
project
;
private
Map
<
HumanFace
,
SingleFaceTab
>
singleFaceTabs
=
new
HashMap
<>();
private
Map
<
HumanFace
,
FaceToFaceTab
>
faceToFaceTabs
=
new
HashMap
<>();
private
java
.
awt
.
GridBagConstraints
gbc
;
private
int
lastY
;
/**
...
...
@@ -66,8 +65,6 @@ public final class ProjectTopComp extends TopComponent {
*/
public
ProjectTopComp
()
{
project
=
new
Project
();
lastY
=
0
;
gbc
=
new
java
.
awt
.
GridBagConstraints
();
initComponents
();
setName
(
Bundle
.
CTL_ProjectTopCompTopComponent
());
setToolTipText
(
Bundle
.
HINT_ProjectTopCompTopComponent
());
...
...
@@ -269,21 +266,23 @@ public final class ProjectTopComp extends TopComponent {
}
//GEN-LAST:event_addButton1MouseClicked
/**
*
TEMP. behavior, remove button will be removing selected secondary face later
* @param evt Removes
primary
face
*
Removes selected models from list and project
* @param evt Removes
selected
face
s
*/
private
void
removeButton1MouseClicked
(
java
.
awt
.
event
.
MouseEvent
evt
)
{
//GEN-FIRST:event_removeButton1MouseClicked
if
(
this
.
project
.
getPrimaryFace
()
!=
null
)
{
this
.
project
.
removePrimaryFace
();
}
javax
.
swing
.
table
.
DefaultTableModel
model
=
(
javax
.
swing
.
table
.
DefaultTableModel
)
jTable1
.
getModel
();
List
<
Integer
>
toDelete
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
model
.
getRowCount
();
i
++)
{
if
(
model
.
getValueAt
(
i
,
0
)
==
(
Object
)
true
)
{
toDelete
.
add
(
0
,
i
);}
}
toDelete
.
forEach
(
i
->
{
model
.
removeRow
(
i
);});
for
(
int
i
:
toDelete
)
{
HumanFace
face
=
this
.
project
.
getFaceByName
(
model
.
getValueAt
(
i
,
1
).
toString
());
this
.
project
.
removeFace
(
face
);
model
.
removeRow
(
i
);
}
}
//GEN-LAST:event_removeButton1MouseClicked
private
void
analyzeButton1MouseClicked
(
java
.
awt
.
event
.
MouseEvent
evt
)
{
//GEN-FIRST:event_analyzeButton1MouseClicked
...
...
@@ -378,14 +377,15 @@ public final class ProjectTopComp extends TopComponent {
ex
.
printStackTrace
();
}
this
.
project
.
setPrimaryFace
(
face
);
javax
.
swing
.
table
.
DefaultTableModel
model
=
(
javax
.
swing
.
table
.
DefaultTableModel
)
jTable1
.
getModel
();
String
name
=
face
.
getName
();
int
from
=
name
.
length
()
-
1
;
while
(
Character
.
valueOf
(
'\\'
).
compareTo
(
name
.
charAt
(
from
))
!=
0
)
{
from
--;}
name
=
name
.
substring
(
from
+
1
);
model
.
addRow
(
new
Object
[]{
false
,
name
});
createSingleFaceTab
(
face
,
name
);
String
name
=
face
.
getShortName
();
if
(
this
.
project
.
getFaceByName
(
name
)
==
null
)
{
this
.
project
.
addFace
(
face
);
model
.
addRow
(
new
Object
[]{
false
,
name
});
createSingleFaceTab
(
face
,
name
);
}
else
{
JOptionPane
.
showMessageDialog
(
this
,
"Model is already loaded"
);
}
}
}
...
...
@@ -443,8 +443,9 @@ public final class ProjectTopComp extends TopComponent {
ex
.
printStackTrace
();
}
this
.
project
.
setPrimaryFace
(
face1
);
this
.
project
.
setSecondaryFaces
(
List
.
of
(
face2
));
//this.project.setPrimaryFace(face1);
//this.project.addFace(face1);
this
.
project
.
setFaces
(
List
.
of
(
face1
,
face2
));
createFaceToFaceTab
(
face1
,
face2
,
"1:1"
);
}
}
...
...
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