Search in sources :

Example 1 with ProfileAssignmentViewer

use of org.twak.tweed.gen.ProfileAssignmentViewer in project chordatlas by twak.

the class SkelGen method selected.

private void selected(PlanSkeleton skel, Node house, SuperFace sf, SuperEdge se) {
    JPanel ui = new JPanel();
    ui.setLayout(new ListDownLayout());
    JButton fac = new JButton("edit facade");
    fac.addActionListener(e -> editFacade(skel, sf, se, false));
    ui.add(fac);
    // JButton tex = new JButton( "texture facade" );
    // tex.addActionListener( e -> editFacade( skel, sf, se, true ) );
    // ui.add( tex );
    JButton proc = new JButton("procedural facade");
    proc.addActionListener(e -> cgaFacade(skel, sf, se));
    ui.add(proc);
    JButton camp = new JButton("procedural extrusions");
    camp.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            closeSitePlan();
            siteplan = new Siteplan(skel.plan, false) {

                SuperFace workon = sf;

                public void show(Output output, Skeleton threadKey) {
                    super.show(output, threadKey);
                    Plot.closeLast();
                    tweed.enqueue(new Runnable() {

                        @Override
                        public void run() {
                            removeGeometryFor(workon);
                            // current selection is invalid
                            tweed.frame.setGenUI(null);
                            setSkel((PlanSkeleton) threadKey, output, workon);
                        }
                    });
                }
            };
            siteplan.setVisible(true);
            siteplan.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        }
    });
    ui.add(camp);
    JButton mini = new JButton("street-view");
    mini.addActionListener(e -> new MiniViewer(se));
    if (sf != null)
        ui.add(mini);
    JButton prof = new JButton("profiles");
    prof.addActionListener(e -> new ProfileAssignmentViewer(sf, skelFootprint == null ? null : skelFootprint.globalProfs));
    ui.add(prof);
    ui.add(new JLabel("height " + sf.heights.size()));
    JButton plan = new JButton("plan");
    plan.addActionListener(e -> new Plot(toRender, footprint));
    ui.add(plan);
    JButton remove = new JButton("remove");
    remove.addActionListener(e -> {
        visible = false;
        calculateOnJmeThread();
        tweed.frame.removeGen(SkelGen.this);
    });
    ui.add(plan);
    JButton b = new JButton("view clean profiles");
    b.addActionListener(e -> SkelFootprint.debugFindCleanProfiles(footprint, this, new ProgressMonitor(null, "", "", 0, 100), tweed));
    ui.add(b);
    JButton c = new JButton("compare profiles");
    c.addActionListener(e -> skelFootprint.debugCompareProfs(skelFootprint.globalProfs));
    ui.add(c);
    tweed.frame.setGenUI(ui);
}
Also used : JPanel(javax.swing.JPanel) ListDownLayout(org.twak.utils.ui.ListDownLayout) PlanSkeleton(org.twak.siteplan.campskeleton.PlanSkeleton) ActionEvent(java.awt.event.ActionEvent) Plot(org.twak.utils.ui.Plot) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) SuperFace(org.twak.tweed.gen.SuperFace) ProgressMonitor(javax.swing.ProgressMonitor) ActionListener(java.awt.event.ActionListener) Siteplan(org.twak.siteplan.campskeleton.Siteplan) Output(org.twak.camp.Output) MiniViewer(org.twak.tweed.gen.MiniViewer) PlanSkeleton(org.twak.siteplan.campskeleton.PlanSkeleton) Skeleton(org.twak.camp.Skeleton) ProfileAssignmentViewer(org.twak.tweed.gen.ProfileAssignmentViewer)

Aggregations

ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 ProgressMonitor (javax.swing.ProgressMonitor)1 Output (org.twak.camp.Output)1 Skeleton (org.twak.camp.Skeleton)1 PlanSkeleton (org.twak.siteplan.campskeleton.PlanSkeleton)1 Siteplan (org.twak.siteplan.campskeleton.Siteplan)1 MiniViewer (org.twak.tweed.gen.MiniViewer)1 ProfileAssignmentViewer (org.twak.tweed.gen.ProfileAssignmentViewer)1 SuperFace (org.twak.tweed.gen.SuperFace)1 ListDownLayout (org.twak.utils.ui.ListDownLayout)1 Plot (org.twak.utils.ui.Plot)1