/* * This is part of Geomajas, a GIS framework, http://www.geomajas.org/. * * Copyright 2008-2015 Geosparc nv, http://www.geosparc.com/, Belgium. * * The program is available in open source according to the GNU Affero * General Public License. All contributions in this program are covered * by the Geomajas Contributors License Agreement. For full licensing * details, see LICENSE.txt in the project root. */ package org.geomajas.gwt2.example.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import org.geomajas.gwt2.example.base.client.sample.SamplePanel; import org.geomajas.gwt2.example.base.client.sample.SamplePanelRegistry; import org.geomajas.gwt2.example.base.client.sample.ShowcaseSampleDefinition; import org.geomajas.gwt2.example.client.i18n.SampleMessages; import org.geomajas.gwt2.example.client.sample.feature.FeatureSelectionPanel; import org.geomajas.gwt2.example.client.sample.feature.MultiLineStringFeatureSelectionPanel; import org.geomajas.gwt2.example.client.sample.general.AlternativeControlsPanel; import org.geomajas.gwt2.example.client.sample.general.MapFillPanel; import org.geomajas.gwt2.example.client.sample.general.NavigationOptionPanel; import org.geomajas.gwt2.example.client.sample.general.ResizeMapPanel; import org.geomajas.gwt2.example.client.sample.general.ServerExceptionPanel; import org.geomajas.gwt2.example.client.sample.general.ViewPortEventPanel; import org.geomajas.gwt2.example.client.sample.layer.LayerAddRemovePanel; import org.geomajas.gwt2.example.client.sample.layer.LayerOpacityPanel; import org.geomajas.gwt2.example.client.sample.layer.LayerOrderPanel; import org.geomajas.gwt2.example.client.sample.layer.LayerRefreshPanel; import org.geomajas.gwt2.example.client.sample.layer.LayerVisibilityPanel; import org.geomajas.gwt2.example.client.sample.listener.ListenerPanel; import org.geomajas.gwt2.example.client.sample.rendering.CanvasImageRenderingPanel; import org.geomajas.gwt2.example.client.sample.rendering.CanvasRenderingPanel; import org.geomajas.gwt2.example.client.sample.rendering.DrawingInteractionPanel; import org.geomajas.gwt2.example.client.sample.rendering.FixedSizeWorldSpaceRenderingPanel; import org.geomajas.gwt2.example.client.sample.rendering.HtmlMarkerPanel; import org.geomajas.gwt2.example.client.sample.rendering.ScreenSpaceRenderingPanel; import org.geomajas.gwt2.example.client.sample.rendering.WorldSpaceRenderingPanel; /** * Entry point and main class for the GWT client example application. * * @author Pieter De Graef */ public class ExampleJar implements EntryPoint { private static final SampleMessages MESSAGES = GWT.create(SampleMessages.class); public static final String CATEGORY_GENERAL = "General Samples"; public static final String CATEGORY_LAYER = "Layer functionalities"; public static final String CATEGORY_FEATURE = "Feature functionalities"; public static final String CATEGORY_RENDERING = "Drawing on the map"; public void onModuleLoad() { // Register all samples: registerGeneralSamples(); registerLayerSamples(); registerFeatureSamples(); registerRenderingSamples(); registerListenerSample(); } public static SampleMessages getMessages() { return MESSAGES; } private void registerGeneralSamples() { SamplePanelRegistry.registerCategory(CATEGORY_GENERAL, 100); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new NavigationOptionPanel(); } public String getTitle() { return MESSAGES.generalNavOptionTitle(); } public String getShortDescription() { return MESSAGES.generalNavOptionShort(); } public String getDescription() { return MESSAGES.generalNavOptionDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "navoption"; } }); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new ResizeMapPanel(); } public String getTitle() { return MESSAGES.generalResizeMapTitle(); } public String getShortDescription() { return MESSAGES.generalResizeMapShort(); } public String getDescription() { return MESSAGES.generalResizeMapDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "resizemap"; } }); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new MapFillPanel(); } public String getTitle() { return MESSAGES.generalMapFillTitle(); } public String getShortDescription() { return MESSAGES.generalMapFillShort(); } public String getDescription() { return MESSAGES.generalMapFillDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "mapfill"; } }); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new ViewPortEventPanel(); } public String getTitle() { return MESSAGES.generalVpEventTitle(); } public String getShortDescription() { return MESSAGES.generalVpEventShort(); } public String getDescription() { return MESSAGES.generalVpEventDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "viewportevent"; } }); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new AlternativeControlsPanel(); } public String getTitle() { return MESSAGES.generalControlsTitle(); } public String getShortDescription() { return MESSAGES.generalControlsShort(); } public String getDescription() { return MESSAGES.generalControlsDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "alternativecontrols"; } }); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new ServerExceptionPanel(); } public String getTitle() { return MESSAGES.generalServerExceptionTitle(); } public String getShortDescription() { return MESSAGES.generalServerExceptionShort(); } public String getDescription() { return MESSAGES.generalServerExceptionDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "serverexception"; } }); // SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { // // public SamplePanel create() { // return new MapTraceNavigationPanel(); // } // // public String getTitle() { // return MESSAGES.generalTraceNavigationTitle(); // } // // public String getShortDescription() { // return MESSAGES.generalTraceNavigationShort(); // } // // public String getDescription() { // return MESSAGES.generalTraceNavigationDescription(); // } // // public String getCategory() { // return CATEGORY_GENERAL; // } // }); } private void registerLayerSamples() { SamplePanelRegistry.registerCategory(CATEGORY_LAYER, 99); SamplePanelRegistry.registerFactory(CATEGORY_LAYER, new ShowcaseSampleDefinition() { public SamplePanel create() { return new LayerAddRemovePanel(); } public String getTitle() { return MESSAGES.layerAddRemoveTitle(); } public String getShortDescription() { return MESSAGES.layerAddRemoveShort(); } public String getDescription() { return MESSAGES.layerAddRemoveDescription(); } public String getCategory() { return CATEGORY_LAYER; } @Override public String getKey() { return "layeraddremove"; } }); SamplePanelRegistry.registerFactory(CATEGORY_LAYER, new ShowcaseSampleDefinition() { public SamplePanel create() { return new LayerOrderPanel(); } public String getTitle() { return MESSAGES.layerOrderTitle(); } public String getShortDescription() { return MESSAGES.layerOrderShort(); } public String getDescription() { return MESSAGES.layerOrderDescription(); } public String getCategory() { return CATEGORY_LAYER; } @Override public String getKey() { return "layerorder"; } }); SamplePanelRegistry.registerFactory(CATEGORY_LAYER, new ShowcaseSampleDefinition() { public SamplePanel create() { return new LayerVisibilityPanel(); } public String getTitle() { return MESSAGES.layerVisibilityTitle(); } public String getShortDescription() { return MESSAGES.layerVisibilityShort(); } public String getDescription() { return MESSAGES.layerVisibilityDescription(); } public String getCategory() { return CATEGORY_LAYER; } @Override public String getKey() { return "layervisibility"; } }); SamplePanelRegistry.registerFactory(CATEGORY_LAYER, new ShowcaseSampleDefinition() { public SamplePanel create() { return new LayerRefreshPanel(); } public String getTitle() { return MESSAGES.layerRefreshTitle(); } public String getShortDescription() { return MESSAGES.layerRefreshShort(); } public String getDescription() { return MESSAGES.layerRefreshDescription(); } public String getCategory() { return CATEGORY_LAYER; } @Override public String getKey() { return "layerrefresh"; } }); SamplePanelRegistry.registerFactory(CATEGORY_LAYER, new ShowcaseSampleDefinition() { public SamplePanel create() { return new LayerOpacityPanel(); } public String getTitle() { return MESSAGES.layerOpacityTitle(); } public String getShortDescription() { return MESSAGES.layerOpacityShort(); } public String getDescription() { return MESSAGES.layerOpacityDescription(); } public String getCategory() { return CATEGORY_LAYER; } @Override public String getKey() { return "layeropacity"; } }); } private void registerFeatureSamples() { SamplePanelRegistry.registerCategory(CATEGORY_FEATURE, 98); SamplePanelRegistry.registerFactory(CATEGORY_FEATURE, new ShowcaseSampleDefinition() { public SamplePanel create() { return new FeatureSelectionPanel(); } public String getTitle() { return MESSAGES.featureSelectionTitle(); } public String getShortDescription() { return MESSAGES.featureSelectionShort(); } public String getDescription() { return MESSAGES.featureSelectionDescription(); } public String getCategory() { return CATEGORY_FEATURE; } @Override public String getKey() { return "featureselection"; } }); SamplePanelRegistry.registerFactory(CATEGORY_FEATURE, new ShowcaseSampleDefinition() { public SamplePanel create() { return new MultiLineStringFeatureSelectionPanel(); } public String getTitle() { return MESSAGES.featureSelectionMultiLineStringTitle(); } public String getShortDescription() { return MESSAGES.featureSelectionMultiLineStringShort(); } public String getDescription() { return MESSAGES.featureSelectionMultiLineStringDescription(); } public String getCategory() { return CATEGORY_FEATURE; } @Override public String getKey() { return "featureselectionlinestring"; } }); } private void registerRenderingSamples() { SamplePanelRegistry.registerCategory(CATEGORY_RENDERING, 97); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new DrawingInteractionPanel(); } public String getTitle() { return MESSAGES.renderingInteractionTitle(); } public String getShortDescription() { return MESSAGES.renderingInteractionShort(); } public String getDescription() { return MESSAGES.renderingInteractionDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "drawinginteraction"; } }); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new ScreenSpaceRenderingPanel(); } public String getTitle() { return MESSAGES.renderingScreenSpaceTitle(); } public String getShortDescription() { return MESSAGES.renderingScreenSpaceShort(); } public String getDescription() { return MESSAGES.renderingScreenSpaceDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "screenspacerendering"; } }); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new WorldSpaceRenderingPanel(); } public String getTitle() { return MESSAGES.renderingWorldSpaceTitle(); } public String getShortDescription() { return MESSAGES.renderingWorldSpaceShort(); } public String getDescription() { return MESSAGES.renderingWorldSpaceDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "worldspacerendering"; } }); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new HtmlMarkerPanel(); } public String getTitle() { return MESSAGES.markerPanelTitle(); } public String getShortDescription() { return MESSAGES.markerPanelShort(); } public String getDescription() { return MESSAGES.markerPanelDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "htmlmarker"; } }); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new FixedSizeWorldSpaceRenderingPanel(); } public String getTitle() { return MESSAGES.renderingWorldSpaceFixedTitle(); } public String getShortDescription() { return MESSAGES.renderingWorldSpaceFixedShort(); } public String getDescription() { return MESSAGES.renderingWorldSpaceFixedDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "fixedsizeworldspacerendering"; } }); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new CanvasRenderingPanel(); } public String getTitle() { return MESSAGES.renderingCanvasTitle(); } public String getShortDescription() { return MESSAGES.renderingCanvasShort(); } public String getDescription() { return MESSAGES.renderingCanvasDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "canvasrendering"; } }); SamplePanelRegistry.registerFactory(CATEGORY_RENDERING, new ShowcaseSampleDefinition() { public SamplePanel create() { return new CanvasImageRenderingPanel(); } public String getTitle() { return MESSAGES.renderingCanvasImageTitle(); } public String getShortDescription() { return MESSAGES.renderingCanvasImageShort(); } public String getDescription() { return MESSAGES.renderingCanvasImageDescription(); } public String getCategory() { return CATEGORY_RENDERING; } @Override public String getKey() { return "canvasrenderingimage"; } }); } private void registerListenerSample() { SamplePanelRegistry.registerCategory(CATEGORY_GENERAL, 105); SamplePanelRegistry.registerFactory(CATEGORY_GENERAL, new ShowcaseSampleDefinition() { public SamplePanel create() { return new ListenerPanel(); } public String getTitle() { return MESSAGES.generalListnerTitle(); } public String getShortDescription() { return MESSAGES.generalListnerShort(); } public String getDescription() { return MESSAGES.generalListnerDescription(); } public String getCategory() { return CATEGORY_GENERAL; } @Override public String getKey() { return "listener"; } }); } }