Package de.hwrberlin.it11.tsp.gui.dialog

Examples of de.hwrberlin.it11.tsp.gui.dialog.AboutDialog


    Label lAntCount = new Label(comp, SWT.NONE);
    lAntCount.setLayoutData("hmin 0, wmin 0");
    lAntCount.setText("Anzahl der Ameisen:");

    _tAntCount = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tAntCount.getText().setLayoutData("hmin pref, wmin 50, growx");
    _tAntCount.setTooltipText("Hier k�nnen Sie einstellen, wie viele Ameisen pro Iterationen den Weg suchen sollen. (X > 0)");
    _tAntCount.setInputMode(AntText.INTEGER_ONLY);
    _tAntCount.setNumberRange(1, Double.POSITIVE_INFINITY, true, true);

    Label lPheromonParameter = new Label(comp, SWT.NONE);
    lPheromonParameter.setLayoutData("hmin 0, wmin 0");
    lPheromonParameter.setText("Pheromonparameter:");

    _tPheromonParameter = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tPheromonParameter.getText().setLayoutData("hmin pref, wmin 50, growx");
    _tPheromonParameter
        .setTooltipText("Hier k�nnen Sie einstellen, wie wichtig das Pheromon auf einer Kante bei der Auswahl des Weges ist. (0 < X <= 5)");
    _tPheromonParameter.setInputMode(AntText.DOUBLE_ONLY);
    _tPheromonParameter.setNumberRange(0, 5, false, true);

    Label lLocalInformation = new Label(comp, SWT.NONE);
    lLocalInformation.setLayoutData("hmin 0, wmin 0");
    lLocalInformation.setText("Lokale Information:");

    _tLocalInformation = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tLocalInformation.getText().setLayoutData("hmin pref, wmin 50, growx");
    _tLocalInformation.setTooltipText("Hier k�nnen Sie einstellen, wie wichtig k�rzere Wege bei der Auswahl des Weges sind. (0 < X <= 5)");
    _tLocalInformation.setInputMode(AntText.DOUBLE_ONLY);
    _tLocalInformation.setNumberRange(0, 5, false, true);

    Label lEvaporationParameter = new Label(comp, SWT.NONE);
    lEvaporationParameter.setLayoutData("hmin 0, wmin 0");
    lEvaporationParameter.setText("Verdunstungsparameter:");

    _tEvaporationParameter = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tEvaporationParameter.getText().setLayoutData("hmin pref, wmin 50, growx");
    _tEvaporationParameter.setTooltipText("Hier k�nnen Sie einstellen, wie viele Pheromone nach einer Iteration verdunsten sollen. (0 < X <= 1)");
    _tEvaporationParameter.setInputMode(AntText.DOUBLE_ONLY);
    _tEvaporationParameter.setNumberRange(0, 1, false, true);

    Label lInitialPheromonParameter = new Label(comp, SWT.NONE);
    lInitialPheromonParameter.setLayoutData("hmin 0, wmin 0");
    lInitialPheromonParameter.setText("Initialpheromonwert:");

    _tInitialPheromonParameter = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tInitialPheromonParameter.getText().setLayoutData("hmin pref, wmin 50, growx");
    _tInitialPheromonParameter
        .setTooltipText("Hier k�nnen Sie einstellen, wie viele Pheromone auf den Kanten beim Start des Suchvorganges liegen sollen. (X > 0)");
    _tInitialPheromonParameter.setInputMode(AntText.DOUBLE_ONLY);
    _tInitialPheromonParameter.setNumberRange(0, Double.POSITIVE_INFINITY, false, true);

    Label lPheromonUpdateParameter = new Label(comp, SWT.NONE);
    lPheromonUpdateParameter.setLayoutData("hmin 0, wmin 0");
    lPheromonUpdateParameter.setText("Pheromonupdateparameter:");

    _tPheromonUpdateParameter = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tPheromonUpdateParameter.getText().setLayoutData("hmin pref, wmin 50, growx");
    _tPheromonUpdateParameter
        .setTooltipText("Hier k�nnen Sie einstellen, wie viele Pheromone eine Ameise auf eine Kante legt, wenn sie dar�ber gelaufen ist. (X > 0)");
    _tPheromonUpdateParameter.setInputMode(AntText.DOUBLE_ONLY);
    _tPheromonUpdateParameter.setNumberRange(0, Double.POSITIVE_INFINITY, false, true);
