Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IDATT2003_gr43-Programmering 2
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
August Reitan Bøgseth
IDATT2003_gr43-Programmering 2
Commits
0b250453
Commit
0b250453
authored
May 20, 2024
by
augustrb
Browse files
Options
Downloads
Patches
Plain Diff
Made a simple set up for the drop down menu
parent
01e7c4a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/edu/ntnu/stud/view/DropDownMenu.java
+24
-11
24 additions, 11 deletions
src/main/java/edu/ntnu/stud/view/DropDownMenu.java
with
24 additions
and
11 deletions
src/main/java/edu/ntnu/stud/view/DropDownMenu.java
+
24
−
11
View file @
0b250453
...
...
@@ -10,25 +10,38 @@ public class DropDownMenu {
public
DropDownMenu
()
{
menuBar
=
new
MenuBar
();
Menu
menu1
=
new
Menu
(
"Transformations"
);
MenuItem
menuItem1
=
new
MenuItem
(
"Affine Transformation"
);
MenuItem
menuItem2
=
new
MenuItem
(
"Julia Transformation"
);
Menu
menuAffine
=
new
Menu
(
"Affine Transformations"
);
Menu
menuJulia
=
new
Menu
(
"Julia Transformations"
);
Menu
menu2
=
new
Menu
(
"Edit"
);
MenuItem
sierpinskiTriangle
=
new
MenuItem
(
"Sierpinski Triangle"
);
MenuItem
barnsleyFern
=
new
MenuItem
(
"Barnsley Fern"
);
MenuItem
customAffine
=
new
MenuItem
(
"Custom Affine Transformation"
);
MenuItem
customJulia
=
new
MenuItem
(
"Custom Julia Set"
);
menu1
.
getItems
().
add
(
menuItem1
);
menu1
.
getItems
().
add
(
menuItem2
);
menuAffine
.
getItems
().
add
(
sierpinskiTriangle
);
menuAffine
.
getItems
().
add
(
barnsleyFern
);
menuAffine
.
getItems
().
add
(
customAffine
);
menu
Item1
.
setOnAction
(
e
->
{
menu
Julia
.
getItems
().
add
(
customJulia
);
sierpinskiTriangle
.
setOnAction
(
e
->
{
System
.
out
.
println
(
"Sierpinski Triangle"
);
});
menuItem2
.
setOnAction
(
e
->
{
barnsleyFern
.
setOnAction
(
e
->
{
System
.
out
.
println
(
"Barnsley Fern"
);
});
customAffine
.
setOnAction
(
e
->
{
System
.
out
.
println
(
"Custom Affine Transformation"
);
});
customJulia
.
setOnAction
(
e
->
{
System
.
out
.
println
(
"Custom Julia Set"
);
});
this
.
menuBar
.
getMenus
().
add
(
menu1
);
this
.
menuBar
.
getMenus
().
add
(
menuAffine
);
this
.
menuBar
.
getMenus
().
add
(
menuJulia
);
this
.
menuBar
.
setMaxWidth
(
15
0
);
this
.
menuBar
.
setMaxWidth
(
30
0
);
}
public
MenuBar
getMenuBar
()
{
...
...
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