Package de.hwrberlin.it11.tsp.gui.components

Examples of de.hwrberlin.it11.tsp.gui.components.StopCriteriaComposite


   *            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


    _bOptTourFilePath.setTooltipText("Ein Klick auf diesen Button �ffnet den Datei-Browser, mit dem Sie eine L�sungsdatei aussuchen k�nnen.");
    _bOptTourFilePath.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        String path = new FileDialogFactory().setParent(getShell()).setFilter(FileDialogFilter.OPTTOUR).setStyle(SWT.OPEN).open();
        if (path != null) {
          List<Integer> indexList = Persister.loadOptTourFile(new File(path));
          if (indexList.size() - 1 != getController().getProject().getTSPData().getNodeList().size()) {
            MessageDialog
                .openError(getShell(), "Ung�ltige optimale Tour",
View Full Code Here

    fileMenuItemOpenTSPFile.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (!_currentTabContent.getController().isRunning()) {
          String path = new FileDialogFactory().setParent(pParent).setStyle(SWT.OPEN).setFilter(FileDialogFilter.TSP).open();
          if (path != null) {
            try {
              File file = new File(path);
              TSPData data = Persister.loadTSPFile(file);
              _currentTabContent.setTSPFile(file);
              _tabFolder.getSelection().setText(data.getName());
              _currentTabContent.getController().getProject().setTSPData(data);
            }
            catch (IllegalArgumentException pEx) {
              MessageDialog.openError(pParent, "Ung�ltige Datei", pEx.getMessage());
            }
          }
        }
        else {
          MessageDialog.openError(pParent, "TSP Datei �ffnen", "Es kann keine TSP Datei ge�ffnet werden, wenn der Algorithmus l�uft.");
        }
      }
    });

    fileMenuItemSaveTSPFile.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        File file = _currentTabContent.getTSPFile();
        if (file == null) {
          String path = new FileDialogFactory().setParent(pParent).setStyle(SWT.SAVE).setFilter(FileDialogFilter.TSP).open();
          if (path != null) {
            file = new File(path);
            _currentTabContent.setTSPFile(file);
          }
        }
        if (file != null) {
          Persister.saveTSPFile(file, _currentTabContent.getController().getProject().getTSPData());
        }
      }
    });

    fileMenuItemSaveTSPFileAs.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        String path = new FileDialogFactory().setParent(pParent).setStyle(SWT.SAVE).setFilter(FileDialogFilter.TSP).open();
        if (path != null) {
          File file = new File(path);
          _currentTabContent.setTSPFile(file);
          Persister.saveTSPFile(file, _currentTabContent.getController().getProject().getTSPData());
        }
      }
    });

    fileMenuItemOpenConfigFile.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (!_currentTabContent.getController().isRunning()) {
          String path = new FileDialogFactory().setParent(pParent).setStyle(SWT.OPEN).setFilter(FileDialogFilter.TSPCONFIG).open();
          if (path != null) {
            try {
              File file = new File(path);
              Parameter parameter = Persister.loadParameterFile(file);
              _currentTabContent.setTSPConfigFile(file);
              _currentTabContent.getController().getProject().setParameter(parameter);
            }
            catch (IllegalArgumentException pEx) {
              MessageDialog.openError(pParent, "Ung�ltige Datei", pEx.getMessage());
            }
          }
        }
        else {
          MessageDialog.openError(pParent, "Konfigurationsdatei �ffnen",
              "Es kann keine Konfigurationsdatei ge�ffnet werden, wenn der Algorithmus l�uft.");
        }
      }
    });

    fileMenuItemSaveConfigFile.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        File file = _currentTabContent.getTSPConfigFile();
        if (file == null) {
          String path = new FileDialogFactory().setParent(pParent).setStyle(SWT.SAVE).setFilter(FileDialogFilter.TSPCONFIG).open();
          if (path != null) {
            file = new File(path);
            _currentTabContent.setTSPConfigFile(file);
          }
        }
        if (file != null) {
          Persister.saveParameterFile(file, _currentTabContent.getController().getProject().getParameter());
        }
      }
    });

    fileMenuItemSaveConfigFileAs.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        String path = new FileDialogFactory().setParent(pParent).setStyle(SWT.SAVE).setFilter(FileDialogFilter.TSPCONFIG).open();
        if (path != null) {
          File file = new File(path);
          _currentTabContent.setTSPConfigFile(file);
          Persister.saveParameterFile(file, _currentTabContent.getController().getProject().getParameter());
        }
View Full Code Here

* Klasse, die die main-Methode enth�lt und das Programm startet.
*/
public class Starter {

  public static void main(String[] args) {
    new GUI().layout();
  }
View Full Code Here

  /**
   * Erzeugt einen neuen TabContent, f�gt ihn zu einem neuen CTabItem hinzu und f�gt das CTabItems dem CTabFolder hinzu. Danach wird der Fokus auf
   * das neu kreierte Item gesetzt.
   */
  private void newTab() {
    TabContent content = new TabContent(_tabFolder, SWT.NONE);
    content.setLayout(new MigLayout("fill"));
    content.setLayoutData("hmin 0, wmin 0");

    CTabItem tabItem = new CTabItem(_tabFolder, SWT.NONE);
    tabItem.setText(content.getController().getProject().getTSPData().getName());
    tabItem.setControl(content);

    _tabFolder.setSelection(tabItem);
    if (_currentTabContent != null) {
      _currentTabContent.getController().getProject().getTSPData().removePropertyChangeListener(this);
View Full Code Here

    helpMenuItemAbout.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        new AboutDialog(pParent, _currentTabContent.getController().getProject()).open();
      }
    });
  }
View Full Code Here

    helpMenuItemHelp.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        new HelpDialog(pParent).open();
      }
    });

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

              _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

    editMenuItemEditPreferences.addSelectionListener(new SelectionAdapter() {

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

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

    editMenuItemCreateRandomProject.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (!_currentTabContent.getController().isRunning()) {
          RandomProjectDialog randomProjectDialog = new RandomProjectDialog(pParent, _currentTabContent.getController().getProject());
          TSPData data = randomProjectDialog.open();
          if (data != null) {
            _currentTabContent.getController().getProject().setTSPData(data);
          }
        }
        else {
View Full Code Here

TOP

Related Classes of de.hwrberlin.it11.tsp.gui.components.StopCriteriaComposite

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.