View Full Code Here


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

    final AntText tXCoordinate = new AntText(new Text(shell, SWT.BORDER), getProject());
    tXCoordinate.getText().setText(Utility.FORMAT.format(_xCoordinate));
    tXCoordinate.getText().setLayoutData("hmin pref, wmin 50, growx");
    tXCoordinate.setTooltipText("Die X Koordinate f�r den neuen Knoten. (X >= 0)");
    tXCoordinate.setInputMode(AntText.DOUBLE_ONLY);
    tXCoordinate.setNumberRange(0, Double.POSITIVE_INFINITY, true, true);

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

    final AntText tYCoordinate = new AntText(new Text(shell, SWT.BORDER), getProject());
    tYCoordinate.getText().setText(Utility.FORMAT.format(_yCoordinate));
    tYCoordinate.getText().setLayoutData("hmin pref, wmin 50, growx");
    tYCoordinate.setTooltipText("Die Y Koordinate f�r den neuen Knoten. (Y >= 0)");
    tYCoordinate.setInputMode(AntText.DOUBLE_ONLY);
    tYCoordinate.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");
    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.");
          }
View Full Code Here

    _rIterationCount.getButton().setLayoutData("hmin 0, wmin 0");
    _rIterationCount.getButton().setText("Iterationen:");
    _rIterationCount
        .setTooltipText("Diese Option l�sst den Suchvorgang stoppen, nachdem eine eingestellte Anzahl an Iterationen durchgef�hrt wurden.");

    _tIterationCount = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tIterationCount.getText().setLayoutData("hmin pref, wmin 50, spanx 2, growx");
    _tIterationCount.setTooltipText("Hier k�nnen Sie einstellen, wie oft iteriert werden soll. (X > 0)");
    _tIterationCount.setInputMode(AntText.INTEGER_ONLY);
    _tIterationCount.setNumberRange(1, Double.POSITIVE_INFINITY, false, true);
    _tIterationCount.addValidInputListener(this);

    _rMaximumTourLength = new AntButton(new Button(comp, SWT.RADIO), getController().getProject());
    _rMaximumTourLength.getButton().setLayoutData("hmin 0, wmin 0");
    _rMaximumTourLength.getButton().setText("Tourl�nge:");
    _rMaximumTourLength
        .setTooltipText("Diese Option l�sst den Suchvorgang stoppen, nachdem eine Tour gefunden wurde, die k�rzer oder gleich lang als eine eingestellte L�nge ist.");

    _tMaximumTourLength = new AntText(new Text(comp, SWT.BORDER), getController().getProject());
    _tMaximumTourLength.getText().setLayoutData("hmin pref, wmin 50, spanx 2, growx");
    _tMaximumTourLength.setTooltipText("Hier k�nnen Sie einstellen, bei welcher Tourl�nge abegebrochen werden soll. (X > 0)");
    _tMaximumTourLength.setInputMode(AntText.DOUBLE_ONLY);
    _tMaximumTourLength.setNumberRange(0, Double.POSITIVE_INFINITY, false, true);
    _tMaximumTourLength.addValidInputListener(this);
View Full Code Here

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

    final AntText tName = new AntText(new Text(shell, SWT.BORDER), getProject());
    tName.getText().setText(_tspData.getName());
    tName.getText().setLayoutData("hmin pref, wmin 50, growx");
    tName.setTooltipText("Name des TSP Projektes.");

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

    final AntText tComment = new AntText(new Text(shell, SWT.BORDER), getProject());
    tComment.getText().setText(_tspData.getComment());
    tComment.getText().setLayoutData("hmin pref, wmin 50, growx");
    tComment.setTooltipText("Kommentar des TSP Projektes.");

    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");
View Full Code Here

    _tPheromonUpdateParameter.setInputMode(AntText.DOUBLE_ONLY);
    _tPheromonUpdateParameter.setNumberRange(0, Double.POSITIVE_INFINITY, false, true);

    _allInputValidListenerList = new ArrayList<AllInputValidListener>();

    new AllInputValidValidator(_allInputValidListenerList, _tAntCount, _tEvaporationParameter, _tInitialPheromonParameter, _tLocalInformation,
        _tPheromonParameter, _tPheromonUpdateParameter);

    resetBinding();
  }
View Full Code Here

   *            das Eltern Composite
   * @param pStyle
   *            die SWT Stylebits dieses Composite
   */
  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%");

