# Java Notes

# EZGui format codes

Code | Type | Action
--- | --- | ---
Add components. $ inserts user component. Others are created.
`$` | comp | Transfers element from param list to panel.
`'...'` | comp | Creates JLabel with name between single quotes.
`-` | comp | Creates horizontal line component.
`|` | comp | Creates vertical line component.
`<` | comp | Creates horizontal empty space that expands as necessary (glue).
`>` | comp | Creates vertical empty space that expands as necessary (glue).
Explicit control of area (rows and columns). Default is single cell.
`W[1-9]` | size | Width in number of columns component will span, eg, W5
`W*` | size | Width will include all columns to right edge.
`H[1-9]` | size | Height in number of rows component will span, eg, H5
`H*` | size | Height will include all rows to bottom.
Explicit new line or skip. Default is to move automatically.
`/` | move | Move cursor to beginning of next row (next column if in by-col mode).
`,` | move | Skip over the current position.
`\` | move | Flip default direction between by-row and by-column.
Alignment control. Default is to expand component to fill its area.
`A[nsewc]+` | align | Align component against edge specified by compass direction (n, ne, e, se, s, sw, w, nw) or center (c). By default it fills the entire area.
By default certain components expand horizontally or vertically. This provides explicit control.
`W+` | exp | Allow component to expand in Width. Can combine with width specification.
`H+` | exp | Allow component to expand in Height. Can combine with height specification.
Miscellaneous
`` | syn | Blanks are ignored. Used for readability and separation.
`~` | debug | Turns on debugging output to System.out.
Unimplemented features
`=` | ??? | Add this component to the size equivalent group.
`[...]` | ??? | Create a subpanel.
`b"..."` | ??? | Titled border. Must be first element of panel.
`bn` | ??? | Border of n pixels. Must be first element of panel.

## Issues

- How to turn off expansion? Should add H-.

## Example starting point for an EZApp

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
    // File   : QuoteOfTheDay.java
    // Purpose: blah, blah, blah
    // Author : Fred Swartz - April 10, 2007 - Placed in public domain.

    package examples;

    import com.fredswartz.ezgui.*;

    ////////////////////////////////////////////////////////////////// QuoteOfTheDay
    public class QuoteOfTheDay extends EZApp {

        //================================================================== startup
        public void startup() {
            EZPanel content = new EZPanel();
            content.format("$", "REPLACE ME");
            show("Title", content);
        }

        //===================================================================== main
        public static void main(String[] args) {
            launch(QuoteOfTheDay.class);
        }
    }