Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following example shows the syntax for a defs section in a Nexaweb Java application UI file including definitions for popup and popupMenu components.

Code Block
languagehtml/xml
linenumberstrue
<xal xmlns="http://openxal.org/ui/java">

...


  <defs>

...


   <popup id="myPopup">

...


    <borderPane>

...


     <label text="south" borderPosition="south"/>

...


     <label text="east" borderPosition="east"/>

...


     <label text="north" borderPosition="north"/>

...


     <label text="west" borderPosition="west"/>

...


     <label text="center" borderPosition="center"/>

...


    </borderPane>

...


   </popup>

...


   <popupMenu id="myPopupMenu">

...


    <menuItem text="A menu item"/>

...


    <menuItem text="Another menu item"/>

...


   </popupMenu>

...


  </defs>

...


  <rootPane>

...


   <borderPane>

...


    <desktopPane borderPosition="center">

...


     <horizontalFlowPane>
      <borderPane width="300px" height="500px">

...


       <button text="A button with a popup" popup="#myPopup" borderPosition="north"/>

...


       <button text="MyPopup Used Here" popup="#myPopupMenu" borderPosition="south"/>

...


       <button height="25px" text="MyPopup Used Here" width="200px" popup="#myPopupMenu" borderPosition="west"/>

...


      </borderPane>

...


     </horizontalFlowPane>

...


    </desktopPane>

...


   </borderPane>

...


  </rootPane>

...


</xal>


The following figures shows the UI displaying the popupMenu, MyPopup, from the middle button, and then the bottom button.

...

The following example shows the syntax for a defs section in a Nexaweb Java application UI file including a linearGradient:

Code Block
languagehtml/xml
linenumberstrue
<xal xmlns="http://openxal.org/ui/java">

...


  <defs>

...


   <linearGradient id="button_gradient_xal" x1="0%" y1="0%" y2="100%">

...


    <stop offset="30%" stop-color="blue"/>

...


    <stop offset="100%" stop-color="#D5DEE3"/>

...


   </linearGradient>

...


  </defs>

...


  <rootPane>

...


   <borderPane>

...


    <desktopPane borderPosition="center"> 
    

...

 <horizontalFlowPane>

...


      <borderPane>
       <button text="OK" borderPosition="north"/>

...


       <button text="Apply" borderPosition="center"/>

...


       <button text="linearGradient" borderPosition="south" backgroundColor="gradient(button_gradient_xal)"/>

...


      </borderPane>

...


     </horizontalFlowPane>

...


    </desktopPane>

...


   </borderPane>

...


  </rootPane>

...


</xal>


The following figure shows the UI displaying a button using the linearGradient defined in the defs section:

...