Package edu.mit.simile.fresnel.configuration

Examples of edu.mit.simile.fresnel.configuration.LensMatchSet


                      }
                    }
                  }
                  if (!match) {
                    // if none of the specified sublenses fit, check for other matches
                    LensMatchSet lenses = this._conf.getLensMatches().getMatch(objResource);
                    if (null != lenses && !lenses.isEmpty()) {
                      sublens = lenses.topMatch();
                      subr = applyLens(group, in, sublens, objResource, current + 1, max);
                    } else {
                      // or if no lenses fit, turn it into a label
                      subr.setTitle(resolveLabel(in, objResource));
                    }
View Full Code Here


                    }
                  }
                 
                  if (!matched) {
                    // if none of the specified sublenses fit, check for other matches
                    LensMatchSet lenses = this._conf.getLensMatches().getMatch(objResource);
                    if (null != lenses) {
                      sublens = lenses.topMatch();
                      Result subr = applyLabelLens(sublens, in, objResource, current + 1, max);
                      ValueResult vr = new ValueResult(subr, pr, selected.getContext());
                      pr.addValue(vr);
                      this._propertyResultModelHash.putResult(prop, pr);
                    } else {
                      // or if no lenses fit, turn it into a label
                      ValueResult vr = new ValueResult(resolveLabel(in, objResource, false).getString(), pr, selected.getContext());
                      pr.addValue(vr);
                      this._propertyResultModelHash.putResult(prop, pr);
                    }
                  }
                }
              } else {
                // if not a sublens situation, check for other matches
                LensMatchSet lenses = this._conf.getLensMatches().getMatch(objResource);
                if (null != lenses) {
                  Result subr = applyLabelLens(lenses.topMatch(), in, objResource, current + 1, max);
                  ValueResult vr = new ValueResult(subr, pr, selected.getContext());
                  pr.addValue(vr);
                  this._propertyResultModelHash.putResult(prop, pr);
                } else {
                  // or if no lenses fit, turn it into a label
View Full Code Here

    if (null != label) return new Title(label);
   
    Resource focusType = (Resource) FresnelUtilities.getType(in, focus);
    // this is ugly, but to not waste resources, it really needs the 'return' statements to
    // return ASAP
    LensMatchSet lenses = this._conf.getLensMatches().getMatch(focus);
    LensMatchSet instanceLenses = this._conf.getInstanceLensMatches().getMatch(focus);
    LensMatchSet classLenses = this._conf.getClassLensMatches().getMatch(focusType);

    if (lens) {
      if (null != lenses) {
        // find label lens for resource
        Iterator<Lens> instancesIt = lenses.getInstanceLenses().iterator();
        while (instancesIt.hasNext()) {
          Lens check = instancesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) { 
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
          }
        }
       
        // find label lens for resource's type
        Iterator<Lens> classesIt = lenses.getClassLenses().iterator();
        while (classesIt.hasNext()) {
          Lens check = classesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) {
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
          }
        }
      }

      if (null != instanceLenses) {
        // find label lens for resource
        Iterator<Lens> instancesIt = instanceLenses.getInstanceLenses().iterator();
        while (instancesIt.hasNext()) {
          Lens check = instancesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) { 
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
          }
        }
      }
      if (null != classLenses) {
        // find label lens for resource
        Iterator<Lens> classesIt = classLenses.getClassLenses().iterator();
        while (classesIt.hasNext()) {
          Lens check = classesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) {
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
View Full Code Here

TOP

Related Classes of edu.mit.simile.fresnel.configuration.LensMatchSet

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.