How to create a user interface like Google maps (a draggable map)? - java

I have to draw a graph with many nodes, and I thought that an user interface like what Google maps offers could be nice to navigate the graph. I'm currently using Java for my application (a web application): what technologies/libraries should I use to build an interface like google maps? What approach?
edit: I'm interested mainly in creating a draggable map with zooming capabilities
edit2: I'm not looking for the exact solution of the problem, but for some starting point

If you have a massive data to display, one approach is to create an interactive interface that let the user to navigate in your data. Higher the zoom, greater the details.
An example of google maps like interface for other purpose is zoompy

Are you familiar with OpenLayers? It is JavaScript map visualization library. Combined with something like OpenStreetMap, you can get some very powerful visualization with data for free.

Take a look at the tools in Eclipse's Graphical Modeling Project.

Take a look at Polymaps, specifically the support for vector data via geoJSON. It's a Javascript library that handles doing all the slippy-map interface: zooming, scrolling, and loading new sections of the map via HTTP. It renders to SVG, so it looks great and works in every browser except pre-9.0 MSIE.
It's a bit odd to use a geographic tool to draw arbitrary graphs, but it's totally doable. The Mandlebrot example is a proof of concept.

I was successful using modestmaps for Processing (find it here). A processing PApplet can be embedded in a swing GUI as explained here. I guess you could use the source to draw your graph in processing and then use the already implemented 'slippy map' features.

Related

Generating a tree visualization in java

I don't know what is the name of this visualization type, but I want to learn how to draw trees like the ones in this image:
I've seen this kind of visualization in many sites but I'm unable to know the technical term behind it.
That graph seems a lot like a force-directed layout. Painting those kind of images is not an easy task, depending on what are you trying to accomplish, you might want to use an existing framwork. If you want to use java you should see at gephi, if you can use an html approach you should definitely take a look at d3.js which is a javascript library for data visualization. They have neat examples: directed-force layout, and collapsible-force layout.
This particular image is done by Stephanie Posavec. You can learn about her design process from an interview she gave the folks at the Data Stories podcast. As far as I remember it, she partially crafts her visualizations by hand, so I'm not sure if you'll ever find an algorithm that does exactly this for you. For different tree layout algorithms, you can refer to treevis.net.

Java Plot Builder

I would like to implement a sort of plot builder (x-y plot, x-time plot, bar not complex plots), where the user defines the generic properties. The results should be some templates that can be used at run time (drag/drop) in another application in which it is decided the data to be plotted. Do you know some tools to be integrated in java or some articles from where to start. I tried to guess if JFreeChart or Gral are able to be used for such things or to pass directly to purchase some product.
Thanks
Marco
You can certainly use JFreeChart for this - it's a good library, the charts are pretty flexible and can do all the things you are likely to need from regular plots.
Though you would need to do some extra work to implement "drag/drop" and and special data linking capabilities. I expect this will be the hard part, whatever charting tool you use.

Extending ArcGIS

