Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
course-material
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
IT1901
course-material
Commits
35925edf
Commit
35925edf
authored
5 years ago
by
George Adrian Stoica
Browse files
Options
Downloads
Patches
Plain Diff
show both properties and tags in the editor
parent
dc7204df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Issue 11 allow user to enter and update metadata about the latlong points
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
simpleexample2/fxui/src/main/java/simpleex/ui/MetaDataEditorController.java
+51
-4
51 additions, 4 deletions
...i/src/main/java/simpleex/ui/MetaDataEditorController.java
with
51 additions
and
4 deletions
simpleexample2/fxui/src/main/java/simpleex/ui/MetaDataEditorController.java
+
51
−
4
View file @
35925edf
package
simpleex.ui
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
javafx.beans.property.SimpleStringProperty
;
import
javafx.beans.value.ObservableValue
;
import
javafx.event.ActionEvent
;
import
javafx.event.Event
;
import
javafx.event.EventType
;
...
...
@@ -10,9 +16,12 @@ import javafx.scene.control.TableColumn;
import
javafx.scene.control.TableView
;
import
javafx.scene.control.TextArea
;
import
javafx.scene.control.TextField
;
import
javafx.scene.control.TableColumn.CellDataFeatures
;
import
javafx.scene.layout.BorderPane
;
import
javafx.scene.layout.VBox
;
import
javafx.stage.Stage
;
import
javafx.util.Callback
;
import
javafx.util.Pair
;
import
simpleex.core.LatLong
;
import
simpleex.core.MetaData
;
import
simpleex.ui.tags.TagsBar
;
...
...
@@ -44,13 +53,13 @@ public class MetaDataEditorController {
private
TextArea
descriptionInput
;
@FXML
private
TableView
<
?
>
propertiesTableView
;
private
TableView
<
Pair
<
String
,
String
>
>
propertiesTableView
;
@FXML
private
TableColumn
<
?,
?
>
propertyNamesColumn
;
private
TableColumn
<
Pair
<
String
,
String
>,
String
>
propertyNamesColumn
;
@FXML
private
TableColumn
<
?,
?
>
propertyValuesColumn
;
private
TableColumn
<
Pair
<
String
,
String
>,
String
>
propertyValuesColumn
;
@FXML
private
TagsBar
tagsBar
;
...
...
@@ -58,6 +67,20 @@ public class MetaDataEditorController {
@FXML
private
Label
coordinatesLabel
;
@FXML
private
void
initialize
()
{
propertyNamesColumn
.
setCellValueFactory
(
cellData
->
new
SimpleStringProperty
(
((
Pair
<
String
,
String
>)
(
cellData
.
getValue
())).
getKey
()
));
propertyValuesColumn
.
setCellValueFactory
(
cellData
->
new
SimpleStringProperty
(
((
Pair
<
String
,
String
>)
(
cellData
.
getValue
())).
getValue
()
));
}
@FXML
void
onCancel
(
ActionEvent
event
)
{
closeDialog
(
event
);
...
...
@@ -93,7 +116,31 @@ public class MetaDataEditorController {
descriptionInput
.
setText
(
latlong
.
getMetaData
().
getProperty
(
MetaData
.
DESCRIPTION_PROPERTY
));
coordinatesLabel
.
setText
(
latlong
.
toString
());
//propertiesTableView.setItems(latlong.getMetaData().propertyNames());
MetaData
metaData
=
latlong
.
getMetaData
();
final
Iterator
<
String
>
propertyNames
=
metaData
.
propertyNames
();
Collection
<
Pair
<
String
,
String
>>
locationProperties
=
new
ArrayList
<
Pair
<
String
,
String
>>();
if
(
propertyNames
.
hasNext
())
{
while
(
propertyNames
.
hasNext
())
{
final
String
propertyName
=
propertyNames
.
next
();
if
((
propertyName
==
MetaData
.
NAME_PROPERTY
)
||
(
propertyName
==
MetaData
.
DESCRIPTION_PROPERTY
))
{
continue
;
}
else
{
Pair
<
String
,
String
>
p
=
new
Pair
<
String
,
String
>(
propertyName
,
metaData
.
getProperty
(
propertyName
));
locationProperties
.
add
(
p
);
}
}
propertiesTableView
.
getItems
().
addAll
(
locationProperties
);
}
final
Iterator
<
String
>
tags
=
metaData
.
tags
();
if
(
tags
.
hasNext
())
{
while
(
tags
.
hasNext
())
{
final
String
tag
=
tags
.
next
();
tagsBar
.
addTag
(
tag
);
}
}
}
...
...
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