Examples of Builder


Examples of org.vfny.geoserver.wms.responses.legend.raster.ColorMapLegendCreator.Builder

        // background bkgColor
        bgColor = LegendUtils.getBackgroundColor(request);

        // colormap element
        final ColorMap cmap = rasterSymbolizer.getColorMap();
        final Builder cmapLegendBuilder = new ColorMapLegendCreator.Builder();
        if (cmap != null && cmap.getColorMapEntries() != null
                && cmap.getColorMapEntries().length > 0) {

            // passing additional options
            cmapLegendBuilder.setAdditionalOptions(request.getLegendOptions());

            // setting type of colormap
            cmapLegendBuilder.setColorMapType(cmap.getType());

            // is this colormap using extended colors
            cmapLegendBuilder.setExtended(cmap.getExtendedColors());

            // setting the requested colormap entries
            cmapLegendBuilder.setRequestedDimension(new Dimension(width, height));

            // setting transparency and background bkgColor
            cmapLegendBuilder.setTransparent(transparent);
            cmapLegendBuilder.setBackgroundColor(bgColor);

            // setting band

            // Setting label font and font bkgColor
            cmapLegendBuilder.setLabelFont(LegendUtils.getLabelFont(request));
            cmapLegendBuilder.setLabelFontColor(LegendUtils.getLabelFontColor(request));

            // set band
            final ChannelSelection channelSelection = rasterSymbolizer.getChannelSelection();
            cmapLegendBuilder.setBand(channelSelection != null ? channelSelection.getGrayChannel()
                    : null);

            // adding the colormap entries
            final ColorMapEntry[] colorMapEntries = cmap.getColorMapEntries();
            for (ColorMapEntry ce : colorMapEntries)
                if (ce != null)
                    cmapLegendBuilder.addColorMapEntry(ce);

            // check the additional options before proceeding
            cmapLegendBuilder.checkAdditionalOptions();

            // instantiate the creator
            cMapLegendCreator = cmapLegendBuilder.create();

        } else
            cMapLegendCreator = null;

    }
View Full Code Here

Examples of org.waveprotocol.box.search.SearchProto.SearchResponse.Builder

   *
   * @param searchResult the search results with digests.
   * @return SearchResponse
   */
  public static SearchResponse serializeSearchResult(SearchResult searchResult, int total) {
    Builder searchBuilder = SearchResponse.newBuilder();
    searchBuilder.setQuery(searchResult.getQuery()).setTotalResults(total);
    for (SearchResult.Digest searchResultDigest : searchResult.getDigests()) {
      SearchResponse.Digest digest = serializeDigest(searchResultDigest);
      searchBuilder.addDigests(digest);
    }
    SearchResponse searchResponse = searchBuilder.build();
    return searchResponse;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.Nindo.Builder

    create(a);

    Element firstEl = (Element) doc.getFirstChild(doc.getDocumentElement());

    Builder b = at(0);
    Attributes attrs = attrs("x", "1", "y", "2");
    b.replaceAttributes(attrs);
    b.elementStart("x", attrs("a", "1"));
    b.characters("hello");
    b.elementStart("y", attrs("b", "2", "c", "3"));
    b.characters("yeah");
    b.elementEnd();
    b.elementEnd();
    String moreText = "more text";
    b.characters(moreText);
    consumeNindo(b.build());

    checkEvents(
        am(firstEl, pairs("x", null, "y", null), attrs),
        ci(doc.asElement(firstEl.getFirstChild())),
        ti(14, moreText));
View Full Code Here

Examples of org.waveprotocol.wave.model.util.FuzzingBackOffScheduler.Builder

      @Override
      public void execute() {
      }
    };
    fakeNativeScheduler = new FakeNativeScheduler();
    scheduler = new Builder(fakeNativeScheduler)
        .setInitialBackOffMs(10)
        .setMaxBackOffMs(100)
        .setRandomisationFactor(0.5)
        .build();
  }
View Full Code Here

