-
Notifications
You must be signed in to change notification settings - Fork 0
MainView materialfx #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Anastasia-Nikitina
wants to merge
72
commits into
filter-panel
Choose a base branch
from
main-view-materialfx
base: filter-panel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MainView materialfx #190
Changes from 67 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
907069b
\added materialfx dialogs and fixed some bugs
Anastasia-Nikitina d899297
removed commented code
Anastasia-Nikitina d8cd2ff
added new style constants
Anastasia-Nikitina d6f3da0
added panels
Anastasia-Nikitina 92dbf3a
removed unused
Anastasia-Nikitina 5bf682c
added borderpane and spaces
Anastasia-Nikitina 50fc61a
added importAction
Anastasia-Nikitina 8173d44
spaces and added paddingAll
Anastasia-Nikitina 8b47503
fixes
Anastasia-Nikitina 642865e
removed unused
Anastasia-Nikitina c4726fd
added grid tab
Anastasia-Nikitina b054f53
removed grid button
Anastasia-Nikitina 75133ac
removed unused
Anastasia-Nikitina 1f44155
added correct icons
Anastasia-Nikitina 9176b58
by inject()
Anastasia-Nikitina 222fe0c
Just an automaticly formatted codestyle
mi-sts fc66c14
Wildcards fix
mi-sts e110d27
added materialfx dialogs and fixed some bugs
Anastasia-Nikitina 9fcc802
removed commented code
Anastasia-Nikitina c56eed7
added new style constants
Anastasia-Nikitina 2edfa45
added panels
Anastasia-Nikitina 7463506
changed SidePanelTab class
Anastasia-Nikitina b4bfb50
fixes
Anastasia-Nikitina d4f0de6
codestyle
Anastasia-Nikitina 879c88a
Tootips shortcuts
Alexander-Ploskin 2437480
Fix an incorrect initializaion of dividers positions
mi-sts 8366103
Add a filters panel view
mi-sts 59ebb50
Update filter settings dialog design and add a logic
mi-sts f844d41
Add a filter applying logic
mi-sts 14501f3
added materialfx dialogs and fixed some bugs
Anastasia-Nikitina b97bc31
removed commented code
Anastasia-Nikitina 15c5bef
changed style of tabs
Anastasia-Nikitina db26999
added panels
Anastasia-Nikitina 8b08dac
removed unused
Anastasia-Nikitina 826ab5f
added correct icons
Anastasia-Nikitina a79b397
added prefSize
Anastasia-Nikitina ba917e0
design for mainView
Anastasia-Nikitina 4493e7f
svg instead of png
Anastasia-Nikitina e55b9ae
added design for catalogue
Anastasia-Nikitina 927f65d
removed unused
Anastasia-Nikitina faeeb79
added controller for settings dialog
Anastasia-Nikitina 3637374
added design for grid settings
Anastasia-Nikitina 31ac808
added design for layers settings
Anastasia-Nikitina 0c04323
removed unused fun and val
Anastasia-Nikitina bea89bb
removed stylesheet
Anastasia-Nikitina ce91351
added placeholder for scene
Anastasia-Nikitina 6c5ab66
change type of container for dialog
Anastasia-Nikitina 1787108
added size for icon
Anastasia-Nikitina 9a5a12e
changes paths
Anastasia-Nikitina fc145c4
changes paths
Anastasia-Nikitina a3770eb
changed and added utils
Anastasia-Nikitina afdb8a1
added design for settings dialog
Anastasia-Nikitina 266cc65
added svg placeholder
Anastasia-Nikitina 2245262
added icon
Anastasia-Nikitina 1aaddd3
removed companion object
Anastasia-Nikitina 6a7018b
removed or commented unused
Anastasia-Nikitina 5fc3155
rebase
Anastasia-Nikitina 2c9513d
codestyle
Anastasia-Nikitina eb93adf
codestyle
Anastasia-Nikitina 2309551
removed png
Anastasia-Nikitina 56cf352
fixed svg
Anastasia-Nikitina 5add380
changed logo
Anastasia-Nikitina f00e48e
fixed disabling button
Anastasia-Nikitina 9d07887
fixed some bugs
Anastasia-Nikitina bf88422
added val instead of var
Anastasia-Nikitina d513985
removed unused
Anastasia-Nikitina 0063811
fixed tabs and spaces
Anastasia-Nikitina 24c1013
removed unused
Anastasia-Nikitina 039bb55
fixes
Anastasia-Nikitina 0f138b9
fixed linter warning
Anastasia-Nikitina 689ee22
fixed problems
Anastasia-Nikitina e45f8c2
fixed linter warning
Anastasia-Nikitina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,23 @@ | ||
| package solve.catalogue | ||
|
|
||
| import javafx.scene.control.Labeled | ||
| import javafx.scene.control.ListView | ||
| import io.github.palexdev.materialfx.controls.MFXCheckListView | ||
| import io.github.palexdev.materialfx.selection.base.IMultipleSelectionModel | ||
| import javafx.beans.property.ObjectProperty | ||
| import javafx.beans.property.SimpleObjectProperty | ||
| import solve.project.model.ProjectFrame | ||
| import solve.project.model.ProjectLayer | ||
| import tornadofx.tooltip | ||
|
|
||
| val ProjectFrame.layers: List<ProjectLayer> | ||
| get() = landmarkFiles.map { it.projectLayer }.distinct() | ||
| fun <T> MFXCheckListView<T>.selectionModelProperty(): ObjectProperty<IMultipleSelectionModel<T>> { | ||
| return SimpleObjectProperty(selectionModel) | ||
| } | ||
|
|
||
| fun <T> synchronizeListViewsSelections(firstListView: ListView<T>, secondListView: ListView<T>) { | ||
| secondListView.selectionModel = firstListView.selectionModel | ||
| fun <T> MFXCheckListView<T>.setSelectionModel(value: IMultipleSelectionModel<T>) { | ||
| selectionModelProperty().set(value) | ||
| } | ||
|
|
||
| fun Labeled.addNameTooltip() { | ||
| tooltip(text) | ||
| val ProjectFrame.layers: List<ProjectLayer> | ||
| get() = landmarkFiles.map { it.projectLayer }.distinct() | ||
|
|
||
| fun <T> synchronizeListViewsSelections(firstListView: MFXCheckListView<T>, secondListView: MFXCheckListView<T>) { | ||
| secondListView.setSelectionModel(firstListView.selectionModel) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| package solve.catalogue.view | ||
|
|
||
| import javafx.beans.property.SimpleObjectProperty | ||
| import javafx.geometry.Insets | ||
| import javafx.geometry.Pos | ||
| import javafx.scene.control.CheckBox | ||
| import javafx.scene.control.RadioButton | ||
| import javafx.scene.control.ToggleButton | ||
| import javafx.scene.control.ToggleGroup | ||
| import javafx.scene.layout.Priority | ||
| import solve.catalogue.addNameTooltip | ||
| import org.controlsfx.control.SegmentedButton | ||
| import solve.catalogue.controller.CatalogueController | ||
| import solve.catalogue.model.ViewFormat | ||
| import solve.styles.CatalogueViewStylesheet | ||
| import solve.styles.Style | ||
| import solve.utils.materialfx.mfxCheckbox | ||
| import tornadofx.* | ||
| import kotlin.properties.ReadWriteProperty | ||
| import kotlin.reflect.KProperty | ||
|
|
@@ -31,9 +34,6 @@ class CatalogueSettingsView : View() { | |
| private val catalogueView: CatalogueView by inject() | ||
|
|
||
| private val viewFormatToggleGroup = ToggleGroup() | ||
| private lateinit var fileNameViewRadioButton: RadioButton | ||
| private lateinit var imagePreviewRadioButton: RadioButton | ||
|
|
||
| private lateinit var selectionCheckBox: CheckBox | ||
| private var checkBoxSelectionState: SelectionState by checkBoxSelectionStateDelegate() | ||
|
|
||
|
|
@@ -45,29 +45,37 @@ class CatalogueSettingsView : View() { | |
| } | ||
| private var isDisplayingInfoLabel = false | ||
|
|
||
| override val root = vbox { | ||
| hbox(5) { | ||
| selectionCheckBox = checkbox("Select all", isSelectionCheckBoxCheckedProperty) { | ||
| addNameTooltip() | ||
| action { | ||
| if (isSelected) { | ||
| controller.selectAllFields() | ||
| } else { | ||
| controller.deselectAllFields() | ||
| private var fileNameViewRadioButton = ToggleButton("FILES").apply { | ||
| style = "-fx-font-family: ${Style.FontCondensed}; -fx-font-weight: ${Style.FontWeightBold};" | ||
| } | ||
| private var imagePreviewRadioButton = ToggleButton("IMAGES").apply { | ||
| style = "-fx-font-family: ${Style.FontCondensed}; -fx-font-weight: ${Style.FontWeightBold};" | ||
| } | ||
|
|
||
| var segmentedButton = SegmentedButton(fileNameViewRadioButton, imagePreviewRadioButton) | ||
|
|
||
| override val root = | ||
| vbox { | ||
| hbox(130) { | ||
| addStylesheet(CatalogueViewStylesheet::class) | ||
| maxWidth = 500.0 | ||
| padding = Insets(0.0, 0.0, 0.0, 0.0) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use paddingall |
||
| selectionCheckBox = mfxCheckbox { | ||
| paddingLeft = 7.0 | ||
| action { | ||
| if (isSelected) { | ||
| controller.checkAllFields() | ||
| } else { | ||
| controller.uncheckAllFields() | ||
| } | ||
| } | ||
| } | ||
| segmentedButton.toggleGroup = viewFormatToggleGroup | ||
|
|
||
| add(segmentedButton) | ||
| paddingBottom = 4 | ||
| } | ||
| pane().hgrow = Priority.ALWAYS | ||
| fileNameViewRadioButton = radiobutton("File view", viewFormatToggleGroup) { | ||
| addNameTooltip() | ||
| } | ||
| imagePreviewRadioButton = radiobutton("Image preview", viewFormatToggleGroup) { | ||
| addNameTooltip() | ||
| } | ||
| paddingBottom = 4 | ||
| } | ||
| add(infoNode) | ||
| }.also { initialize() } | ||
| }.also { initialize() } | ||
|
|
||
| init { | ||
| viewFormatProperty.onChange { newFormat -> | ||
|
|
@@ -78,7 +86,7 @@ class CatalogueSettingsView : View() { | |
|
|
||
| fun resetSettings() { | ||
| checkBoxSelectionState = CatalogueController.initialSelectionState | ||
| viewFormatToggleGroup.selectToggle(getViewFormatRadioButton(CatalogueController.initialViewFormat)) | ||
| viewFormatToggleGroup.selectToggle(getViewFormatToggleButton(CatalogueController.initialViewFormat)) | ||
| } | ||
|
|
||
| fun displayInfoLabel(withText: String) { | ||
|
|
@@ -105,24 +113,24 @@ class CatalogueSettingsView : View() { | |
|
|
||
| private fun initialize() { | ||
| initializeViewFormatRadioButtons() | ||
| viewFormatToggleGroup.selectToggle(getViewFormatRadioButton(CatalogueController.initialViewFormat)) | ||
| viewFormatToggleGroup.selectToggle(getViewFormatToggleButton(CatalogueController.initialViewFormat)) | ||
| } | ||
|
|
||
| private fun getRadioButtonViewFormat(radioButton: RadioButton) = when (radioButton) { | ||
| private fun getRadioButtonViewFormat(toggleButton: ToggleButton) = when (toggleButton) { | ||
| fileNameViewRadioButton -> ViewFormat.FileName | ||
| imagePreviewRadioButton -> ViewFormat.ImagePreview | ||
| else -> throw IllegalArgumentException("Unexpected view format radio button!") | ||
| else -> throw IllegalArgumentException("Unexpected view format toggle button!") | ||
| } | ||
|
|
||
| private fun getViewFormatRadioButton(viewFormat: ViewFormat) = when (viewFormat) { | ||
| private fun getViewFormatToggleButton(viewFormat: ViewFormat) = when (viewFormat) { | ||
| ViewFormat.FileName -> fileNameViewRadioButton | ||
| ViewFormat.ImagePreview -> imagePreviewRadioButton | ||
| } | ||
|
|
||
| private fun initializeViewFormatRadioButtons() { | ||
| viewFormatToggleGroup.selectedToggleProperty().onChange { | ||
| it ?: return@onChange | ||
| viewFormat = getRadioButtonViewFormat(it as RadioButton) | ||
| viewFormat = getRadioButtonViewFormat(it as ToggleButton) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -137,10 +145,12 @@ class CatalogueSettingsView : View() { | |
| selectionCheckBox.isIndeterminate = false | ||
| isSelectionCheckBoxChecked = true | ||
| } | ||
|
|
||
| SelectionState.None -> { | ||
| selectionCheckBox.isIndeterminate = false | ||
| isSelectionCheckBoxChecked = false | ||
| } | ||
|
|
||
| SelectionState.Part -> { | ||
| selectionCheckBox.isIndeterminate = true | ||
| isSelectionCheckBoxChecked = false | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid public fields