Package resources.digesters

Examples of resources.digesters.Plugin


 
  private void tipoGpsComboWidgetSelected(SelectionEvent evt)
  {
    try
    {
      Plugin selectedGPS = ClassManager.getInstance().getPluginByName((String)gpsHash.get(((CCombo)evt.getSource()).getText()));
     
      if (selectedGPS != null)
      {
        if (!webcamConfig.isDisposed())
          webcamConfig.dispose();
        ImageBasedGPS gps = (ImageBasedGPS) selectedGPS.makeIntance();
        Simulation.getCurrent().setGps(gps);
        GPSGUI gpsGUI = (GPSGUI) selectedGPS.makeGUInstance(gps);
        webcamConfig = gpsGUI.getConfigPannel(composite2, composite2.getStyle());
        GridData webcamConfigLData = new GridData();
        webcamConfigLData.horizontalAlignment = GridData.FILL;
        webcamConfigLData.verticalAlignment = GridData.BEGINNING;
        webcamConfigLData.grabExcessVerticalSpace=true;
View Full Code Here


    webcamConfigLData.horizontalSpan = 1;
    gpsConfig.setLayoutData(webcamConfigLData);
    GridLayout webcamConfigLayout = new GridLayout();
    webcamConfigLayout.numColumns = 2;
    gpsConfig.setLayout(webcamConfigLayout);
    Plugin ic;
   
    try
    {
      ic = ClassManager.getInstance().getPluginByName(((ImageBasedGPS)this.component).getImageCollector().getClass().getCanonicalName());
    }
    catch (EasyBotAppException e1)
    {
      throw new ComponentGUIException(e1.getMessage());
    }
   
    if (ic != null)
    {
   
      try
      {
        icGUI = (ImageCollectorGUI) ic.makeGUInstance(((ImageBasedGPS)component).getImageCollector());
        Composite imageCollectorConfig = icGUI.getConfigPannel(gpsConfig, style);
        GridData icLData = new GridData();
        icLData.horizontalAlignment = GridData.FILL;
        icLData.verticalAlignment = GridData.BEGINNING;
        icLData.grabExcessHorizontalSpace=true;
View Full Code Here

      if (worldTree.getSelectionCount() > 0
          && worldTree.getSelection()[0].getText().compareTo("World") != 0) {
        Robot roboTemp = Simulation.getCurrent().getRobotByName(
            worldTree.getSelection()[0].getText());
        if (roboTemp != null) {
          Plugin plugin = ClassManager.getInstance().getPluginByName(
              roboTemp.getClass().getCanonicalName());

          // Se instancia la clase GUI y se le pasa el robot.

          if (plugin != null) {
            Composite temp = customRobotStatus;
            RobotGUI robotGUI = (RobotGUI) plugin
                .makeGUInstance(roboTemp);
            customRobotStatus = robotGUI.getStatusPannel(
                robotStatus, robotStatus.getStyle());

            if (temp != null && !temp.isDisposed())
View Full Code Here

      if (worldTree.getSelectionCount() > 0 && worldTree.getSelection()[0].getText().compareTo("World")!= 0)
      {
        Robot roboTemp = Simulation.getCurrent().getRobotByName(worldTree.getSelection()[0].getText());
        if (roboTemp != null)
        {
          Plugin plugin = ClassManager.getInstance().getPluginByName(roboTemp.getClass().getCanonicalName());
         
          // Se instancia la clase GUI y se le pasa el robot.
         
          if ( plugin != null )
          {
            Composite temp = customRobotStatus;
            RobotGUI robotGUI = (RobotGUI)plugin.makeGUInstance(roboTemp);
            customRobotStatus =  robotGUI.getStatusPannel( robotStatus, robotStatus.getStyle());
           
            if ( temp != null  &&  !temp.isDisposed() )
              temp.dispose();
           
View Full Code Here

      for (int i=0; i<this.getRobotArray().size();i++)
      {
        String file =((Robot)this.getRobotArray().get(i)).getXMLConfigFile();
        xmlWriter.println("\t<robot>");
        xmlWriter.println("\t\t<xmlfile>"+this.getBaseSimulationDirectory()+"\\components\\"+file+"</xmlfile>");
        Plugin robot = ClassManager.getInstance().getPluginByName(((Robot)this.getRobotArray().get(i)).getClass().getCanonicalName());
        xmlWriter.println("\t\t<xml-rules>"+robot.getContext().getPath()+robot.getXmlRulesFile()+"</xml-rules>");
        xmlWriter.println("\t</robot>");
      }
     
      xmlWriter.println("\t<gps>");
      xmlWriter.println("\t\t<xmlfile>"+this.getBaseSimulationDirectory()+"\\components\\gps.xml</xmlfile>");
      Plugin gps = ClassManager.getInstance().getPluginByName(Simulation.getCurrent().getGps().getClass().getCanonicalName());
      xmlWriter.println("\t\t<xml-rules>"+gps.getContext().getPath()+gps.getXmlRulesFile()+"</xml-rules>");
      xmlWriter.println("\t</gps>");
     
      // Bloques XML correspondientes a los lugares ("places").
      xmlWriter.println("\t<places>");
      for (int i=0;i<places.length;i++)
View Full Code Here

          sensorComposite.setLayout(sensorCompositeLayout);
          sensorComposite.setLayoutData(sensorCompositeLData);
          {
            for (int i=0; i<((Robot)component).getFeatures().length;i++)
            {
              Plugin plugin = ClassManager.getInstance().getPluginByName(((Robot)component).getFeatures()[i].getClass().getCanonicalName());

              if (plugin != null)
              {
                FeatureGUI featureGUI = (FeatureGUI)plugin.makeGUInstance(((Robot)component).getFeatures()[i]);
                featureStatus =  featureGUI.getStatusPannel( sensorComposite, sensorComposite.getStyle());
                 
                //Fuerzo layout
                GridData featureStatusLData = new GridData();
                featureStatusLData.horizontalAlignment = GridData.FILL;
                featureStatusLData.verticalAlignment = GridData.FILL;
                featureStatusLData.grabExcessHorizontalSpace = true;
                featureStatusLData.grabExcessVerticalSpace = true;
                featureStatus.setLayoutData(featureStatusLData);
              }
            }
          }       
          sensorComposite.layout(true);
        }
        neuralNet = new CTabItem(tabs,SWT.NONE);
        neuralNet.setText("Red Neuronal");
        neuralNet.setImage(SWTResourceManager.getImage("resources/icons/icon24x24/enable/neuron.png"));
        {
          Plugin neuralNetPlugin = ClassManager.getInstance().getPluginByName(((Robot)component).getNeuralNetwork().getClass().getCanonicalName());
          if (neuralNetPlugin != null)
          {
            NeuralNetworkGUI nnGUI = (NeuralNetworkGUI) neuralNetPlugin.makeGUInstance(((Robot)component).getNeuralNetwork());
            Composite neuralNetComposite = nnGUI.getStatusPannel(tabs,SWT.NONE);
            neuralNet.setControl(neuralNetComposite);
            GridData neuralNetCompositeLData = new GridData();
            neuralNetCompositeLData.horizontalAlignment = GridData.BEGINNING;
            neuralNetCompositeLData.verticalAlignment = GridData.BEGINNING;
            neuralNetCompositeLData.grabExcessHorizontalSpace = true;
            neuralNetCompositeLData.grabExcessVerticalSpace = false;
            GridLayout neuralNetCompositeLayout = new GridLayout();
            neuralNetComposite.setLayout(neuralNetCompositeLayout);
            neuralNetComposite.setLayoutData(neuralNetCompositeLData);
            neuralNetComposite.layout(true);
          }
         
        }
        commChannel = new CTabItem(tabs,SWT.NONE);
        commChannel.setText("Canal de Comunicaciones");
        commChannel.setImage(SWTResourceManager.getImage("resources/icons/icon24x24/enable/Connection.png"));
        {
          Plugin ccPlugin = ClassManager.getInstance().getPluginByName(((Robot)component).getCommChannel().getClass().getCanonicalName());
          if (ccPlugin != null)
          {
            CommunicationChannelGUI ccGUI = (CommunicationChannelGUI) ccPlugin.makeGUInstance(((Robot)component).getCommChannel());
            Composite ccComposite = ccGUI.getStatusPannel(tabs,SWT.NONE);
            commChannel.setControl(ccComposite);
            GridData ccCompositeLData = new GridData();
            ccCompositeLData.horizontalAlignment = GridData.BEGINNING;
            ccCompositeLData.verticalAlignment = GridData.BEGINNING;
View Full Code Here

          featureTabs = new CTabFolder(configTabs,SWT.NONE);
          cTabFeatures.setControl(featureTabs);
         
          for (int i=0; i<((Robot)component).getFeatures().length; i++)
          {
            Plugin feature = null;
            if (((Robot)component).getFeatures() != null)
              feature = ClassManager.getInstance().getPluginByName( ((Robot)component).getFeatures()[i].getClass().getCanonicalName() );
            if (feature != null)
            {
              cTabItem1 = new CTabItem(featureTabs, SWT.NONE);
              cTabItem1.setText( ((Robot)component).getFeatures()[i].getDescription() );
              {
                FeatureGUI featureGUI = (FeatureGUI)feature.makeGUInstance(((Robot)component).getFeatures()[i]);
                configPannelFeature = featureGUI.getConfigPannel( featureTabs, featureTabs.getStyle());
               
                if (configPannelFeature != null)
                {
                  //Fuerzo el layout que trae el feature para qeu se ajuste al diaogo
                  GridData configPannelFeatureLData = new GridData();
                  configPannelFeatureLData.horizontalAlignment = GridData.FILL;
                  configPannelFeatureLData.verticalAlignment = GridData.FILL;
                  configPannelFeatureLData.grabExcessHorizontalSpace = true;
                  configPannelFeatureLData.grabExcessVerticalSpace = true;
                  configPannelFeature.setLayoutData(configPannelFeatureLData);
                 
                  cTabItem1.setControl(configPannelFeature);
                }
                 
                configElements.add(featureGUI);
       
              }
            }
            featureTabs.setSelection(0);
            featureTabs.layout(true);
           
          }
        }
        Plugin neuralNet = null;
        if ( ((Robot)component).getNeuralNetwork() != null )
          neuralNet = ClassManager.getInstance().getPluginByName( ((Robot)component).getNeuralNetwork().getClass().getCanonicalName() );
        if (neuralNet != null)
        {
          CTabItem cTabNeuralNetwork = new CTabItem(configTabs, SWT.NONE);
          cTabNeuralNetwork.setImage(SWTResourceManager.getImage("resources/icons/icon24x24/enable/neuron.png"));
          cTabNeuralNetwork.setText("Red Neuronal");
          {
            NeuralNetworkGUI neuralNetworkGUI = (NeuralNetworkGUI)neuralNet.makeGUInstance(((Robot)component).getNeuralNetwork());
            Composite configPannelNeuralNet = neuralNetworkGUI.getConfigPannel( configTabs,SWT.NONE);
            if (configPannelNeuralNet != null)
            {
              //Fuerzo el layout para que se adapte al dialogo
              GridData configPannelNeuralNetLData = new GridData();
              configPannelNeuralNetLData.horizontalAlignment = GridData.FILL;
              configPannelNeuralNetLData.verticalAlignment = GridData.FILL;
              configPannelNeuralNetLData.grabExcessHorizontalSpace = true;
              configPannelNeuralNetLData.grabExcessVerticalSpace = true;
              configPannelNeuralNet.setLayoutData(configPannelNeuralNetLData);
             
              cTabNeuralNetwork.setControl(configPannelNeuralNet);
              configPannelNeuralNet.layout(true);
             
            }
            configElements.add(neuralNetworkGUI);           
           
          }
        }
        Plugin commChannel = null;
        if ( ((Robot)component).getCommChannel() != null )
          commChannel = ClassManager.getInstance().getPluginByName( ((Robot)component).getCommChannel().getClass().getCanonicalName() );
        if (commChannel != null)
        {
          CTabItem cTabCommChannel = new CTabItem(configTabs,SWT.NONE);
          cTabCommChannel.setText("Canal de Comunicaciones");
          cTabCommChannel.setImage(SWTResourceManager.getImage("resources/icons/icon32x32/enable/Connection Configuration.png"));
          {
            CommunicationChannelGUI communicationChannelGUI= (CommunicationChannelGUI)commChannel.makeGUInstance(((Robot)component).getCommChannel());
            Composite configPannelcommChannel =  communicationChannelGUI.getConfigPannel(configTabs, SWT.NONE);
            if (configPannelcommChannel != null)
            {
              // Fuerzo el layout para que se ajuste al dialogo
              GridData configPannelcommChannelLData = new GridData();
View Full Code Here

  {
    super(parent, style);
   
    try
    {
      Plugin newRobotPlugin = ClassManager.getInstance().getPluginByName(robotName);
      if ( newRobotPlugin != null )
      {
        robot    = (Robot)newRobotPlugin.makeIntance();
        newRobot  = true;
      }
    }
    catch(Exception e)
    {
View Full Code Here

          customSpaceLData.verticalAlignment = GridData.FILL;
          customSpaceLData.grabExcessVerticalSpace = true;
          customSpace.setLayoutData(customSpaceLData);
          customSpace.setLayout(customSpaceLayout);
          {
            Plugin robotPlugin = ClassManager.getInstance().getPluginByName(robot.getClass().getCanonicalName());
            if (robotPlugin != null)
            {
              robotGUI= (RobotGUI)robotPlugin.makeGUInstance(robot);
              customPannel =  robotGUI.getConfigPannel(customSpace, customSpace.getStyle());
              if (customPannel != null)
              {
                //Fuerzo el layout que traia a que se ajuste al del dialogo
                GridData customPannelLData = new GridData();
View Full Code Here

          bottonLData.verticalAlignment = GridData.FILL;
          bottonLData.grabExcessVerticalSpace = true;
          customSpace.setLayoutData(bottonLData);
         
          {
            Plugin commChannelPlugin = ClassManager.getInstance().getPluginByName(commChannel.getClass().getCanonicalName());
            if (commChannelPlugin != null)
            {
              CommunicationChannelGUI commChannelConfig = (CommunicationChannelGUI) commChannelPlugin.makeGUInstance(commChannel);
              //customPannel = commChannelConfig.getConfigPannel(customSpace,customSpace.getStyle());
              commChannelConfig.getConfigPannel(customSpace,customSpace.getStyle());
            }
           
          }
View Full Code Here

TOP

Related Classes of resources.digesters.Plugin

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.