View Full Code Here

   *            der Controller dieses DrawComposite
   */
  public DrawComposite(Composite pParent, int pStyle, AntController pController) {
    super(pParent, pStyle, pController);

    AntProject project = getController().getProject();
    project.addPropertyChangeListener(this);
    project.getParameter().addPropertyChangeListener(this);
    project.getTSPData().addPropertyChangeListener(this);
    Preferences.getInstance().addPropertyChangeListener(this);

    _scrolledComposite = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL);
    _scrolledComposite.setLayoutData("hmin 0, wmin 0, grow, push");
    _scrolledComposite.setExpandHorizontal(true);
    _scrolledComposite.setExpandVertical(true);

    _canvas = new Canvas(_scrolledComposite, SWT.DOUBLE_BUFFERED);

    _zoomFactor = new AntScale(new Scale(this, SWT.VERTICAL), getController().getProject());
    _zoomFactor.getScale().setLayoutData("hmin 0, wmin pref, growy");
    _zoomFactor.getScale().setMinimum(5);
    _zoomFactor.getScale().setMaximum(300);
    _zoomFactor.setTooltipText("Hier k�nnen Sie den Zoom-Faktor einstellen, mit dem die Knoten und Kanten dargestellt werden.");

    _canvas.addPaintListener(new AntPaintListener());
    _canvas.addMouseListener(new MouseAdapter() {

      @Override
      public void mouseDown(MouseEvent pE) {
        if (pE.button == 1) {
          if (_selectedNode != null) {
            _selectedNode.removePropertyChangeListener(DrawComposite.this);
          }
          double zoomFactor = getController().getProject().getParameter().getZoomFactor();
          double x = (pE.x - BORDER_WIDTH) / zoomFactor;
          double y = (pE.y - BORDER_WIDTH) / zoomFactor;
          _selectedNode = getController().getProject().getNodeForCoordinates((int) x, (int) y);
          if (_selectedNode != null) {
            _selectedNode.addPropertyChangeListener(DrawComposite.this);
            _drag = true;
          }
          _canvas.redraw();
        }
      }



      @Override
      public void mouseUp(MouseEvent pE) {
        if (pE.button == 1) {
          _drag = false;
        }
      }



      @Override
      public void mouseDoubleClick(MouseEvent pE) {
        if (pE.button == 1) {
          if (pE.x - BORDER_WIDTH >= 0 && pE.y - BORDER_WIDTH >= 0 && !getController().isRunning()) {
            if (_selectedNode != null) {
              _selectedNode.removePropertyChangeListener(DrawComposite.this);
              _drag = false;
              _selectedNode = null;
            }
            AntProject project = getController().getProject();
            double zoomFactor = project.getParameter().getZoomFactor();
            NewNodeDialog newNodeDialog = new NewNodeDialog(getShell(), project, (pE.x - BORDER_WIDTH) / zoomFactor,
                (pE.y - BORDER_WIDTH) / zoomFactor);
            Node newNode = newNodeDialog.open();
            if (newNode != null) {
              project.getTSPData().addNode(newNode);
            }
          }
        }
      }
    });
View Full Code Here

          || PropertyChangeTypes.TSPDATA_NODELIST_ADD.equals(propertyName) // Es wurde eine Node zur Knotenliste hinzugef�gt
          || PropertyChangeTypes.TSPDATA_NODELIST_REMOVE.equals(propertyName) // Es wurde eine Node von der Knotenliste entfernt
          || PropertyChangeTypes.PARAMETER_ZOOMFACTOR.equals(propertyName)) { // Der Zoom-Faktor hat sich ver�ndert
        double maxX = 0;
        double maxY = 0;
        AntProject project = getController().getProject();
        for (Node node : project.getTSPData().getNodeList()) {
          if (node.getxCoordinate() > maxX) {
            maxX = node.getxCoordinate();
          }
          if (node.getyCoordinate() > maxY) {
            maxY = node.getyCoordinate();
          }
        }

        double zoomFactor = project.getParameter().getZoomFactor();
        int preferredWidth = (int) (maxX * zoomFactor) + BORDER_WIDTH * 2;
        int preferredHeight = (int) (maxY * zoomFactor) + BORDER_WIDTH * 2;

        _scrolledComposite.setMinSize(preferredWidth, preferredHeight);

View Full Code Here

   */
  private class AntPaintListener implements PaintListener {

    @Override
    public void paintControl(PaintEvent pE) {
      AntProject project = getController().getProject();
      List<Node> nodeList = project.getTSPData().getNodeList();
      double zoomFactor = project.getParameter().getZoomFactor();

      Result result = project.getResult();
      Preferences preferences = Preferences.getInstance();

      if (preferences.isAntialias()) {
        pE.gc.setAntialias(SWT.ON);
      }
View Full Code Here

   * Enabled und disabled den Start-Button basierend auf den Validierungsstati der in dieser Instanz definierten Textfelder und des Ergebnisses des
   * AllInputValodListener.
   */
  private void evaluateStartEnabled() {
    boolean enable = _allInputValid && _tIterationCount.isValidInput() && _tMaximumTourLength.isValidInput();
    AntProject project = getController().getProject();
    enable = enable && project.getTSPData().getNodeList().size() > 1;
    if (_rOptTourFilePath.getButton().getSelection()) {
      enable = enable
          && !(project.getOptimalTourIndeces() == null || (project.getTSPData().getNodeList().size() != project.getOptimalTourIndeces()
              .size() - 1));
    }
    _bStart.getButton().setEnabled(enable);
  }
View Full Code Here

TOP

Related Classes of de.hwrberlin.it11.tsp.gui.dialog.AboutDialog

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.