I've been tasked with a thesis project where i have to extend the features of ArcGis. I've been asked to create a model written in Python that can run out of ArcGIS 10. This model will have a simple user interface where the user can drag/drop a variety of shapefiles and enter the values for particular variables in order for the model to run effectively. Once the model has finished running, a new shapefile is created that lays out the most cost effective Collector Cable route for a wind turbine from point A to point B.
I'd like to know if such a functionality/ extension already exists in ArcGIS so i don't have to re-invent the wheel. If not then what is the best programming language to learn to extend ArcGIS for this (Python vs Visual basic vs Java). My background is Java, PHP, Jquery and Javascript. Also any pointers in the right direction i.e documentation, resources etc would be hugely appreciated
You must understand EXACTLY how it should work and where the tool should place all input and output datasets, their structures, attribute table fields and so on.
There is only one person who knows all these stuff - and it is You.
And it is not "the wheel", but it is a custom tool. You can build a model in built-in model builder (the great thing) and then export the model into a Python script.
Check this video http://www.youtube.com/watch?v=mBSXBqEP-7Y
And again. You have to know: 1) Input datasets and parameters 2) What do you want to get as the output 3) How it should work
I do stuff like this every day for my day job in customizing ArcGIS for utility companies like gas, water, and electric. We create buttons for them that does similar things like - draw a service gas line from the gas meter point on the side of the house to the nearest point on the nearest gas main line, split the main at that point, insert a "T" point feature, and connect the service line from the "T" to the meter.
We mostly use C# and a bit of VB.net. You may want to look into creating a Python Add-in for something like ArcGIS Explorer. Or an Add-in for ArcMap.
Explorer and ArcMap let you add shapefiles as layers in the map. Add-ins let you easily add a button to the toolbar that can do things to the features on the map like query their attributes and modify their attributes and geometry to move them around on the map, as well as create new features and fill out attributes and place them on the map with X,Y or Lat/Long.
So your "Calculate Best Cable Route" tool could be a button your create on the toolbar (ICommand) that would first:
1. let the users select point A and point B on the map using the built in selection tools in Explorer/ArcMap.
2. let the users click your custom ICommand button.
3. your ICommand.OnClick() method would then execute all the code to try different routes based on geometry of other features on the map like street edges, building outlines, property lines, etc. then calculate the total cost like digging in dirt, asphalt, and getting permission/Right of way for cases where it goes over property lines.
See the ArcGIS ArcObjects API here to get started:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ICommand_Interface/00430000001s000000/
Creating a Python AddIn is probably the quickest and easiest approach if you just want to do some geoprocessing and deploy the tool to lots of users.
But as soon as you need a user interface (that does more than simply select GIS data sources) you should create a .Net AddIn (using either C# or VB.net).
I've created many AddIns over the years and they are a dramatic improvement to the old ArcGIS "plugins" that involved lots of complicated COM registration. AddIns are easy to build and deploy. Easy for users to install and uninstall.
.Net has excellent, powerful features for creating rich user interfaces with the kind of drag and drop that you require. And there are great books, forums, samples to leverage.

representing a topological map using java

I'm developing a indoor navigation program for android, and i'm stuck right at the beginning:
How do you represent a map in java?
I will prefer a way that will allow me to apply Dijkstra's algorithm easily.
note: i need the program to know the size of each room and where are the entrances and exits.
edit: i'm looking for a object to use in the BL not the UI
Android has a built-in GUI element called a mapView that you can add to a screen in your application. It is a Google map and will require you to obtain your applications API key. You can add overlays to it and locate points on the map based on latitude and longitude (I think it supports other methods as well) and these points could be used for Dijkstra's algorithm.
Hope this helps, good luck.
I think, what you are describing is a extended topological map (where you have an estimate on the nodes absolute location). So you basically need a component that can draw a graph with locations attached to the nodes. Also, you might want the possibility to draw addistional stuff (like heat maps for wifi connectivitiy, bluetooth devices or whatever you are using to estimate your position and gather information about the environment). You are also dealing with the SLAM problem.
I don't know of any existing component that can do the visual task for that, but maybe you find something with google. I wouldn't however recommend it. I would just create my own component (using a TextView and draw my stuff on that). It is much more flexible, not that much of an effort and you can choose the functionality and data format, which can be very helpful in such cases...
Once you have all the rest running (which is a lot!), you still can decide to look for some fancy component that may integrate even google maps, is able to zoom or so.

Java Graph Visualisation Library: Nodes with multiple connect points

Can anyone recommend a Java Graph Visualisation library in which graph nodes can be rendered with multiple connect points?
For example, supposing a graph node represents a processor that takes input from two sources and produces output. This would be visualised as 3 vertices. However, clearly each vertex has a defined role in the workflow and therefore ideally my node would appear with 3 distinct connection points that the user could attach vertices to.
I've taken a look at JUNG but I don't think it will suit my needs.
Any recommendations welcome; either on specific libraries or alternative approaches I can take.
You could try JGraph's java library
JGRAPH
It has a good amount of functionality and I have used it with success before. The only thing is that the documentation is a bit lacking, but if you read through some examples and code its pretty good when you get the hang of it.
Take a look at JGraph (http://www.jgraph.com/). I used jgraph-5.14.0.0 for a similar project before. Here are the graphs that I made for another project: https://github.com/eamocanu/spellcheck.graph/tree/master/graph%20photos

Categories

Resources