英文:
JavaFX, best node/tools to use for this task?
问题
我正在开发一个大学项目,一个处理餐厅菜单管理的桌面程序。
由于我对JavaFX还不熟悉,不了解可以使用的各种工具。我将提供一个示意图,解释我想创建的内容。
大圆角矩形是我的“类别”,如“开胃菜”和“头盘”(在我的示意图中,它们是意大利文,所以我在翻译)。我希望这些矩形可点击,以便展开并显示它们包含的餐点。
通过按+按钮,我想创建一个类别。
由于我的程序必须是关于组织菜单的,我还想点击-按钮并进入“删除”模式,在类别和餐点的左侧出现复选框,我可以选择它们,按“确认”删除它们。
我还想按=按钮来对我的类别排序(也许我想将开胃菜放在头盘后面,或者将餐点移动到一个类别内部)。
你认为我可以使用什么工具/库/节点来处理这个问题?我已经查了很多,但只发现了TitledPanes或Accordions,但似乎对我要做的事情太静态了。
英文:
i'm developing as a University project a destkop program that handles restaurant menu's management.
Since i'm new to JavaFX, i don't have knowledge of the various tools i can use. I'll provide a mock up of what i want to create with explanations.
The big rounded rectangles are my 'Categories', so 'Appetizers' and 'First Course' (in my mock up they're in italian, so i'm translating). I want this rectangles to be clickable so they can expand and show the meals they have inside.
By pressing the + button, i want to create a category.
Since my program have to be about organizing the menu, i also want to click the - button and enter a "delete" mode, where checkboxes appear on the left side of both categories and meals, i can select them and pressing 'Confirm' deletes them.
I also want to press the '=' button to order my categories (maybe i want to put Appetizers after First Course, or move meals inside a category).
What do you think is the best tools/library/node i can use to deal with this problem? I've looked up a lot but only found out about TitledPanes or Accordions, but seems to static for what i have to do.
答案1
得分: 1
这个问题可能有更多可行的解决方案。
可以理解,但实际上并没有。
通过选择TitledPane
或Accordion
,您可以确信已经获得了对问题的最佳建议解决方案。
要学习使用这些控件,您可以使用SceneBuilder进行原型设计。您可以在Oracle教程中学习布局。
Accordion,但似乎对我要做的事情太静态了。
查看Accordion getPanes()
javadoc:
更改此ObservableList将立即导致Accordion更新以显示此ObservableList的新内容。
因此内容是动态的,而不是静态的。
我能在运行时移动Accordion内的TitledPanes的位置吗?
在面板列表中的顺序决定了Accordion中显示的面板的顺序。更改列表中的顺序将自动更改显示的顺序,因为它是一个观察到的列表。
英文:
> there could be MANY more viable options to deal with this problem.
Understandable, but there are not.
You can be confident that you have the best advised solution to your problem by selecting TitledPane
s or an Accordion
.
To learn to use these controls, you can prototype using SceneBuilder. You can study layouts in the Oracle tutorials.
> Accordions, but seems to static for what i have to do.
See Accordion getPanes()
javadoc:
> Changing this ObservableList will immediately result in the Accordion updating to display the new contents of this ObservableList.
so the content is dynamic, not static.
> can i move the titledpanes' position inside the accordion at runtime?
The order in the pane list determines the order of the displayed panes in the Accordion. Changing the order in the list will automatically change the displayed order, as it is an observed list.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论