Package de.hwrberlin.it11.tsp.unittest

Examples of de.hwrberlin.it11.tsp.unittest.ParameterTest


    editMenuItemEditTSPData.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        new TSPDataDialog(pParent, _currentTabContent.getController().getProject().getTSPData(), _currentTabContent.getController()
            .getProject()).open();
      }
    });

    editMenuItemEditPreferences.addSelectionListener(new SelectionAdapter() {
View Full Code Here


    Parameter parameter = getController().getProject().getParameter();

    // Zahl der Iterationen binden
    pDBC.bindValue(SWTObservables.observeText(_tIterationCount.getText(), SWT.Modify),
        BeansObservables.observeValue(pRealm, parameter, PropertyChangeTypes.PARAMETER_ITERATIONCOUNT), new StringToIntegerUpdateStrategy(),
        new NumberToStringUpdateStrategy());
    // Schwellenwert der Tourl�nge binden
    pDBC.bindValue(SWTObservables.observeText(_tMaximumTourLength.getText(), SWT.Modify),
        BeansObservables.observeValue(pRealm, parameter, PropertyChangeTypes.PARAMETER_MAXIMUMTOURLENGTH),
        new StringToDoubleUpdateStrategy(), new NumberToStringUpdateStrategy());
  }
View Full Code Here

        BeansObservables.observeValue(pRealm, parameter, PropertyChangeTypes.PARAMETER_ITERATIONCOUNT), new StringToIntegerUpdateStrategy(),
        new NumberToStringUpdateStrategy());
    // Schwellenwert der Tourl�nge binden
    pDBC.bindValue(SWTObservables.observeText(_tMaximumTourLength.getText(), SWT.Modify),
        BeansObservables.observeValue(pRealm, parameter, PropertyChangeTypes.PARAMETER_MAXIMUMTOURLENGTH),
        new StringToDoubleUpdateStrategy(), new NumberToStringUpdateStrategy());
  }
View Full Code Here

  protected void bindValues(DataBindingContext pDBC, Realm pRealm) {
    Parameter parameter = getController().getProject().getParameter();

    // Zahl der Iterationen binden
    pDBC.bindValue(SWTObservables.observeText(_tIterationCount.getText(), SWT.Modify),
        BeansObservables.observeValue(pRealm, parameter, PropertyChangeTypes.PARAMETER_ITERATIONCOUNT), new StringToIntegerUpdateStrategy(),
        new NumberToStringUpdateStrategy());
    // Schwellenwert der Tourl�nge binden
    pDBC.bindValue(SWTObservables.observeText(_tMaximumTourLength.getText(), SWT.Modify),
        BeansObservables.observeValue(pRealm, parameter, PropertyChangeTypes.PARAMETER_MAXIMUMTOURLENGTH),
        new StringToDoubleUpdateStrategy(), new NumberToStringUpdateStrategy());
View Full Code Here

  @Override
  protected void bindValues(DataBindingContext pDBC, Realm pRealm) {
    // ZoomFactor-Scale binden
    pDBC.bindValue(SWTObservables.observeSelection(_zoomFactor.getScale()),
        BeansObservables.observeValue(pRealm, getController().getProject().getParameter(), PropertyChangeTypes.PARAMETER_ZOOMFACTOR),
        new ZoomFactorTargetToModelUpdateStrategy(), new ZoomFactorModelToTargetUpdateStrategy());
    // Statustext binden
    pDBC.bindValue(SWTObservables.observeText(_statusLabel),
        BeansObservables.observeValue(pRealm, getController().getProject(), PropertyChangeTypes.PROJECT_STATUSTEXT));
  }
View Full Code Here

  @Override
  protected void bindValues(DataBindingContext pDBC, Realm pRealm) {
    // ZoomFactor-Scale binden
    pDBC.bindValue(SWTObservables.observeSelection(_zoomFactor.getScale()),
        BeansObservables.observeValue(pRealm, getController().getProject().getParameter(), PropertyChangeTypes.PARAMETER_ZOOMFACTOR),
        new ZoomFactorTargetToModelUpdateStrategy(), new ZoomFactorModelToTargetUpdateStrategy());
    // Statustext binden
    pDBC.bindValue(SWTObservables.observeText(_statusLabel),
        BeansObservables.observeValue(pRealm, getController().getProject(), PropertyChangeTypes.PROJECT_STATUSTEXT));
  }
View Full Code Here

    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");
    confirm.setTooltipText("Speichert die Eigenschaften und schlie�t den Dialog.");
    confirm.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (tRedrawInterval.isValidInput()) {
          try {
            preferences.setAntialias(bAntialias.getButton().getSelection());
            preferences.setRedrawInterval(Utility.FORMAT.parse(tRedrawInterval.getText().getText()).intValue());
            preferences.setNodeColor(cNodeColor.getBackground());
            preferences.setCurrentNodeColor(cCurrentNodeColor.getBackground());
            preferences.setBestTourGlobalColor(cBestTourGlobalColor.getBackground());
            preferences.setBestTourIterationColor(cBestTourIterationColor.getBackground());
            preferences.setBackgroundColor(cBackgroundColor.getBackground());
          }
          catch (ParseException e) {
            MessageDialog.openError(shell, "Fehler beim umwandeln der Werte",
                "Beim Umwandeln der Werte von Text in eine Zahl ist ein Fehler aufgetreten.");
          }
          shell.close();
        }
        else {
          MessageDialog
              .openError(shell, "Ung�ltiger Wert",
                  "Eines der Textfelder hat einen ung�ltigen Eingabewert (rot unterlegt). Um fortzufahren geben Sie bitte einen g�ltigen Wert ein.");
        }
      }
    });

    AntButton cancel = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    cancel.getButton().setText("Abbrechen");
    cancel.getButton().setLayoutData("hmin pref, wmin pref, grow");
    cancel.setTooltipText("Schlie�t den Dialog und verwirft alle �nderungen.");
    cancel.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        shell.close();
      }
