comparison src/econnect/wp3_3/client/core/ApplicationGrid.java @ 38:050331208ad7 CellTable

Fix for NullPointer exceptions of parameters
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Thu, 06 Dec 2012 18:04:25 +0100
parents cfe8045c4610
children ed444173aef0
comparison
equal deleted inserted replaced
37:7c9aa2fdfa43 38:050331208ad7
591 591
592 public void setDefinedBounds(){ 592 public void setDefinedBounds(){
593 int zoom = 0; 593 int zoom = 0;
594 float cLon = 0, cLat = 0; 594 float cLon = 0, cLat = 0;
595 int mapId = 0; 595 int mapId = 0;
596 if( !Window.Location.getParameter("zoom").equals("undefined") ){ 596 if( (Window.Location.getParameter("zoom") != null) && !Window.Location.getParameter("zoom").equals("undefined") ){
597 zoom = new Integer(Window.Location.getParameter("zoom")).intValue(); 597 zoom = new Integer(Window.Location.getParameter("zoom")).intValue();
598 } 598 }
599 if( !Window.Location.getParameter("centerLon").equals("undefined") ){ 599 if( (Window.Location.getParameter("centerLon") != null) && !Window.Location.getParameter("centerLon").equals("undefined") ){
600 cLon = new Float(Window.Location.getParameter("centerLon")).floatValue(); 600 cLon = new Float(Window.Location.getParameter("centerLon")).floatValue();
601 } 601 }
602 if( !Window.Location.getParameter("centerLat").equals("undefined") ){ 602 if( (Window.Location.getParameter("centerLat") != null) && !Window.Location.getParameter("centerLat").equals("undefined") ){
603 cLat = new Float(Window.Location.getParameter("centerLat")).floatValue(); 603 cLat = new Float(Window.Location.getParameter("centerLat")).floatValue();
604 } 604 }
605 if( !Window.Location.getParameter("mapId").equals("undefined") ){ 605 if( (Window.Location.getParameter("mapId") != null) && !Window.Location.getParameter("mapId").equals("undefined") ){
606 mapId = new Integer(Window.Location.getParameter("mapId")).intValue(); 606 mapId = new Integer(Window.Location.getParameter("mapId")).intValue();
607 } 607 }
608 if( zoom != 0 || cLon != 0 || cLat != 0 || mapId != 0 ){ 608 if( zoom != 0 || cLon != 0 || cLat != 0 || mapId != 0 ){
609 this.getMap().getJsMap().configure(zoom, cLon, cLat, mapId); 609 this.getMap().getJsMap().configure(zoom, cLon, cLat, mapId);
610 } 610 }
611 String minSelTime = null, maxSelTime = null; 611 String minSelTime = null, maxSelTime = null;
612 if( !Window.Location.getParameter("minSelTime").equals("undefined") ){ 612 if( (Window.Location.getParameter("minSelTime") != null) && !Window.Location.getParameter("minSelTime").equals("undefined") ){
613 minSelTime = Window.Location.getParameter("minSelTime"); 613 minSelTime = Window.Location.getParameter("minSelTime");
614 } 614 }
615 if( !Window.Location.getParameter("maxSelTime").equals("undefined") ){ 615 if( (Window.Location.getParameter("maxSelTime") != null) && !Window.Location.getParameter("maxSelTime").equals("undefined") ){
616 maxSelTime = Window.Location.getParameter("maxSelTime"); 616 maxSelTime = Window.Location.getParameter("maxSelTime");
617 } 617 }
618 if( minSelTime != null && maxSelTime != null ){ 618 if( minSelTime != null && maxSelTime != null ){
619 this.getPlot().getJsTimeplot().selectTimerange(minSelTime,maxSelTime); 619 this.getPlot().getJsTimeplot().selectTimerange(minSelTime,maxSelTime);
620 } 620 }
621 if( !Window.Location.getParameter("connections").equals("undefined") ){ 621 if( (Window.Location.getParameter("connections") != null) && !Window.Location.getParameter("connections").equals("undefined") ){
622 int connections = new Integer(Window.Location.getParameter("connections")).intValue(); 622 int connections = new Integer(Window.Location.getParameter("connections")).intValue();
623 if( connections == 1 ){ 623 if( connections == 1 ){
624 this.getMap().getJsMap().setConnections(connections); 624 this.getMap().getJsMap().setConnections(connections);
625 this.getMap().setConImage(true); 625 this.getMap().setConImage(true);
626 } 626 }
627 } 627 }
628 String minTime = null, maxTime = null; 628 String minTime = null, maxTime = null;
629 if( !Window.Location.getParameter("minTime").equals("undefined") ){ 629 if( (Window.Location.getParameter("minTime") != null) && !Window.Location.getParameter("minTime").equals("undefined") ){
630 minTime = Window.Location.getParameter("minTime"); 630 minTime = Window.Location.getParameter("minTime");
631 } 631 }
632 if( !Window.Location.getParameter("maxTime").equals("undefined") ){ 632 if( (Window.Location.getParameter("maxTime") != null) && !Window.Location.getParameter("maxTime").equals("undefined") ){
633 maxTime = Window.Location.getParameter("maxTime"); 633 maxTime = Window.Location.getParameter("maxTime");
634 } 634 }
635 if( minTime != null && maxTime != null ){ 635 if( minTime != null && maxTime != null ){
636 this.core.refineByTime(minTime,maxTime); 636 this.core.refineByTime(minTime,maxTime);
637 } 637 }