Examples of org.xnio.OptionMap.Builder

    @Override
    public OptionMap getOptionMap() {
        List<String> mechanisms = new LinkedList<String>();
        Set<Property> properties = new HashSet<Property>();
        Builder builder = OptionMap.builder();

        mechanisms.add(JBOSS_LOCAL_USER);
        builder.set(SASL_POLICY_NOPLAINTEXT, false);
        properties.add(Property.of(LOCAL_DEFAULT_USER, DOLLAR_LOCAL));
        if (tokensDir != null) {
            properties.add(Property.of(LOCAL_USER_CHALLENGE_PATH, tokensDir));
        }
        if (digestMd5Supported()) {
            mechanisms.add(DIGEST_MD5);
            properties.add(Property.of(REALM_PROPERTY, realm.getName()));
            if (contains(DigestHashCallback.class, realm.getCallbackHandler().getSupportedCallbacks())) {
                properties.add(Property.of(PRE_DIGESTED_PROPERTY, Boolean.TRUE.toString()));
            }
        } else if (plainSupported()) {
            mechanisms.add(PLAIN);
        } else if (realm == null) {
            mechanisms.add(ANONYMOUS);
            builder.set(SASL_POLICY_NOANONYMOUS, false);
        } else {
            throw new IllegalStateException("A security realm has been specified but no supported mechanism identified.");
        }

        SslMode sslMode = getSslMode();
        switch (sslMode) {
            case OFF:
                builder.set(SSL_ENABLED, false);
                break;
            case TRANSPORT_ONLY:
                builder.set(SSL_ENABLED, true);
                builder.set(SSL_STARTTLS, true);
                break;
            case CLIENT_AUTH_REQUESTED:
                builder.set(SSL_ENABLED, true);
                builder.set(SSL_STARTTLS, true);
                mechanisms.add(0, EXTERNAL);
                builder.set(SSL_CLIENT_AUTH_MODE, REQUESTED);
                break;
        // We do not currently support the SSL_CLIENT_AUTH_MODE of REQUIRED as there is always
        // the possibility that the local mechanism will still be needed.
        }

        builder.set(SASL_MECHANISMS, Sequence.of(mechanisms));
        builder.set(SASL_PROPERTIES, Sequence.of(properties));

        return builder.getMap();
    }
View Full Code Here

Examples of shapes.common.Builder

public class Main2 {

  public static void main(String[] args) {
    // (see also shapes.impl.composite.Main)
    // define a complex group of shapes.impl.composite
    Builder builder = new CompositeBuilder();
    builder.startGroup();
      builder.addCircle(20);
      builder.addRectangle(100, 200);
      builder.startGroup();
        builder.addRectangle(50, 30);
        builder.addRectangle(300, 60);
        builder.setFilled(false);
        builder.startPolygon();
          builder.addPoint(50, 50);
          builder.addPoint(60, 100);
          builder.addPoint(100, 110);
          builder.addPoint(120, 60);
        builder.endPolygon();
        builder.setStroke(Color.CYAN);
        builder.addCircle(50);
        builder.setFilled(false);
        builder.setStroke(Color.ORANGE);
        builder.setLocation(100, 200);
      builder.endGroup();
      builder.setFilled(true);
      builder.setStroke(Color.RED);
      builder.setLocation(150, 50);
    builder.endGroup();
    builder.setLocation(50, 100);
    final Shape s = builder.getProduct();
    System.out.println(s.accept(new Size()) + " basic shapes");
   
    // calculate the bounding box
    final Location b = s.accept(new BoundingBox());
    final Rectangle r = (Rectangle) b.getChild();
View Full Code Here

Examples of spoon.processing.Builder

        env.setVerbose(false);
        env.setDebug(false);
        env.setComplianceLevel(complianceLevel);
        final Factory factory = new Factory(new DefaultCoreFactory(), env);

        final Builder builder = factory.getBuilder();
        for (final File inputSource : inputSources) {
            getLog().info("Adding input source: " + inputSource.getPath());
            builder.addInputSource(inputSource);
        }
        builder.build();

        final ProcessingManager processing = new QueueProcessingManager(factory);
        for (final String processor : processors) {
            getLog().info("Adding processor: " + processor);
            if (processor.endsWith(".groovy")) {
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.