001: /*
002: * GWT-Ext Widget Library
003: * Copyright(c) 2007-2008, GWT-Ext.
004: * licensing@gwt-ext.com
005: *
006: * http://www.gwt-ext.com/license
007: */
008:
009: package com.gwtext.sample.showcase2.client;
010:
011: import com.gwtext.client.data.*;
012: import com.gwtext.client.widgets.grid.*;
013:
014: public class SampleData {
015:
016: private static Object[][] countryData;
017: private static String[][] stateData;
018: private static Object[][] companyData;
019: private static Object[][] companyDataSmall;
020:
021: public static Object[][] getCountries() {
022: if (countryData == null) {
023: //abbr, name, capital, continent, population, area in sq. km
024: countryData = new Object[][] {
025: new Object[] { "au", "Australia", "Canberra",
026: "Australia", new Integer(18090000),
027: new Integer(7713360) },
028: new Object[] { "br", "Brazil", "Brasilia",
029: "South America", new Integer(170000000),
030: new Integer(8547404) },
031: new Object[] { "ca", "Canada", "Ottawa",
032: "North America", new Integer(31000000),
033: new Integer(9976140) },
034: new Object[] { "cn", "China", "Beijing", "Asia",
035: new Integer(1222017000),
036: new Integer(9596960) },
037: new Object[] { "de", "Germany", "Berlin", "Europe",
038: new Integer(80942000), new Integer(356910) },
039: new Object[] { "fr", "France", "Paris", "Europe",
040: new Integer(57571000), new Integer(551500) },
041: new Object[] { "in", "India", "New Delhi", "Asia",
042: new Integer(913747000),
043: new Integer(3287590) },
044: new Object[] { "sc", "Seychelles", "Victoria",
045: "Africa", new Integer(73000),
046: new Integer(280) },
047: new Object[] { "us", "United States",
048: "Washington, DC", "North America",
049: new Integer(260513000),
050: new Integer(9372610) },
051: new Object[] { "jp", "Japan", "Tokyo", "Asia",
052: new Integer(125422000), new Integer(377800) },
053: new Object[] { "ie", "Italy", "Rome", "Eorope",
054: new Integer(57867000), new Integer(301270) },
055: new Object[] { "gh", "Ghana", "Accra", "Africa",
056: new Integer(16944000), new Integer(238540) },
057: new Object[] { "ie", "Iceland", "Reykjavik",
058: "Europe", new Integer(270000),
059: new Integer(103000) },
060: new Object[] { "fi", "Finland", "Helsinki",
061: "Europe", new Integer(5033000),
062: new Integer(338130) },
063: new Object[] { "ch", "Switzerland", "Berne",
064: "Europe", new Integer(6910000),
065: new Integer(41290) } };
066: }
067: return countryData;
068: }
069:
070: public static String[][] getStates() {
071: if (stateData == null) {
072: stateData = new String[][] {
073: new String[] { "AL", "Alabama",
074: "The Heart of Dixie" },
075: new String[] { "AK", "Alaska",
076: "The Land of the Midnight Sun" },
077: new String[] { "AZ", "Arizona",
078: "The Grand Canyon State" },
079: new String[] { "AR", "Arkansas",
080: "The Natural State" },
081: new String[] { "CA", "California",
082: "The Golden State" },
083: new String[] { "CO", "Colorado",
084: "The Mountain State" },
085: new String[] { "CN", "Connecticut",
086: "The Constitution State" },
087: new String[] { "DE", "Delaware", "The First State" },
088: new String[] { "DC", "District of Columbia",
089: "The Nation's Capital" },
090: new String[] { "FL", "Florida",
091: "The Sunshine State" },
092: new String[] { "GA", "Georgia", "The Peach State" },
093: new String[] { "HW", "Hawaii", "The Aloha State" },
094: new String[] { "ID", "Idaho", "Famous Potatoes" },
095: new String[] { "IL", "Illinois",
096: "The Prairie State" },
097: new String[] { "IN", "Indiana",
098: "The Hospitality State" },
099: new String[] { "IA", "Iowa", "The Corn State" },
100: new String[] { "KS", "Kansas",
101: "The Sunflower State" },
102: new String[] { "KY", "Kentucky",
103: "The Bluegrass State" },
104: new String[] { "LA", "Louisiana", "The Bayou State" },
105: new String[] { "ME", "Maine", "The Pine Tree State" },
106: new String[] { "MA", "Massachusetts",
107: "The Spirit of America" },
108: new String[] { "MD", "Maryland", "Chesapeake State" },
109: new String[] { "MI", "Michigan",
110: "Great Lakes State" },
111: new String[] { "MN", "Minnesota",
112: "North Star State" },
113: new String[] { "MS", "Mississippi",
114: "Magnolia State" },
115: new String[] { "MO", "Missouri", "Show Me State" },
116: new String[] { "MT", "Montana", "Big Sky Country" },
117: new String[] { "NE", "Nebraska", "Beef State" },
118: new String[] { "NV", "Nevada", "Silver State" },
119: new String[] { "NH", "New Hampshire",
120: "Granite State" },
121: new String[] { "NJ", "New Jersey", "Garden State" },
122: new String[] { "NM", "New Mexico",
123: "Land of Enchantment" },
124: new String[] { "NY", "New York", "Empire State" },
125: new String[] { "NC", "North Carolina",
126: "First in Freedom" },
127: new String[] { "ND", "North Dakota",
128: "Peace Garden State" },
129: new String[] { "OH", "Ohio", "The Heart of it All" },
130: new String[] { "OK", "Oklahoma", "Oklahoma is OK" },
131: new String[] { "OR", "Oregon", "Pacific Wonderland" },
132: new String[] { "PA", "Pennsylvania",
133: "Keystone State" },
134: new String[] { "RH", "Rhode Island", "Ocean State" },
135: new String[] { "SC", "South Carolina",
136: "Nothing Could be Finer" },
137: new String[] { "SD", "South Dakota",
138: "Great Faces, Great Places" },
139: new String[] { "TE", "Tennessee", "Volunteer State" },
140: new String[] { "TX", "Texas", "Lone Star State" },
141: new String[] { "UT", "Utah", "Salt Lake State" },
142: new String[] { "VE", "Vermont",
143: "Green Mountain State" },
144: new String[] { "VA", "Virginia", "Mother of States" },
145: new String[] { "WA", "Washington",
146: "Green Tree State" },
147: new String[] { "WV", "West Virginia",
148: "Mountain State" },
149: new String[] { "WI", "Wisconsin",
150: "America's Dairyland" },
151: new String[] { "WY", "Wyoming",
152: "Like No Place on Earth" } };
153: }
154: return stateData;
155: }
156:
157: public static Object[][] getCompanyDataLarge() {
158: if (companyData == null) {
159: companyData = new Object[][] {
160: new Object[] { "3m Co", new Double(71.72),
161: new Double(0.02), new Double(0.03),
162: "9/1 12:00am", "MMM", "Manufacturing" },
163: new Object[] { "Alcoa Inc", new Double(29.01),
164: new Double(0.42), new Double(1.47),
165: "9/1 12:00am", "AA", "Manufacturing" },
166: new Object[] { "Altria Group Inc",
167: new Double(83.81), new Double(0.28),
168: new Double(0.34), "9/1 12:00am", "MO",
169: "Manufacturing" },
170: new Object[] { "American Express Company",
171: new Double(52.55), new Double(0.01),
172: new Double(0.02), "9/1 12:00am", "AXP",
173: "Finance" },
174: new Object[] {
175: "American International Group, Inc.",
176: new Double(64.13), new Double(0.31),
177: new Double(0.49), "9/1 12:00am", "AIG",
178: "Services" },
179: new Object[] { "AT&T Inc.", new Double(31.61),
180: new Double(-0.48), new Double(-1.54),
181: "9/1 12:00am", "T", "Services" },
182: new Object[] { "Boeing Co.", new Double(75.43),
183: new Double(0.53), new Double(0.71),
184: "9/1 12:00am", "BA", "Manufacturing" },
185: new Object[] { "Caterpillar Inc.",
186: new Double(67.27), new Double(0.92),
187: new Double(1.39), "9/1 12:00am", "CAT",
188: "Services" },
189: new Object[] { "Citigroup, Inc.",
190: new Double(49.37), new Double(0.02),
191: new Double(0.04), "9/1 12:00am", "C",
192: "Finance" },
193: new Object[] {
194: "E.I. du Pont de Nemours and Company",
195: new Double(40.48), new Double(0.51),
196: new Double(1.28), "9/1 12:00am", "DD",
197: "Manufacturing" },
198: new Object[] { "Exxon Mobil Corp",
199: new Double(68.1), new Double(-0.43),
200: new Double(-0.64), "9/1 12:00am", "XOM",
201: "Manufacturing" },
202: new Object[] { "General Electric Company",
203: new Double(34.14), new Double(-0.08),
204: new Double(-0.23), "9/1 12:00am", "GE",
205: "Manufacturing" },
206: new Object[] { "General Motors Corporation",
207: new Double(30.27), new Double(1.09),
208: new Double(3.74), "9/1 12:00am", "GM",
209: "Automotive" },
210: new Object[] { "Hewlett-Packard Co.",
211: new Double(36.53), new Double(-0.03),
212: new Double(-0.08), "9/1 12:00am", "HPQ",
213: "Computer" },
214: new Object[] { "Honeywell Intl Inc",
215: new Double(38.77), new Double(0.05),
216: new Double(0.13), "9/1 12:00am", "HON",
217: "Manufacturing" },
218: new Object[] { "Intel Corporation",
219: new Double(19.88), new Double(0.31),
220: new Double(1.58), "9/1 12:00am", "INTC",
221: "Computer" },
222: new Object[] { "International Business Machines",
223: new Double(81.41), new Double(0.44),
224: new Double(0.54), "9/1 12:00am", "IBM",
225: "Computer" },
226: new Object[] { "Johnson & Johnson",
227: new Double(64.72), new Double(0.06),
228: new Double(0.09), "9/1 12:00am", "JNJ",
229: "Medical" },
230: new Object[] { "JP Morgan & Chase & Co",
231: new Double(45.73), new Double(0.07),
232: new Double(0.15), "9/1 12:00am", "JPM",
233: "Finance" },
234: new Object[] { "McDonald\"s Corporation",
235: new Double(36.76), new Double(0.86),
236: new Double(2.40), "9/1 12:00am", "MCD",
237: "Food" },
238: new Object[] { "Merck & Co., Inc.",
239: new Double(40.96), new Double(0.41),
240: new Double(1.01), "9/1 12:00am", "MRK",
241: "Medical" },
242: new Object[] { "Microsoft Corporation",
243: new Double(25.84), new Double(0.14),
244: new Double(0.54), "9/1 12:00am", "MSFT",
245: "Computer" },
246: new Object[] { "Pfizer Inc", new Double(27.96),
247: new Double(0.4), new Double(1.45),
248: "9/1 12:00am", "PFE", "Medical" },
249: new Object[] { "The Coca-Cola Company",
250: new Double(45.07), new Double(0.26),
251: new Double(0.58), "9/1 12:00am", "KO",
252: "Food" },
253: new Object[] { "The Home Depot, Inc.",
254: new Double(34.64), new Double(0.35),
255: new Double(1.02), "9/1 12:00am", "HD",
256: "Retail" },
257: new Object[] { "The Procter & Gamble Company",
258: new Double(61.91), new Double(0.01),
259: new Double(0.02), "9/1 12:00am", "PG",
260: "Manufacturing" },
261: new Object[] { "United Technologies Corporation",
262: new Double(63.26), new Double(0.55),
263: new Double(0.88), "9/1 12:00am", "UTX",
264: "Computer" },
265: new Object[] { "Verizon Communications",
266: new Double(35.57), new Double(0.39),
267: new Double(1.11), "9/1 12:00am", "VZ",
268: "Services" },
269: new Object[] { "Wal-Mart Stores, Inc.",
270: new Double(45.45), new Double(0.73),
271: new Double(1.63), "9/1 12:00am", "WMT",
272: "Retail" },
273: new Object[] {
274: "Walt Disney Company (The) (Holding Company)",
275: new Double(29.89), new Double(0.24),
276: new Double(0.81), "9/1 12:00am", "DIS",
277: "Services" } };
278:
279: }
280: return companyData;
281: }
282:
283: public static Object[][] getCompanyDataSmall() {
284: if (companyDataSmall == null) {
285: companyDataSmall = new Object[][] {
286: new Object[] { "3m Co", new Double(71.72),
287: new Double(0.02), new Double(0.03),
288: "9/1 12:00am", "MMM", "Manufacturing" },
289: new Object[] { "Alcoa Inc", new Double(29.01),
290: new Double(0.42), new Double(1.47),
291: "9/1 12:00am", "AA", "Manufacturing" },
292: new Object[] { "Altria Group Inc",
293: new Double(83.81), new Double(0.28),
294: new Double(0.34), "9/1 12:00am", "MO",
295: "Manufacturing" },
296: new Object[] { "American Express Company",
297: new Double(52.55), new Double(0.01),
298: new Double(0.02), "9/1 12:00am", "AXP",
299: "Finance" },
300: new Object[] {
301: "American International Group, Inc.",
302: new Double(64.13), new Double(0.31),
303: new Double(0.49), "9/1 12:00am", "AIG",
304: "Services" },
305: new Object[] { "AT&T Inc.", new Double(31.61),
306: new Double(-0.48), new Double(-1.54),
307: "9/1 12:00am", "T", "Services" },
308: new Object[] { "Boeing Co.", new Double(75.43),
309: new Double(0.53), new Double(0.71),
310: "9/1 12:00am", "BA", "Manufacturing" },
311: new Object[] { "Caterpillar Inc.",
312: new Double(67.27), new Double(0.92),
313: new Double(1.39), "9/1 12:00am", "CAT",
314: "Services" },
315: new Object[] { "Citigroup, Inc.",
316: new Double(49.37), new Double(0.02),
317: new Double(0.04), "9/1 12:00am", "C",
318: "Finance" },
319: new Object[] {
320: "E.I. du Pont de Nemours and Company",
321: new Double(40.48), new Double(0.51),
322: new Double(1.28), "9/1 12:00am", "DD",
323: "Manufacturing" } };
324:
325: }
326: return companyDataSmall;
327: }
328:
329: public static String getShortBogusMarkup() {
330: return "<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.";
331: }
332:
333: public static String getBogusMarkup() {
334: return "<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.</p>";
335: }
336: }
|