View Full Code Here

    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");
    confirm.setTooltipText("W�hlt die angeklickte Farbe aus und schlie�t den Dialog.");
    confirm.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        shell.close();
      }
    });

    AntButton cancel = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    cancel.getButton().setText("Abbrechen");
    cancel.getButton().setLayoutData("hmin pref, wmin pref, grow");
    cancel.setTooltipText("Schlie�t den Dialog ohne eine Farbe auszuw�hlen.");
    cancel.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        _result = null;
        shell.close();
View Full Code Here

    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");
    confirm.setTooltipText("Erstellt ein neues Projekt und schlie�t den Dialog.");
    confirm.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (tNodeCount.isValidInput() && tMaxXCoordinate.isValidInput() && tMaxYCoordinate.isValidInput()) {
          List<Node> nodeList = new ArrayList<Node>();
          int nodeCount;
          try {
            nodeCount = Utility.FORMAT.parse(tNodeCount.getText().getText()).intValue();
            double maxX = Utility.FORMAT.parse(tMaxXCoordinate.getText().getText()).doubleValue();
            double maxY = Utility.FORMAT.parse(tMaxYCoordinate.getText().getText()).doubleValue();
            if (nodeCount == 0) {
              nodeCount = (int) (Math.random() * 99) + 1;
            }
            if (maxX == 0) {
              maxX = (int) (Math.random() * 4999) + 1;
            }
            if (maxY == 0) {
              maxY = (int) (Math.random() * 4999) + 1;
            }
            for (int i = 0; i < nodeCount; i++) {
              Node node = new Node(Math.random() * maxX, Math.random() * maxY);
              nodeList.add(node);
            }

            _result = new TSPData();
            _result.setName("Zufallsprojekt");
            _result.setComment("Zufallsgeneriertes Projekt");
            _result.setEdgeWeightType("EUC_2D");
            _result.setNodeList(nodeList);
            _result.setType("TSP");
          }
          catch (ParseException e) {
            MessageDialog.openError(shell, "Fehler beim umwandeln der Werte",
                "Beim Umwandeln der Werte von Text in eine Zahl ist ein Fehler aufgetreten.");
          }

          shell.dispose();
        }
      }
    });

    AntButton cancel = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    cancel.getButton().setText("Abbrechen");
    cancel.getButton().setLayoutData("hmin pref, wmin pref, grow");
    cancel.setTooltipText("Schlei�t den Dialog ohne ein Projekt zu erstellen.");
    cancel.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        shell.close();
      }
View Full Code Here

    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");
    confirm.setTooltipText("Erstellt einen neuen Knoten mit den angegebenen Koordinaten und schlie�t den Dialog.");
    confirm.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (tXCoordinate.isValidInput() && tYCoordinate.isValidInput()) {
          try {
            _result = new Node(Utility.FORMAT.parse(tXCoordinate.getText().getText()).doubleValue(), Utility.FORMAT.parse(
                tYCoordinate.getText().getText()).doubleValue());
          }
          catch (ParseException e) {
            MessageDialog.openError(shell, "Fehler beim umwandeln der Werte",
                "Beim Umwandeln der Werte von Text in eine Zahl ist ein Fehler aufgetreten.");
          }
          shell.close();
        }
        else {
          MessageDialog
              .openError(shell, "Ung�ltiger Wert",
                  "Eines der Textfelder hat einen ung�ltigen Eingabewert (rot unterlegt). Um fortzufahren geben Sie bitte einen g�ltigen Wert ein.");
        }
      }
    });

    AntButton cancel = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    cancel.getButton().setText("Abbrechen");
    cancel.getButton().setLayoutData("hmin pref, wmin pref, grow");
    cancel.setTooltipText("Schlie�t den Dialog ohne Erstellung eines Knotens.");
    cancel.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        shell.close();
      }
View Full Code Here

TOP

Related Classes of de.hwrberlin.it11.tsp.unittest.ParameterTest

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.