package pointGroups.gui;

import java.awt.BorderLayout;
import java.util.concurrent.Future;

import javax.swing.JButton;
import javax.swing.JPanel;

import de.jreality.plugin.JRViewer;
import de.jreality.scene.Viewer;


public class SchlegelView
  extends JPanel
{

  private static final long serialVersionUID = -3642299900579728806L;

  protected Future<JRViewer> viewerFuture;
  protected JRViewer schlegelViewer;
  protected Viewer schlegelView;

  public SchlegelView() {
    super();

    setLayout(new BorderLayout());

    JButton button3 = new JButton("VIEW");
    add(button3, BorderLayout.PAGE_END);

    viewerFuture = UiViewer.viewerFactory(this);
  }

  public Viewer getSchlegelView() {
    try {
      schlegelViewer = viewerFuture.get();
      schlegelView = schlegelViewer.getViewer();
    }
    catch (Exception e) {
      e.printStackTrace();
    }

    return schlegelView;
  }

  public void dispose() {
    UiViewer.dispose(viewerFuture);
  }
}

@@ -52,44 +52,8 @@
 out;
-%0Aimport java.util.concurrent.Future;
 %0A%0Aim
@@ -129,56 +129,27 @@
 ity.
-plugin.JRViewer;%0Aimport de.jreality.scene.Viewer
+geometry.Primitives
 ;%0A%0A%0A
@@ -281,107 +281,52 @@
 ted 
-Future%3CJRViewer%3E viewerFuture;%0A  protected JRViewer schlegelViewer;%0A  protected Viewer schlegelView
+final UiViewer uiViewer = new UiViewer(this)
 ;%0A%0A 
@@ -493,285 +493,101 @@
     
-viewerFuture = UiViewer.viewerFactory(this);%0A  %7D%0A%0A  public Viewer getSchlegelView() %7B%0A    try %7B%0A      schlegelViewer = viewerFuture.get();%0A      schlegelView = schlegel
+// TODO: remove me, just a placeholder geometry%0A    ui
 Viewer.
-getViewer();%0A    %7D%0A    catch (Exception e) %7B%0A      e.printStackTrace();%0A    %7D%0A%0A    return schlegelView
+setGeometry(Primitives.cone(15))
 ;%0A  
@@ -619,17 +619,17 @@
 ) %7B%0A    
-U
+u
 iViewer.
@@ -640,20 +640,8 @@
 ose(
-viewerFuture
 );%0A 

use the UiViewer to manage jReality in the SchlegelView