Package org.openquark.cal.machine

Examples of org.openquark.cal.machine.ProgramResourceLocator$Folder


  }

  public File publishKML() throws FileNotFoundException {
    File outputFile = new File(ServletContextParameterMap.getParameterValue(ContextParameter.USER_DIRECTORY_PATH) + "KML/" + worksheet.getTitle() + ".kml");
    final Kml kml = KmlFactory.createKml();
    final Folder folder = kml.createAndSetFolder()
        .withName(worksheet.getTitle()).withOpen(true);

    Style style = folder.createAndAddStyle().withId("karma");
   
    if(randomCounter++%2 == 0)
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png"));
    else
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/red-pushpin.png"));

    for (edu.isi.karma.geospatial.Point point : points) {
      folder.createAndAddPlacemark()
          .withDescription(point.getHTMLDescription())
          .withVisibility(true)
          .withStyleUrl("karma")
          .createAndSetPoint()
          .withAltitudeMode(AltitudeMode.CLAMP_TO_GROUND)
          .addToCoordinates(
              point.getLongitude() + "," + point.getLatitude());

    }

    for (edu.isi.karma.geospatial.LineString line : lines) {
      folder.createAndAddPlacemark()
          .withDescription(line.getHTMLDescription())
          .withVisibility(true).createAndSetLineString()
          .withAltitudeMode(AltitudeMode.CLAMP_TO_GROUND)
          .setCoordinates(line.getCoordinatesList());
    }
    int n=0;
    for (Polygon polygon: polygons) {
      FeatureTable featureTable = polygonTable.get(n);
     
      Placemark placemark = folder.createAndAddPlacemark()
      .withDescription(featureTable.getHTMLDescription())
      .withVisibility(true);
     
      final de.micromata.opengis.kml.v_2_2_0.Polygon kmlPolygon = new de.micromata.opengis.kml.v_2_2_0.Polygon();
      placemark.setGeometry(kmlPolygon);
View Full Code Here


    Document document = kml.createAndSetDocument()
      .withName("Infinit.e KML Interface"
      .withDescription("Infinit.e search KML representation");
   
    // Create the folder to contain the placemarks (allows us to have multiple folders
    Folder placemarksFolder = document.createAndAddFolder()
      .withName("Documents")
      .withDescription("Placemarks for the document locations in the query");
   
    // loop through the result set
    for ( BasicDBObject fdbo : docs)
    {
      // start out by checking to see if the title is not null
      if ( fdbo.getString("title") != null ) {
        // add logic to check for entities or event
        // Add in loop to create all the placemark points
       
        String description = "";
        if ( fdbo.getString("description") != null )
          description = fdbo.getString("description");
                 
        Point placemark = placemarksFolder.createAndAddPlacemark()
           .withName(fdbo.getString("title")).withOpen(Boolean.TRUE)
           .withDescription(description)
           .createAndSetPoint().addToCoordinates(-0.126236, 51.500152);
      }
    }
View Full Code Here

            // if not a layer link, move on
            if(context.getCurrentLayer() == null || context.getCurrentFeatureCollection() == null) {
                return feature;
            }
           
            Folder folder = (Folder) feature;
           
            String linkbase = "";
            try {
                linkbase = getFeatureTypeURL(context);
                linkbase += ".kml";
View Full Code Here

        // build the contents
        for (SimpleFeatureCollection collection : collections) {
            // create the folder
            SimpleFeatureCollection fc = (SimpleFeatureCollection) collection;
            Folder folder = document.createAndAddFolder();
            folder.setName(fc.getSchema().getTypeName());

            // have it be decorated
            List<KmlDecorator> folderDecorators = context.getDecoratorsForClass(Folder.class);
            for (KmlDecorator decorator : folderDecorators) {
                folder = (Folder) decorator.decorate(folder, context);
View Full Code Here

        // build the contents
        for (SimpleFeatureCollection collection : collections) {
            // create the folder
            SimpleFeatureCollection fc = (SimpleFeatureCollection) collection;
            Folder folder = document.createAndAddFolder();
            folder.setName(fc.getSchema().getTypeName());
           
            // have it be decorated
            List<KmlDecorator> folderDecorators = context.getDecoratorsForClass(Folder.class);
            for (KmlDecorator decorator : folderDecorators) {
                folder = (Folder) decorator.decorate(folder, context);
View Full Code Here

    }

    private void encodeLayerSuperOverlay(Document container, int layerIndex, Envelope bounds,
            int zoomLevel) {
        Layer layer = mapContent.layers().get(layerIndex);
        Folder folder = container.createAndAddFolder();
        folder.setName(layer.getTitle());

        LookAtOptions lookAtOptions = new LookAtOptions(request.getFormatOptions());
        if (bounds != null) {
            LookAtDecoratorFactory lookAtFactory = new LookAtDecoratorFactory();
            ReferencedEnvelope layerBounds = layer.getBounds();
            CoordinateReferenceSystem layerCRS = layerBounds.getCoordinateReferenceSystem();
            if(layerCRS != null && !CRS.equalsIgnoreMetadata(layerCRS, DefaultGeographicCRS.WGS84)) {
                try {
                    layerBounds = layerBounds.transform(DefaultGeographicCRS.WGS84, true);
                } catch(Exception e) {
                    throw new ServiceException("Failed to transform the layer bounds for "
                            + layer.getTitle() + " to WGS84", e);
                }
            }
            LookAt la = lookAtFactory.buildLookAt(layerBounds, lookAtOptions, false);
            folder.setAbstractView(la);
        }

        encodeNetworkLinks(folder, layer, bounds, zoomLevel);
    }
View Full Code Here

                List<Layer> layers = context.getMapContent().layers();
                Layer layer = layers.get(i++);
                context.setCurrentLayer(layer);
               
                // setup the folder and let it be decorated
                Folder folder = new Folder();
                folder.setName(layer.getTitle());

                // if it's a feature layer, setup the feature collection for it (some decorators use it)
                if (layer instanceof FeatureLayer) {
                    try {
                        WMSMapContent mapContent = context.getMapContent();
View Full Code Here

                // (Set of ProgramResourceLocator)
                Set<ProgramResourceLocator> deleteSet = new HashSet<ProgramResourceLocator>();

                for (int i = 0; i < folderMembers.length; ++i) {
                    ProgramResourceLocator folderMember = folderMembers[i];
                    String name = folderMembers[i].getName();

                    if (!currentFileSet.contains(name)) {
                        deleteSet.add(folderMember);
                    }
View Full Code Here

                }
                Set<LECCModule> dependeeModuleSet = getDependeeModuleSet();
                List<LECCModule> dependeeModuleList = new ArrayList<LECCModule>(dependeeModuleSet);

                // Use the CALClassLoader factory method to create a class loader instance.
                ProgramResourceLocator moduleFolderLocator = new ProgramResourceLocator.Folder(getName(), ResourcePath.EMPTY_PATH);
                classLoader = CALClassLoader.makeCALClassLoader(resourceRepository, moduleFolderLocator, getForeignClassLoader(), this, dependeeModuleList);
            }

            return classLoader;
        }
View Full Code Here

       
        ProgramResourceLocator[] members = resourceRepository.getMembers(moduleFolder);
       
        for (int fileN = 0, nFiles = members.length; fileN < nFiles; ++fileN) {
           
            ProgramResourceLocator member = members[fileN];
            String name = member.getName();
           
            // Skip anything which isn't a class file.
            if (!(member instanceof ProgramResourceLocator.File) || !name.toLowerCase().endsWith(".class")) {
                continue;
            }
            ProgramResourceLocator.File classFileLocator = (ProgramResourceLocator.File)member;
           
            byte[] bytecode;
            InputStream classFileContents = null;
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                classFileContents = resourceRepository.getContents(classFileLocator);
                byte[] buf = new byte[4096];
               
                while (true) {
                    int bytesRead = classFileContents.read(buf);
                    if (bytesRead < 0) {
                        break;
                    }
                   
                    baos.write(buf, 0, bytesRead);
                }
               
                bytecode = baos.toByteArray();
               
            } catch (IOException ioe) {
                throw new RuntimeException("Could not read the class file " + member.getName() + ".");
               
            } finally {
                if (classFileContents != null) {
                    try {
                        classFileContents.close();
                    } catch (IOException e) {
                    }
                }
            }
                            
            final boolean dumpAsmifiedText = true;
            final boolean dumpDisassembledText = true;
            final boolean verifyClassFileFormat = true;           
           
            //javac generates many debug op codes, such as line number annotations. For comparison with the asm
            //generated byte codes we can skip these.
            final boolean skipDebugOpCodes = true;
           
            final boolean skipInnerClassAttributes = false;
                 
            String classFileName = member.getName();           
            String className = classFileName.substring(0, classFileName.length() - ".class".length());
            String moduleName = moduleFolder.getModuleName().toString().replaceAll("_", "__").replace('.', '_');          
                   
            if (dumpAsmifiedText) {
                String asmifierDumpPath = "d:\\dev\\asmifierOutput\\javaSource\\" + moduleName + "\\" + className + ".txt"
View Full Code Here

TOP

Related Classes of org.openquark.cal.machine.ProgramResourceLocator$Folder

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.