Loading...
Logo
Processing Forum
giovanni.bacci's Profile
6 Posts
7 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hi all. I'm trying to do a simple interface to a data base, using controlP5. Everything it's fine, except when it comes to show the result of a query. I'd like to have it in a tabular like arrangement. For the horizontal display both list and textArea are fine, but i cannot get any vertical alignment of the rows... it's possible to do it in processing with controlp5? Any hints?

    Thanks,
    Giovanni
    Hi all! I've played a bit with the (excellent) unfolding maps library for processing. I've menaged to create and handle markers extending the AbstractMarker class, but i've noticed that this class is especially aimed to plot single point on a map. That's fine for displaying cities, but i can't find an appropriate way to display paths (i.e. state boundaries). What i'm asking if it's possible to have two marker manager for the same map, so i can define a cityMarker and a boundaryMarker, so i can turn it on/off indipendently. Suggestion?

    Thanks!
    Hi all! I'm trying to create a checkbox, using a set of images to show is status. I'm encountering two problems:
    - i'm not able to show a label describing the item
    - when i click on the checkbox, i get the error: java.lang.NoSuchMethodException: chkbox_image.theChkbox(int)

    Here's a simple code
    1. import controlP5.*;

      ControlP5 myCP5;

      void setup()
      {
        size(400,400);
       
        myCP5 = new ControlP5(this);
       
        PImage theImage = loadImage("check_box_active.png");
       
        myCP5.addCheckBox("theChkbox")
              .setPosition(30,20)
              .setItemsPerRow(2)
              .setSpacingColumn(50)
              .setSpacingRow(30)
              .setImage(theImage)
              .setSize(theImage)
              .addItem("First item", 1)
              .addItem("Second item", 2)
              .addItem("Third item", 3)
              .addItem("Fourth item", 4)
              ;
      }

      void draw()
      {
        background(200);
      }
    and this is the image used:


    Thanks,
      Giovanni
    Sorry if it's a stupid question, but i've made some test and googled a bit without getting any clue.
    In short: when i add buttons (or whatever) to a group, the group dimension (the height, especially) are not updated accordingly. So some button is draw outside of group background. With setWidth() i've found that it' possible to change the width of the group, but i've not been able to change the height. The .setHeight() don't work as expected (seems to change only the label bar height).
      If someone have some clue it will be nice...

    thanks,
      Giovanni
    When i create a map, i'd like to see displayed only the contents inside the map. So markers, lines, etc. with coordinates that are outside map boundaries should be clipped. To made the question clear, just see the GeoRSSMarkerApp example with map dimension modified to explain the problem:
    1. import processing.opengl.*;
      import codeanticode.glgraphics.*;
      import de.fhpotsdam.unfolding.*;
      import de.fhpotsdam.unfolding.geo.*;
      import de.fhpotsdam.unfolding.utils.*;

      de.fhpotsdam.unfolding.Map map;

      List<Location> rssGeoLocations = new ArrayList<Location>();

      public void setup() {
        size(800, 600, GLConstants.GLGRAPHICS);
        smooth();

        map = new de.fhpotsdam.unfolding.Map(this,20, 20, 400, 520);
        map.zoomToLevel(2);
        MapUtils.createDefaultEventDispatcher(this, map);

        loadRSSGeoLocations();
      }

      public void loadRSSGeoLocations() {
        // Load RSS feed
        String url = "http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M5.xml";
        XMLElement rss = new XMLElement(this, url);
        // Get all items
        XMLElement[] itemXMLElements = rss.getChildren("channel/item");
        for (int i = 0; i < itemXMLElements.length; i++) {
          // Adds lat,lon as locations for each item
          XMLElement latXML = itemXMLElements[i].getChild("geo:lat");
          XMLElement lonXML = itemXMLElements[i].getChild("geo:long");
          float lat = Float.valueOf(latXML.getContent());
          float lon = Float.valueOf(lonXML.getContent());

          rssGeoLocations.add(new Location(lat, lon));
        }
      }

      public void draw() {
        background(0);
        map.draw();

        for (Location location : rssGeoLocations) {
          float xy[] = map.getScreenPositionFromLocation(location);
          drawEarthquakeMarker(xy[0], xy[1]);
        }
      }

      public void drawEarthquakeMarker(float x, float y) {
        noStroke();
        fill(200, 200, 0, 100);
        ellipse(x, y, 40, 40);
        fill(255, 100);
        ellipse(x, y, 30, 30);
        fill(200, 200, 0, 100);
        ellipse(x, y, 20, 20);
        fill(255, 200);
        ellipse(x, y, 10, 10);
      }

    There's a simple solution to only show markers inside the map?

    Thanks,
      Giovanni