Examples of Customization


Examples of com.aelitis.azureus.core.custom.Customization

       
        checked_customization = true;
       
        CustomizationManager cust_man = CustomizationManagerFactory.getSingleton();
       
        Customization cust = cust_man.getActiveCustomization();
       
        if ( cust != null ){
         
          String cust_name   = COConfigurationManager.getStringParameter( "metasearch.custom.name", "" );
          String cust_version = COConfigurationManager.getStringParameter( "metasearch.custom.version", "0" );
         
          boolean  new_name   = !cust_name.equals( cust.getName());
          boolean  new_version = org.gudy.azureus2.core3.util.Constants.compareVersions( cust_version, cust.getVersion() ) < 0;
         
          if ( new_name || new_version ){

            log( "Customization: checking templates for " + cust.getName() + "/" + cust.getVersion());
           
            try{
              InputStream[] streams = cust.getResources( Customization.RT_META_SEARCH_TEMPLATES );
             
              if ( streams.length > 0 && new_name ){
               
                  // reset engines
               
                log( "    setting auto-mode to false" );
               
                setAutoMode( false );
               
                /*
                Engine[]  engines = meta_search.getEngines( false, false );

                for (int i=0;i<engines.length;i++){
                 
                  Engine engine = engines[i];
                 
                  if ( engine.getSelectionState()) == Engine.SEL_STATE_MANUAL_SELECTED ){
                   
                  }
                }
                */
              }
              for (int i=0;i<streams.length;i++){
               
                InputStream is = streams[i];
               
                try{
                  VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile(is);
                 
                  if ( vf != null ){
                   
                    VuzeFileComponent[] comps = vf.getComponents();
                   
                    for (int j=0;j<comps.length;j++){
                     
                      VuzeFileComponent comp = comps[j];
                     
                      if ( comp.getType() == VuzeFileComponent.COMP_TYPE_METASEARCH_TEMPLATE ){
                       
                        try{
                          Engine e =
                            getSingleton().importEngine( comp.getContent(), false );
                         
                          log( "    updated " + e.getName());
                         
                          e.setSelectionState( Engine.SEL_STATE_MANUAL_SELECTED );
                         
                        }catch( Throwable e ){
                         
                          Debug.printStackTrace(e);
                        }
                      }
                    }
                  }
                }finally{
                 
                  try{
                    is.close();
                   
                  }catch( Throwable e ){
                  }
                }
              }
            }finally{
             
              COConfigurationManager.setParameter( "metasearch.custom.name", cust.getName());
              COConfigurationManager.setParameter( "metasearch.custom.version", cust.getVersion());
            }
          }
        }
      }
     
View Full Code Here

Examples of com.aelitis.azureus.core.custom.Customization

 
      AEDiagnostics.addEvidenceGenerator( this );
     
      CustomizationManager cust_man = CustomizationManagerFactory.getSingleton();
     
      Customization cust = cust_man.getActiveCustomization();
     
      if ( cust != null ){
       
        String cust_name   = COConfigurationManager.getStringParameter( "subscriptions.custom.name", "" );
        String cust_version = COConfigurationManager.getStringParameter( "subscriptions.custom.version", "0" );
       
        boolean  new_name   = !cust_name.equals( cust.getName());
        boolean  new_version = org.gudy.azureus2.core3.util.Constants.compareVersions( cust_version, cust.getVersion() ) < 0;
       
        if ( new_name || new_version ){

          log( "Customization: checking templates for " + cust.getName() + "/" + cust.getVersion());
         
          try{
            InputStream[] streams = cust.getResources( Customization.RT_SUBSCRIPTIONS );
           
            for (int i=0;i<streams.length;i++){
             
              InputStream is = streams[i];
             
              try{
                VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile(is);
               
                if ( vf != null ){
                 
                  VuzeFileComponent[] comps = vf.getComponents();
                 
                  for (int j=0;j<comps.length;j++){
                   
                    VuzeFileComponent comp = comps[j];
                   
                    int type = comp.getType();
                   
                    if (   type == VuzeFileComponent.COMP_TYPE_SUBSCRIPTION ||
                        type == VuzeFileComponent.COMP_TYPE_SUBSCRIPTION_SINGLETON  ){
                     
                      try{
                        importSubscription(
                            type,
                            comp.getContent(),
                            false );
                       
                        comp.setProcessed();
                       
                      }catch( Throwable e ){
                       
                        Debug.printStackTrace(e);
                      }
                    }
                  }
                }
              }finally{
               
                try{
                  is.close();
                 
                }catch( Throwable e ){
                }
              }
            }
          }finally{
           
            COConfigurationManager.setParameter( "subscriptions.custom.name", cust.getName());
            COConfigurationManager.setParameter( "subscriptions.custom.version", cust.getVersion());
          }
        }
      }
     
      scheduler = new SubscriptionSchedulerImpl( this );
