Package net.miginfocom.swt

Examples of net.miginfocom.swt.MigLayout


    return mainPanel;
  }

  private TabItem createButtonBarsPanel(TabFolder parent, String text, String helpTag, boolean sizeLocked)
  {
    MigLayout lm = new MigLayout("nogrid, fillx, aligny 100%, gapy unrel");
    TabItem panel = createTabPanel(parent, text, lm);

    // Notice that the order in the rows below does not matter...
    String[][] buttons = new String[][] {
        {"No", "Yes"},
View Full Code Here


  public Control createOrientation(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    MigLayout lm = new MigLayout("flowy", "[grow,fill]", "[]0[]15lp[]0[]");
    TabItem mainPanel = createTabPanel(tabbedPane, "Orientation", lm);

    // Default orientation
    MigLayout defLM = new MigLayout("", "[][grow,fill]", "");

    Composite defPanel = createPanel(mainPanel, defLM);
    addSeparator(defPanel, "Default Orientation");
    createLabel(defPanel, "Level", "");
    createTextField(defPanel, "", "span,growx");
    createLabel(defPanel, "Radar", "");
    createTextField(defPanel, "", "");
    createTextField(defPanel, "", "");

    // Right-to-left, Top-to-bottom
    MigLayout rtlLM = new MigLayout("rtl,ttb",
                                       "[][grow,fill]",
                                       "");
    Composite rtlPanel = createPanel(mainPanel, rtlLM);
    addSeparator(rtlPanel, "Right to Left");
    createLabel(rtlPanel, "Level", "");
    createTextField(rtlPanel, "", "span,growx");
    createLabel(rtlPanel, "Radar", "");
    createTextField(rtlPanel, "", "");
    createTextField(rtlPanel, "", "");

    // Right-to-left, Bottom-to-top
    MigLayout rtlbLM = new MigLayout("rtl,btt",
                                     "[][grow,fill]",
                                     "");
    Composite rtlbPanel = createPanel(mainPanel, rtlbLM);
    addSeparator(rtlbPanel, "Right to Left, Bottom to Top");
    createLabel(rtlbPanel, "Level", "");
    createTextField(rtlbPanel, "", "span,growx");
    createLabel(rtlbPanel, "Radar", "");
    createTextField(rtlbPanel, "", "");
    createTextField(rtlbPanel, "", "");

    // Left-to-right, Bottom-to-top
    MigLayout ltrbLM = new MigLayout("ltr,btt",
                                     "[][grow,fill]",
                                     "");

    Composite ltrbPanel = createPanel(mainPanel, ltrbLM);
    addSeparator(ltrbPanel, "Left to Right, Bottom to Top");
View Full Code Here

  public Control createCell_Position(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    // Absolute grid position
    MigLayout absLM = new MigLayout("",
                                    "[100:pref,fill]",
                                    "[100:pref,fill]");

    TabItem absPanel = createTabPanel(tabbedPane, "Absolute", absLM);
    createPanel(absPanel, "cell 0 0", null);
    createPanel(absPanel, "cell 2 0", null);
    createPanel(absPanel, "cell 3 0", null);
    createPanel(absPanel, "cell 1 1", null);
    createPanel(absPanel, "cell 0 2", null);
    createPanel(absPanel, "cell 2 2", null);
    createPanel(absPanel, "cell 2 2", null);


    // Relative grid position with wrap
    MigLayout relAwLM = new MigLayout("wrap",
                                      "[100:pref,fill][100:pref,fill][100:pref,fill][100:pref,fill]",
                                      "[100:pref,fill]");
    TabItem relAwPanel = createTabPanel(tabbedPane, "Relative + Wrap", relAwLM);
    createPanel(relAwPanel, "", null);
    createPanel(relAwPanel, "skip", null);
    createPanel(relAwPanel, "", null);
    createPanel(relAwPanel, "skip,wrap", null);
    createPanel(relAwPanel, "", null);
    createPanel(relAwPanel, "skip,split", null);
    createPanel(relAwPanel, "", null);


    // Relative grid position with manual wrap
    MigLayout relWLM = new MigLayout("",
                                     "[100:pref,fill]",
                                     "[100:pref,fill]");
    TabItem relWPanel = createTabPanel(tabbedPane, "Relative", relWLM);
    createPanel(relWPanel, "", null);
    createPanel(relWPanel, "skip", null);
    createPanel(relWPanel, "wrap", null);
    createPanel(relWPanel, "skip,wrap", null);
    createPanel(relWPanel, "", null);
    createPanel(relWPanel, "skip,split", null);
    createPanel(relWPanel, "", null);


    // Mixed relative and absolute grid position
    MigLayout mixLM = new MigLayout("",
                                       "[100:pref,fill]",
                                       "[100:pref,fill]");
    TabItem mixPanel = createTabPanel(tabbedPane, "Mixed", mixLM);
    createPanel(mixPanel, "", null);
    createPanel(mixPanel, "cell 2 0", null);
View Full Code Here

  private Control createPlainImpl(Composite parent, boolean debug)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    MigLayout lm = new MigLayout((debug && benchRuns == 0 ? "debug" : ""), "[r][100lp, fill][60lp][95lp, fill]", "");
    TabItem panel = createTabPanel(tabbedPane, "Plain", lm);

    addSeparator(panel, "Manufacturer");
    createLabel(panel, "Company", "");
    createTextField(panel, "", "span,growx");
View Full Code Here

    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    for (int i = 0; i < 2; i++) {   // Jumping for 0 and Stable for 1
      String colConstr = i == 0 ? "[right][300]" : "[right, 150lp:pref][300]";

      MigLayout LM1 = new MigLayout("wrap", colConstr, "");
      TabItem panel1 = createTabPanel(tabbedPane, i == 0 ? "Jumping 1" : "Stable 1", LM1);
      createLabel(panel1, "File Number:", "");
      createTextField(panel1, "", "growx");
      createLabel(panel1, "RFQ Number:", "");
      createTextField(panel1, "", "growx");
      createLabel(panel1, "Entry Date:", "");
      createTextField(panel1, "        ", "wmin 6*6");
      createLabel(panel1, "Sales Person:", "");
      createTextField(panel1, "", "growx");

      MigLayout LM2 = new MigLayout("wrap", colConstr, "");
      TabItem panel2 = createTabPanel(tabbedPane, i == 0 ? "Jumping 2" : "Stable 2", LM2);
      createLabel(panel2, "Shipper:", "");
      createTextField(panel2, "        ", "split 2");
      createTextField(panel2, "", "growx");
      createLabel(panel2, "Consignee:", "");
View Full Code Here

  public Control createComponent_Sizes(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    MigLayout lm = new MigLayout("wrap", "[right][0:pref,grow]", "");

    TabItem tabPanel = createTabPanel(tabbedPane, "Component Sizes", new FillLayout());

    SashForm sashForm = new SashForm(getComposite(tabPanel), SWT.HORIZONTAL | SWT.SMOOTH);
    sashForm.setBackground(new Color(display, 255, 255, 255));
View Full Code Here

  public Control createCell_Alignments(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    // Horizontal
    MigLayout hLM = new MigLayout("wrap",
                                  "[grow,left][grow,center][grow,right][grow,fill,center]",
                                  "[]unrel[][]");
    TabItem hPanel = createTabPanel(tabbedPane, "Horizontal", hLM);
    String[] sizes = new String[] {"", "growx", "growx 0", "left", "center", "right", "leading", "trailing"};
    createLabel(hPanel, "[left]", "c");
    createLabel(hPanel, "[center]", "c");
    createLabel(hPanel, "[right]", "c");
    createLabel(hPanel, "[fill,center]", "c, growx 0");

    for (int r = 0; r < sizes.length; r++) {
      for (int c = 0; c < 4; c++) {
        String text = sizes[r].length() > 0 ? sizes[r] : "default";
        createButton(hPanel, text, sizes[r]);
      }
    }

    // Vertical
    MigLayout vLM = new MigLayout("wrap,flowy",
                                     "[right][]",
                                     "[grow,top][grow,center][grow,bottom][grow,fill,bottom][grow,fill,baseline]");
    TabItem vPanel = createTabPanel(tabbedPane, "Vertical", vLM);
    String[] vSizes = new String[] {"", "growy", "growy 0", "top", "center", "bottom"};
    createLabel(vPanel, "[top]", "center");
View Full Code Here

  public Control createUnits(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    // Horizontal
    MigLayout hLM = new MigLayout("wrap",
                                  "[right][]",
                                  "");
    TabItem hPanel = createTabPanel(tabbedPane, "Horizontal", hLM);
    String[] sizes = new String[] {"72pt", "25.4mm", "2.54cm", "1in", "72px", "96px", "120px", "25%", "30sp"};
    for (int i = 0; i < sizes.length; i++) {
      createLabel(hPanel, sizes[i], "");
      createTextField(hPanel, "", "width " + sizes[i] + "");
    }

    // Horizontal lp
    MigLayout hlpLM = new MigLayout("", "[right][][]", "");
    TabItem hlpPanel = createTabPanel(tabbedPane, "Horizontal LP", hlpLM);
    createLabel(hlpPanel, "9 cols", "");
    createTextField(hlpPanel, "", "wmin 9*6");
    String[] lpSizes = new String[] {"75lp", "75px", "88px", "100px"};
    createLabel(hlpPanel, "", "wrap");
    for (int i = 0; i < lpSizes.length; i++) {
      createLabel(hlpPanel, lpSizes[i], "");
      createTextField(hlpPanel, "", "width " + lpSizes[i] + ", wrap");
    }

    // Vertical
    MigLayout vLM = new MigLayout("wrap,flowy",
                                     "[c]",
                                     "[top][top]");
    TabItem vPanel = createTabPanel(tabbedPane, "Vertical", vLM);
    String[] vSizes = new String[] {"72pt", "25.4mm", "2.54cm", "1in", "72px", "96px", "120px", "25%", "30sp"};
    for (int i = 0; i < sizes.length; i++) {
      createLabel(vPanel, vSizes[i], "");
      createTextArea(vPanel, "", "width 50!, height " + vSizes[i] + "");
    }

    // Vertical lp
    MigLayout vlpLM = new MigLayout("wrap,flowy",
                                       "[c]",
                                       "[top][top]40px[top][top]");
    TabItem vlpPanel = createTabPanel(tabbedPane, "Vertical LP", vlpLM);
    createLabel(vlpPanel, "4 rows", "");
    createTextArea(vlpPanel, "\n\n\n\n", "width 50!");
View Full Code Here

  public Control createGrouping(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    // Ungrouped
    MigLayout ugM = new MigLayout("", "[]push[][][]", "");
    TabItem ugPanel = createTabPanel(tabbedPane, "Ungrouped", ugM);
    createButton(ugPanel, "Help", "");
    createButton(ugPanel, "< Back", "gap push");
    createButton(ugPanel, "Forward >", "");
    createButton(ugPanel, "Apply", "gap unrel");
    createButton(ugPanel, "Cancel", "gap unrel");

    // Grouped Components
    MigLayout gM = new MigLayout("nogrid, fillx");
    TabItem gPanel = createTabPanel(tabbedPane, "Grouped (Components)", gM);
    createButton(gPanel, "Help", "sg");
    createButton(gPanel, "< Back", "sg, gap push");
    createButton(gPanel, "Forward >", "sg");
    createButton(gPanel, "Apply", "sg, gap unrel");
    createButton(gPanel, "Cancel", "sg, gap unrel");

    // Grouped Columns
    MigLayout gcM = new MigLayout("", "[sg,fill]push[sg,fill][sg,fill]unrel[sg,fill]unrel[sg,fill]", "");
    TabItem gcPanel = createTabPanel(tabbedPane, "Grouped (Columns)", gcM);
    createButton(gcPanel, "Help", "");
    createButton(gcPanel, "< Back", "");
    createButton(gcPanel, "Forward >", "");
    createButton(gcPanel, "Apply", "");
    createButton(gcPanel, "Cancel", "");

    // Ungrouped Rows
    MigLayout ugrM = new MigLayout();     // no "sg" is the only difference to next panel
    TabItem ugrPanel = createTabPanel(tabbedPane, "Ungrouped Rows", ugrM);
    createLabel(ugrPanel, "File Number:", "");
    createTextField(ugrPanel, "30                            ", "wrap");
    createLabel(ugrPanel, "BL/MBL number:", "");
    createTextField(ugrPanel, "7      ", "split 2");
    createTextField(ugrPanel, "7      ", "wrap");
    createLabel(ugrPanel, "Entry Date:", "");
    createTextField(ugrPanel, "7      ", "wrap");
    createLabel(ugrPanel, "RFQ Number:", "");
    createTextField(ugrPanel, "30                            ", "wrap");
    createLabel(ugrPanel, "Goods:", "");
    createCheck(ugrPanel, "Dangerous", "wrap");
    createLabel(ugrPanel, "Shipper:", "");
    createTextField(ugrPanel, "30                            ", "wrap");
    createLabel(ugrPanel, "Customer:", "");
    createTextField(ugrPanel, "", "split 2,growx");
    createButton(ugrPanel, "...", "width 60px:pref,wrap");
    createLabel(ugrPanel, "Port of Loading:", "");
    createTextField(ugrPanel, "30                            ", "wrap");
    createLabel(ugrPanel, "Destination:", "");
    createTextField(ugrPanel, "30                            ", "wrap");

    // Grouped Rows
    MigLayout grM = new MigLayout("", "[]", "[sg]");    // "sg" is the only difference to previous panel
    TabItem grPanel = createTabPanel(tabbedPane, "Grouped Rows", grM);
    createLabel(grPanel, "File Number:", "");
    createTextField(grPanel, "30                            ","wrap");
    createLabel(grPanel, "BL/MBL number:", "");
    createTextField(grPanel, "7      ","split 2");
View Full Code Here

  public Control createSpan(Composite parent)
  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    // Horizontal span
    MigLayout colLM = new MigLayout("",
                                    "[fill][25%,fill][105lp!,fill][150px!,fill]",
                                    "[]15[][]");
    TabItem colPanel = createTabPanel(tabbedPane, "Column Span/Split", colLM);
    createTextField(colPanel, "Col1 [ ]", "");
    createTextField(colPanel, "Col2 [25%]", "");
    createTextField(colPanel, "Col3 [105lp!]", "");
    createTextField(colPanel, "Col4 [150px!]", "wrap");

    createLabel(colPanel, "Full Name:", "");
    createTextField(colPanel, "span, growx                              ", "span,growx");

    createLabel(colPanel, "Phone:", "");
    createTextField(colPanel, "   ", "span 3, split 5");
    createTextField(colPanel, "     ", null);
    createTextField(colPanel, "     ", null);
    createTextField(colPanel, "       ", null);
    createLabel(colPanel, "(span 3, split 4)", "wrap");

    createLabel(colPanel, "Zip/City:", "");
    createTextField(colPanel, "     ", "");
    createTextField(colPanel, "span 2, growx", null);

    // Vertical span
    MigLayout rowLM = new MigLayout("wrap",
                                       "[225lp]para[225lp]",
                                       "[]3[]unrel[]3[]unrel[]3[]");
    TabItem rowPanel = createTabPanel(tabbedPane, "Row Span", rowLM);
    createLabel(rowPanel, "Name", "");
    createLabel(rowPanel, "Notes", "");
View Full Code Here

TOP

Related Classes of net.miginfocom.swt.MigLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.