Changes between Version 2 and Version 3 of JComponentEnvironment


Ignore:
Timestamp:
05/17/13 16:26:24 (6 years ago)
Author:
welberge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • JComponentEnvironment

    v2 v3  
    11= JComponentEnvironment and constructing Swing user interfaces using the VirtualHumanSpec = 
    2 The JComponentEnvironment can be used to set up the user interface layout of demo in which the different UI elements are later filled out using the XML specification. The layout can be created using JPanels: 
     2The JComponentEnvironment can be used to set up the user interface layout of demo in which the different UI elements are later filled out using the XML specification. The layout can be created using JPanels (or any other JComponent): 
    33{{{ 
     4JFrame jframe = new JFrame(); 
     5final AsapEnvironment ee = new AsapEnvironment(); 
    46final JComponentEnvironment jce = new JComponentEnvironment(); 
    5         try 
     7try 
     8{ 
     9    SwingUtilities.invokeAndWait(new Runnable() 
     10    { 
     11 
     12        @Override 
     13        public void run() 
    614        { 
    7             SwingUtilities.invokeAndWait(new Runnable() 
    8             { 
    9  
    10                 @Override 
    11                 public void run() 
    12                 { 
    13                     JPanel jPanel = new JPanel(); 
    14                     jce.registerComponent("panel1", jPanel); 
    15                     mainJFrame.setLayout(new BorderLayout()); 
    16                     mainJFrame.add(jPanel, BorderLayout.SOUTH); 
    17                 } 
    18             }); 
     15            JPanel jPanel = new JPanel(); 
     16            jce.registerComponent("panel1", jPanel); 
     17            jframe.setLayout(new BorderLayout()); 
     18            jframeadd(jPanel, BorderLayout.SOUTH); 
    1919        } 
    20         catch (InvocationTargetException e) 
    21         { 
    22             throw new RuntimeException(e); 
    23         } 
    24         catch (InterruptedException e) 
    25         { 
    26             throw new RuntimeException(e); 
    27         } 
     20    }); 
     21} 
     22catch (InvocationTargetException e) 
     23{ 
     24    throw new RuntimeException(e); 
     25} 
     26catch (InterruptedException e) 
     27{ 
     28    throw new RuntimeException(e); 
     29} 
     30ArrayList<Environment> environments = new ArrayList<Environment>(); 
     31environments.add(jce); 
     32... 
     33ee.init(environments, clock); 
     34.. 
     35ee.loadVirtualHuman("humanoid", "", "humanoid.xml", "AsapRealizer demo"); 
    2836}}}