Package net.miginfocom.swt

Examples of net.miginfocom.swt.MigLayout


      Composite parent = new Composite(shell, SWT.DOUBLE_BUFFERED);

      shell.setLayout(new FillLayout());
//      parent.setLayoutData("wmin 100");

      MigLayout layout = new MigLayout("debug,wrap 2");
      parent.setLayout(layout);

      Label label1 = new Label(parent, SWT.WRAP);
      label1.setText("This is an even longer label that just goes on and on...");
      label1.setLayoutData("wmin 50");
View Full Code Here


public class ExampleGood
{
  protected void buildControls(Composite parent)
  {
    parent.setLayout(new MigLayout("inset 0", "[fill, grow]", "[fill, grow]"));

    Table table = new Table(parent, SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL);
    table.setLayoutData("id table, hmin 100, wmin 300");
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
View Full Code Here

        scroller.setLayout(new FillLayout());

        // the actual content of the tab
        Composite tabComposite = new Composite(scroller, SWT.NONE);
        layoutConstraint = layoutConstraint + ", gapy 15";
        tabComposite.setLayout(new MigLayout(layoutConstraint, ""));

        // which goes as content to the scrolled composite
        scroller.setContent(tabComposite);
        scroller.setExpandVertical(true);
        scroller.setExpandHorizontal(true);
View Full Code Here

        final ScrolledComposite scroller = new ScrolledComposite(folder, SWT.V_SCROLL);
        scroller.setLayout(new FillLayout());

        // the actual content of the tab
        Composite tabComposite = new Composite(scroller, SWT.NONE);
        tabComposite.setLayout(new MigLayout(layoutConstraint, ""));

        // which goes as content to the scrolled composite
        scroller.setContent(tabComposite);
        scroller.setExpandVertical(true);
        scroller.setExpandHorizontal(true);
View Full Code Here

  public void open() {
    Shell parent = getParent();
    final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
    shell.setText("Eigenschaften");
    shell.setImage(Images.COG);
    shell.setLayout(new MigLayout("fill, wrap 2"));
    shell.setLayoutData("hmin pref, wmin pref");

    final Preferences preferences = Preferences.getInstance();

    Label lAntialias = new Label(shell, SWT.NONE);
    lAntialias.setText("Antialiasing:");
    lAntialias.setLayoutData("hmin pref, wmin pref");

    final AntButton bAntialias = new AntButton(new Button(shell, SWT.CHECK), getProject());
    bAntialias.getButton().setSelection(preferences.isAntialias());
    bAntialias.getButton().setLayoutData("hmin pref, wmin pref");
    bAntialias.setTooltipText("Mit dieser Optionen k�nnen Sie Antialiasing an- und ausschalten.");

    Label lRedrawInterval = new Label(shell, SWT.NONE);
    lRedrawInterval.setText("Neuzeichnungsintervall:");
    lRedrawInterval.setLayoutData("hmin pref, wmin pref");

    final AntText tRedrawInterval = new AntText(new Text(shell, SWT.BORDER), getProject());
    tRedrawInterval.getText().setText(Utility.FORMAT.format(preferences.getRedrawInterval()));
    tRedrawInterval.getText().setLayoutData("hmin pref, wmin pref, grow");
    tRedrawInterval.setTooltipText("Hier k�nnen Sie einstellen, nach wie vielen Iterationen neu gezeichnet werden soll. (X > 0)");
    tRedrawInterval.setInputMode(AntText.INTEGER_ONLY);
    tRedrawInterval.setNumberRange(1, Double.POSITIVE_INFINITY, true, true);

    Label lNodeColor = new Label(shell, SWT.NONE);
    lNodeColor.setText("Farbe der Knoten:");
    lNodeColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cNodeColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cNodeColor.setBackground(preferences.getNodeColor());
    cNodeColor.getComposite().setLayoutData("height 20!, wmin 50");
    cNodeColor.setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die Knoten gezeichnet werden.");
    cNodeColor.getComposite().addMouseListener(new ChooseColorListener(cNodeColor));

    Label lCurrentNodeColor = new Label(shell, SWT.NONE);
    lCurrentNodeColor.setText("Farbe der ausgew�hlten Knoten:");
    lCurrentNodeColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cCurrentNodeColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cCurrentNodeColor.setBackground(preferences.getCurrentNodeColor());
    cCurrentNodeColor.getComposite().setLayoutData("height 20!, wmin 50");
    cCurrentNodeColor.setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die ausgew�hlten Knoten gezeichnet werden.");
    cCurrentNodeColor.getComposite().addMouseListener(new ChooseColorListener(cCurrentNodeColor));

    Label lBestTourGlobalColor = new Label(shell, SWT.NONE);
    lBestTourGlobalColor.setText("Farbe der besten globalen Tour:");
    lBestTourGlobalColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cBestTourGlobalColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cBestTourGlobalColor.setBackground(preferences.getBestTourGlobalColor());
    cBestTourGlobalColor.getComposite().setLayoutData("height 20!, wmin 50");
    cBestTourGlobalColor.setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die Linien der globalen besten Tour gezeichnet werden.");
    cBestTourGlobalColor.getComposite().addMouseListener(new ChooseColorListener(cBestTourGlobalColor));

    Label lBestTourIterationColor = new Label(shell, SWT.NONE);
    lBestTourIterationColor.setText("Farbe der besten Tour der Iteration:");
    lBestTourIterationColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cBestTourIterationColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cBestTourIterationColor.setBackground(preferences.getBestTourIterationColor());
    cBestTourIterationColor.getComposite().setLayoutData("height 20!, wmin 50");
    cBestTourIterationColor
        .setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die Linien der besten Tour der Iteration gezeichnet werden.");
    cBestTourIterationColor.getComposite().addMouseListener(new ChooseColorListener(cBestTourIterationColor));

    Label lBackgroundColor = new Label(shell, SWT.NONE);
    lBackgroundColor.setText("Farbe des Malfl�chenhintergrundes:");
    lBackgroundColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cBackgroundColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cBackgroundColor.setBackground(preferences.getBackgroundColor());
    cBackgroundColor.getComposite().setLayoutData("height 20!, wmin 50");
    cBackgroundColor.setTooltipText("Hier k�nnen Sie die Hintergrundfarbe der Malfl�che einstellen.");
    cBackgroundColor.getComposite().addMouseListener(new ChooseColorListener(cBackgroundColor));

    Composite buttonComp = new Composite(shell, SWT.NONE);
    buttonComp.setLayout(new MigLayout("wrap 2, ins 0", "[50%][50%]"));
    buttonComp.setLayoutData("hmin 0, wmin 0, growx, spanx");

    AntButton confirm = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    confirm.getButton().setText("Speichern");
    confirm.getButton().setLayoutData("hmin pref, wmin pref, grow");
View Full Code Here

  public void open() {
    Shell parent = getParent();
    final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.MAX);
    shell.setText("Hilfe");
    shell.setImage(Images.HELP);
    shell.setLayout(new MigLayout("fill, wrap"));
    shell.setLayoutData("hmin 400, wmin 500");

    Browser browser = new Browser(shell, SWT.NONE);
    browser.setLayoutData("hmin 400, wmin 800, hmax 100%-60, wmax 100%-30, grow");
    browser.setUrl(new File("AOFHelp\\help.html").getAbsolutePath());
View Full Code Here

  public Color open() {
    Shell parent = getParent();
    final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
    shell.setText("Farbe w�hlen");
    shell.setImage(Images.COLOR_SWATCH);
    shell.setLayout(new MigLayout("fill, wrap 4"));
    shell.setLayoutData("hmin pref, wmin pref");

    AntComposite black = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    black.setBackground(Colors.BLACK);
    black.getComposite().setLayoutData("height 20!, width 50!");
    black.getComposite().addMouseListener(new ChosenColorListener(black));

    AntComposite darkGrey = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkGrey.setBackground(Colors.DARK_GREY);
    darkGrey.getComposite().setLayoutData("height 20!, width 50!");
    darkGrey.getComposite().addMouseListener(new ChosenColorListener(darkGrey));

    AntComposite grey = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    grey.setBackground(Colors.GREY);
    grey.getComposite().setLayoutData("height 20!, width 50!");
    grey.getComposite().addMouseListener(new ChosenColorListener(grey));

    AntComposite white = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    white.setBackground(Colors.WHITE);
    white.getComposite().setLayoutData("height 20!, width 50!");
    white.getComposite().addMouseListener(new ChosenColorListener(white));

    AntComposite darkBlue = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkBlue.setBackground(Colors.DARK_BLUE);
    darkBlue.getComposite().setLayoutData("height 20!, width 50!");
    darkBlue.getComposite().addMouseListener(new ChosenColorListener(darkBlue));

    AntComposite blue = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    blue.setBackground(Colors.BLUE);
    blue.getComposite().setLayoutData("height 20!, width 50!");
    blue.getComposite().addMouseListener(new ChosenColorListener(blue));

    AntComposite darkCyan = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkCyan.setBackground(Colors.DARK_CYAN);
    darkCyan.getComposite().setLayoutData("height 20!, width 50!");
    darkCyan.getComposite().addMouseListener(new ChosenColorListener(darkCyan));

    AntComposite cyan = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cyan.setBackground(Colors.CYAN);
    cyan.getComposite().setLayoutData("height 20!, width 50!");
    cyan.getComposite().addMouseListener(new ChosenColorListener(cyan));

    AntComposite darkRed = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkRed.setBackground(Colors.DARK_RED);
    darkRed.getComposite().setLayoutData("height 20!, width 50!");
    darkRed.getComposite().addMouseListener(new ChosenColorListener(darkRed));

    AntComposite red = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    red.setBackground(Colors.RED);
    red.getComposite().setLayoutData("height 20!, width 50!");
    red.getComposite().addMouseListener(new ChosenColorListener(red));

    AntComposite darkMagenta = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkMagenta.setBackground(Colors.DARK_MAGENTA);
    darkMagenta.getComposite().setLayoutData("height 20!, width 50!");
    darkMagenta.getComposite().addMouseListener(new ChosenColorListener(darkMagenta));

    AntComposite magenta = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    magenta.setBackground(Colors.MAGENTA);
    magenta.getComposite().setLayoutData("height 20!, width 50!");
    magenta.getComposite().addMouseListener(new ChosenColorListener(magenta));

    AntComposite darkGreen = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkGreen.setBackground(Colors.DARK_GREEN);
    darkGreen.getComposite().setLayoutData("height 20!, width 50!");
    darkGreen.getComposite().addMouseListener(new ChosenColorListener(darkGreen));

    AntComposite green = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    green.setBackground(Colors.GREEN);
    green.getComposite().setLayoutData("height 20!, width 50!");
    green.getComposite().addMouseListener(new ChosenColorListener(green));

    AntComposite darkYellow = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    darkYellow.setBackground(Colors.DARK_YELLOW);
    darkYellow.getComposite().setLayoutData("height 20!, width 50!");
    darkYellow.getComposite().addMouseListener(new ChosenColorListener(darkYellow));

    AntComposite yellow = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    yellow.setBackground(Colors.YELLOW);
    yellow.getComposite().setLayoutData("height 20!, width 50!");
    yellow.getComposite().addMouseListener(new ChosenColorListener(yellow));

    Composite buttonComp = new Composite(shell, SWT.NONE);
    buttonComp.setLayout(new MigLayout("wrap 2, ins 0", "[50%][50%]"));
    buttonComp.setLayoutData("hmin 0, wmin 0, growx, spanx");

    AntButton confirm = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    confirm.getButton().setText("Speichern");
    confirm.getButton().setLayoutData("hmin pref, wmin pref, grow");
View Full Code Here

   */
  public TabContent(Composite pParent, int pStyle) {
    super(pParent, pStyle, new AntController(new AntProject()));

    Composite comp = new Composite(this, SWT.NONE);
    comp.setLayout(new MigLayout("fill, ins 0", "[][pref!]"));
    comp.setLayoutData("hmin pref, wmin pref, grow, hmax 98%, wmax 99%");

    DrawComposite draw = new DrawComposite(comp, SWT.BORDER, getController());
    draw.setLayout(new MigLayout("ins 0"));
    draw.setLayoutData("hmin 500, wmin 500, grow");

    Composite right = new Composite(comp, SWT.NONE);
    right.setLayout(new MigLayout("wrap, ins 0", "[pref!]"));
    right.setLayoutData("hmin pref, wmin pref, growy");

    Label picture = new Label(right, SWT.NONE);
    picture.setImage(Images.COWBOY);
    picture.setLayoutData("hmin pref, wmin pref, align center");

    InputComposite input = new InputComposite(right, SWT.BORDER, getController());
    input.setLayout(new MigLayout());
    input.setLayoutData("hmin pref, wmin pref, grow");

    StopCriteriaComposite criteria = new StopCriteriaComposite(right, SWT.BORDER, getController());
    criteria.setLayout(new MigLayout());
    criteria.setLayoutData("hmin pref, wmin pref, grow");

    OutputComposite output = new OutputComposite(right, SWT.BORDER, getController());
    output.setLayout(new MigLayout("fill"));
    output.setLayoutData("hmin pref, wmin pref, grow");

    input.addAllInputValidListener(criteria);
  }
View Full Code Here

  public TSPData open() {
    Shell parent = getParent();
    final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
    shell.setText("Zufallsprojekt");
    shell.setImage(Images.CHART_LINE_EDIT);
    shell.setLayout(new MigLayout("fill, wrap 2", "[pref!][100!]"));
    shell.setLayoutData("hmin pref, wmin pref");

    Label lNodeCount = new Label(shell, SWT.NONE);
    lNodeCount.setText("Anzahl der St�dte:");
    lNodeCount.setLayoutData("hmin pref, wmin pref");

    final AntText tNodeCount = new AntText(new Text(shell, SWT.BORDER), getProject());
    tNodeCount.getText().setText("0");
    tNodeCount.getText().setLayoutData("hmin pref, wmin 50, growx");
    tNodeCount.setTooltipText("Tragen Sie hier die Anzahl der Knoten ein. F�r einen zuf�lligen Wert von 1 bis 100 tragen Sie 0 ein. (X >= 0)");
    tNodeCount.setInputMode(AntText.INTEGER_ONLY);
    tNodeCount.setNumberRange(0, Double.POSITIVE_INFINITY, true, true);

    Label lMaxXCoordinate = new Label(shell, SWT.NONE);
    lMaxXCoordinate.setText("Maximale X Koordinate:");
    lMaxXCoordinate.setLayoutData("hmin pref, wmin pref");

    final AntText tMaxXCoordinate = new AntText(new Text(shell, SWT.BORDER), getProject());
    tMaxXCoordinate.getText().setText("0");
    tMaxXCoordinate.getText().setLayoutData("hmin pref, wmin 50, growx");
    tMaxXCoordinate
        .setTooltipText("Tragen Sie hier den maximalen Wert der X Koordinate ein, den ein Knoten haben kann. F�r einen zuf�lligen Wert von 1 bis 5000 tragen Sie 0 ein. (X >= 0)");
    tMaxXCoordinate.setInputMode(AntText.DOUBLE_ONLY);
    tMaxXCoordinate.setNumberRange(0, Double.POSITIVE_INFINITY, true, true);

    Label lMaxYCoordinate = new Label(shell, SWT.NONE);
    lMaxYCoordinate.setText("Maximale Y Koordinate:");
    lMaxYCoordinate.setLayoutData("hmin pref, wmin pref");

    final AntText tMaxYCoordinate = new AntText(new Text(shell, SWT.BORDER), getProject());
    tMaxYCoordinate.getText().setText("0");
    tMaxYCoordinate.getText().setLayoutData("hmin pref, wmin 50, growx");
    tMaxYCoordinate
        .setTooltipText("Tragen Sie hier den maximalen Wert der Y Koordinate ein, den ein Knoten haben kann. F�r einen zuf�lligen Wert von 1 bis 5000 tragen Sie 0 ein. (X >= 0)");
    tMaxYCoordinate.setInputMode(AntText.DOUBLE_ONLY);
    tMaxYCoordinate.setNumberRange(0, Double.POSITIVE_INFINITY, true, true);

    Composite buttonComp = new Composite(shell, SWT.NONE);
    buttonComp.setLayout(new MigLayout("wrap 2, ins 0", "[50%][50%]"));
    buttonComp.setLayoutData("hmin 0, wmin 0, growx, spanx");

    AntButton confirm = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    confirm.getButton().setText("Erstellen");
    confirm.getButton().setLayoutData("hmin pref, wmin pref, grow");
View Full Code Here

    getController().getProject().addPropertyChangeListener(this);
    getController().getProject().getParameter().addPropertyChangeListener(this);
    getController().addAlgorithmListener(this);

    Composite comp = new Composite(this, SWT.NONE);
    comp.setLayout(new MigLayout("fill, wrap, ins 0"));
    comp.setLayoutData("hmin pref, wmin pref, growx");

    Group bestTour = new Group(comp, SWT.NONE);
    bestTour.setLayout(new MigLayout("fill, wrap 2", "[pref!][]"));
    bestTour.setLayoutData("hmin pref, wmin pref, growx");
    bestTour.setText("Beste Tour");

    Label bestTourIteration = new Label(bestTour, SWT.NONE);
    bestTourIteration.setLayoutData("hmin 0, wmin 0");
    bestTourIteration.setText("Iteration:");

    _lBestTourIteration = new Label(bestTour, SWT.NONE);
    _lBestTourIteration.setLayoutData("hmin 0, wmin 0, growx");

    Label bestTourGlobal = new Label(bestTour, SWT.NONE);
    bestTourGlobal.setLayoutData("hmin 0, wmin 0");
    bestTourGlobal.setText("Global:");

    _lBestTourGlobal = new Label(bestTour, SWT.NONE);
    _lBestTourGlobal.setLayoutData("hmin 0, wmin 0, growx");

    Group averageTour = new Group(comp, SWT.NONE);
    averageTour.setLayout(new MigLayout("fill, wrap 2", "[pref!][]"));
    averageTour.setLayoutData("hmin pref, wmin pref, growx");
    averageTour.setText("Durchschnittliche Tour");

    Label averageTourIteration = new Label(averageTour, SWT.NONE);
    averageTourIteration.setLayoutData("hmin 0, wmin 0");
    averageTourIteration.setText("Iteration:");

    _lAverageTourIteration = new Label(averageTour, SWT.NONE);
    _lAverageTourIteration.setLayoutData("hmin 0, wmin 0, growx");

    Label averageTourGlobal = new Label(averageTour, SWT.NONE);
    averageTourGlobal.setLayoutData("hmin 0, wmin 0");
    averageTourGlobal.setText("Global:");

    _lAverageTourGlobal = new Label(averageTour, SWT.NONE);
    _lAverageTourGlobal.setLayoutData("hmin 0, wmin 0, growx");

    Composite passedTimeComp = new Composite(comp, SWT.NONE);
    passedTimeComp.setLayout(new MigLayout("fill, wrap 2, ins 0 10 0 0", "[pref!][]"));
    passedTimeComp.setLayoutData("hmin pref, wmin pref, growx");

    Label elapsedTime = new Label(passedTimeComp, SWT.NONE);
    elapsedTime.setLayoutData("hmin 0, wmin 0");
    elapsedTime.setText("Verstrichene Zeit:");
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.