1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
package my3d; import java.util.ArrayList; import javafx.scene.canvas.Canvas; import javafx.scene.control.CheckMenuItem; import javafx.scene.control.MenuItem; public abstract class _viewer3d4 extends _viewer3d3 { @Override public _viewport3d create_viewport(Canvas view) { return new _viewport3d2(view); } @Override public void init_menu() { super.init_menu(); _viewport3d2 vp2 = (_viewport3d2)vp; ArrayList<MenuItem> items; items = add_setting_menu((index) -> { vp2.set_zsort_enable(!vp2.is_zsort_enable()); repaint(); }, "cZソート" ); ((CheckMenuItem)items.get(0)).setSelected(vp2.is_zsort_enable()); } }