diff options
author | Joshua Slack <[email protected]> | 2017-09-11 07:46:31 -0500 |
---|---|---|
committer | Joshua Slack <[email protected]> | 2017-09-11 07:46:31 -0500 |
commit | 90fa0f6c4997d65e5c5980cd1602956d62cc83c8 (patch) | |
tree | 811405dd6613fee8f84e1d8846f043aa891faa5c /ardor3d-examples/src | |
parent | d2e0a7c79d1be87f867691a9e0317a549014ebcb (diff) |
Added new UI Components - UIPieMenu and UIPieMenuItem.
Added new backdrops - Disk and Arc
Added generic skin support for the above
Added use of piemenu to one of the examples.
Made popover an interface shared between piemenu and popupmenu
Diffstat (limited to 'ardor3d-examples/src')
-rw-r--r-- | ardor3d-examples/src/main/java/com/ardor3d/example/ui/InteractUIExample.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/ardor3d-examples/src/main/java/com/ardor3d/example/ui/InteractUIExample.java b/ardor3d-examples/src/main/java/com/ardor3d/example/ui/InteractUIExample.java index 13dedb2..03d7a75 100644 --- a/ardor3d-examples/src/main/java/com/ardor3d/example/ui/InteractUIExample.java +++ b/ardor3d-examples/src/main/java/com/ardor3d/example/ui/InteractUIExample.java @@ -32,9 +32,9 @@ import com.ardor3d.extension.ui.UIComboBox; import com.ardor3d.extension.ui.UIContainer; import com.ardor3d.extension.ui.UIFrame; import com.ardor3d.extension.ui.UIHud; -import com.ardor3d.extension.ui.UIMenuItem; import com.ardor3d.extension.ui.UIPanel; -import com.ardor3d.extension.ui.UIPopupMenu; +import com.ardor3d.extension.ui.UIPieMenu; +import com.ardor3d.extension.ui.UIPieMenuItem; import com.ardor3d.extension.ui.UISlider; import com.ardor3d.extension.ui.backdrop.EmptyBackdrop; import com.ardor3d.extension.ui.border.EmptyBorder; @@ -328,12 +328,12 @@ public class InteractUIExample extends ExampleBase { manager.addFilter(new PlaneBoundaryFilter(new Plane(Vector3.UNIT_Y, 0))); } - UIPopupMenu menu; + UIPieMenu menu; protected void showMenu() { if (menu == null) { - menu = new UIPopupMenu(); - menu.addItem(new UIMenuItem("Add Node After", null, true, new ActionListener() { + menu = new UIPieMenu(hud); + menu.addItem(new UIPieMenuItem("Add Node After", null, true, new ActionListener() { @Override public void actionPerformed(final ActionEvent event) { final Spatial spat = manager.getSpatialTarget(); @@ -343,7 +343,23 @@ public class InteractUIExample extends ExampleBase { createMarkerAfter(spat); } })); - menu.addItem(new UIMenuItem("Delete Node", null, true, new ActionListener() { + menu.addItem(new UIPieMenuItem("Delete Node 1", null, true, new ActionListener() { + @Override + public void actionPerformed(final ActionEvent event) { + final Spatial spat = manager.getSpatialTarget(); + if (spat == null) { + return; + } + removeMarker(spat); + } + })); + menu.setCenterItem(new UIPieMenuItem("Cancel", null, true, new ActionListener() { + @Override + public void actionPerformed(final ActionEvent event) { + return; + } + })); + menu.addItem(new UIPieMenuItem("Delete Node 2", null, true, new ActionListener() { @Override public void actionPerformed(final ActionEvent event) { final Spatial spat = manager.getSpatialTarget(); @@ -354,7 +370,6 @@ public class InteractUIExample extends ExampleBase { } })); menu.updateMinimumSizeFromContents(); - menu.pack(); menu.layout(); } |