View Full Code Here

Examples of com.aelitis.azureus.core.custom.Customization

   
    AEDiagnostics.addEvidenceGenerator( this );
   
    CustomizationManager cust_man = CustomizationManagerFactory.getSingleton();
   
    Customization cust = cust_man.getActiveCustomization();
   
    if ( cust != null ){
     
      String cust_name   = COConfigurationManager.getStringParameter( "cnetworks.custom.name", "" );
      String cust_version = COConfigurationManager.getStringParameter( "cnetworks.custom.version", "0" );
     
      boolean  new_name   = !cust_name.equals( cust.getName());
      boolean  new_version = Constants.compareVersions( cust_version, cust.getVersion() ) < 0;
     
      if ( new_name || new_version ){
       
        try{
          InputStream[] streams = cust.getResources( Customization.RT_CNETWORKS );
         
          for (int i=0;i<streams.length;i++){
           
            InputStream is = streams[i];
           
            try{
              VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile(is);
             
              if ( vf != null ){
               
                VuzeFileComponent[] comps = vf.getComponents();
               
                for (int j=0;j<comps.length;j++){
                 
                  VuzeFileComponent comp = comps[j];
                 
                  int type = comp.getType();
                 
                  if ( type == VuzeFileComponent.COMP_TYPE_CONTENT_NETWORK ){
                   
                    try{
                        // change here as we always add all networks upfront so
                        // we always set the customisation flag regardless of
                        // whether existing or not
                     
                      ContentNetwork imported = importNetwork( comp.getContent());
                     
                      imported.setPersistentProperty( ContentNetwork.PP_IS_CUSTOMIZATION, true );
                     
                      comp.setProcessed();
                     
                    }catch( Throwable e ){
                     
                      log( "Failed to import customisation network", e );
                    }
                  }
                }
              }
            }finally{
             
              try{
                is.close();
               
              }catch( Throwable e ){
              }
            }
          }
        }finally{
         
          COConfigurationManager.setParameter( "cnetworks.custom.name", cust.getName());
          COConfigurationManager.setParameter( "cnetworks.custom.version", cust.getVersion());
        }
      }
    }
   
   
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

