Package hu.u_szeged.nbo.client.ui.components.perspective

Examples of hu.u_szeged.nbo.client.ui.components.perspective.ResourceAllocationPerspective


    this.workspace.setLayoutData(this.workspaceStackLayoutData);

    this.loggerContainer = new Composite(mainContainer, SWT.NONE);
    this.logger = new ClientLoggerComponent(loggerContainer, this);

    this.spPerspective = new ResourceAllocationPerspective(this);
    this.ttPerspective = new TransportationTaskPerspective(this);
    this.settingsPerspective = new SettingsPerspective(this);
   
    this.updateClientPerspective = new UpdateClientPerspective(this);
View Full Code Here


      if (domain instanceof ResourceAllocation) {
        lastSelection = selection;

        ResourceAllocation ra = (ResourceAllocation)domain;
        ResourceAllocationPerspective perspective = mainWindow.getRAPerspective();

        String textSolution = ra.getSolution().get(ra.getName());
        String log = ra.getLog();

        mainWindow.changePerspective(perspective);

        perspective.setSummaryText(ra.getSummary());
        perspective.setSourceTables(ra);
        perspective.setSolutionTables(ra);


        if (perspective.getContent().getSelection() == null)
          perspective.getContent().setSelection(0);

        if (textSolution != null)
          perspective.setSolutionText(textSolution);
        else
          perspective.clearText();

        if (log != null)
          perspective.setServerOutputText(log);
        else
          perspective.clearText();

        if ((ra.isSolved() || ra.isFailed()) && !ra.isAcknowledged()) {
          ra.setState(Model.ACKNOWLEDGED);
          mainWindow.getProblemBrowserTree().getTreeViewer().refresh();
       

        if (ra.isStarted() && !ra.isFailed())  {
          perspective.getAlgSelector().setEnabled(false);
          perspective.getOptionsGroup().setEnabled(false);
        }

        else {
          perspective.getAlgSelector().setEnabled(true);
          perspective.getOptionsGroup().setEnabled(true);
        }

        Combo selector = perspective.getAlgSelector();
        Text mText =
          (Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.M_TEXT];
        Text l1Text =
          (Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.L1_TEXT];
        Text l2Text =
          (Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.L2_TEXT];
        Text KText =
          (Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.K_TEXT];
        Text rText =
          (Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.R_TEXT];

        selector.select(ra.getAlgorithmIndex(ra.getAlgorithm()));

        if (ra.getAlgorithm().equals("greedy4")) {
          String m = ra.getAlgParams().get("m");
View Full Code Here

              String success = "";

              if (selection.getFirstElement() == problem) {
                if (problem instanceof ResourceAllocation) {
                  ResourceAllocation raProblem = ((ResourceAllocation)problem);
                  ResourceAllocationPerspective perspective = mainWindow.getRAPerspective();

                  raProblem.setState(Model.ACKNOWLEDGED);
                  perspective.setSummaryText(raProblem.getSummary());
                  perspective.setSolutionText(finalTextSolution);
                  perspective.setSolutionTables((ResourceAllocation)problem);
                  perspective.setServerOutputText(log);
                 
                  perspective.getAlgSelector().setEnabled(false);
                  perspective.getOptionsGroup().setEnabled(false);
                }
              }

              if (!problem.isFailed()) {
                success = "Excercise " + domain.getName()
View Full Code Here

   
    for (Iterator iterator = selection.iterator(); iterator.hasNext();) {
      Model model = (Model)iterator.next();
     
      if (model instanceof ResourceAllocation) {
        ResourceAllocationPerspective perspective = mainWindow.getRAPerspective();
        ResourceAllocation raProblem = (ResourceAllocation) model;
               
        if ((raProblem.isStarted()) && (!raProblem.isFailed()) && (!raProblem.isSolved())) {
          raProblem.getSolverThread().stopSolving();
          SolutionMonitorThread.monitors.get(raProblem.getName()).stopMonitoring(); // FIX: started problem fails to stop
        }
       
        raProblem.clear();
       
        perspective.clearSolutionTables(raProblem.getName());
        perspective.clearText();
        perspective.setSummaryText(raProblem.getSummary());
        perspective.getAlgSelector().select(raProblem.getAlgorithmIndex(raProblem.getAlgorithm()));
       
        Text mText =
                (Text)perspective.getOptionsGroup().getChildren()[ResourceAllocationPerspective.M_TEXT];
             
                mText.setEnabled(false);
                mText.setText("1");
               
              perspective.getAlgSelector().setEnabled(true);
              perspective.getOptionsGroup().setEnabled(true);
             
              ClientLogManager.addUserLog("Results cleared for problem " + raProblem
                  + " [#" + raProblem.getUniqueID() + "].", false);
      }
       
View Full Code Here

TOP

Related Classes of hu.u_szeged.nbo.client.ui.components.perspective.ResourceAllocationPerspective

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.