Java Reference
In-Depth Information
How to do it...
The code for this recipe is a little long. So, it has been segmented into chunks for easier
readability and comprehension. For the full code listing of this recipe, see the script file
available at ch06/source-code/src/webservice/ZillowMashupDmo.fx
1. Let us first declare some constant values and global variables used throughout the
script file:
def w = 640;
def h = 480;
def imgW = w * 0.7;
def imgH = h * 0.6;
def ZILLOW_WS = "
def GOOGLE_WS = "";
def DEFAULT_ADDR = createAddress ("1600 Pennsylvania Ave, Washing-
ton DC");
def conv = URLConverter{};
var scene :Scene;
var imgView :ImageView;
2. Next, define two classes that are used as data model to represent addresses and
Zillow listings:
// Address model
class Address {
public var street:String;
public var city:String;
public var state:String;
public var zip:String;
override public function toString(){
return "{street}, "
"{city} {state} {zip}";
// Zillow Listing Model
class ZillowListing extends Address {
Search WWH ::

Custom Search