//    } else if (customization.equals(Customization.Undecided)) {
//      iconName += "undecided";
//    }
//   
//    return htIcon.get(iconName);
    Customization cFinal = node.getCustomizationVersion().getFinalCustomizationById(node.getFeature().getID());
    Customization cSelf = node.getCustomizationVersion().getCustomizationById(node.getFeature().getID());
   
    return ImageManager.getInstance().getCustomizationIcon(cFinal , cSelf , !node.getCustomizationVersion().isFeatureCustomizedByParentVersion(node.getFeature().getID()));
  }
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

 
  public class ConstraintExplorerCellRenderHelper {
    protected int getCustomizationCount(List<Customization> cus , Customization target) {
      int result = 0;
      for (Iterator<Customization> itCustomization=cus.iterator() ; itCustomization.hasNext() ; ) {
        Customization c = itCustomization.next();
        if (c.getName().equals(target.getName())) {
          result ++;
        }
      }
     
      return result;
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

                cf = constraintModel.getCFRelation(feature , gc , false);
            }
            sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
          }
         
          Customization value = Customization.Undecided;
          if (gc.getType().getName().equals(GroupConstraintType.SingleGroup.getName())) {
            if (super.getCustomizationCount(sCustomization , Customization.Selected)>1) {
              value = Customization.Unselected;
            } else if (super.getCustomizationCount(sCustomization , Customization.Undecided)==0) {
              value = Customization.Selected;
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

          if (cf==null) {
              cf = constraintModel.getCFRelation(feature , vp , false);
          }
          sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
        }
        Customization lValue = Customization.Undecided;
        if (lType.getName().equals(CompositeConstraintPortType.Single.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Selected)==1) {
            lValue = Customization.Selected;
          } else {
            lValue = Customization.Unselected;
          }
        } else if (lType.getName().equals(CompositeConstraintPortType.All.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Unselected)==0) {
            lValue = Customization.Selected;
          } else {
            lValue = Customization.Unselected;
          }
        } else /*if (gc.getType().getName().equals(GroupConstraintType.SingleGroup))*/ {
          if (super.getCustomizationCount(sCustomization , Customization.Selected)>0) {
            lValue = Customization.Selected;
          } else if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else {
            lValue = Customization.Unselected;
          }
        }
       
        sCustomization = new ArrayList<Customization>();
        for (Iterator<Feature> itFeature=vp.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature feature = itFeature.next();
          CFRelation cf = constraintModel.getCFRelation(feature , vp , true);
          if (cf==null) {
              cf = constraintModel.getCFRelation(feature , vp , false);
          }
          sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
        }
        Customization rValue = Customization.Undecided;
        if (rType.getName().equals(CompositeConstraintPortType.Single.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            rValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Selected)==1) {
            rValue = Customization.Selected;
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

          if (cf==null) {
              cf = constraintModel.getCFRelation(feature , cc , false);
          }
          sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
        }
        Customization lValue = Customization.Undecided;
        if (cc.getSourceType().getName().equals(CompositeConstraintPortType.Single.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Selected)==1) {
            lValue = Customization.Selected;
          } else {
            lValue = Customization.Unselected;
          }
        } else if (cc.getSourceType().getName().equals(CompositeConstraintPortType.All.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Unselected)==0) {
            lValue = Customization.Selected;
          } else {
            lValue = Customization.Unselected;
          }
        } else /*if (gc.getType().getName().equals(GroupConstraintType.SingleGroup))*/ {
          if (super.getCustomizationCount(sCustomization , Customization.Selected)>0) {
            lValue = Customization.Selected;
          } else if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else {
            lValue = Customization.Unselected;
          }
        }
       
        sCustomization = new ArrayList<Customization>();
        for (Iterator<Feature> itFeature=cc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature feature = itFeature.next();
          CFRelation cf = constraintModel.getCFRelation(feature , cc , true);
          if (cf==null) {
              cf = constraintModel.getCFRelation(feature , cc , false);
          }
          sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
        }
        Customization rValue = Customization.Undecided;
        if (cc.getSinkType().getName().equals(CompositeConstraintPortType.Single.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            rValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Selected)==1) {
            rValue = Customization.Selected;
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

                            3);
                }
            }

            //gh start
            Customization ct = (Customization) getAttribute(ConstantDefinition.CURRENT_CUSTOMIZATION);
            if (ct != null) {
                int x = 0;
                int y = 0;
                int width = 0;
                int height = 0;

                if (r.width < titleHeight) {
                    x = r.x + 1;
                    y = r.y + 1;
                    width = r.width - 1;
                    height = titleHeight - 1;
                } else {
                    x = r.x + (r.width - titleHeight) / 2 + 1;
                    y = r.y + 1;
                    width = titleHeight - 1;
                    height = titleHeight - 1;
                }

                Boolean customizable = (Boolean) getAttribute(ConstantDefinition.CURRENT_CUSTOMIZATION_CUSTOMIZABLE);
                if (customizable != null && !customizable.booleanValue()) {
                    g.setColor(Color.GRAY);
                    g.fillOval(x, y, width, height);
                }

                Color oldColor = g.getColor();

                g.setColor(Color.BLACK);
                if (Customization.Selected.getName().equals(ct.getName())) {
                    g.drawLine(x, y + height / 2, x + width, y + height / 2);
                    g.drawLine(x + width / 2, y, x + width / 2, y + height);
                }
                if (Customization.Unselected.getName().equals(ct.getName())) {
                    g.drawLine(x, y + height / 2, x + width, y + height / 2);
                }

                g.setColor(oldColor);
            }
View Full Code Here

Examples of de.FeatureModellingTool.Customize.Customization

                            3);
                }
            }

            //gh start
            Customization ct = (Customization) getAttribute(ConstantDefinition.CURRENT_CUSTOMIZATION);
            if (ct != null) {
                int x = 0;
                int y = 0;
                int width = 0;
                int height = 0;

                if (r.width < titleHeight) {
                    x = r.x + 1;
                    y = r.y + 1;
                    width = r.width - 1;
                    height = titleHeight - 1;
                } else {
                    x = r.x + (r.width - titleHeight) / 2 + 1;
                    y = r.y + 1;
                    width = titleHeight - 1;
                    height = titleHeight - 1;
                }

                Boolean customizable = (Boolean) getAttribute(ConstantDefinition.CURRENT_CUSTOMIZATION_CUSTOMIZABLE);
                if (customizable != null && !customizable.booleanValue()) {
                    g.setColor(Color.GRAY);
                    g.fillOval(x, y, width, height);
                }

                Color oldColor = g.getColor();

                g.setColor(Color.BLACK);
                if (Customization.Selected.getName().equals(ct.getName())) {
                    g.drawLine(x, y + height / 2, x + width, y + height / 2);
                    g.drawLine(x + width / 2, y, x + width / 2, y + height);
                }
                if (Customization.Unselected.getName().equals(ct.getName())) {
                    g.drawLine(x, y + height / 2, x + width, y + height / 2);
                }

                g.setColor(oldColor);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.