arcgissamples\scenario\map\MapInfo.java
/* Copyright 2010 ESRI * * All rights reserved under the copyright laws of the United States * and applicable international laws, treaties, and conventions. * * You may freely redistribute and use this sample code, with or * without modification, provided you include the original copyright * notice and use restrictions. * * See the use restrictions. * */ package arcgissamples.scenario.map; /** Helper class for creating mapserverconnection object. */ public class MapInfo { static MapServerConnectionInfo mapServerConnection; static String connectionType; public MapInfo() { } /**Returns the map info instance * @return MapInfo */ public static MapServerConnectionInfo getMapInfoInstance() { if (mapServerConnection == null) { if(connectionType == null) return null; if(connectionType.equalsIgnoreCase("internet")) mapServerConnection = new InternetConnectionInfo(); else mapServerConnection = new LANConnectionInfo(); } return mapServerConnection; } public static void setConnectionType(String connectiontype) { if(mapServerConnection != null) { mapServerConnection.stop(); mapServerConnection = null; } connectionType = connectiontype; } }