Package net.miginfocom.swt

Examples of net.miginfocom.swt.MigLayout


  {
    TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);

    // Pos tab
    TabItem posTabPanel = createTabPanel(tabbedPane, "X Y Positions", new FillLayout());
    final Composite posPanel = createPanel(posTabPanel, new MigLayout());

    createButton(posPanel, "pos 0.5al 0al", null);
    createButton(posPanel, "pos 1al 0al", null);
    createButton(posPanel, "pos 0.5al 0.5al", null);
    createButton(posPanel, "pos 5in 45lp", null);
    createButton(posPanel, "pos 0.5al 0.5al", null);
    createButton(posPanel, "pos 0.5al 1al", null);
    createButton(posPanel, "pos 1al .25al", null);
    createButton(posPanel, "pos visual.x2-pref visual.y2-pref", null);
    createButton(posPanel, "pos 1al -1in", null);
    createButton(posPanel, "pos 100 100", null);
    createButton(posPanel, "pos (10+(20*3lp)) 200", null);
    createButton(posPanel, "Drag Window! (pos 500-container.xpos 500-container.ypos)",
                 "pos 500-container.xpos 500-container.ypos");

    // Bounds tab
    TabItem boundsTabPanel = createTabPanel(tabbedPane, "X1 Y1 X2 Y2 Bounds", new FillLayout());
    Composite boundsPanel = createPanel(boundsTabPanel, new MigLayout());

    Label southLabel = createLabel(boundsPanel, "pos (visual.x+visual.w*0.1) visual.y2-40 (visual.x2-visual.w*0.1) visual.y2", null, SWT.CENTER | SWT.BORDER);
    southLabel.setBackground(new Color(display, 200, 200, 255));
    deriveFont(southLabel, SWT.BOLD, 10);

View Full Code Here


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

    TabItem linksPanel = createTabPanel(tabbedPane, "Component Links", new MigLayout());

    // Links tab
    createButton(linksPanel, "Mini", "pos null ta.y ta.x2 null, pad 3 0 -3 0");
    createTextArea(linksPanel, "Components, Please Link to Me!\nMy ID is: 'ta'", "id ta, pos 0.5al 0.5al, w 300");
    createButton(linksPanel, "id b1,pos ta.x2 ta.y2", null);
    createButton(linksPanel, "pos b1.x2+rel b1.y visual.x2 null", null);
    createCheck(linksPanel, "pos (ta.x+indent) (ta.y2+rel)", null);
    createButton(linksPanel, "pos ta.x2+rel ta.y visual.x2 null", null);
    createButton(linksPanel, "pos null ta.y+(ta.h-pref)/2 ta.x-rel null", null);
    createButton(linksPanel, "pos ta.x ta.y2+100 ta.x2 null", null);

    // External tab
    TabItem externalPanel = createTabPanel(tabbedPane, "External Components", new MigLayout());

    Button extButt = createButton(externalPanel, "Bounds Externally Set!", "id ext, external");
    extButt.setBounds(250, 130, 200, 40);
    createButton(externalPanel, "pos ext.x2 ext.y2", "pos ext.x2 ext.y2");
    createButton(externalPanel, "pos null null ext.x ext.y", "pos null null ext.x ext.y");

    TabItem egTabPanel = createTabPanel(tabbedPane, "End Grouping", new FillLayout());
    final Composite egPanel = createPanel(egTabPanel, new MigLayout());

    createButton(egPanel, "id b1, endgroupx g1, pos 200 200", null);
    createButton(egPanel, "id b2, endgroupx g1, pos (b1.x+2ind) (b1.y2+rel)", null);
    createButton(egPanel, "id b3, endgroupx g1, pos (b1.x+4ind) (b2.y2+rel)", null);
    createButton(egPanel, "id b4, endgroupx g1, pos (b1.x+6ind) (b3.y2+rel)", null);

    // Group Bounds tab
    TabItem gpTabPanel = createTabPanel(tabbedPane, "Group Bounds", new FillLayout());
    final Composite gpPanel = createPanel(gpTabPanel, new MigLayout());

    createButton(gpPanel, "id grp1.b1, pos n 0.5al 50% n", null);
    createButton(gpPanel, "id grp1.b2, pos 50% 0.5al n n", null);
    createButton(gpPanel, "id grp1.b3, pos 0.5al n n b1.y", null);
    createButton(gpPanel, "id grp1.b4, pos 0.5al b1.y2 n n", null);
View Full Code Here

    return tabbedPane;
  }

  private TabItem createFlowPanel(TabFolder parent, String text, String gridFlow, String cellFlow)
  {
    MigLayout lm = new MigLayout("center, wrap 3," + gridFlow,
                                 "[110,fill]",
                                 "[110,fill]");
    TabItem panel = createTabPanel(parent, text, lm);

    for (int i = 0; i < 9; i++) {
View Full Code Here

    return createPlainImpl(parent, true);
  }

  public Control createButton_Bars(final Composite parent)
  {
    MigLayout lm = new MigLayout("ins 0 0 15lp 0",
                                    "[grow]",
                                    "[grow]u[baseline,nogrid]");

    final Composite mainPanel = new Composite(parent, DOUBLE_BUFFER);
    mainPanel.setLayout(lm);
View Full Code Here

    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][200]" : "[right, 75lp:pref][200]";

      MigLayout LM1 = new MigLayout("wrap", colConstr, "");
      TabItem panel1 = createTabPanel(tabbedPane, i == 0 ? "Jumping 1" : "Stable 2", 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, "", "wmin 6*6,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, 50, 50, 50));
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.