diff --git a/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessFolder.java b/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessFolder.java index dc94e25dd7..9efe56e231 100644 --- a/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessFolder.java +++ b/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessFolder.java @@ -39,7 +39,7 @@ public class LocalProcessFolder implements IResolve { /** * LocalProcessFolder constructor with package visibility as it should only be constructed by * LocalProcessService. - * + * * @param service * @param factory */ @@ -48,7 +48,7 @@ public class LocalProcessFolder implements IResolve { this.factory = factory; this.id = new ID( service.getID() + "/" + factory.getClass().getSimpleName(), "local" ); } - + public ProcessFactory getFactory() { return factory; } @@ -137,7 +137,6 @@ public String getTitle() { } public void dispose( IProgressMonitor monitor ) { - // TODO Auto-generated method stub } diff --git a/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessService.java b/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessService.java index 65e18396e9..274304f447 100644 --- a/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessService.java +++ b/plugins/org.locationtech.udig.catalog.geotools/src/org/locationtech/udig/catalog/geotools/process/LocalProcessService.java @@ -30,7 +30,7 @@ /** * Gathers up all ProcessFactories findable by GeoTools into the local catalog. - * + * * @author Jody Garnett (LISAsoft) * @since 1.2.0 */ @@ -40,7 +40,7 @@ public class LocalProcessService extends IService { * ID used for geotools processes */ public final static String ID = "process:///localhost/geotools/process"; //$NON-NLS-1$ - + /** Service ID used for GeoTools processes */ public final static ID SERVICE_ID = new ID(ID,"geotools"); @@ -55,7 +55,7 @@ public Map getConnectionParams() { params.put(LocalProcessServiceExtension.KEY, SERVICE_ID.toURL() ); return params; } - + public Status getStatus() { if( folders == null ){ return super.getStatus(); @@ -71,7 +71,7 @@ public Throwable getMessage() { public org.locationtech.udig.catalog.ID getID() { return SERVICE_ID; } - + public URL getIdentifier() { return SERVICE_ID.toURL(); } @@ -83,11 +83,11 @@ public synchronized List members( IProgressMonitor monitor ) throws IO for( ProcessFactory factory : Processors.getProcessFactories() ){ LocalProcessFolder folder = new LocalProcessFolder(this, factory ); folders.add( folder ); - } + } } return folders; } - + /** * This service does not provide any spatial data. * @return null, as this service does not provide any spatial data @@ -99,7 +99,6 @@ public List resources( IProgressMonitor monitor ) throws @Override protected IServiceInfo createInfo( IProgressMonitor monitor ) throws IOException { - // TODO Auto-generated method stub return null; } diff --git a/plugins/org.locationtech.udig.catalog.jgrass/src/org/locationtech/udig/catalog/jgrass/activeregion/dialogs/CatalogJGrassMapsetsTreeViewer.java b/plugins/org.locationtech.udig.catalog.jgrass/src/org/locationtech/udig/catalog/jgrass/activeregion/dialogs/CatalogJGrassMapsetsTreeViewer.java index 239d8a0c37..3fab01ee76 100644 --- a/plugins/org.locationtech.udig.catalog.jgrass/src/org/locationtech/udig/catalog/jgrass/activeregion/dialogs/CatalogJGrassMapsetsTreeViewer.java +++ b/plugins/org.locationtech.udig.catalog.jgrass/src/org/locationtech/udig/catalog/jgrass/activeregion/dialogs/CatalogJGrassMapsetsTreeViewer.java @@ -1,6 +1,6 @@ /* - * JGrass - Free Open Source Java GIS http://www.jgrass.org - * (C) HydroloGIS - www.hydrologis.com + * JGrass - Free Open Source Java GIS http://www.jgrass.org + * (C) HydroloGIS - www.hydrologis.com * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -49,7 +49,7 @@ * This class supplies a tree viewer containing the JGrass mapsets that are in the catalog When a * mapset is selected it is passed to the WidgetObservers that are registered with this class. *

- * + * * @author Andrea Antonello - www.hydrologis.com * @since 1.1.0 */ @@ -119,7 +119,7 @@ public void selectionChanged( SelectionChangedEvent event ) { private class ContentProvider implements ITreeContentProvider { /** * Gets the children of the specified object - * + * * @param arg0 the parent object * @return Object[] */ @@ -171,7 +171,7 @@ private Object[] filteredLayers( List layers ) { } /** * Gets the parent of the specified object - * + * * @param arg0 the object * @return Object */ @@ -190,7 +190,7 @@ public Object getParent( Object arg0 ) { /** * Returns whether the passed object has children - * + * * @param arg0 the parent object * @return boolean */ @@ -205,7 +205,7 @@ public boolean hasChildren( Object arg0 ) { /** * Gets the root element(s) of the tree - * + * * @param arg0 the input data * @return Object[] */ @@ -241,7 +241,7 @@ public void dispose() { /** * Called when the input changes - * + * * @param arg0 the viewer * @param arg1 the old input * @param arg2 the new input @@ -297,7 +297,7 @@ public LabelProvider() { /** * Gets the image to display for a node in the tree - * + * * @param arg0 the node * @return Image */ @@ -313,7 +313,7 @@ public Image getImage( Object arg0 ) { /** * Gets the text to display for a node in the tree - * + * * @param arg0 the node * @return String */ @@ -335,7 +335,7 @@ public String getText( Object arg0 ) { /** * Adds a listener to this label provider - * + * * @param arg0 the listener */ public void addListener( ILabelProviderListener arg0 ) { @@ -354,7 +354,7 @@ public void dispose() { /** * Returns whether changes to the specified property on the specified element would affect * the label for the element - * + * * @param arg0 the element * @param arg1 the property * @return boolean @@ -365,7 +365,7 @@ public boolean isLabelProperty( Object arg0, String arg1 ) { /** * Removes the listener - * + * * @param arg0 the listener to remove */ public void removeListener( ILabelProviderListener arg0 ) { @@ -378,7 +378,6 @@ public List getSelectedLayers() { } public int getType() { - // TODO Auto-generated method stub return 0; } diff --git a/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/Activator.java b/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/Activator.java index 7d86313c6e..62d4dfb9b6 100644 --- a/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/Activator.java +++ b/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/Activator.java @@ -82,32 +82,31 @@ protected org.eclipse.swt.widgets.Control createDialogArea( layout.verticalSpacing = 0; comp.setLayout(layout); Control msg; - try { + try { Browser browser = new Browser(comp, SWT.NONE); browser.setText(String.format(htmlForm,Messages.GetHTMLDriverMsg)); - msg = browser; - browser.addLocationListener(new LocationListener() { - + msg = browser; + browser.addLocationListener(new LocationListener() { + @Override public void changing(LocationEvent event) { event.doit = false; org.eclipse.swt.program.Program.launch(event.location); - + } - + @Override public void changed(LocationEvent event) { - // TODO Auto-generated method stub - + } }); - } catch (SWTError e) { + } catch (SWTError e) { Text text = new Text(comp, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.BORDER | SWT.SHADOW_IN); text.setText(Messages.GetDriverMsg); msg = text; - } + } GridDataFactory.fillDefaults().span(2, 1) .hint(500, 200).applyTo(msg); area(path, JDBC_FILE_NAME, comp); @@ -124,7 +123,7 @@ public Text area(String defaultPath, @Override public void handleEvent(Event event) { - path = text1.getText(); + path = text1.getText(); updateRestart(); } @@ -204,7 +203,7 @@ public void start(BundleContext context) throws Exception { /* * (non-Javadoc) - * + * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext * ) @@ -232,7 +231,7 @@ public void run() { File newPlugin; boolean needUserCopy; - + File requiredPluginDir = new File(pluginsDir, pluginName); try { newPlugin = requiredPluginDir; @@ -246,7 +245,7 @@ public void run() { final String dest = new File(newPlugin,"libs").getPath(); final File finalNewPlugin = newPlugin; - + transfer(dest, JDBC_FILE_NAME, dialog); transfer(dest, CONFIG_FILE_NAME, dialog); @@ -255,25 +254,25 @@ public void run() { Dialog dialog2 = new Dialog(shell) { protected Control createDialogArea(Composite parent) { Control comp; - try { - Browser browser = new Browser(parent, SWT.NONE); - - String mainMessage = String.format(Messages.GetHTMLCopyPluginMsg,finalNewPlugin.getParentFile().getAbsolutePath(), finalNewPlugin.getAbsolutePath(), pluginsDir.getAbsolutePath()); - browser.setText(mainMessage); - browser.addLocationListener(new LocationListener() { - - @Override - public void changing(LocationEvent event) { - event.doit = false; - org.eclipse.swt.program.Program.launch(event.location); - } - - @Override - public void changed(LocationEvent event) { - } - }); - comp = browser; - } catch (SWTError e) { + try { + Browser browser = new Browser(parent, SWT.NONE); + + String mainMessage = String.format(Messages.GetHTMLCopyPluginMsg,finalNewPlugin.getParentFile().getAbsolutePath(), finalNewPlugin.getAbsolutePath(), pluginsDir.getAbsolutePath()); + browser.setText(mainMessage); + browser.addLocationListener(new LocationListener() { + + @Override + public void changing(LocationEvent event) { + event.doit = false; + org.eclipse.swt.program.Program.launch(event.location); + } + + @Override + public void changed(LocationEvent event) { + } + }); + comp = browser; + } catch (SWTError e) { Text text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.BORDER | SWT.SHADOW_IN); @@ -282,24 +281,24 @@ public void changed(LocationEvent event) { text.setText(mainMessage); comp = text; } - GridDataFactory.fillDefaults().hint(500, 200).applyTo(comp); + GridDataFactory.fillDefaults().hint(500, 200).applyTo(comp); - return comp; + return comp; }; @Override protected Button createButton(Composite parent, int id, String label, boolean defaultButton) { Button button = super.createButton(parent, id,label, defaultButton); if (id == Window.OK) button.setText("Restart"); - + return button; } }; - + if(dialog2.open() == Window.CANCEL) return; } } - + String cmd = buildCommandLine(shell); if (cmd != null) { System.setProperty(PROP_EXIT_CODE, Integer.toString(24)); @@ -315,7 +314,7 @@ protected Button createButton(Composite parent, public File findPluginsDir() throws IOException { Bundle bundle = Platform.getBundle(GEOTOOLS_LIBS_PLUGIN); - + String filePath = FileLocator.toFileURL(FileLocator.find(bundle, new Path("glib"), new HashMap())).getFile(); return new File(filePath).getParentFile().getParentFile(); } @@ -326,7 +325,7 @@ private void transfer(String dest, String driver, LicenseDialog dialog) RandomAccessFile in = null; try { String fromPath = new File(dialog.getPath(),driver).getPath(); - + String toPath = new File(dest, driver).getPath(); out = new RandomAccessFile(toPath, "rw"); in = new RandomAccessFile(fromPath.trim(), "r"); @@ -385,7 +384,7 @@ protected static void createPluginStructure(File newPlugin) throws IOException { * Create and return a string with command line options for eclipse.exe that * will launch a new workbench that is the same as the currently running * one, but using the argument directory as its workspace. - * + * * @param workspace * the directory to use as the new workspace * @return a string of command line options or null on error @@ -437,7 +436,7 @@ private static String buildCommandLine(Shell shell) { /** * Returns the shared instance - * + * * @return the shared instance */ public static Activator getDefault() { diff --git a/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/ExtraParams.java b/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/ExtraParams.java index f5994a6641..b13f85236b 100644 --- a/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/ExtraParams.java +++ b/plugins/org.locationtech.udig.catalog.teradata/src/org/locationtech/udig/catalog/teradata/ExtraParams.java @@ -25,14 +25,12 @@ public class ExtraParams implements Tab { @Override public boolean leavingPage() { - // TODO Auto-generated method stub return false; } @Override public Either> getParams( Map params) { - // TODO Auto-generated method stub return null; } @@ -43,18 +41,15 @@ public Collection getResourceIDs(Map params) { @Override public void addListener(Listener modifyListener) { - // TODO Auto-generated method stub } @Override public void init() { - // TODO Auto-generated method stub } public Control createControl(TabFolder tabFolder, int none) { - // TODO Auto-generated method stub return null; } diff --git a/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/DummyConnectionPage.java b/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/DummyConnectionPage.java index de799af846..eaa774b059 100644 --- a/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/DummyConnectionPage.java +++ b/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/DummyConnectionPage.java @@ -37,7 +37,6 @@ public void createControl(Composite parent) { } public String getId() { - // TODO Auto-generated method stub return null; } @@ -45,9 +44,9 @@ public Map getParams() { URL url = null; try { url = new URL("http://dummy.refractions.net"); //$NON-NLS-1$ - } + } catch (MalformedURLException e) {} - + HashMap map = new HashMap(); map.put("dummy", url); //$NON-NLS-1$ return map; @@ -58,7 +57,7 @@ public List getURLs() { ArrayList list = new ArrayList(); list.add(new URL("http://dummy.refractions.net")); //$NON-NLS-1$ return list; - } + } catch (MalformedURLException e) { return null; } diff --git a/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/BasicWorkflowTest.java b/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/BasicWorkflowTest.java index 821e86366a..8a827042a3 100644 --- a/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/BasicWorkflowTest.java +++ b/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/BasicWorkflowTest.java @@ -27,38 +27,38 @@ import org.junit.Test; public class BasicWorkflowTest { - + int i = 0; Workflow pipe; State1 s1; State4 s4; - + @Before public void setUp() throws Exception { pipe = new Workflow(); s1 = new State1(); s4 = new State4(); - + pipe.setStates(new State[]{s1,s4}); i = 1; } - + @Test(expected = IllegalStateException.class) public void testPipeState() { pipe.next(new DummyMonitor()); } - + @Test public void testNonBlocking() { Shell shell = new Shell(Display.getDefault()); final Dialog dialog = new Dialog(shell) {}; - + Listener1 l = new Listener1() { - + @Override public void finished(State state) { super.finished(state); - + Display.getDefault().asyncExec( new Runnable() { @@ -70,21 +70,21 @@ public void run() { } }; pipe.addListener(l); - + pipe.start(); pipe.next(); pipe.next(); pipe.next(); pipe.next(); pipe.next(); - - //need to open a dialog here to "halt" the ui thread so that the + + //need to open a dialog here to "halt" the ui thread so that the // the workbench doesn't close while the pipe is still running dialog.setBlockOnOpen(true); dialog.open(); if (!shell.isDisposed()) shell.dispose(); - + assertTrue(l.state1); assertTrue(l.state2); assertTrue(l.state3); @@ -99,37 +99,37 @@ public void run() { assertNotNull(pipe.getState(State3.class)); assertNotNull(pipe.getState(State4.class)); assertNotNull(pipe.getState(State5.class)); - + assertTrue(pipe.getState(State1.class).ran); assertTrue(pipe.getState(State2.class).ran); assertTrue(pipe.getState(State3.class).ran); assertTrue(pipe.getState(State4.class).ran); assertTrue(pipe.getState(State5.class).ran); } - + @Test public void testBlocking() { Listener1 l = new Listener1(); pipe.addListener(l); - + pipe.start(new NullProgressMonitor()); pipe.next(new NullProgressMonitor()); pipe.next(new NullProgressMonitor()); pipe.next(new NullProgressMonitor()); pipe.next(new NullProgressMonitor()); pipe.next(new NullProgressMonitor()); - + // int x = 0; // while(!l.finished && x++ < 10) { // try { // Thread.sleep(500); -// } +// } // catch (InterruptedException e) { // e.printStackTrace(); // fail(); // } // } - + assertTrue(l.state1); assertTrue(l.state2); assertTrue(l.state3); @@ -144,41 +144,41 @@ public void testBlocking() { assertNotNull(pipe.getState(State3.class)); assertNotNull(pipe.getState(State4.class)); assertNotNull(pipe.getState(State5.class)); - + assertTrue(pipe.getState(State1.class).ran); assertTrue(pipe.getState(State2.class).ran); assertTrue(pipe.getState(State3.class).ran); assertTrue(pipe.getState(State4.class).ran); assertTrue(pipe.getState(State5.class).ran); } - + @Ignore @Test public void testStateFailureNonBlocking() { Shell shell = new Shell(Display.getDefault()); final Dialog dialog = new Dialog(shell) {}; - + //test where one state craps out s4.run = false; - + Listener1 l = new Listener2() { @Override public void stateFailed(State state) { super.stateFailed(state); - + if (dialog.getShell().isVisible()) { - + dialog.getShell().getDisplay().asyncExec( new Runnable() { public void run() { - dialog.close(); + dialog.close(); }; } - ); + ); } - + } - + @Override public void finished(State state) { super.finished(state); @@ -186,15 +186,15 @@ public void finished(State state) { } }; pipe.addListener(l); - + pipe.start(); pipe.next(); pipe.next(); pipe.next(); pipe.next(); pipe.next(); - - //need to open a dialog here to "halt" the ui thread so that the + + //need to open a dialog here to "halt" the ui thread so that the // the workbench doesn't close while the pipe is still running // create a watchdog to kill it after a specified amount of time Runnable runnable = new Runnable() { @@ -212,24 +212,24 @@ public void run(){ public void run() { if (dialog.getShell().isVisible()) { dialog.close(); - } + } } } ); } }; new Thread(runnable).start(); - + dialog.setBlockOnOpen(true); if( !l.finished ) dialog.open(); if (!shell.isDisposed()) shell.dispose(); - + assertTrue(l.state1); assertTrue(l.state2); assertTrue(l.state3); - assertTrue(!l.state4); + assertTrue(!l.state4); assertTrue(!l.state5); assertTrue(!l.finished); assertTrue(!l.fail); @@ -240,21 +240,21 @@ public void run() { assertNotNull(pipe.getState(State3.class)); assertNotNull(pipe.getState(State4.class)); assertNull(pipe.getState(State5.class)); - + assertTrue(pipe.getState(State1.class).ran); assertTrue(pipe.getState(State2.class).ran); assertTrue(pipe.getState(State3.class).ran); assertTrue(pipe.getState(State4.class).ran); - + assertEquals(pipe.getCurrentState(),s4); } - + @Ignore @Test public void testStateFailureBlocking() { //test where one state craps out s4.run = false; - + Listener1 l = new Listener2() { @Override public void finished(State state) { @@ -262,14 +262,14 @@ public void finished(State state) { } }; pipe.addListener(l); - + pipe.start(null); pipe.next(null); pipe.next(null); pipe.next(null); pipe.next(null); pipe.next(null); - + assertTrue(l.state1); assertTrue(l.state2); assertTrue(l.state3); @@ -284,36 +284,36 @@ public void finished(State state) { assertNotNull(pipe.getState(State3.class)); assertNotNull(pipe.getState(State4.class)); assertNull(pipe.getState(State5.class)); - + assertTrue(pipe.getState(State1.class).ran); assertTrue(pipe.getState(State2.class).ran); assertTrue(pipe.getState(State3.class).ran); assertTrue(pipe.getState(State4.class).ran); - + assertEquals(pipe.getCurrentState(),s4); } @Ignore @Test public void testRun() { - + assertTrue(!pipe.isFinished()); assertTrue(!pipe.isStarted()); assertTrue(!pipe.getState(State1.class).ran); assertTrue(!pipe.getState(State4.class).ran); - - + + pipe.run(new DummyMonitor()); - + assertTrue(pipe.isFinished()); assertTrue(pipe.isStarted()); assertTrue(pipe.getState(State1.class).ran); assertTrue(pipe.getState(State2.class).ran); assertTrue(pipe.getState(State3.class).ran); assertTrue(pipe.getState(State4.class).ran); - + } - + class Listener1 implements Listener { boolean state1 = false; @@ -321,23 +321,22 @@ class Listener1 implements Listener { boolean state3 = false; boolean state4 = false; boolean state5 = false; - + boolean fail = false; boolean finished = false; - + public void started(State first) { - - + } - + public void forward(State state, State prev) { - + } public void backward(State current, State next) { - // TODO Auto-generated method stub + } - + public void statePassed(State state) { switch(i) { case 1: @@ -360,12 +359,12 @@ public void statePassed(State state) { state5 = state instanceof State5; i++; break; - + default: fail = true; } } - + public void stateFailed(State state) { fail = true; } @@ -373,57 +372,57 @@ public void stateFailed(State state) { public void finished(State last) { finished = true; } - + } - + class Listener2 extends Listener1 { - + boolean incomplete = false; - + @Override public void stateFailed(State state) { - incomplete = state instanceof State4; + incomplete = state instanceof State4; } } - + private class State1 extends SimpleState { @Override public State next() { return new State2(); } } - + private class State2 extends SimpleState { @Override public State next() { return new State3(); } } - + private class State3 extends SimpleState { @Override public State next() { return null; } - + } - + private class State4 extends SimpleState { - + @Override public State next() { return new State5(); } } - + private class State5 extends SimpleState { - + @Override public State next() { return null; } } - - + + } diff --git a/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/DummyMonitor.java b/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/DummyMonitor.java index 04c9772243..e2b9ab006f 100644 --- a/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/DummyMonitor.java +++ b/plugins/org.locationtech.udig.catalog.ui.tests/src/org/locationtech/udig/catalog/tests/ui/workflow/DummyMonitor.java @@ -1,49 +1,42 @@ /** - * + * */ package org.locationtech.udig.catalog.tests.ui.workflow; import org.eclipse.core.runtime.IProgressMonitor; public class DummyMonitor implements IProgressMonitor { - public void beginTask(String name, int totalWork) { - // TODO Auto-generated method stub - - } - - public void done() { - // TODO Auto-generated method stub - - } - - public void internalWorked(double work) { - // TODO Auto-generated method stub - - } - - public boolean isCanceled() { - // TODO Auto-generated method stub - return false; - } - - public void setCanceled(boolean value) { - // TODO Auto-generated method stub - - } - - public void setTaskName(String name) { - // TODO Auto-generated method stub - - } - - public void subTask(String name) { - // TODO Auto-generated method stub - - } - - public void worked(int work) { - // TODO Auto-generated method stub - - } - + + public void beginTask(String name, int totalWork) { + + } + + public void done() { + + } + + public void internalWorked(double work) { + + } + + public boolean isCanceled() { + return false; + } + + public void setCanceled(boolean value) { + + } + + public void setTaskName(String name) { + + } + + public void subTask(String name) { + + } + + public void worked(int work) { + + } + } diff --git a/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wmsc/ui/WMSCConnectionFactory.java b/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wmsc/ui/WMSCConnectionFactory.java index c8eff0a98e..95324fb612 100644 --- a/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wmsc/ui/WMSCConnectionFactory.java +++ b/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/internal/wmsc/ui/WMSCConnectionFactory.java @@ -32,10 +32,10 @@ /** * Connection factory for a wmsc service. - * + * * Note the url must have "tiled=true" to be a wmsc service. - * - * + * + * * @author Emily Gouge (Refractions Research, Inc.) * @since 1.1.0 */ @@ -52,9 +52,9 @@ public boolean canProcess(Object context) { IResolve resolve = (IResolve) context; return resolve.canResolve( TiledWebMapServer.class ); } - return toCapabilitiesURL(context) != null; + return toCapabilitiesURL(context) != null; } - + /** * Creates connection parameters from a given context */ @@ -92,7 +92,7 @@ else if (handle instanceof WMSCGeoResourceImpl ){ return wms.getConnectionParams(); } catch (IOException e) { checkedURL( layer.getIdentifier() ); - } + } } else if( handle.canResolve( TiledWebMapServer.class )){ // must be some kind of handle from a search! @@ -100,19 +100,19 @@ else if( handle.canResolve( TiledWebMapServer.class )){ } return Collections.emptyMap(); } - + /** 'Create' params given the provided url, no magic occurs */ static public Map createParams( URL url ){ WMSCServiceExtension factory = new WMSCServiceExtension(); Map params = factory.createParams( url ); if( params != null) return params; - + Map params2 = new HashMap(); params2.put(WMSCServiceImpl.WMSC_URL_KEY,url); return params2; } - + /** * Convert "data" to a wmsc capabilities url. *

@@ -142,58 +142,57 @@ else if( ID.cast(data) != null ){ return toCapabilitiesURL( id.toURL() ); } } - return null; // no idea what this should be + return null; // no idea what this should be } static URL toCapabilitiesURL( IResolve resolve ){ if( resolve instanceof IService ){ return toCapabilitiesURL( (IService) resolve ); } - return toCapabilitiesURL( resolve.getIdentifier() ); + return toCapabilitiesURL( resolve.getIdentifier() ); } static URL toCapabilitiesURL( IService resolve ){ if( resolve instanceof WMSCServiceImpl ){ return toCapabilitiesURL( (WMSCServiceImpl) resolve ); } - return toCapabilitiesURL( resolve.getIdentifier() ); + return toCapabilitiesURL( resolve.getIdentifier() ); } /** No further QA checks needed - we know this one works */ static URL toCapabilitiesURL( WMSCServiceImpl wms ){ - return wms.getIdentifier(); + return wms.getIdentifier(); } - /** + /** * Quick sanity check to see if url is a WMSC url; * Must contain "tiled=true" - * + * */ static URL toCapabilitiesURL( URL url ){ if (url == null) return null; - + String query = url.getQuery() == null ? null : url.getQuery().toLowerCase(); String protocol = url.getProtocol() == null ? null : url.getProtocol().toLowerCase(); - + if (!"http".equals(protocol) //$NON-NLS-1$ - && !"https".equals(protocol)) { //$NON-NLS-1$ + && !"https".equals(protocol)) { //$NON-NLS-1$ return null; } - + if( query != null && query.indexOf( "tiled=true" ) != -1){ //$NON-NLS-1$ return checkedURL(url); } return null; - - + } - + /** Check that any trailing #layer is removed from the url */ static public URL checkedURL( URL url ){ String check = url.toExternalForm(); int hash = check.indexOf('#'); if ( hash == -1 ){ - return url; + return url; } try { return new URL( check.substring(0, hash )); @@ -201,9 +200,8 @@ static public URL checkedURL( URL url ){ return null; } } - + public URL createConnectionURL(Object context) { - // TODO Auto-generated method stub return null; } diff --git a/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/wmsc/server/WMSCSchema.java b/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/wmsc/server/WMSCSchema.java index 86307702e6..74d4c7f228 100644 --- a/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/wmsc/server/WMSCSchema.java +++ b/plugins/org.locationtech.udig.catalog.wms/src/org/locationtech/udig/catalog/wmsc/server/WMSCSchema.java @@ -40,7 +40,7 @@ *

* http://wiki.osgeo.org/wiki/WMS_Tiling_Client_Recommendation#GetCapabilities_Responses *

- * + * * @author Emily Gouge (Refractions Research, Inc) * @since 1.1.0 */ @@ -70,8 +70,8 @@ public class WMSCSchema implements Schema { new WMSCElement("Format", XSISimpleTypes.String.getInstance()), //$NON-NLS-1$ new WMSCElement("Layers", XSISimpleTypes.String.getInstance()), //$NON-NLS-1$ new WMSCElement("Styles", XSISimpleTypes.String.getInstance()), //_StyleType.getInstance()) //$NON-NLS-1$ - - + + new WMSCElement("Name", XSISimpleTypes.String.getInstance()), //$NON-NLS-1$ new WMSCElement("Title", XSISimpleTypes.String.getInstance()), //$NON-NLS-1$ new WMSCElement("OnlineResource", XSISimpleTypes.String.getInstance()) //$NON-NLS-1$ @@ -258,7 +258,6 @@ public Type getType() { * @see org.geotools.xml.schema.ElementGrouping#getGrouping() */ public int getGrouping() { - // TODO Auto-generated method stub return ELEMENT; } diff --git a/plugins/org.locationtech.udig.catalog.wmt/src/org/locationtech/udig/catalog/internal/wmt/wmtsource/ww/QuadTileSet.java b/plugins/org.locationtech.udig.catalog.wmt/src/org/locationtech/udig/catalog/internal/wmt/wmtsource/ww/QuadTileSet.java index 76e55ce785..977a7d5917 100644 --- a/plugins/org.locationtech.udig.catalog.wmt/src/org/locationtech/udig/catalog/internal/wmt/wmtsource/ww/QuadTileSet.java +++ b/plugins/org.locationtech.udig.catalog.wmt/src/org/locationtech/udig/catalog/internal/wmt/wmtsource/ww/QuadTileSet.java @@ -19,7 +19,7 @@ /** * Represents a <QuadTileSet> of a <LayerSet> * see: http://worldwindxml.worldwindcentral.com/zoomit.xml?version=1.4.0.0 - * + * * @author to.srwn * @since 1.1.0 */ @@ -27,54 +27,54 @@ public class QuadTileSet { private String name; private String id; private ReferencedEnvelope bbox; - + private ImageAccessor accessor; - - + + public QuadTileSet(Element xmlElement, String id) throws Exception { this.name = xmlElement.getChildText("Name"); //$NON-NLS-1$ this.id = LayerSet.constructId(id, name); - + parseBbox(xmlElement.getChild("BoundingBox")); //$NON-NLS-1$ parseImageAccessor(xmlElement.getChild("ImageAccessor")); //$NON-NLS-1$ } - + private void parseBbox(Element bboxElement) throws Exception { try { double maxY = getNumericValueFromChild(bboxElement.getChild("North")); //$NON-NLS-1$ double minY = getNumericValueFromChild(bboxElement.getChild("South")); //$NON-NLS-1$ double minX = getNumericValueFromChild(bboxElement.getChild("West")); //$NON-NLS-1$ double maxX = getNumericValueFromChild(bboxElement.getChild("East")); //$NON-NLS-1$ - + ReferencedEnvelope bounds = new ReferencedEnvelope(minX, maxX, minY, maxY, DefaultGeographicCRS.WGS84); - + this.bbox = bounds; } catch (Exception exc) { WMTPlugin.log("[QuadTileSet.parseBbox] Getting the BBox failed", exc); //$NON-NLS-1$ - + throw exc; } } - + private double getNumericValueFromChild(Element bboxChild) throws Exception { return Double.parseDouble( bboxChild.getChildText("Value") //$NON-NLS-1$ ); } - + private void parseImageAccessor(Element accessorElement) throws Exception { this.accessor = new ImageAccessor(accessorElement, this); } - + public ReferencedEnvelope getBounds() { return bbox; } - + public double[] getScaleList() { return accessor.getScaleList(); } - + public WWZoomLevel getZoomLevel(int index) { return accessor.getZoomLevel(index); } @@ -98,6 +98,6 @@ public String getId() { * Used to clean up. */ public void dispose() { - // TODO Auto-generated method stub + } } diff --git a/plugins/org.locationtech.udig.feature.editor/src/org/locationtech/udig/feature/editor/DefaultEditor.java b/plugins/org.locationtech.udig.feature.editor/src/org/locationtech/udig/feature/editor/DefaultEditor.java index b364a7a4fd..f7b38198ff 100644 --- a/plugins/org.locationtech.udig.feature.editor/src/org/locationtech/udig/feature/editor/DefaultEditor.java +++ b/plugins/org.locationtech.udig.feature.editor/src/org/locationtech/udig/feature/editor/DefaultEditor.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.feature.editor; @@ -23,7 +23,7 @@ /** * This is the default FeatureEditor; making use of a PropertySheet page to show the attributes of a * feature and allow them to be edited. - * + * * @author Jesse */ public class DefaultEditor extends ViewPart implements IUDIGView { @@ -95,17 +95,14 @@ public Object getAdapter( Class adapter ) { return new IPropertySource(){ public void setPropertyValue( Object id, Object value ) { - // TODO Auto-generated method stub } public void resetPropertyValue( Object id ) { - // TODO Auto-generated method stub } public boolean isPropertySet( Object id ) { - // TODO Auto-generated method stub return false; } diff --git a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestMap.java b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestMap.java index ea4a265b2a..0c7407a53e 100644 --- a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestMap.java +++ b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestMap.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.info.tests; @@ -27,7 +27,7 @@ public class TestMap implements IMap { private IRenderManager renderManager = new TestRenderManager(); private IViewportModel viewportModel; private List layers; - + public TestMap() { } @@ -44,53 +44,43 @@ public TestMap(IRenderManager renderManager, IViewportModel viewportModel, List< } public void addMapCompositionListener(IMapCompositionListener listener) { - // TODO Auto-generated method stub - + } public void addMapListener(IMapListener listener) { - // TODO Auto-generated method stub - + } public void executeASyncWithoutUndo(MapCommand command) { - // TODO Auto-generated method stub - + } public void executeSyncWithoutUndo(MapCommand command) { - // TODO Auto-generated method stub - + } public String getAbstract() { - // TODO Auto-generated method stub return null; } public double getAspectRatio(IProgressMonitor monitor) { - // TODO Auto-generated method stub return 0; } public IBlackboard getBlackboard() { - // TODO Auto-generated method stub return null; } // public ReferencedEnvelope getBounds(IProgressMonitor monitor) throws IOException { public ReferencedEnvelope getBounds(IProgressMonitor monitor) { - // TODO Auto-generated method stub return null; } public IEditManager getEditManager() { - // TODO Auto-generated method stub return null; } public URI getID() { - // TODO Auto-generated method stub return null; } @@ -107,23 +97,19 @@ public IViewportModel getViewportModel() { } public void removeMapCompositionListener(IMapCompositionListener listener) { - // TODO Auto-generated method stub - + } public void removeMapListener(IMapListener listener) { - // TODO Auto-generated method stub - + } public void sendCommandASync(MapCommand command) { - // TODO Auto-generated method stub - + } public void sendCommandSync(MapCommand command) { - // TODO Auto-generated method stub - + } public String getName() { @@ -131,26 +117,22 @@ public String getName() { } public IProject getProject() { - // TODO Auto-generated method stub return null; } @Override public List getElements(Class type) { - // TODO Auto-generated method stub return null; } @Override public List getElements() { - // TODO Auto-generated method stub return null; } @Override public LayerFactory getLayerFactory() { - // TODO Auto-generated method stub return null; } - + } diff --git a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestRenderManager.java b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestRenderManager.java index 0c85f7967c..70cb8ee8f1 100644 --- a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestRenderManager.java +++ b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestRenderManager.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.info.tests; @@ -24,8 +24,9 @@ public class TestRenderManager implements IRenderManager { private IMapDisplay mapDisplay; TestRenderManager() { + } - + /** * @param mapDisplay */ @@ -34,20 +35,15 @@ public TestRenderManager(IMapDisplay mapDisplay) { this.mapDisplay = mapDisplay; } - - public void clearSelection(ILayer layer) { - // TODO Auto-generated method stub - + } public RenderedImage getImage() { - // TODO Auto-generated method stub return null; } public IMap getMap() { - // TODO Auto-generated method stub return null; } @@ -56,48 +52,40 @@ public IMapDisplay getMapDisplay() { } public List getRenderers() { - // TODO Auto-generated method stub return null; } public void refresh(Envelope bounds) { - // TODO Auto-generated method stub - + } public void refresh(ILayer layer, Envelope bounds) { - // TODO Auto-generated method stub - + } public void refreshSelection(ILayer layer, Envelope bounds) { - // TODO Auto-generated method stub - + } public void stopRendering() { - // TODO Auto-generated method stub - + } @Override public boolean areLayersRelatedByContext(ILayer layer, ILayer contained) { - // TODO Auto-generated method stub return false; } @Override public Map getTiles( Collection bounds) { - // TODO Auto-generated method stub return null; } @Override public Collection computeTileBounds( ReferencedEnvelope viewBounds, double worldunitsperpixel) { - // TODO Auto-generated method stub return null; } - + } diff --git a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportModel.java b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportModel.java index 74b25091ed..6525ae1065 100644 --- a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportModel.java +++ b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportModel.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.info.tests; @@ -41,9 +41,8 @@ public class TestViewportModel implements ViewportModel { private CoordinateReferenceSystem crs; TestViewportModel() { + } - - /** * @param displaySize @@ -57,10 +56,7 @@ public TestViewportModel(Dimension displaySize, ReferencedEnvelope bbox, Coordin this.crs = crs; } - - public double getAspectRatio() { - // TODO Auto-generated method stub return 0; } @@ -73,120 +69,98 @@ public CoordinateReferenceSystem getCRS() { } public Coordinate getCenter() { - // TODO Auto-generated method stub return null; } public double getHeight() { - // TODO Auto-generated method stub return 0; } public Map getMapInternal() { - // TODO Auto-generated method stub return null; } public Coordinate getPixelSize() { - // TODO Auto-generated method stub return null; } public RenderManager getRenderManagerInternal() { - // TODO Auto-generated method stub return null; } public double getWidth() { - // TODO Auto-generated method stub return 0; } public boolean isInitialized() { - // TODO Auto-generated method stub return false; } public boolean isSetCRS() { - // TODO Auto-generated method stub return false; } public ViewportModel panUsingScreenCoords(int xpixels, int ypixels) { - // TODO Auto-generated method stub return null; } public ViewportModel panUsingWorldCoords(double x, double y) { - // TODO Auto-generated method stub return null; } public Coordinate pixelToWorld(int x, int y) { - // TODO Auto-generated method stub return null; } public void setBounds(Envelope value) { - // TODO Auto-generated method stub - + } public void setBounds(double minx, double maxx, double miny, double maxy) throws IllegalArgumentException { - // TODO Auto-generated method stub - + } public void setCRS(CoordinateReferenceSystem value) { - // TODO Auto-generated method stub - + } public void setCenter(Coordinate value) { - // TODO Auto-generated method stub - + } public void setHeight(double value) { - // TODO Auto-generated method stub - + } public void setInitialized(boolean initialized) { - // TODO Auto-generated method stub - + } public void setMapInternal(Map value) { - // TODO Auto-generated method stub - + } public void setRenderManagerInternal(RenderManager value) { - // TODO Auto-generated method stub - + } public void setScale(double scaleDenominator) { - // TODO Auto-generated method stub - + } public void setWidth(double value) { - // TODO Auto-generated method stub - + } public void unsetCRS() { - // TODO Auto-generated method stub - + } public Point worldToPixel(Coordinate coord) { - Point2D w = new Point2D.Double(coord.x, coord.y); - AffineTransform at = worldToScreenTransform(); - Point2D p = at.transform(w, new Point2D.Double()); - return new Point((int) p.getX(), (int) p.getY()); + Point2D w = new Point2D.Double(coord.x, coord.y); + AffineTransform at = worldToScreenTransform(); + Point2D p = at.transform(w, new Point2D.Double()); + return new Point((int) p.getX(), (int) p.getY()); } public AffineTransform worldToScreenTransform() { @@ -194,275 +168,201 @@ public AffineTransform worldToScreenTransform() { } public ViewportModel zoom(double zoom) { - // TODO Auto-generated method stub return null; } public void zoomToBox(Envelope box) { - // TODO Auto-generated method stub - + } public void zoomToExtent() { - // TODO Auto-generated method stub - + } public TreeIterator eAllContents() { - // TODO Auto-generated method stub return null; } public EClass eClass() { - // TODO Auto-generated method stub return null; } public EObject eContainer() { - // TODO Auto-generated method stub return null; } public EStructuralFeature eContainingFeature() { - // TODO Auto-generated method stub return null; } public EReference eContainmentFeature() { - // TODO Auto-generated method stub return null; } public EList eContents() { - // TODO Auto-generated method stub return null; } public EList eCrossReferences() { - // TODO Auto-generated method stub return null; } public Object eGet(EStructuralFeature arg0) { - // TODO Auto-generated method stub return null; } public Object eGet(EStructuralFeature arg0, boolean arg1) { - // TODO Auto-generated method stub return null; } public boolean eIsProxy() { - // TODO Auto-generated method stub return false; } public boolean eIsSet(EStructuralFeature arg0) { - // TODO Auto-generated method stub return false; } public Resource eResource() { - // TODO Auto-generated method stub return null; } public void eSet(EStructuralFeature arg0, Object arg1) { - // TODO Auto-generated method stub - + } public void eUnset(EStructuralFeature arg0) { - // TODO Auto-generated method stub - + } public EList eAdapters() { - // TODO Auto-generated method stub return null; } public boolean eDeliver() { - // TODO Auto-generated method stub return false; } public void eNotify(Notification arg0) { - // TODO Auto-generated method stub - + } public void eSetDeliver(boolean arg0) { - // TODO Auto-generated method stub - + } public void sizeChanged(MapDisplayEvent event) { - // TODO Auto-generated method stub - + } public void addViewportModelListener(IViewportModelListener listener) { - // TODO Auto-generated method stub - + } public IMap getMap() { - // TODO Auto-generated method stub return null; } public double getScaleDenominator() { - // TODO Auto-generated method stub return 0; } public void removeViewportModelListener(IViewportModelListener listener) { - // TODO Auto-generated method stub - + } public AffineTransform worldToScreenTransform(Envelope mapExtent, Dimension displaySize) { double scaleX = displaySize.getWidth() / mapExtent.getWidth(); - double scaleY = displaySize.getHeight() / mapExtent.getHeight(); + double scaleY = displaySize.getHeight() / mapExtent.getHeight(); - double tx = -mapExtent.getMinX() * scaleX; - double ty = (mapExtent.getMinY() * scaleY) + displaySize.getHeight(); + double tx = -mapExtent.getMinX() * scaleX; + double ty = (mapExtent.getMinY() * scaleY) + displaySize.getHeight(); - AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty); + AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty); - return at; + return at; } - - @Override public Object eInvoke(EOperation operation, EList arguments) throws InvocationTargetException { - // TODO Auto-generated method stub return null; } - - @Override public SortedSet getDefaultPreferredScaleDenominators() { - // TODO Auto-generated method stub return null; } - - @Override public boolean isBoundsChanging() { - // TODO Auto-generated method stub return false; } - - @Override public SortedSet getPreferredScaleDenominators() { - // TODO Auto-generated method stub return null; } - - @Override public void setPreferredScaleDenominators(SortedSet value) { - // TODO Auto-generated method stub - - } - + } @Override public void setBounds(ReferencedEnvelope value) { - // TODO Auto-generated method stub - - } - + } @Override public void setBounds(ReferencedEnvelope value, boolean forceContainBBoxZoom) { - // TODO Auto-generated method stub - - } - + } @Override public ViewportModel zoom(double zoom, Coordinate fixedPoint) { - // TODO Auto-generated method stub return null; } - - @Override public void setScale(double scaleDenominator, int dpi, int displayWidth, int displayHeight) { - // TODO Auto-generated method stub - - } - + } @Override public void setIsBoundsChanging(boolean changing) { - // TODO Auto-generated method stub - - } - + } @Override public List getAvailableTimesteps() { - // TODO Auto-generated method stub return null; } - - @Override public DateTime getCurrentTimestep() { - // TODO Auto-generated method stub return null; } - - @Override public void setCurrentTimestep(DateTime value) { - // TODO Auto-generated method stub - - } - + } @Override public List getAvailableElevation() { - // TODO Auto-generated method stub return null; } - - @Override public Double getCurrentElevation() { - // TODO Auto-generated method stub return null; } - - @Override public void setCurrentElevation(Double value) { - // TODO Auto-generated method stub - + } - + } diff --git a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportPane.java b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportPane.java index 46f83c8f8d..96ae8bfe54 100644 --- a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportPane.java +++ b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/TestViewportPane.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.info.tests; @@ -22,11 +22,11 @@ public class TestViewportPane implements ViewportPane { private Dimension displaySize; - + public TestViewportPane() { super(); } - + /** * @param displaySize */ @@ -36,127 +36,103 @@ public TestViewportPane(Dimension displaySize) { } public void addDrawCommand(IDrawCommand command) { - // TODO Auto-generated method stub - + } public void addMouseListener(MapMouseListener l) { - // TODO Auto-generated method stub - + } public void addMouseMotionListener(MapMouseMotionListener l) { - // TODO Auto-generated method stub - + } public void addMouseWheelListener(MapMouseWheelListener l) { - // TODO Auto-generated method stub - + } public void addPaneListener(IMapDisplayListener listener) { - // TODO Auto-generated method stub - + } public void dispose() { - // TODO Auto-generated method stub - + } public void enableDrawCommands(boolean enable) { - // TODO Auto-generated method stub - + } public Control getControl() { - // TODO Auto-generated method stub return null; } public MapEditor getMapEditor() { - // TODO Auto-generated method stub return null; } public BufferedImage image(int w, int h) { - // TODO Auto-generated method stub return null; } public boolean isDisposed() { - // TODO Auto-generated method stub return false; } public boolean isVisible() { - // TODO Auto-generated method stub return false; } public void removeMouseListener(MapMouseListener l) { - // TODO Auto-generated method stub - + } public void removeMouseMotionListener(MapMouseMotionListener l) { - // TODO Auto-generated method stub - + } public void removeMouseWheelListener(MapMouseWheelListener l) { - // TODO Auto-generated method stub - + } public void removePaneListener(IMapDisplayListener listener) { - // TODO Auto-generated method stub - + } public void renderDone() { - // TODO Auto-generated method stub - + } public void renderStarting() { - // TODO Auto-generated method stub - + } public void renderUpdate() { - // TODO Auto-generated method stub - + } public void repaint() { - // TODO Auto-generated method stub - + } public void repaint(int x, int y, int width, int height) { - // TODO Auto-generated method stub - + } public void setCursor(Cursor cursor) { - // TODO Auto-generated method stub - + } public void setRenderManager(RenderManager manager) { - // TODO Auto-generated method stub - + } public int getDPI() { - // TODO Auto-generated method stub return 0; } public Dimension getDisplaySize() { - + return displaySize; } @@ -170,20 +146,17 @@ public int getWidth() { @Override public void update() { - // TODO Auto-generated method stub - + } @Override public GlassPane getGlass() { - // TODO Auto-generated method stub return null; } @Override public void setGlass(GlassPane glass) { - // TODO Auto-generated method stub - + } } diff --git a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/WMSLayer.java b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/WMSLayer.java index 27b47a2128..9c4f94975c 100644 --- a/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/WMSLayer.java +++ b/plugins/org.locationtech.udig.info.tests/src/org/locationtech/udig/info/tests/WMSLayer.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.info.tests; @@ -36,9 +36,8 @@ public class WMSLayer implements ILayer {; private WebMapServer wms; public WMSLayer() { + } - - /** * @param map @@ -52,51 +51,40 @@ public WMSLayer(IMap map, Layer wmslayer, WebMapServer wms) { this.wms = wms; } - - public void addListener(ILayerListener listener) { - // TODO Auto-generated method stub - + } // public ReferencedEnvelope getBounds(IProgressMonitor monitor, CoordinateReferenceSystem crs) throws IOException { public ReferencedEnvelope getBounds(IProgressMonitor monitor, CoordinateReferenceSystem crs) { - // TODO Auto-generated method stub return null; } public CoordinateReferenceSystem getCRS(IProgressMonitor monitor) { - // TODO Auto-generated method stub return null; } public CoordinateReferenceSystem getCRS() { - // TODO Auto-generated method stub return null; } public IGeoResource getGeoResource() { - // TODO Auto-generated method stub return null; } public IGeoResource getGeoResource(Class clazz) { - // TODO Auto-generated method stub return null; } public List getGeoResources() { - // TODO Auto-generated method stub return null; } public ImageDescriptor getIcon() { - // TODO Auto-generated method stub return null; } public URL getID() { - // TODO Auto-generated method stub return null; } @@ -109,12 +97,10 @@ public String getName() { } public IBlackboard getProperties() { - // TODO Auto-generated method stub return null; } public Query getQuery(boolean selection) { - // TODO Auto-generated method stub return null; } @@ -122,7 +108,7 @@ public E getResource(Class resourceType, IProgressMonitor monitor) throws if (resourceType == Layer.class) { return (E) this.wmslayer; } - + if (resourceType == WebMapServer.class) { return (E) this.wms; } @@ -130,136 +116,113 @@ public E getResource(Class resourceType, IProgressMonitor monitor) throws } public SimpleFeatureType getSchema() { - // TODO Auto-generated method stub return null; } public int getStatus() { - // TODO Auto-generated method stub return 0; } public String getStatusMessage() { - // TODO Auto-generated method stub return null; } public IStyleBlackboard getStyleBlackboard() { - // TODO Auto-generated method stub return new IStyleBlackboard() { - @Override - public boolean addListener(IBlackboardListener listener) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean removeListener(IBlackboardListener listener) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean contains(String key) { - // TODO Auto-generated method stub - return false; - } - - @Override - public Object get(String key) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void put(String key, Object value) { - // TODO Auto-generated method stub - - } - - @Override - public Float getFloat(String key) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Integer getInteger(String key) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getString(String key) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void putFloat(String key, float value) { - // TODO Auto-generated method stub - - } - - @Override - public void putInteger(String key, int value) { - // TODO Auto-generated method stub - - } - - @Override - public void putString(String key, String value) { - // TODO Auto-generated method stub - - } - - @Override - public Object remove(String key) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void clear() { - // TODO Auto-generated method stub - - } - - @Override - public void flush() { - // TODO Auto-generated method stub - - } - - @Override - public void addAll(IBlackboard blackboard) { - // TODO Auto-generated method stub - - } - - @Override - public Set keySet() { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean isSelected(String styleId) { - // TODO Auto-generated method stub - return false; - } - + @Override + public boolean addListener(IBlackboardListener listener) { + return false; + } + + @Override + public boolean removeListener(IBlackboardListener listener) { + return false; + } + + @Override + public boolean contains(String key) { + return false; + } + + @Override + public Object get(String key) { + return null; + } + + @Override + public void put(String key, Object value) { + + } + + @Override + public Float getFloat(String key) { + return null; + } + + @Override + public Integer getInteger(String key) { + return null; + } + + @Override + public String getString(String key) { + return null; + } + + @Override + public void putFloat(String key, float value) { + + } + + @Override + public void putInteger(String key, int value) { + + } + + @Override + public void putString(String key, String value) { + + } + + @Override + public Object remove(String key) { + return null; + } + + @Override + public void clear() { + + } + + @Override + public void flush() { + + } + + @Override + public void addAll(IBlackboard blackboard) { + + } + + @Override + public Set keySet() { + return null; + } + + @Override + public boolean isSelected(String styleId) { + return false; + } + }; } public int getZorder() { - // TODO Auto-generated method stub return 0; } public boolean isApplicable(String toolCategoryId) { - // TODO Auto-generated method stub return false; } @@ -267,7 +230,7 @@ public boolean isType(Class resourceType) { if (resourceType == Layer.class) { return true; } - + return false; } @@ -276,91 +239,66 @@ public boolean isVisible() { } public MathTransform layerToMapTransform() throws IOException { - // TODO Auto-generated method stub return null; } public MathTransform mapToLayerTransform() throws IOException { - // TODO Auto-generated method stub return null; } public void refresh(Envelope bounds) { - // TODO Auto-generated method stub - + } public void removeListener(ILayerListener listener) { - // TODO Auto-generated method stub - + } public void setStatus(int status) { - // TODO Auto-generated method stub - + } public void setStatusMessage(String string) { - // TODO Auto-generated method stub - + } public int compareTo(ILayer arg0) { - // TODO Auto-generated method stub return 0; } - - @Override public IGeoResource findGeoResource(Class clazz) { - // TODO Auto-generated method stub return null; } - - @Override public boolean hasResource(Class resourceType) { - // TODO Auto-generated method stub return false; } @Override public IBlackboard getBlackboard() { - // TODO Auto-generated method stub return null; } + @Override + public boolean getInteraction(Interaction interaction) { + return false; + } + @Override + public boolean isShown() { + return false; + } - @Override - public boolean getInteraction( Interaction interaction ) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isShown() { - // TODO Auto-generated method stub - return false; - } - - - - @Override - public Filter getFilter() { - // TODO Auto-generated method stub - return null; - } - - + @Override + public Filter getFilter() { + return null; + } - @Override - public Filter createBBoxFilter(Envelope boundingBox, IProgressMonitor monitor) { - // TODO Auto-generated method stub - return null; - } + @Override + public Filter createBBoxFilter(Envelope boundingBox, IProgressMonitor monitor) { + return null; + } - } diff --git a/plugins/org.locationtech.udig.printing.ui/src/org/locationtech/udig/printing/ui/internal/editor/parts/BoxPart.java b/plugins/org.locationtech.udig.printing.ui/src/org/locationtech/udig/printing/ui/internal/editor/parts/BoxPart.java index e4597342da..65584a5f62 100644 --- a/plugins/org.locationtech.udig.printing.ui/src/org/locationtech/udig/printing/ui/internal/editor/parts/BoxPart.java +++ b/plugins/org.locationtech.udig.printing.ui/src/org/locationtech/udig/printing/ui/internal/editor/parts/BoxPart.java @@ -50,7 +50,7 @@ /** * A part for all boxes. - * + * * @author Richard Gould * @author Jesse * @since 0.3 @@ -81,7 +81,7 @@ public void deactivate() { box.eAdapters().remove(this.listener); box.removePropertyChangeListener(listener); } - + @Override public Object getAdapter(Class key) { Box box = ((Box) getModel()); @@ -104,12 +104,12 @@ protected void refreshVisuals() { ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), rectangle); } - + public BoxPrinter getBoxPrinter(){ return ((Box)getModel()).getBoxPrinter(); } - + public void performRequest( Request request ) { EditPolicy policy = getEditPolicy(request.getType()); @@ -130,9 +130,9 @@ public void performRequest( Request request ) { } if( !action.isDone() ) return; - + Command command = action.getCommand(); - + if( command!=null && command.canExecute() ){ getViewer().getEditDomain().getCommandStack().execute(command); } @@ -141,17 +141,16 @@ public void performRequest( Request request ) { @Override public void setModel( Object model ) { - // TODO Auto-generated method stub super.setModel(model); } - + protected List getModelSourceConnections() { return ((Box) getModel()).getSourceConnections(); } protected List getModelTargetConnections() { return ((Box) getModel()).getTargetConnections(); } - + protected void createEditPolicies() { installEditPolicy(EditPolicy.COMPONENT_ROLE, new PageElementEditPolicy()); installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GraphicalNodeEditPolicy(){ @@ -188,7 +187,7 @@ protected Command getReconnectSourceCommand( ReconnectRequest request ) { }); List boxes = PrintingPlugin.getDefault().getBoxes(); - + Box model = (Box) getModel(); BoxPrinter printer = model.getBoxPrinter(); String defaultActionID = null; @@ -198,7 +197,7 @@ protected Command getReconnectSourceCommand( ReconnectRequest request ) { break; } } - + Collection actions = PrintingPlugin.getBoxExtensionActions(null); for( BoxAction element : actions ) { try { @@ -210,7 +209,7 @@ protected Command getReconnectSourceCommand( ReconnectRequest request ) { } else { isAcceptable = element.isAcceptableBoxPrinter(printer); } - + if (isAcceptable) { EditPolicy policyObj = element.getEditPolicy(); installEditPolicy(element.getRequest().getType(), policyObj); @@ -225,7 +224,7 @@ protected Command getReconnectSourceCommand( ReconnectRequest request ) { protected IFigure createFigure() { return new BoxFigure(); } - + public ConnectionAnchor getSourceConnectionAnchor( ConnectionEditPart connection) { return new ChopboxAnchor(getFigure()); @@ -264,11 +263,11 @@ public void propertyChange( PropertyChangeEvent event ) { * Returns the default action for the box. See {@link BoxFactory#getDefaultActionID()} for more details * * @return the default action for the box - * + * * @see BoxFactory#getDefaultActionID() */ public BoxAction getDefaultAction() { return defaultAction; } - + } diff --git a/plugins/org.locationtech.udig.project.ui.tests/src/org/locationtech/udig/project/tests/ui/RendererSetterHandler.java b/plugins/org.locationtech.udig.project.ui.tests/src/org/locationtech/udig/project/tests/ui/RendererSetterHandler.java index f4d2c2d302..6e8b018fc2 100644 --- a/plugins/org.locationtech.udig.project.ui.tests/src/org/locationtech/udig/project/tests/ui/RendererSetterHandler.java +++ b/plugins/org.locationtech.udig.project.ui.tests/src/org/locationtech/udig/project/tests/ui/RendererSetterHandler.java @@ -60,7 +60,7 @@ /** * Test handler that provides a way to check behavior of {@link RenderMetricsSorter}. - * + * * @author Nikolaos Pringouris * */ @@ -91,9 +91,9 @@ public void run() { } /** - * Helper class to compute rate of an {@link AbstractRenderMetrics} metric. + * Helper class to compute rate of an {@link AbstractRenderMetrics} metric. * see also {@link RenderMetricsSorter} - * + * * @author Nikolaos Pringouris * */ @@ -108,7 +108,7 @@ protected double rate( AbstractRenderMetrics metrics ) { ILayer layer = metrics.getRenderContext().getLayer(); final IStyleBlackboard style = layer.getStyleBlackboard(); - //render metrics - + //render metrics - //guarenteed to be between 0 & 1 - higher better so we subtract one to get make lower better double renderAppearanceMetric = 1 - metrics.getUserAppearanceMetric(style); double userAppearanceMetric = 1 - metrics.getRenderAppearanceMetric(style); @@ -127,7 +127,7 @@ protected double rate( AbstractRenderMetrics metrics ) { if (diff == 0){ resolutionMetric = 0; //perfect match (lower is better) }else{ - resolutionMetric = (diff / width); //lower number + resolutionMetric = (diff / width); //lower number } int multiLayerMetric = 1 - rateMultiLayerRenderer(metrics); @@ -145,7 +145,7 @@ protected double rate( AbstractRenderMetrics metrics ) { } private int rateScaleRange( AbstractRenderMetrics metrics ) { - Set> scales =new HashSet>(); + Set> scales =new HashSet>(); try { scales =metrics.getValidScaleRanges(); } catch (Exception e) { @@ -177,7 +177,7 @@ private int rateMultiLayerRenderer( AbstractRenderMetrics metrics ) { /** * Provides a Dialog that enables setting/resetting of preferred Renderer * and displays info of available metrics ratings. - * + * * @author Nikolaos Pringouris * */ @@ -198,7 +198,7 @@ private class RendererControlDialog extends TitleAreaDialog { /** * @param parentShell - * @param emf + * @param emf */ protected RendererControlDialog(Shell parentShell) { super(parentShell); @@ -227,11 +227,11 @@ public void selectionChanged(SelectionChangedEvent event) { if (selection instanceof Layer) { Layer layer = (Layer)selection; sorter = new RenderMetricsSorterExt(Collections.singletonList(layer)); - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); Collection metrics = getApplicableRendererMetrics(layer); rendererCombo.setInput(metrics); - + RenderContext context = layer.getMapInternal().getRenderManagerInternal().getRendererCreator().getRenderContext(layer); IRenderer rend = layer.getMapInternal().getRenderManagerInternal().getRendererCreator().getRenderer(context); for (AbstractRenderMetrics metric : metrics) { @@ -272,7 +272,7 @@ public void selectionChanged(SelectionChangedEvent event) { layer.getStyleBlackboard().putString(RendererCreatorImpl.PREFERRED_RENDERER_ID, rendererMetric.getId()); } */ - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); RendererControlDialog.this.setMessage("A close and reopen of the Map is needed in order changes to apply", MessageDialog.WARNING); } @@ -306,12 +306,11 @@ public void widgetSelected(SelectionEvent e) { ApplicationGISInternal.getActiveMap().getBlackBoardInternal().remove(RendererCreatorImpl.PREFERRED_RENDERER_ID); } RendererControlDialog.this.setErrorMessage("A close and reopen of the Map is needed in order changes to apply"); - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); } @Override public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub } @@ -332,12 +331,11 @@ public void widgetSelected(SelectionEvent e) { layer.getStyleBlackboard().remove(RendererCreatorImpl.PREFERRED_RENDERER_ID); } RendererControlDialog.this.setErrorMessage("A close and reopen of the Map is needed in order changes to apply"); - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); } @Override public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub } @@ -358,12 +356,11 @@ public void widgetSelected(SelectionEvent e) { ApplicationGISInternal.getActiveMap().getBlackBoardInternal().remove(RendererCreatorImpl.LAST_RESORT_RENDERER_ID); } RendererControlDialog.this.setErrorMessage("A close and reopen of the Map is needed in order changes to apply"); - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); } @Override public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub } @@ -384,12 +381,11 @@ public void widgetSelected(SelectionEvent e) { layer.getStyleBlackboard().remove(RendererCreatorImpl.LAST_RESORT_RENDERER_ID); } RendererControlDialog.this.setErrorMessage("A close and reopen of the Map is needed in order changes to apply"); - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); } @Override public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub } @@ -408,12 +404,11 @@ public void widgetSelected(SelectionEvent e) { ApplicationGISInternal.getActiveMap().getBlackBoardInternal().remove(RendererCreatorImpl.LAST_RESORT_RENDERER_ID); ApplicationGISInternal.getActiveMap().getBlackBoardInternal().remove(RendererCreatorImpl.PREFERRED_RENDERER_ID); RendererControlDialog.this.setErrorMessage("A close and reopen of the Map is needed in order changes to apply"); - outputText.setText(printRendererInfo(layer)); + outputText.setText(printRendererInfo(layer)); } @Override public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub } @@ -466,9 +461,9 @@ private String printRendererInfo(Layer layer) { buf.append("----------------------------------").append("\n"); return buf.toString(); } - + /** - * + * * @param layer */ private Collection getApplicableRendererMetrics(Layer layer) { @@ -476,21 +471,21 @@ private Collection getApplicableRendererMetrics(Layer lay } /** - * + * * @param layer */ private Collection getNotApplicableRendererMetrics(Layer layer) { return getRendererMetrics(layer, false); } - + /** - * + * * @param layer */ private Collection getRendererMetrics(Layer layer, boolean applicable) { Collection result = new ArrayList(); RenderContext context = layer.getMapInternal().getRenderManagerInternal().getRendererCreator().getRenderContext(layer); - + Collection metrics = layer.getMapInternal().getRenderManagerInternal().getRendererCreator().getAvailableRendererMetrics(layer); int order = 1; for (AbstractRenderMetrics metric : metrics) { diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/internal/ui/wizard/URLConnectionFactory.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/internal/ui/wizard/URLConnectionFactory.java index 9f8d581c95..5b58c6e504 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/internal/ui/wizard/URLConnectionFactory.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/internal/ui/wizard/URLConnectionFactory.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.project.internal.ui.wizard; @@ -20,7 +20,6 @@ public class URLConnectionFactory extends UDIGConnectionFactory { */ @Override public boolean canProcess(Object context) { - // TODO Auto-generated method stub return false; } @@ -29,7 +28,6 @@ public boolean canProcess(Object context) { */ @Override public Map createConnectionParameters(Object context) { - // TODO Auto-generated method stub return null; } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/PlatformGeoSelectionManager.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/PlatformGeoSelectionManager.java index 20ed3a59c3..095855f92f 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/PlatformGeoSelectionManager.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/PlatformGeoSelectionManager.java @@ -316,7 +316,6 @@ public void partActivated(IWorkbenchPartReference partRef) { @Override public void partBroughtToTop(IWorkbenchPartReference partRef) { - // TODO Auto-generated method stub } @@ -346,31 +345,26 @@ public void partClosed(IWorkbenchPartReference partRef) { @Override public void partDeactivated(IWorkbenchPartReference partRef) { - // TODO Auto-generated method stub } @Override public void partHidden(IWorkbenchPartReference partRef) { - // TODO Auto-generated method stub } @Override public void partInputChanged(IWorkbenchPartReference partRef) { - // TODO Auto-generated method stub } @Override public void partOpened(IWorkbenchPartReference partRef) { - // TODO Auto-generated method stub } @Override public void partVisible(IWorkbenchPartReference partRef) { - // TODO Auto-generated method stub } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/MapFactory.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/MapFactory.java index 7486f60fd3..a7a37428ca 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/MapFactory.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/MapFactory.java @@ -55,10 +55,10 @@ /** * A Factory for creating maps from different types of resources. - * + * * @author jeichar * @since 0.9.0 - * + * * @deprecated use {@link ApplicationGIS} */ public class MapFactory { @@ -82,7 +82,7 @@ private MapFactory() { *

* This is equivalent to calling processURLs(resources, null). *

- * + * * @param resources a List of URLs pointing to services (WMS, Shapefile, etc) * @deprecated use {@link ApplicationGIS#createAndOpenMap(List)} */ @@ -100,7 +100,7 @@ public void processURLs( List resources ) { *

* This is equivalent to calling processURLs(resources, target, false). *

- * + * * @param resources a List of URLs pointing to services (WMS, Shapefile, etc) * @param target Project to use if a new map is going to be created * @deprecated use {@link ApplicationGIS#createAndOpenMap(List, org.locationtech.udig.project.IProject)} @@ -117,12 +117,12 @@ public void processURLs( List resources, Project target ) { * will be added to a new map, contained in the project designated by target, or * the current project if target is null. *

- * + * * @param resources a List of URLs pointing to services (WMS, Shapefile, etc) * @param target Project to use if a new map is going to be created * @param newMap if true, a new map will be created even if there is one already open * @deprecated use {@link ApplicationGIS#addLayersToMap(org.locationtech.udig.project.IProject, List)} or {@link ApplicationGIS#createAndOpenMap(List, org.locationtech.udig.project.IProject)} - * + * */ public void processURLs( List resources, Project target, boolean newMap ) { process(target, resources, newMap); @@ -136,7 +136,7 @@ public void processURLs( List resources, Project target, boolean newMap ) { * will be added to a new map, contained in the project designated by target, or * the current project if target is null. *

- * + * * @param resources a List of IResolves to load onto a map * @param target Project to use if a new map is going to be created * @param newMap if true, a new map will be created even if there is one already open @@ -149,7 +149,7 @@ public void processResolves( List resources, Project target, boolean n * This method will perform all of its work in a Job and will not block. *

* TODO fix this Process a list of X, try and make - * + * * @param resources a List of IResolves * @param newMap forces a new map to be created */ @@ -158,8 +158,8 @@ public void process( final Project target, final List resources, final boolean n throw new InvalidParameterException("Parameter 'resources' cannot be null."); //$NON-NLS-1$ } - Job job = new Job(Messages.ProjectUIPlugin_loadingServices_title){ - @SuppressWarnings("unchecked") + Job job = new Job(Messages.ProjectUIPlugin_loadingServices_title){ + @SuppressWarnings("unchecked") protected IStatus run( final IProgressMonitor monitor ) { List exceptions = new ArrayList(); @@ -172,7 +172,7 @@ protected IStatus run( final IProgressMonitor monitor ) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } - monitor.beginTask(Messages.MapFactory_taskSorting, resources.size()); + monitor.beginTask(Messages.MapFactory_taskSorting, resources.size()); try { if (object instanceof URL) { services.addAll(handleURL((URL) object, monitor)); @@ -210,7 +210,7 @@ protected IStatus run( final IProgressMonitor monitor ) { for( IResolve resolve : services ) { monitor.beginTask( - Messages.ProjectUIPlugin_loadingServices_task, services.size()); + Messages.ProjectUIPlugin_loadingServices_task, services.size()); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } @@ -243,10 +243,10 @@ protected IStatus run( final IProgressMonitor monitor ) { if (map == null || newMap) { map = getMap(monitor, target, newMap); } - + if( map.getBlackboard().get(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR)==null ){ IPreferenceStore store = ProjectPlugin.getPlugin().getPreferenceStore(); - RGB background = PreferenceConverter.getColor(store, PreferenceConstants.P_BACKGROUND); + RGB background = PreferenceConverter.getColor(store, PreferenceConstants.P_BACKGROUND); map.getBlackboard().put(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR, new Color(background.red, background.green, background.blue )); } @@ -264,7 +264,7 @@ protected IStatus run( final IProgressMonitor monitor ) { } for( IGeoResource resource : geoResources ) { - monitor.beginTask(Messages.MapFactory_retrieveTask, geoResources.size()); + monitor.beginTask(Messages.MapFactory_retrieveTask, geoResources.size()); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } @@ -295,16 +295,16 @@ protected IStatus run( final IProgressMonitor monitor ) { if (exceptions.size() != 0) { String message = null; if (exceptions.size() > 1) { - message = Messages.MapFactory_multiError; + message = Messages.MapFactory_multiError; } else { - message = Messages.MapFactory_error; + message = Messages.MapFactory_error; } ExceptionDisplayer.displayExceptions(exceptions, message, ProjectUIPlugin.ID); } monitor.done(); - return new Status(IStatus.OK, ProjectUIPlugin.ID, IStatus.OK, + return new Status(IStatus.OK, ProjectUIPlugin.ID, IStatus.OK, Messages.ProjectUIPlugin_success, null); } }; @@ -371,16 +371,16 @@ private List handleURL( URL url, IProgressMonitor monitor ) throws IOE private void handleProjectURL( URL url, IProgressMonitor monitor ) { monitor = validateMonitor(monitor); - monitor.subTask(Messages.ProjectUIPlugin_loadingProject_task); + monitor.subTask(Messages.ProjectUIPlugin_loadingProject_task); File file = URLUtils.urlToFile(url); - + ProjectPlugin.getPlugin().getProjectRegistry().getProject( file.getAbsolutePath() ); return; } /** * Same as processResources(monitor, resources, null); - * + * * @param monitor * @param resources * @return @@ -394,7 +394,7 @@ public List processResources( IProgressMonitor monitor, List reso *

* If no servies work we will just punt out the exception from the last entry. *

- * + * * @param url * @return * @throws IOException @@ -432,13 +432,13 @@ List acquireGoodServices( URL url, IProgressMonitor monitor ) throws I * Processes each element within the list of resources and returns all the Layers that have been * discovered as a result. This is typically used to turn URLs, Files, IServices and * IGeoResources into Layers. - * + * * @param monitor a progress monitor to indicate a user of work, can be null * @param resources a list of objects to be processed * @param target a target indicating that this is being performed on some object, can be null * @return a List containing all discovered layers */ - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public List processResources( IProgressMonitor monitor, List resources, Object target ) { @@ -520,11 +520,10 @@ Map getCurrentMap() { /* * (non-Javadoc) - * + * * @see java.lang.Runnable#run() */ public void run() { - // TODO Auto-generated method stub if (isMapOpen()) { UDIGEditorInput input = (UDIGEditorInput) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage().getActiveEditor() @@ -547,7 +546,7 @@ boolean isMapOpen() { } private String getNewMapName( Project currentProject ) { - String name = Messages.ProjectUIPlugin_newMap_name; + String name = Messages.ProjectUIPlugin_newMap_name; int count = currentProject.getElementsInternal().size() + 1; diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/actions/AddLayersAction.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/actions/AddLayersAction.java index 959478db9b..5df034a9ef 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/actions/AddLayersAction.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/actions/AddLayersAction.java @@ -27,7 +27,7 @@ /** * Performs the open action from the file menu of uDig. It is responsible for creating new maps * from selected resources. - * + * * @author rgould * @since 0.9.0 */ @@ -70,88 +70,71 @@ public void setActivePart( IAction action, IWorkbenchPart targetPart ) { } public void addPropertyChangeListener( IPropertyChangeListener listener ) { - // TODO Auto-generated method stub - + } public int getAccelerator() { - // TODO Auto-generated method stub return 0; } public String getActionDefinitionId() { - // TODO Auto-generated method stub return null; } public String getDescription() { - // TODO Auto-generated method stub return null; } public ImageDescriptor getDisabledImageDescriptor() { - // TODO Auto-generated method stub return null; } public HelpListener getHelpListener() { - // TODO Auto-generated method stub return null; } public ImageDescriptor getHoverImageDescriptor() { - // TODO Auto-generated method stub return null; } public String getId() { - // TODO Auto-generated method stub return null; } public ImageDescriptor getImageDescriptor() { - // TODO Auto-generated method stub return null; } public IMenuCreator getMenuCreator() { - // TODO Auto-generated method stub return null; } public int getStyle() { - // TODO Auto-generated method stub return 0; } public String getText() { - // TODO Auto-generated method stub return null; } public String getToolTipText() { - // TODO Auto-generated method stub return null; } public boolean isChecked() { - // TODO Auto-generated method stub return false; } public boolean isEnabled() { - // TODO Auto-generated method stub return false; } public boolean isHandled() { - // TODO Auto-generated method stub return false; } public void removePropertyChangeListener( IPropertyChangeListener listener ) { - // TODO Auto-generated method stub - + } public void run() { @@ -159,73 +142,59 @@ public void run() { } public void runWithEvent( Event event ) { - // TODO Auto-generated method stub - + } public void setActionDefinitionId( String id ) { - // TODO Auto-generated method stub - + } public void setChecked( boolean checked ) { - // TODO Auto-generated method stub - + } public void setDescription( String text ) { - // TODO Auto-generated method stub - + } public void setDisabledImageDescriptor( ImageDescriptor newImage ) { - // TODO Auto-generated method stub - + } public void setEnabled( boolean enabled ) { - // TODO Auto-generated method stub - + } public void setHelpListener( HelpListener listener ) { - // TODO Auto-generated method stub - + } public void setHoverImageDescriptor( ImageDescriptor newImage ) { - // TODO Auto-generated method stub - + } public void setId( String id ) { - // TODO Auto-generated method stub - + } public void setImageDescriptor( ImageDescriptor newImage ) { - // TODO Auto-generated method stub - + } public void setMenuCreator( IMenuCreator creator ) { - // TODO Auto-generated method stub - + } public void setText( String text ) { - // TODO Auto-generated method stub - + } public void setToolTipText( String text ) { - // TODO Auto-generated method stub - + } public void setAccelerator( int keycode ) { - // TODO Auto-generated method stub - + } } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/IGeoResourcePropertySource.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/IGeoResourcePropertySource.java index 0c1002a5fa..e69b60ca73 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/IGeoResourcePropertySource.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/IGeoResourcePropertySource.java @@ -26,31 +26,33 @@ /** * A Property source for services. - * + * * @author jeichar * @since 0.3 */ public class IGeoResourcePropertySource implements IPropertySource2 { private IGeoResource geoResource; private IPropertyDescriptor[] descriptors; - private static final String RESOURCE = Messages.IGeoResourcePropertySource_0; + private static final String RESOURCE = Messages.IGeoResourcePropertySource_0; IPropertyDescriptor resourceDescriptor; - private static final String FEATURE_SOURCE = Messages.IGeoResourcePropertySource_1; + private static final String FEATURE_SOURCE = Messages.IGeoResourcePropertySource_1; + /** * Creates a new instance of DataPropertySource - * + * * @param entry */ public IGeoResourcePropertySource( IGeoResource entry ) { this.geoResource = entry; } + /** * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() */ public Object getEditableValue() { - // TODO Auto-generated method stub return null; } + /** * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() */ @@ -61,9 +63,9 @@ public IPropertyDescriptor[] getPropertyDescriptors() { if (geoResource.canResolve(FeatureSource.class)) { resourceDescriptor = new SchemaDescriptor( FEATURE_SOURCE, - Messages.IGeoResourcePropertySource_schema, (FeatureSource) geoResource.resolve(FeatureSource.class, null)); + Messages.IGeoResourcePropertySource_schema, (FeatureSource) geoResource.resolve(FeatureSource.class, null)); } else { - resourceDescriptor = new PropertyDescriptor(RESOURCE, + resourceDescriptor = new PropertyDescriptor(RESOURCE, Messages.IGeoResourcePropertySource_data); } } catch (IOException e) { @@ -78,6 +80,7 @@ public IPropertyDescriptor[] getPropertyDescriptors() { System.arraycopy(descriptors, 0, c, 0, c.length); return c; } + /** * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) */ @@ -94,31 +97,33 @@ public Object getPropertyValue( Object id ) { } return null; } + /** * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object) */ public boolean isPropertySet( Object id ) { - // TODO Auto-generated method stub return false; } + /** * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) */ public void resetPropertyValue( Object id ) { - // TODO Auto-generated method stub + } + /** * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, * java.lang.Object) */ public void setPropertyValue( Object id, Object value ) { - // TODO Auto-generated method stub + } + /** * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertyResettable(java.lang.Object) */ public boolean isPropertyResettable( Object id ) { - // TODO implement method body return true; } } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaDescriptor.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaDescriptor.java index 462b5a03da..7d1cf5ff8c 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaDescriptor.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaDescriptor.java @@ -28,7 +28,7 @@ /** * A Descriptor for a SimpleFeatureType aka Schema for the properties view. - * + * * @author jeichar * @since 1.0.0 */ @@ -39,7 +39,7 @@ public class SchemaDescriptor extends PropertyDescriptor implements IPropertySou /** * Creates a new instance of FeatureSourceDescriptor - * + * * @param id * @param name * @param source @@ -60,7 +60,6 @@ public CellEditor createPropertyEditor( Composite parent ) { * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() */ public Object getEditableValue() { - // TODO Auto-generated method stub return null; } @@ -76,10 +75,10 @@ public IPropertyDescriptor[] getPropertyDescriptors() { String name = attrs[i].getLocalName().toLowerCase(); name = name.substring(0, 1).toUpperCase() + name.substring(1); d = new PropertyDescriptor(Integer.valueOf(i), name); - if ( attrs[i] instanceof GeometryDescriptor ) - d.setCategory(Messages.ScemaDescriptor_geometry); + if ( attrs[i] instanceof GeometryDescriptor ) + d.setCategory(Messages.ScemaDescriptor_geometry); else - d.setCategory(Messages.ScemaDescriptor_attributeTypes); + d.setCategory(Messages.ScemaDescriptor_attributeTypes); desc.add(d); } descriptors = new IPropertyDescriptor[desc.size()]; @@ -103,7 +102,6 @@ public Object getPropertyValue( Object id ) { * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object) */ public boolean isPropertySet( Object id ) { - // TODO Auto-generated method stub return false; } @@ -111,7 +109,6 @@ public boolean isPropertySet( Object id ) { * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) */ public void resetPropertyValue( Object id ) { - // TODO Auto-generated method stub } @@ -120,7 +117,6 @@ public void resetPropertyValue( Object id ) { * java.lang.Object) */ public void setPropertyValue( Object id, Object value ) { - // TODO Auto-generated method stub } } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaEditor.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaEditor.java index b46cf436d0..3f4b9efd70 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaEditor.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/properties/SchemaEditor.java @@ -18,16 +18,17 @@ /** * Allows SimpleFeatureType schemas to be edited. - * + * * @author jeichar * @since 0.3 */ public class SchemaEditor extends DialogCellEditor { private SimpleFeatureType type; + /** * Creates a new instance of SchemaEditor - * + * * @param parent The parent of this editor widget * @param type The feature type to edit. */ @@ -35,12 +36,12 @@ public SchemaEditor( Composite parent, SimpleFeatureType type ) { super(parent); this.type = type; } + /** * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(org.eclipse.swt.widgets.Control) */ protected Object openDialogBox( Control cellEditorWindow ) { type.getName().getLocalPart(); // does nothing yet. - // TODO Auto-generated method stub return null; } } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventAdapter.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventAdapter.java index b16ac44215..f37b5b7c68 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventAdapter.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventAdapter.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.project.ui.internal.render.displayAdapter.impl; @@ -11,7 +11,7 @@ /** * This class turns AWT events into SWT events - * + * * @author Jesse */ public class EventAdapter implements MouseListener, MouseMotionListener, @@ -27,7 +27,6 @@ public EventAdapter(EventHandler handler) { * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) */ public void mouseClicked(MouseEvent e) { - // TODO Auto-generated method stub } @@ -35,7 +34,6 @@ public void mouseClicked(MouseEvent e) { * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) */ public void mouseEntered(MouseEvent e) { - // TODO Auto-generated method stub } @@ -43,7 +41,6 @@ public void mouseEntered(MouseEvent e) { * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) */ public void mouseExited(MouseEvent e) { - // TODO Auto-generated method stub } @@ -51,7 +48,6 @@ public void mouseExited(MouseEvent e) { * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) */ public void mousePressed(MouseEvent e) { - // TODO Auto-generated method stub } @@ -59,7 +55,6 @@ public void mousePressed(MouseEvent e) { * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) */ public void mouseReleased(MouseEvent e) { - // TODO Auto-generated method stub } @@ -67,7 +62,6 @@ public void mouseReleased(MouseEvent e) { * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent) */ public void mouseDragged(MouseEvent e) { - // TODO Auto-generated method stub } @@ -75,7 +69,6 @@ public void mouseDragged(MouseEvent e) { * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent) */ public void mouseMoved(MouseEvent e) { - // TODO Auto-generated method stub } @@ -83,7 +76,6 @@ public void mouseMoved(MouseEvent e) { * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent) */ public void mouseWheelMoved(MouseWheelEvent e) { - // TODO Auto-generated method stub } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventHandlerJava.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventHandlerJava.java index e004716f69..89b927a74c 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventHandlerJava.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/render/displayAdapter/impl/EventHandlerJava.java @@ -1,5 +1,5 @@ /** - * + * */ package org.locationtech.udig.project.ui.internal.render.displayAdapter.impl; @@ -10,7 +10,7 @@ import java.awt.event.MouseWheelListener; /** - * + * * @author Jesse */ public class EventHandlerJava implements MouseListener, MouseMotionListener, MouseWheelListener { @@ -22,42 +22,35 @@ public EventHandlerJava(EventJob eventJob) { } public void mouseClicked(MouseEvent e) { - + } public void mouseEntered(MouseEvent e) { - // TODO Auto-generated method stub - + } public void mouseExited(MouseEvent e) { - // TODO Auto-generated method stub - + } public void mousePressed(MouseEvent e) { - // TODO Auto-generated method stub - + } public void mouseReleased(MouseEvent e) { - // TODO Auto-generated method stub - + } public void mouseDragged(MouseEvent e) { - // TODO Auto-generated method stub - + } public void mouseMoved(MouseEvent e) { - // TODO Auto-generated method stub - + } public void mouseWheelMoved(MouseWheelEvent e) { - // TODO Auto-generated method stub - + } } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/wizard/url/URLWizardPage.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/wizard/url/URLWizardPage.java index 549b186620..145611dd13 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/wizard/url/URLWizardPage.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/internal/wizard/url/URLWizardPage.java @@ -53,7 +53,7 @@ public class URLWizardPage extends AbstractUDIGImportPage implements ModifyListe * Construct URLWizardPage. */ public URLWizardPage() { - super(Messages.URLWizardPage_title); + super(Messages.URLWizardPage_title); settings = ProjectUIPlugin.getDefault().getDialogSettings().getSection(URL_WIZARD); if (settings == null) { @@ -62,9 +62,9 @@ public URLWizardPage() { } public String getId() { - // TODO Auto-generated method stub return null; } + public boolean canProcess( Object object ) { URL url = CatalogPlugin.locateURL(object); if (url == null) { @@ -94,7 +94,7 @@ public void createControl( Composite parent ) { gridData = new GridData(); Label urlLabel = new Label(composite, SWT.NONE); - urlLabel.setText(Messages.URLWizardPage_label_url_text); + urlLabel.setText(Messages.URLWizardPage_label_url_text); urlLabel.setLayoutData(gridData); gridData = new GridData(GridData.FILL_HORIZONTAL); @@ -128,7 +128,7 @@ public boolean canFlipToNextPage() { /** * Double click in list, or return from url control. - * + * * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) * @param e */ @@ -158,7 +158,7 @@ public void modifyText( ModifyEvent e ) { new URL(url.getText()); setErrorMessage(null); } catch (MalformedURLException exception) { - setErrorMessage(Messages.URLWizardPage_error_invalidURL); + setErrorMessage(Messages.URLWizardPage_error_invalidURL); } getWizard().getContainer().updateButtons(); } @@ -176,12 +176,10 @@ private void saveWidgetValues() { } public Map getParams() { - // TODO Auto-generated method stub return null; } public List getURLs() { - // TODO Auto-generated method stub return null; } } diff --git a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/wizard/export/map/ExportMapWizard.java b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/wizard/export/map/ExportMapWizard.java index 71ea64704a..e04dae2dd0 100644 --- a/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/wizard/export/map/ExportMapWizard.java +++ b/plugins/org.locationtech.udig.project.ui/src/org/locationtech/udig/project/ui/wizard/export/map/ExportMapWizard.java @@ -1,12 +1,12 @@ /* uDig - User Friendly Desktop Internet GIS client - * http://udig.refractions.net - * (C) 2004-2013, Refractions Research Inc. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD - * License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). - */ +* http://udig.refractions.net +* (C) 2004-2013, Refractions Research Inc. +* +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD +* License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). +*/ package org.locationtech.udig.project.ui.wizard.export.map; import java.util.Collection; @@ -24,50 +24,49 @@ /** * Wizard for exporting a project, its maps and all associated data to a project. - * + * * @author Jesse */ public class ExportMapWizard extends Wizard implements IExportWizard { MapSelectorPage mapSelector; - + /** * Create a new instance */ public ExportMapWizard() { - setWindowTitle("Export Map"); - String title = null; // will use default page title - ImageDescriptor banner = ProjectUIPlugin.getDefault().getImageDescriptor( Icons.WIZBAN +"exportselection_wiz.gif" ); - //setDefaultPageImageDescriptor(banner); - mapSelector = new MapSelectorPageWithScaleColumn("Export Selection", title, banner ); + setWindowTitle("Export Map"); + String title = null; // will use default page title + ImageDescriptor banner = ProjectUIPlugin.getDefault().getImageDescriptor( Icons.WIZBAN +"exportselection_wiz.gif" ); + //setDefaultPageImageDescriptor(banner); + mapSelector = new MapSelectorPageWithScaleColumn("Export Selection", title, banner ); } /* (non-Javadoc) - * @see org.eclipse.jface.wizard.Wizard#performFinish() - */ + * @see org.eclipse.jface.wizard.Wizard#performFinish() + */ @Override public boolean performFinish() { Collection maps = mapSelector.getMaps(); for (IMap map : maps) { collect(map); } - + zip(); return true; } private void collect(IMap map) { - + } private void zip() { - // TODO Auto-generated method stub - + } /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) - */ + * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) + */ public void init(IWorkbench workbench, IStructuredSelection selection) { mapSelector.setSelection(selection); } diff --git a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/StyleContent.java b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/StyleContent.java index 7546cef6b2..754443fb31 100644 --- a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/StyleContent.java +++ b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/StyleContent.java @@ -31,7 +31,7 @@ /** * Provides a way to persist an arbitrary object placed on the style blackboard. - * + * * @author Jesse * @since 1.0.0 */ @@ -94,7 +94,7 @@ public Object load( IMemento memento ) { } try { text = memento.getString("object"); - + ByteArrayInputStream bytes = new ByteArrayInputStream(text.getBytes()); ObjectInputStream restore = new ObjectInputStream(new BufferedInputStream(bytes)); Object value = restore.readObject(); @@ -115,7 +115,6 @@ public Object load( IMemento memento ) { @Override public Object createDefaultStyle( IGeoResource resource, Color colour, IProgressMonitor monitor ) throws IOException { - // TODO Auto-generated method stub return null; } }; @@ -131,7 +130,7 @@ public Object createDefaultStyle( IGeoResource resource, Color colour, * This id is also used by Renderer and StyleConfigurator, often implementation will have a * static final String ID defined for programmers. *

- * + * * @return The style id which identifies the style. * @uml.property name="id" */ @@ -142,7 +141,7 @@ public String getId() { /** * Construct with ID supplied by subclass. This id must be the same as the id declared by the * extension point. - * + * * @param id */ public StyleContent( String id ) { @@ -155,7 +154,7 @@ public StyleContent( String id ) { /** * Returns the class of the object which does the actual styling work. - * + * * @return the class of the style object. */ public abstract Class< ? > getStyleClass(); @@ -166,7 +165,7 @@ public StyleContent( String id ) { * (Currently used with XMLMemento to persist StyleEntry, it is hoped that an EMFMemento can be * writen). *

- * + * * @param style the style object to persisit. * @param memento Momento used to store the style object state. */ @@ -178,7 +177,7 @@ public StyleContent( String id ) { * (Currently used with XMLMemento to persist StyleEntry, it is hoped that an EMFMemento can be * writen). *

- * + * * @param memento object which contains previously saved object state. * @return Loaded object and state. */ @@ -186,7 +185,7 @@ public StyleContent( String id ) { /** * Loads a style object from a URL. This method is blocking. - * + * * @param url the URL pointing to the style's location * @param monitor Progress monitor to report back to caller, allowed to be null. * @return a load style object, or null if it could not be loaded @@ -196,7 +195,7 @@ public StyleContent( String id ) { /** * Creates a default Style give a resource and color. - * + * * @param resource to attempt to create a style for. * @param colour color to use while creating style. * @param monitor monitor used to show progress of style creation. diff --git a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/LayerDecorator.java b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/LayerDecorator.java index 233920616c..658f14c97a 100644 --- a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/LayerDecorator.java +++ b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/LayerDecorator.java @@ -57,7 +57,7 @@ /** * Wraps a layer and delegates all the method calls to that layer. See the gang of four decorator * pattern. - * + * * @author Jesse * @since 1.0.0 */ @@ -85,7 +85,7 @@ public void refresh( LayerEvent event ) { /** * Construct LayerDecorator. - * + * * @param layer */ public LayerDecorator( Layer layer ) { @@ -680,7 +680,7 @@ public E getResource( Class resourceType, IProgressMonitor monitor ) thro /** * The decorated layer - * + * * @return the decorated layer */ public Layer getWrappedLayer() { @@ -878,7 +878,7 @@ public Object eInvoke( int operationID, EList< ? > arguments ) throws Invocation return interalObject.eInvoke(operationID, arguments); } - public int eDerivedOperationID( int baseOperationID, Class< ? > baseClass ) { + public int eDerivedOperationID( int baseOperationID, Class< ? > baseClass ) { return interalObject.eDerivedOperationID(baseOperationID, baseClass); } @@ -889,14 +889,12 @@ public java.util.Map getInteractionMap() { @Override public boolean isShown() { - // TODO Auto-generated method stub return false; } @Override public void setShown( boolean value ) { - // TODO Auto-generated method stub - + } } diff --git a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/impl/NullGeoResource.java b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/impl/NullGeoResource.java index ad888583cf..d6debf38ec 100644 --- a/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/impl/NullGeoResource.java +++ b/plugins/org.locationtech.udig.project/src/org/locationtech/udig/project/internal/impl/NullGeoResource.java @@ -27,7 +27,7 @@ * Placeholder indicating that GeoResources was found. *

* This is often used by a Layer when there was no resource found for the layer. - * + * * @author Jesse */ public class NullGeoResource extends IGeoResource { @@ -45,7 +45,7 @@ public Status getStatus() { } public Throwable getMessage() { - return new Exception(Messages.NullGeoResource_0); + return new Exception(Messages.NullGeoResource_0); } public URL getIdentifier() { @@ -59,17 +59,14 @@ public URL getIdentifier() { } @Override - protected IGeoResourceInfo createInfo( IProgressMonitor monitor ) { - // TODO Auto-generated method stub + protected IGeoResourceInfo createInfo( IProgressMonitor monitor ) { return new IGeoResourceInfo(){ @Override public ReferencedEnvelope getBounds() { - // TODO Auto-generated method stub return new ReferencedEnvelope(new Envelope(), null); } @Override public CoordinateReferenceSystem getCRS() { - // TODO Auto-generated method stub return null; } diff --git a/plugins/org.locationtech.udig.style.sld/src/org/locationtech/udig/style/sld/editor/StyleThemePage.java b/plugins/org.locationtech.udig.style.sld/src/org/locationtech/udig/style/sld/editor/StyleThemePage.java index 20b022b7ab..37dd437005 100644 --- a/plugins/org.locationtech.udig.style.sld/src/org/locationtech/udig/style/sld/editor/StyleThemePage.java +++ b/plugins/org.locationtech.udig.style.sld/src/org/locationtech/udig/style/sld/editor/StyleThemePage.java @@ -1,13 +1,13 @@ /* - * uDig - User Friendly Desktop Internet GIS client - * http://udig.refractions.net - * (C) 2012, Refractions Research Inc. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD - * License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). - */ +* uDig - User Friendly Desktop Internet GIS client +* http://udig.refractions.net +* (C) 2012, Refractions Research Inc. +* +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD +* License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). +*/ package org.locationtech.udig.style.sld.editor; import java.awt.Color; @@ -139,14 +139,14 @@ public class StyleThemePage extends StyleEditorPage { private static final int LABEL_SEPARATOR_BOTTOM = 12; private static final int LABEL_STATUSBAR = 13; - + private static final int LABEL_ICON_COLORBLIND = 14; private static final int LABEL_ICON_PHOTOCOPY = 15; private static final int LABEL_ICON_PROJECTOR = 16; private static final int LABEL_ICON_LCD = 17; private static final int LABEL_ICON_CRT = 18; private static final int LABEL_ICON_PRINT = 19; - + static final int BUTTON_COLORBLIND = 20; static final int BUTTON_PHOTOCOPY = 21; static final int BUTTON_PROJECTOR = 22; @@ -154,14 +154,14 @@ public class StyleThemePage extends StyleEditorPage { static final int BUTTON_CRT = 24; static final int BUTTON_PRINT = 25; private static final int BUTTON_REMOVE = 26; - + private static final int COMPOSITE_PARENT = 30; private static final int COMPOSITE_TOP = 31; private static final int COMPOSITE_MIDDLE = 32; private static final int COMPOSITE_BOTTOM = 33; private static final int COMPOSITE_BOTTOM_LEFT = 34; - - // Key for saving the opacity in the layer's blackboard. String formatted + + // Key for saving the opacity in the layer's blackboard. String formatted // red-green-blue private static final String BORDER_COLOR_KEY = "theme_page_border_color"; //$NON-NLS-1$ // Key for saving the opacity in the layer's blackboard. Integer @@ -198,12 +198,12 @@ public class StyleThemePage extends StyleEditorPage { private HashMap pageControls = new HashMap(); private List numericAttr = new ArrayList(); - private double[] opacity; + private double[] opacity; private HashMap controlNames = new HashMap(); private HashMap viewerQuality = new HashMap(); private HashMap uniqueCounts = new HashMap(); - + private ColorBrewer brewer; private boolean reverseColours = false; private StyleGenerator sg; @@ -213,7 +213,7 @@ public class StyleThemePage extends StyleEditorPage { private Classifier classifier; private TableSettings tableSettings; private boolean elseSelection = true; - + private FilterFactory2 ff; private FeatureCollection collection; private FeatureSource source; @@ -222,7 +222,7 @@ public class StyleThemePage extends StyleEditorPage { TableViewer paletteTable; TreeViewer treeViewer; BrewerPalette customPalette = null; - + /** * Classifier is produced by running a classification function over a FeatureCollection. *

@@ -231,27 +231,27 @@ public class StyleThemePage extends StyleEditorPage { */ //ExplicitClassifier customBreak = null; Classifier customBreak = null; - + public StyleThemePage() { //create factories ff = (FilterFactory2) CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()); sb = new StyleBuilder(ff); - + //suitability icons - controlNames.put(LABEL_ICON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour); - controlNames.put(LABEL_ICON_CRT, Messages.StyleEditor_theme_suitability_crt); - controlNames.put(LABEL_ICON_LCD, Messages.StyleEditor_theme_suitability_lcd); - controlNames.put(LABEL_ICON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy); - controlNames.put(LABEL_ICON_PRINT, Messages.StyleEditor_theme_suitability_print); - controlNames.put(LABEL_ICON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj); + controlNames.put(LABEL_ICON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour); + controlNames.put(LABEL_ICON_CRT, Messages.StyleEditor_theme_suitability_crt); + controlNames.put(LABEL_ICON_LCD, Messages.StyleEditor_theme_suitability_lcd); + controlNames.put(LABEL_ICON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy); + controlNames.put(LABEL_ICON_PRINT, Messages.StyleEditor_theme_suitability_print); + controlNames.put(LABEL_ICON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj); //suitability toggle buttons - controlNames.put(BUTTON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour); - controlNames.put(BUTTON_CRT, Messages.StyleEditor_theme_suitability_crt); - controlNames.put(BUTTON_LCD, Messages.StyleEditor_theme_suitability_lcd); - controlNames.put(BUTTON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy); - controlNames.put(BUTTON_PRINT, Messages.StyleEditor_theme_suitability_print); - controlNames.put(BUTTON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj); + controlNames.put(BUTTON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour); + controlNames.put(BUTTON_CRT, Messages.StyleEditor_theme_suitability_crt); + controlNames.put(BUTTON_LCD, Messages.StyleEditor_theme_suitability_lcd); + controlNames.put(BUTTON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy); + controlNames.put(BUTTON_PRINT, Messages.StyleEditor_theme_suitability_print); + controlNames.put(BUTTON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj); //suitability icon - palette suitability lookup viewerQuality.put(PaletteSuitability.VIEWER_COLORBLIND, LABEL_ICON_COLORBLIND); @@ -261,11 +261,11 @@ public StyleThemePage() { viewerQuality.put(PaletteSuitability.VIEWER_PRINT, LABEL_ICON_PRINT); viewerQuality.put(PaletteSuitability.VIEWER_PROJECTOR, LABEL_ICON_PROJECTOR); } - + public Button getButton(int widgetID) { return (Button) getControl(widgetID); } - + public Combo getCombo(int widgetID) { return (Combo) getControl(widgetID); } @@ -273,7 +273,7 @@ public Combo getCombo(int widgetID) { public Composite getComposite(int widgetID) { return (Composite) getControl(widgetID); } - + public Label getLabel(int widgetID) { return (Label) getControl(widgetID); } @@ -287,15 +287,15 @@ public GridData getLayoutData(int widgetID) { if (layout instanceof GridData) return (GridData) layout; else return new GridData(); //return empty, or throw exception (null)? } - + public Object getControl(int widgetID) { return pageControls.get(widgetID); } - + private boolean isNumber(String attributeType) { return numericAttr.contains(attributeType); } - + private boolean isNumber(AttributeDescriptor attributeType) { if (Number.class.isAssignableFrom(attributeType.getType().getBinding())) { return true; @@ -338,7 +338,7 @@ public String getErrorMessage() { public ColorBrewer getBrewer() { if (brewer == null) { createBrewer(); - + // add custom palettes List palettesList = CustomPalettesLoader.PALETTESLIST; for( BrewerPalette brewerPalette : palettesList ) { @@ -353,7 +353,7 @@ public ColorBrewer getBrewer() { } return brewer; } - + private void createToggleButton(Composite parent, int buttonId, Image image) { Button toggleButton = new Button(parent, SWT.TOGGLE); GridData gridData = new GridData(SWT.NONE, SWT.NONE, false, false); @@ -364,18 +364,18 @@ private void createToggleButton(Composite parent, int buttonId, Image image) { pageControls.put(buttonId, toggleButton); updateToggleTooltip(buttonId); } - + private void updateToggleTooltip(int buttonId) { Button toggle = getButton(buttonId); String tooltip; if (toggle.getSelection()) { - tooltip = Messages.StyleEditor_theme_suitability_show; + tooltip = Messages.StyleEditor_theme_suitability_show; } else { - tooltip = Messages.StyleEditor_theme_suitability_hide; + tooltip = Messages.StyleEditor_theme_suitability_hide; } toggle.setToolTipText(tooltip+" "+controlNames.get(buttonId)); //$NON-NLS-1$ } - + private void createSuitabilityIcon(Composite parent, int id, String tooltip, Image image) { Label suitabilityIcon = new Label(parent, SWT.NONE); GridData gridData = new GridData(SWT.NONE, SWT.NONE, false, false); @@ -384,7 +384,7 @@ private void createSuitabilityIcon(Composite parent, int id, String tooltip, Ima suitabilityIcon.setToolTipText(tooltip); pageControls.put(id, suitabilityIcon); } - + @Override public void createPageContent( Composite parent2 ) { Composite parent = new Composite(parent2, SWT.NONE); @@ -406,14 +406,14 @@ public void createPageContent( Composite parent2 ) { //create the content pageControls.put(COMPOSITE_PARENT, parent); Font font = getShell().getFont(); - - createTopComponent(parent, font); - + + createTopComponent(parent, font); + Label separator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false); separator.setLayoutData(gridData); separator.setFont(font); - + createPaletteChooserComposite(parent, font); separator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); @@ -435,13 +435,13 @@ public void createPageContent( Composite parent2 ) { pageControls.put(LABEL_STATUSBAR, status); } - /** - * Creates the composite for modifying the palette - */ - private Composite createPaletteEditorComposite(Composite parent, Font font) { - GridLayout layout; - GridData gridData; - Composite compBottom = new Composite(parent, SWT.NONE); + /** + * Creates the composite for modifying the palette + */ + private Composite createPaletteEditorComposite(Composite parent, Font font) { + GridLayout layout; + GridData gridData; + Composite compBottom = new Composite(parent, SWT.NONE); gridData = new GridData(SWT.FILL, SWT.FILL, true, false); gridData.heightHint = 0; compBottom.setLayoutData(gridData); @@ -452,7 +452,7 @@ private Composite createPaletteEditorComposite(Composite parent, Font font) { compBottom.setVisible(false); compBottom.setFont(font); pageControls.put(COMPOSITE_BOTTOM, compBottom); - + Composite compBottomLeft = new Composite(compBottom, SWT.NONE); compBottomLeft.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); layout = new GridLayout(1, false); @@ -460,61 +460,61 @@ private Composite createPaletteEditorComposite(Composite parent, Font font) { layout.marginWidth = 0; compBottomLeft.setLayout(layout); pageControls.put(COMPOSITE_BOTTOM_LEFT, compBottomLeft); - + Composite compBottomLeftButtons = new Composite(compBottomLeft, SWT.NONE); compBottomLeftButtons.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false)); layout = new GridLayout(4, true); layout.marginHeight = 0; layout.marginWidth = 0; compBottomLeftButtons.setLayout(layout); - + createPaletteEditorControls(font, compBottomLeftButtons); - - createPaletteEditorTreeViewer(compBottomLeft, font); + + createPaletteEditorTreeViewer(compBottomLeft, font); CellEditor[] editors = createCellEditors(); - + treeViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged( SelectionChangedEvent event ) { - + if (((StructuredSelection) event.getSelection()).isEmpty()) { getButton(BUTTON_REMOVE).setEnabled(false); } else { getButton(BUTTON_REMOVE).setEnabled(true); } - + } - + }); - + treeViewer.setCellModifier(new IPaletteCellEditor(this)); treeViewer.setColumnProperties(new String[] {"colour", "title", "styleExpr"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ treeViewer.setCellEditors(editors); //populate the tree - + Composite compBottomRight = new Composite(compBottom, SWT.NONE); compBottomRight.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false)); layout = new GridLayout(1, false); layout.marginHeight = 0; layout.marginWidth = 0; compBottomRight.setLayout(layout); - - createSuitabilityDisplay(compBottomRight); - - - return compBottom; - } - - /** - * Creates the widgets that display the what situations the current palette is suitable for. - */ - private void createSuitabilityDisplay(Composite compBottomRight) { - GridLayout layout; - Label labelSuitability = new Label(compBottomRight, SWT.NONE); + + createSuitabilityDisplay(compBottomRight); + + + return compBottom; + } + + /** + * Creates the widgets that display the what situations the current palette is suitable for. + */ + private void createSuitabilityDisplay(Composite compBottomRight) { + GridLayout layout; + Label labelSuitability = new Label(compBottomRight, SWT.NONE); labelSuitability.setLayoutData(new GridData(SWT.NONE, SWT.NONE, false, false)); - labelSuitability.setText(Messages.StyleEditor_theme_suitability); - + labelSuitability.setText(Messages.StyleEditor_theme_suitability); + Composite icons = new Composite(compBottomRight, SWT.RIGHT); icons.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false)); layout = new GridLayout(3, true); @@ -522,35 +522,35 @@ private void createSuitabilityDisplay(Composite compBottomRight) { layout.marginWidth = 0; icons.setLayout(layout); - createSuitabilityIcon(icons, LABEL_ICON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage()); - createSuitabilityIcon(icons, LABEL_ICON_CRT, Messages.StyleEditor_theme_suitability_crt, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON).createImage()); - createSuitabilityIcon(icons, LABEL_ICON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON).createImage()); - createSuitabilityIcon(icons, LABEL_ICON_LCD, Messages.StyleEditor_theme_suitability_lcd, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage()); - createSuitabilityIcon(icons, LABEL_ICON_PRINT, Messages.StyleEditor_theme_suitability_print, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON).createImage()); + createSuitabilityIcon(icons, LABEL_ICON_COLORBLIND, Messages.StyleEditor_theme_suitability_colour, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage()); + createSuitabilityIcon(icons, LABEL_ICON_CRT, Messages.StyleEditor_theme_suitability_crt, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON).createImage()); + createSuitabilityIcon(icons, LABEL_ICON_PROJECTOR, Messages.StyleEditor_theme_suitability_proj, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON).createImage()); + createSuitabilityIcon(icons, LABEL_ICON_LCD, Messages.StyleEditor_theme_suitability_lcd, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage()); + createSuitabilityIcon(icons, LABEL_ICON_PRINT, Messages.StyleEditor_theme_suitability_print, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON).createImage()); createSuitabilityIcon(icons, LABEL_ICON_PHOTOCOPY, Messages.StyleEditor_theme_suitability_pcopy, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON).createImage()); - } + } - private CellEditor[] createCellEditors() { - CellEditor[] editors = new CellEditor[3]; + private CellEditor[] createCellEditors() { + CellEditor[] editors = new CellEditor[3]; //TODO: create a nicer color chooser CellEditor celledit0 = new ColorCellEditor(treeViewer.getTree()); - TextCellEditor celledit1 = new TextCellEditor(treeViewer.getTree()); - TextCellEditor celledit2 = new TextCellEditor(treeViewer.getTree()); + TextCellEditor celledit1 = new TextCellEditor(treeViewer.getTree()); + TextCellEditor celledit2 = new TextCellEditor(treeViewer.getTree()); editors[0] = celledit0; editors[1] = celledit1; editors[2] = celledit2; - return editors; - } - - /** - * @param compBottomLeft - * @param font - * @return - */ - private Tree createPaletteEditorTreeViewer(Composite compBottomLeft, Font font) { - GridData gridData; - treeViewer = new TreeViewer(compBottomLeft, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); + return editors; + } + + /** + * @param compBottomLeft + * @param font + * @return + */ + private Tree createPaletteEditorTreeViewer(Composite compBottomLeft, Font font) { + GridData gridData; + treeViewer = new TreeViewer(compBottomLeft, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); Tree treeTable = treeViewer.getTree(); treeTable.setHeaderVisible(true); treeTable.setLinesVisible(true); @@ -558,27 +558,27 @@ private Tree createPaletteEditorTreeViewer(Composite compBottomLeft, Font font) gridData.widthHint = compBottomLeft.getBounds().x; gridData.heightHint = compBottomLeft.getBounds().y; treeTable.setLayoutData(gridData); - + TreeColumn colImage = new TreeColumn(treeTable, SWT.LEFT); - colImage.setText(Messages.StyleEditor_theme_column_colour); + colImage.setText(Messages.StyleEditor_theme_column_colour); TreeColumn colTitle = new TreeColumn(treeTable, SWT.LEFT); - colTitle.setText(Messages.StyleEditor_theme_column_label); - + colTitle.setText(Messages.StyleEditor_theme_column_label); + TreeColumn colExpr = new TreeColumn(treeTable, SWT.LEFT); colExpr.setText(Messages.StyleEditor_theme_column_expression); treeTable.layout(); - + tableSettings = new TableSettings(treeTable); tableSettings.setColumnMin(0, 40); tableSettings.setColumnMin(1, 100); tableSettings.setColumnMin(0, 50); - + treeViewer.setLabelProvider(new StyleTreeLabelProvider()); treeViewer.setSorter(new StyleTreeSorter()); treeViewer.setContentProvider(new StyleTreeContentProvider()); - + treeViewer.setInput(getFTS()); treeViewer.expandAll(); Control treeControl = treeViewer.getControl(); @@ -587,28 +587,28 @@ private Tree createPaletteEditorTreeViewer(Composite compBottomLeft, Font font) treeControl.setLayoutData(gd); treeControl.setFont(font); treeControl.setVisible(false); - return treeTable; - } - - /** - * Creates the Opacity Reverse and Remove controls - */ - private void createPaletteEditorControls(Font font, - Composite compBottomLeftButtons) { + return treeTable; + } + + /** + * Creates the Opacity Reverse and Remove controls + */ + private void createPaletteEditorControls(Font font, + Composite compBottomLeftButtons) { Composite combos = new Composite(compBottomLeftButtons, SWT.NONE); combos.setLayout(new GridLayout(2,false)); createOpacityControls(font, combos); createBorderControls(font, combos); - createReverseButton(compBottomLeftButtons); - createRemoveButton(compBottomLeftButtons); - } - - /** - * @param compBottomLeftButtons - */ - private void createRemoveButton(Composite compBottomLeftButtons) { - Button removeButton = new Button(compBottomLeftButtons, SWT.RIGHT); - removeButton.setText(Messages.StyleEditor_theme_remove); + createReverseButton(compBottomLeftButtons); + createRemoveButton(compBottomLeftButtons); + } + + /** + * @param compBottomLeftButtons + */ + private void createRemoveButton(Composite compBottomLeftButtons) { + Button removeButton = new Button(compBottomLeftButtons, SWT.RIGHT); + removeButton.setText(Messages.StyleEditor_theme_remove); removeButton.setEnabled(false); removeButton.addSelectionListener(new SelectionListener() { @@ -626,17 +626,17 @@ public void widgetSelected( SelectionEvent e ) { public void widgetDefaultSelected( SelectionEvent e ) { widgetSelected(e); } - + }); pageControls.put(BUTTON_REMOVE, removeButton); - } - - /** - * @param compBottomLeftButtons - */ - private void createReverseButton(Composite compBottomLeftButtons) { - Button reverseButton = new Button(compBottomLeftButtons, SWT.RIGHT); - reverseButton.setText(Messages.StyleEditor_theme_reverse); + } + + /** + * @param compBottomLeftButtons + */ + private void createReverseButton(Composite compBottomLeftButtons) { + Button reverseButton = new Button(compBottomLeftButtons, SWT.RIGHT); + reverseButton.setText(Messages.StyleEditor_theme_reverse); reverseButton.addSelectionListener(new SelectionListener() { public void widgetSelected( SelectionEvent e ) { @@ -652,15 +652,15 @@ public void widgetSelected( SelectionEvent e ) { public void widgetDefaultSelected( SelectionEvent e ) { widgetSelected(e); } - + }); - } + } private void createBorderControls( Font font, Composite compBottomLeftButtons ) { GridData gridData; Label opacityLabel = new Label(compBottomLeftButtons, SWT.NONE); opacityLabel.setFont(font); - opacityLabel.setText("Outline"); + opacityLabel.setText("Outline"); gridData = new GridData(SWT.LEFT, SWT.DEFAULT, false, false); opacityLabel.setLayoutData(gridData); @@ -675,7 +675,7 @@ private void createBorderControls( Font font, Composite compBottomLeftButtons ) colorCombo.addSelectionListener(new BorderColorComboListener(this)); } } - + private boolean isPolygonCompatible() { Class type = getSelectedLayer().getSchema().getGeometryDescriptor().getType().getBinding(); if( LineString.class.isAssignableFrom(type) || MultiLineString.class.isAssignableFrom(type) @@ -684,16 +684,16 @@ private boolean isPolygonCompatible() { } return true; } - /** - * @param font - * @param compBottomLeftButtons - */ - private void createOpacityControls(Font font, - Composite compBottomLeftButtons) { - GridData gridData; - Label opacityLabel = new Label(compBottomLeftButtons, SWT.NONE); + /** + * @param font + * @param compBottomLeftButtons + */ + private void createOpacityControls(Font font, + Composite compBottomLeftButtons) { + GridData gridData; + Label opacityLabel = new Label(compBottomLeftButtons, SWT.NONE); opacityLabel.setFont(font); - opacityLabel.setText(Messages.StyleEditor_theme_opacity); + opacityLabel.setText(Messages.StyleEditor_theme_opacity); gridData = new GridData(SWT.LEFT, SWT.DEFAULT, false, false); opacityLabel.setLayoutData(gridData); @@ -707,15 +707,15 @@ private void createOpacityControls(Font font, opacityCombo.select(5); //default 50% opacityCombo.setVisibleItemCount(8); opacityCombo.addSelectionListener(new SimpleComboListener()); - } + } /** * Creates the composite that allows the user to choose the palette */ - private Composite createPaletteChooserComposite(Composite parent, Font font) { - GridLayout layout; - - Composite compMiddle = new Composite(parent, SWT.NONE); + private Composite createPaletteChooserComposite(Composite parent, Font font) { + GridLayout layout; + + Composite compMiddle = new Composite(parent, SWT.NONE); compMiddle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); layout = new GridLayout(1, false); layout.marginHeight = 0; @@ -725,8 +725,8 @@ private Composite createPaletteChooserComposite(Composite parent, Font font) { pageControls.put(COMPOSITE_MIDDLE, compMiddle); GridData gridData; - Composite compMiddle2 = createPaletteLabel(font, compMiddle); - + Composite compMiddle2 = createPaletteLabel(font, compMiddle); + Composite compMiddle3 = new Composite(compMiddle2, SWT.NONE); compMiddle3.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, true, false)); layout = new GridLayout(3, false); @@ -735,7 +735,7 @@ private Composite createPaletteChooserComposite(Composite parent, Font font) { compMiddle3.setLayout(layout); createPaletteFilterComposite(font, compMiddle3); - + //list of matching palettes paletteTable = new TableViewer(new Table(compMiddle, SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION)); TableLayout tableLayout = new TableLayout(); @@ -754,35 +754,35 @@ private Composite createPaletteChooserComposite(Composite parent, Font font) { paletteTable.addFilter(new BrewerPaletteViewerFilter(this)); paletteTable.setSorter(new BrewerPaletteViewerSorter()); - + paletteTable.setInput(getBrewer()); paletteTable.addSelectionChangedListener(new PalettesListener()); - - return compMiddle; - } - - /** - * Creates the palette type chooser and the buttons to filter for parameters such as color blindness. - */ - private void createPaletteFilterComposite(Font font, Composite compMiddle3) { - GridLayout layout; - GridData gridData; - Label paletteFilterLabel = new Label(compMiddle3, SWT.LEFT); + + return compMiddle; + } + + /** + * Creates the palette type chooser and the buttons to filter for parameters such as color blindness. + */ + private void createPaletteFilterComposite(Font font, Composite compMiddle3) { + GridLayout layout; + GridData gridData; + Label paletteFilterLabel = new Label(compMiddle3, SWT.LEFT); paletteFilterLabel.setFont(font); - paletteFilterLabel.setText(Messages.StyleEditor_theme_show); + paletteFilterLabel.setText(Messages.StyleEditor_theme_show); gridData = new GridData(SWT.LEFT, SWT.FILL, false, true); gridData.verticalSpan = 2; paletteFilterLabel.setLayoutData(gridData); - + Combo paletteFilter = new Combo(compMiddle3, SWT.BORDER | SWT.READ_ONLY); pageControls.put(COMBO_PALETTES, paletteFilter); - paletteFilter.add(Messages.StyleEditor_theme_palette_all, 0); - paletteFilter.add(Messages.StyleEditor_theme_palette_num, 1); - paletteFilter.add(Messages.StyleEditor_theme_palette_seq, 2); - paletteFilter.add(Messages.StyleEditor_theme_palette_div, 3); - paletteFilter.add(Messages.StyleEditor_theme_palette_cat, 4); + paletteFilter.add(Messages.StyleEditor_theme_palette_all, 0); + paletteFilter.add(Messages.StyleEditor_theme_palette_num, 1); + paletteFilter.add(Messages.StyleEditor_theme_palette_seq, 2); + paletteFilter.add(Messages.StyleEditor_theme_palette_div, 3); + paletteFilter.add(Messages.StyleEditor_theme_palette_cat, 4); paletteFilter.select(0); - paletteFilter.setToolTipText(Messages.StyleEditor_theme_palette_tip); + paletteFilter.setToolTipText(Messages.StyleEditor_theme_palette_tip); paletteFilter.addSelectionListener(new SelectionListener() { public void widgetSelected( SelectionEvent e ) { @@ -792,7 +792,7 @@ public void widgetSelected( SelectionEvent e ) { public void widgetDefaultSelected( SelectionEvent e ) { widgetSelected(e); } - + }); Composite compMiddle4 = new Composite(compMiddle3, SWT.NONE); @@ -802,7 +802,7 @@ public void widgetDefaultSelected( SelectionEvent e ) { layout.marginWidth = 0; layout.horizontalSpacing = 0; compMiddle4.setLayout(layout); - + //toggle buttons createToggleButton(compMiddle4, BUTTON_COLORBLIND, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON).createImage()); createToggleButton(compMiddle4, BUTTON_CRT, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON).createImage()); @@ -810,11 +810,11 @@ public void widgetDefaultSelected( SelectionEvent e ) { createToggleButton(compMiddle4, BUTTON_LCD, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON).createImage()); createToggleButton(compMiddle4, BUTTON_PRINT, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON).createImage()); createToggleButton(compMiddle4, BUTTON_PHOTOCOPY, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON).createImage()); - } + } - private Composite createPaletteLabel(Font font, Composite compMiddle) { - GridLayout layout; - Composite compMiddle2 = new Composite(compMiddle, SWT.NONE); + private Composite createPaletteLabel(Font font, Composite compMiddle) { + GridLayout layout; + Composite compMiddle2 = new Composite(compMiddle, SWT.NONE); compMiddle2.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false)); layout = new GridLayout(2, false); layout.marginHeight = 0; @@ -823,18 +823,18 @@ private Composite createPaletteLabel(Font font, Composite compMiddle) { Label palettesLabel = new Label(compMiddle2, SWT.LEFT); palettesLabel.setFont(font); - palettesLabel.setText(Messages.StyleEditor_theme_palette); + palettesLabel.setText(Messages.StyleEditor_theme_palette); GridData gridData = new GridData(SWT.LEFT, SWT.BOTTOM, true, false); palettesLabel.setLayoutData(gridData); - return compMiddle2; - } - - /** - * Creates the composite that contains the information about what attributes to theme by - * and the type of theme. - */ - private Composite createTopComponent(Composite parent, Font font) { - Composite compTop = new Composite(parent, SWT.NONE); + return compMiddle2; + } + + /** + * Creates the composite that contains the information about what attributes to theme by + * and the type of theme. + */ + private Composite createTopComponent(Composite parent, Font font) { + Composite compTop = new Composite(parent, SWT.NONE); GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); compTop.setLayoutData(gridData); GridLayout layout = new GridLayout(5, false); @@ -844,56 +844,56 @@ private Composite createTopComponent(Composite parent, Font font) { compTop.setFont(font); pageControls.put(COMPOSITE_TOP, compTop); createAttributeLabels(font, compTop); - + createAttributeCombos(compTop); - - - return compTop; - } - - /** - * Creates all the labels for the Attribute composite - */ - private void createAttributeLabels(Font font, Composite compTop) { - Label attributesLabel = new Label(compTop, SWT.NONE); + + + return compTop; + } + + /** + * Creates all the labels for the Attribute composite + */ + private void createAttributeLabels(Font font, Composite compTop) { + Label attributesLabel = new Label(compTop, SWT.NONE); attributesLabel.setFont(font); - attributesLabel.setText(Messages.StyleEditor_theme_attribute); + attributesLabel.setText(Messages.StyleEditor_theme_attribute); attributesLabel.setLayoutData(createDefaultGridData()); Label classesLabel = new Label(compTop, SWT.NONE); classesLabel.setFont(font); - classesLabel.setText(Messages.StyleEditor_theme_classes); + classesLabel.setText(Messages.StyleEditor_theme_classes); classesLabel.setLayoutData(createDefaultGridData()); Label breaksLabel = new Label(compTop, SWT.NONE); breaksLabel.setFont(font); - breaksLabel.setText(Messages.StyleEditor_theme_break); + breaksLabel.setText(Messages.StyleEditor_theme_break); breaksLabel.setLayoutData(createDefaultGridData()); Label normalizeLabel = new Label(compTop, SWT.LEFT); normalizeLabel.setFont(font); - normalizeLabel.setText(Messages.StyleEditor_theme_normalize); + normalizeLabel.setText(Messages.StyleEditor_theme_normalize); normalizeLabel.setLayoutData(createDefaultGridData()); Label elseLabel = new Label(compTop, SWT.LEFT); elseLabel.setFont(font); - elseLabel.setText(Messages.StyleEditor_theme_else); + elseLabel.setText(Messages.StyleEditor_theme_else); elseLabel.setLayoutData(createDefaultGridData()); - } - - /** - * @return - */ - private GridData createDefaultGridData() { - return new GridData(SWT.LEFT, SWT.DEFAULT, true, false); - } - - /** - * Create the Combos for selecting and configuring how the themeing will work - */ - private void createAttributeCombos(Composite compTop) { - GridData gridData; - Combo attributeCombo = new Combo(compTop, SWT.BORDER | SWT.READ_ONLY); + } + + /** + * @return + */ + private GridData createDefaultGridData() { + return new GridData(SWT.LEFT, SWT.DEFAULT, true, false); + } + + /** + * Create the Combos for selecting and configuring how the themeing will work + */ + private void createAttributeCombos(Composite compTop) { + GridData gridData; + Combo attributeCombo = new Combo(compTop, SWT.BORDER | SWT.READ_ONLY); pageControls.put(COMBO_ATTRIBUTES, attributeCombo); attributeCombo.setLayout(new GridLayout()); gridData = createDefaultGridData(); @@ -905,18 +905,18 @@ private void createAttributeCombos(Composite compTop) { } attributeCombo.setVisibleItemCount(16); attributeCombo.addListener(SWT.Modify, new AttributeComboListener()); - + Combo classesCombo = new Combo(compTop, SWT.BORDER); pageControls.put(COMBO_CLASSES, classesCombo); classesCombo.setLayout(new GridLayout(1, false)); gridData = createDefaultGridData(); classesCombo.setLayoutData(gridData); - + for (int i = 2; i < 13; i++) { Integer j = (Integer) i; classesCombo.add(j.toString()); } - + classesCombo.select(3); //default is 5 classes classesCombo.setVisibleItemCount(16); classesCombo.addListener(SWT.Modify, new ClassesComboListener()); @@ -942,19 +942,19 @@ private void createAttributeCombos(Composite compTop) { elseCombo.setLayout(new GridLayout(1, false)); gridData = createDefaultGridData(); elseCombo.setLayoutData(gridData); - elseCombo.add(Messages.StyleEditor_theme_else_hide); - elseCombo.add(Messages.StyleEditor_theme_else_min); - elseCombo.add(Messages.StyleEditor_theme_else_max); + elseCombo.add(Messages.StyleEditor_theme_else_hide); + elseCombo.add(Messages.StyleEditor_theme_else_min); + elseCombo.add(Messages.StyleEditor_theme_else_max); elseCombo.select(0); - elseCombo.setToolTipText(Messages.StyleEditor_theme_else_tip); + elseCombo.setToolTipText(Messages.StyleEditor_theme_else_tip); elseCombo.addSelectionListener(new ElseComboListener()); - } + } - private void loadWithAttributeTypes(Combo attributeCombo, - StyleLayer selectedLayer) { - SimpleFeatureType featureType = selectedLayer.getSchema(); + private void loadWithAttributeTypes(Combo attributeCombo, + StyleLayer selectedLayer) { + SimpleFeatureType featureType = selectedLayer.getSchema(); - if (featureType != null) { + if (featureType != null) { List attributesList = new ArrayList(); for (int i = 0; i < featureType.getAttributeCount(); i++) { AttributeDescriptor attributeType = featureType.getDescriptor(i); @@ -971,31 +971,31 @@ private void loadWithAttributeTypes(Combo attributeCombo, attributeCombo.removeAll(); attributeCombo.setItems(attributesList.toArray(new String[] {})); - //select the first numeric attribute that isn't ID - int index = -1; - if (numericAttr.size() > 1) { - if (numericAttr.get(0).equalsIgnoreCase("id")) { //$NON-NLS-1$ - index = attributeCombo.indexOf(numericAttr.get(1)); - } else { - index = attributeCombo.indexOf(numericAttr.get(0)); - } - } else if (numericAttr.size() == 1) { - index = attributeCombo.indexOf(numericAttr.get(0)); - } - if (index > -1) attributeCombo.select(index); - if (attributeCombo.getSelectionIndex() == -1) { - //we couldn't find a desirable attribute, just grab the first one - if (featureType.getAttributeCount() > 0) { - attributeCombo.select(0); - } - } - } - } + //select the first numeric attribute that isn't ID + int index = -1; + if (numericAttr.size() > 1) { + if (numericAttr.get(0).equalsIgnoreCase("id")) { //$NON-NLS-1$ + index = attributeCombo.indexOf(numericAttr.get(1)); + } else { + index = attributeCombo.indexOf(numericAttr.get(0)); + } + } else if (numericAttr.size() == 1) { + index = attributeCombo.indexOf(numericAttr.get(0)); + } + if (index > -1) attributeCombo.select(index); + if (attributeCombo.getSelectionIndex() == -1) { + //we couldn't find a desirable attribute, just grab the first one + if (featureType.getAttributeCount() > 0) { + attributeCombo.select(0); + } + } + } + } private boolean removeRule(Rule rule) { Style style = getStyle(); - + if (style.featureTypeStyles().isEmpty()) return false; - + for(FeatureTypeStyle featureTypeStyle: style.featureTypeStyles()) { if( featureTypeStyle == null ) continue; boolean removed = featureTypeStyle.rules().remove( rule ); @@ -1005,7 +1005,7 @@ private boolean removeRule(Rule rule) { } return false; } - + @Override public void styleChanged( Object source ) { // ignore @@ -1017,20 +1017,20 @@ private void swapColours(Rule rule1, Rule rule2) { SLDPlugin.log("StyleThemePage.swapColours(): Number of symbolizers each rule and not equal - aborting colour swap", null); //$NON-NLS-1$ return; } - Expression tempColour; + Expression tempColour; for (int i = 0; i < symb1.length; i++) { if (symb1[i] instanceof PolygonSymbolizer) { tempColour = ((PolygonSymbolizer) symb1[i]).getFill().getColor(); ((PolygonSymbolizer) symb1[i]).getFill().setColor(((PolygonSymbolizer) symb2[i]).getFill().getColor()); ((PolygonSymbolizer) symb2[i]).getFill().setColor(tempColour); } else if (symb1[i] instanceof PointSymbolizer) { - GraphicalSymbol g1 = ((PointSymbolizer)symb1[i]).getGraphic().graphicalSymbols().get(0); - GraphicalSymbol g2 = ((PointSymbolizer)symb2[i]).getGraphic().graphicalSymbols().get(0); - if (g1 instanceof Mark && g2 instanceof Mark) { - tempColour = ((Mark)g1).getFill().getColor(); - ((Mark)g1).getFill().setColor( ((Mark)g2).getFill().getColor() ); - ((Mark)g2).getFill().setColor( tempColour ); - } + GraphicalSymbol g1 = ((PointSymbolizer)symb1[i]).getGraphic().graphicalSymbols().get(0); + GraphicalSymbol g2 = ((PointSymbolizer)symb2[i]).getGraphic().graphicalSymbols().get(0); + if (g1 instanceof Mark && g2 instanceof Mark) { + tempColour = ((Mark)g1).getFill().getColor(); + ((Mark)g1).getFill().setColor( ((Mark)g2).getFill().getColor() ); + ((Mark)g2).getFill().setColor( tempColour ); + } } else if (symb1[i] instanceof LineSymbolizer) { tempColour = ((LineSymbolizer) symb1[i]).getStroke().getColor(); ((LineSymbolizer) symb1[i]).getStroke().setColor(((LineSymbolizer) symb2[i]).getStroke().getColor()); @@ -1038,16 +1038,16 @@ private void swapColours(Rule rule1, Rule rule2) { } } } - + public void setStatusText(String text) { getLabel(LABEL_STATUSBAR).setText(text); } - + @Override public String getLabel() { return null; } - + private class AttributeComboListener implements Listener { public void handleEvent(Event e) { //record the attribute @@ -1061,7 +1061,7 @@ public void handleEvent(Event e) { setStatusText(""); //$NON-NLS-1$ } else { //TODO: don't use strings to match break types - if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) { + if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) { //determine if we've already calculated the number of unique values String attribute = selectedAttributeType.getName().getLocalPart(); if (uniqueCounts.containsKey(attribute)) { @@ -1079,7 +1079,7 @@ public void handleEvent(Event e) { SLDPlugin.log("unique values calculation failed", e1); //$NON-NLS-1$ } if (uniqueCount > -1) { - updateUnique(attribute, uniqueCount); + updateUnique(attribute, uniqueCount); } } else { //clear the status label @@ -1112,12 +1112,12 @@ private class PalettesListener implements ISelectionChangedListener { public void selectionChanged(SelectionChangedEvent event) { if (inputsValid()) generateTheme(); } - + } private class SuitabilityToggleListener implements SelectionListener { private int id; - + public SuitabilityToggleListener(int id) { super(); this.id = id; @@ -1131,9 +1131,9 @@ public void widgetSelected( SelectionEvent e ) { public void widgetDefaultSelected( SelectionEvent e ) { widgetSelected(e); } - + } - + private class ClassesComboListener implements Listener { public void handleEvent( Event event ) { updatePalettes(); @@ -1142,7 +1142,7 @@ public void handleEvent( Event event ) { } } - + private class ElseComboListener implements SelectionListener { public void widgetSelected(SelectionEvent e) { int index = getCombo(COMBO_ELSE).getSelectionIndex(); @@ -1155,7 +1155,7 @@ public void widgetSelected(SelectionEvent e) { if (classesIndex < (getCombo(COMBO_CLASSES).getItemCount() - 1)) { getCombo(COMBO_CLASSES).select(classesIndex + 1); } - } + } elseSelection = (index > 0); if (inputsValid()) generateTheme(); } @@ -1164,7 +1164,7 @@ public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); } } - + private class SimpleComboListener implements SelectionListener { public void widgetSelected(SelectionEvent e) { if (inputsValid()) generateTheme(); @@ -1185,27 +1185,27 @@ private void updateBreaks() { String value = breaksCombo.getText(); breaksCombo.removeAll(); if (isNumber(currentAttr)) { //show numeric break types - breaksCombo.add(Messages.StyleEditor_theme_equalInterval); - breaksCombo.add(Messages.StyleEditor_theme_quantile); - breaksCombo.add(Messages.StyleEditor_theme_uniques); - //breaksCombo.add(Messages.StyleEditor_theme_standardDeviation); + breaksCombo.add(Messages.StyleEditor_theme_equalInterval); + breaksCombo.add(Messages.StyleEditor_theme_quantile); + breaksCombo.add(Messages.StyleEditor_theme_uniques); + //breaksCombo.add(Messages.StyleEditor_theme_standardDeviation); int index = breaksCombo.indexOf(value); if (index > -1) breaksCombo.select(index); else breaksCombo.select(1); } else { //show categorical break types - breaksCombo.add(Messages.StyleEditor_theme_uniques); + breaksCombo.add(Messages.StyleEditor_theme_uniques); int index = breaksCombo.indexOf(value); if (index > -1) breaksCombo.select(index); else breaksCombo.select(0); } } - + private void updateNormalize() { Combo normalizeCombo = getCombo(COMBO_NORMALIZE); String value = normalizeCombo.getText(); String currentAttr = getCombo(COMBO_ATTRIBUTES).getText(); normalizeCombo.removeAll(); - normalizeCombo.add(Messages.StyleEditor_theme_none); + normalizeCombo.add(Messages.StyleEditor_theme_none); if (isNumber(currentAttr)) { normalizeCombo.setEnabled(true); for (int i = 0; i < numericAttr.size(); i++) { @@ -1221,7 +1221,7 @@ private void updateNormalize() { normalizeCombo.setEnabled(false); } } - + boolean inputsValid() { if (getCombo(COMBO_ATTRIBUTES).getText().length() < 1) return false; else if (paletteTable.getSelection().isEmpty()) return false; @@ -1239,21 +1239,21 @@ void generateTheme() { } else { normalize = getAttributeType(getCombo(COMBO_NORMALIZE).getText()); } - + //generate the defaults Runnable genDefault = new Runnable(){ public void run() { //generate the expression Expression expr = null; Expression attr = ff.property(selectedAttributeType.getName()); - + if (normalize != null) { Divide divide = ff.divide(attr, ff.property(normalize.getName())); expr = divide; } else { expr = attr; } - + StructuredSelection structuredSelection = (StructuredSelection) paletteTable.getSelection(); BrewerPalette pal = (BrewerPalette) structuredSelection.getFirstElement(); if (pal == null) { @@ -1273,12 +1273,12 @@ public void run() { }catch (Exception e) { suitability = CustomUnknownPaletteSuitability.getInstance().getSuitability(numClasses); } - + //check for custom classifier - if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)) { + if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)) { classifier = customBreak; } - + boolean classifierModified = false; if (classifier == null) { classifierModified = true; @@ -1289,83 +1289,83 @@ public void run() { if (function.getClasses() != new Integer(getCombo(COMBO_CLASSES).getText()).intValue()-1) classifierModified = true; } - if (getCombo(COMBO_ELSE).getSelectionIndex() > 0) + if (getCombo(COMBO_ELSE).getSelectionIndex() > 0) classifierModified = true; - else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)) + else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)) classifierModified = true; - else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_equalInterval)) && !(function instanceof EqualIntervalFunction)) + else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_equalInterval)) && !(function instanceof EqualIntervalFunction)) classifierModified = true; - else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_quantile)) && !(function instanceof QuantileFunction)) + else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_quantile)) && !(function instanceof QuantileFunction)) classifierModified = true; - else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_standardDeviation)) && !(function instanceof StandardDeviationFunction)) + else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_standardDeviation)) && !(function instanceof StandardDeviationFunction)) classifierModified = true; - else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) && !(function instanceof UniqueIntervalFunction)) + else if ((getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) && !(function instanceof UniqueIntervalFunction)) classifierModified = true; else if (!function.equals(expr)) classifierModified = true; } - + String semanticTypeIdentifier; //break type:palette - if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) + if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) semanticTypeIdentifier = "unique:"; //$NON-NLS-1$ - else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_equalInterval)) + else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_equalInterval)) semanticTypeIdentifier = "equalinterval:"; //$NON-NLS-1$ - else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_quantile)) + else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_quantile)) semanticTypeIdentifier = "quantile:"; //$NON-NLS-1$ else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase("standard deviation")) //$NON-NLS-1$ semanticTypeIdentifier = "standarddeviation:"; //$NON-NLS-1$ - else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)) + else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)) semanticTypeIdentifier = "custom:"; //$NON-NLS-1$ else { semanticTypeIdentifier = "default:"; //$NON-NLS-1$ } semanticTypeIdentifier = semanticTypeIdentifier.concat(paletteName.toLowerCase()); - + //create the classification function, if necessary if (classifierModified) { //TODO: add other classifiers - FunctionName fn = null; + FunctionName fn = null; boolean createClassifier = true; if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_uniques)) - fn = UniqueIntervalFunction.NAME; + fn = UniqueIntervalFunction.NAME; else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_equalInterval)) - fn = EqualIntervalFunction.NAME; + fn = EqualIntervalFunction.NAME; else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_quantile)) - fn = QuantileFunction.NAME; + fn = QuantileFunction.NAME; else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_standardDeviation)) - fn = StandardDeviationFunction.NAME; - else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)){ + fn = StandardDeviationFunction.NAME; + else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEditor_theme_custom)){ classifier = customBreak; createClassifier = false; - }else{ + }else{ return; } - - if (createClassifier) { - function = (ClassificationFunction) ff.function(fn.getFunctionName(), new Expression[fn.getArgumentCount()]); - - ProgressListener cancelProgress = ((StyleEditorDialog) getContainer()).getProgressListener(); - function.setProgressListener(cancelProgress); - numClasses = new Integer(getCombo(COMBO_CLASSES).getText()).intValue(); - - if (getCombo(COMBO_ELSE).getSelectionIndex() == 0) { - // function.setNumberOfClasses(numClasses); - function.setClasses(numClasses); - } else { - // function.setNumberOfClasses(numClasses-1); - function.setClasses(numClasses - 1); - } - // function.setCollection(collection); - function.getParameters().set(0, expr); // set the expression last, since it causes the calculation - // function.setExpression(expr); - classifier = (Classifier) function.evaluate(collection,Classifier.class); - } + + if (createClassifier) { + function = (ClassificationFunction) ff.function(fn.getFunctionName(), new Expression[fn.getArgumentCount()]); + + ProgressListener cancelProgress = ((StyleEditorDialog) getContainer()).getProgressListener(); + function.setProgressListener(cancelProgress); + numClasses = new Integer(getCombo(COMBO_CLASSES).getText()).intValue(); + + if (getCombo(COMBO_ELSE).getSelectionIndex() == 0) { + // function.setNumberOfClasses(numClasses); + function.setClasses(numClasses); + } else { + // function.setNumberOfClasses(numClasses-1); + function.setClasses(numClasses - 1); + } + // function.setCollection(collection); + function.getParameters().set(0, expr); // set the expression last, since it causes the calculation + // function.setExpression(expr); + classifier = (Classifier) function.evaluate(collection,Classifier.class); + } } //generate the style BrewerPalette palette = getBrewer().getPalette(paletteName); - + Color[] colors = null; try{ colors = palette.getColors(numClasses); @@ -1382,7 +1382,7 @@ else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEdit colors[j] = tempColor; } } - + int elsemode = -1; if (getCombo(COMBO_ELSE).getSelectionIndex() == 0) { //sg.setElseMode(StyleGenerator.ELSEMODE_IGNORE); @@ -1402,7 +1402,7 @@ else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEdit opac = 1; } Color borderColor = BorderColorComboListener.getBorder(getCombo(COMBO_BORDER_COLOR)); - + FeatureTypeStyle newFTS = null; try { newFTS = StyleGenerator.createFeatureTypeStyle(classifier, (org.opengis.filter.expression.Expression) expr, colors, semanticTypeIdentifier, getSelectedLayer().getSchema().getGeometryDescriptor(), elsemode, opac, null); @@ -1425,7 +1425,7 @@ else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEdit Style style = getStyle(); //ensure the style has an SLD if (style == null) throw new RuntimeException("Style is null"); //$NON-NLS-1$ - + StyledLayerDescriptor sld = null; //SLDs.styledLayerDescriptor(style); if (sld == null) { SLDContent.createDefaultStyledLayerDescriptor(style); @@ -1439,12 +1439,12 @@ else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEdit ErrorManager.get().displayException(e, msg, SLDPlugin.ID); return; } - + //update the suitability icons if (suitability != null) { updateSuitabilities(suitability); } - + treeViewer.setInput(newFTS); } } @@ -1462,17 +1462,17 @@ else if (getCombo(COMBO_BREAKTYPE).getText().equalsIgnoreCase(Messages.StyleEdit displayBottomComposite(); TableUtils.resizeColumns(treeViewer.getTree(), tableSettings, TableUtils.MODE_JUMP); //TODO: only the first time - + treeViewer.getControl().setVisible(true); } /** - * This takes as much as possible from the old rules and applies them + * This takes as much as possible from the old rules and applies them * to the new ones. In that way mark type, size and borders are properly kept. - * + * * @param newFTS the new style to tweak. * @param opac an opacity value to apply to the fill. - * @param borderColor + * @param borderColor */ private void applyExistingRulesProperties( FeatureTypeStyle newFTS, double opac, Color borderColor ) { Style style = getStyle(); @@ -1527,10 +1527,10 @@ private void applyExistingRulesProperties( FeatureTypeStyle newFTS, double opac, for( Symbolizer newSymbolizer : newSymbolizers ) { if (newSymbolizer instanceof PolygonSymbolizer) { PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer ) newSymbolizer; - + Fill previousFill = SLDs.fill(polygonSymbolizer); previousFill.setOpacity(ff.literal(opac)); - + Stroke stroke = SLDs.stroke(polygonSymbolizer); if (stroke != null) { if(borderColor!=null){ @@ -1539,14 +1539,14 @@ private void applyExistingRulesProperties( FeatureTypeStyle newFTS, double opac, polygonSymbolizer.setStroke(null); } } - + } } } } } } - + /** * Iterates through the style blackboard style and returns the ColorBrewer FeatureTypeStyle. * @@ -1562,12 +1562,12 @@ FeatureTypeStyle getFTS() { } return null; } - + /** * Given a Style object and a FeatureTypeStyle, this method scans the SemanticTypeIdentifiers of * each FTS inside the style. If a ColorBrewer themed identifier is found, the new FTS will * replace it. - * + * * @param style future parent of the FTS * @param fts FTS to insert/replace with */ @@ -1581,12 +1581,12 @@ private void addThemedFTStoStyle(Style style, FeatureTypeStyle fts) { symbs.add(newSymbs[j].getClass()); } } - + //search for a match, and replace if found boolean found = false; for (int i = 0; i < style.featureTypeStyles().size(); i ++) { if (SLDs.isSemanticTypeMatch(style.featureTypeStyles().get(i), "colorbrewer:.*")) { //$NON-NLS-1$ - style.featureTypeStyles().set(i, fts); + style.featureTypeStyles().set(i, fts); found = true; } else { //purge any conflicting Symbolizers (same class) @@ -1599,7 +1599,7 @@ private void addThemedFTStoStyle(Style style, FeatureTypeStyle fts) { for (int k = 0; k < symb.length; k++) { if (symbs.contains(symb[k].getClass())) { //the Symbolizer class is a match Object[] temp = removeElement(newSymb, k-deletedElements); - if (temp.length > 0) { + if (temp.length > 0) { newSymb = new Symbolizer[temp.length]; for (int l = 0; l < temp.length; l++) { newSymb[l] = (Symbolizer) temp[l]; @@ -1637,8 +1637,8 @@ private void addThemedFTStoStyle(Style style, FeatureTypeStyle fts) { } } if (changed) { - style.featureTypeStyles().get(i).rules().clear(); - style.featureTypeStyles().get(i).rules().addAll(rule); + style.featureTypeStyles().get(i).rules().clear(); + style.featureTypeStyles().get(i).rules().addAll(rule); } } //delete any FTSs with zero rules @@ -1647,20 +1647,20 @@ private void addThemedFTStoStyle(Style style, FeatureTypeStyle fts) { if (style.featureTypeStyles().get(i).rules().size() == 0) { Object[] temp = removeElement(style.featureTypeStyles(), i); for (int j = 0; j < temp.length; j++) { - items.add((FeatureTypeStyle)temp[j]); + items.add((FeatureTypeStyle)temp[j]); } } } //create a FTS if needed - style.featureTypeStyles().clear(); + style.featureTypeStyles().clear(); if (!found) { - style.featureTypeStyles().add(fts); + style.featureTypeStyles().add(fts); //match was not found, so add the FTS } style.featureTypeStyles().addAll(items); } - + private Object[] removeElement(List array, int indexToRemove) { if (array.size() == 1) return new Object[0]; Object[] newArray = new Object[array.size()-1]; @@ -1672,7 +1672,7 @@ private Object[] removeElement(List array, int indexToRemove) { } return newArray; } - + private Object[] removeElement(Object[] array, int indexToRemove) { if (array.length == 1) return new Object[0]; Object[] newArray = new Object[array.length-1]; @@ -1697,7 +1697,7 @@ private AttributeDescriptor getAttributeType(String attributeTypeName) { private void createBrewer() { brewer = PlatformGIS.getColorBrewer(); } - + private void displayBottomComposite() { Object layout = paletteTable.getControl().getLayoutData(); if (layout instanceof GridData) { @@ -1710,12 +1710,12 @@ private void displayBottomComposite() { getComposite(COMPOSITE_BOTTOM).setVisible(true); getLayoutData(COMPOSITE_BOTTOM).grabExcessVerticalSpace = true; getLayoutData(COMPOSITE_BOTTOM_LEFT).grabExcessVerticalSpace = true; - + getComposite(COMPOSITE_MIDDLE).layout(); getComposite(COMPOSITE_BOTTOM).layout(); getComposite(COMPOSITE_PARENT).layout(); } - + private void updateSuitabilities(int[] suitability) { for (Iterator i = viewerQuality.keySet().iterator(); i.hasNext();) { Integer key = i.next(); @@ -1727,30 +1727,30 @@ private void updateSuitabilities(int[] suitability) { if (quality == PaletteSuitability.QUALITY_GOOD) { //getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.GOOD_OVERLAY))); label.setImage(getImageWithOverlay(icon, null)); - label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_good); + label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_good); } else if (quality == PaletteSuitability.QUALITY_DOUBTFUL) { getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.DOUBTFUL_OVERLAY))); - label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_doubtful); + label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_doubtful); } else if (quality == PaletteSuitability.QUALITY_BAD) { getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.BAD_OVERLAY))); - label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_bad); + label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_bad); } else { //UNKNOWN getLabel(icon).setImage(getImageWithOverlay(icon, SLDPlugin.getDefault().getImageDescriptor(ImageConstants.UNKNOWN_OVERLAY))); - label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_unknown); + label.setToolTipText(viewer+Messages.StyleEditor_theme_suitability_unknown); } } } - + private Image getImageWithOverlay(int iconLabelID, ImageDescriptor overlay) { //get the base image ImageDescriptor descriptor = null; - Image base = null; - if (iconLabelID == LABEL_ICON_COLORBLIND) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON); - else if (iconLabelID == LABEL_ICON_CRT) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON); - else if (iconLabelID == LABEL_ICON_LCD) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON); - else if (iconLabelID == LABEL_ICON_PHOTOCOPY) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON); - else if (iconLabelID == LABEL_ICON_PRINT) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON); - else if (iconLabelID == LABEL_ICON_PROJECTOR) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON); + Image base = null; + if (iconLabelID == LABEL_ICON_COLORBLIND) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.COLORBLIND_ICON); + else if (iconLabelID == LABEL_ICON_CRT) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.CRT_ICON); + else if (iconLabelID == LABEL_ICON_LCD) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.LAPTOP_ICON); + else if (iconLabelID == LABEL_ICON_PHOTOCOPY) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PHOTOCOPY_ICON); + else if (iconLabelID == LABEL_ICON_PRINT) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PRINTER_ICON); + else if (iconLabelID == LABEL_ICON_PROJECTOR) descriptor = SLDPlugin.getDefault().getImageDescriptor(ImageConstants.PROJECTOR_ICON); if (descriptor != null) base = descriptor.createImage(); if (overlay == null) return base; //apply the overlay @@ -1779,7 +1779,7 @@ public void gotFocus() { setButtonSelection(memento, BUTTON_PRINT, PRINT_KEY); setButtonSelection(memento, BUTTON_PROJECTOR, PROJECTOR_KEY); setOutine(memento); - + setPaletteSelection(memento); readCustomPalette(memento); readCustomBreak(memento); @@ -1819,15 +1819,14 @@ private void setOutine( IMemento memento ) { } private void readCustomBreak(IMemento memento) { - // TODO Auto-generated method stub - + } private void readCustomPalette(IMemento memento) { List colors = new ArrayList(); int index = 1; - while(memento.getInteger(CUSTOM_PALETTE+index)!=null){ - int rgb = memento.getInteger(CUSTOM_PALETTE+index); + while(memento.getInteger(CUSTOM_PALETTE+index)!=null){ + int rgb = memento.getInteger(CUSTOM_PALETTE+index); colors.add(new Color(rgb)); index++; } @@ -1840,11 +1839,11 @@ private void readCustomPalette(IMemento memento) { }else{ customPalette = new BrewerPalette(); PaletteSuitability suitability = new PaletteSuitability(); - + SampleScheme newScheme = new SampleScheme(); String unknown = "?"; //$NON-NLS-1$ for (int i = 0; i < colors.size(); i++) { - if (i > 0) { + if (i > 0) { //create a simple scheme int[] scheme = new int[i+1]; for (int j = 0; j < i+1; j++) { @@ -1865,8 +1864,8 @@ private void readCustomPalette(IMemento memento) { customPalette.setPaletteSuitability(suitability); customPalette.setColors(colors.toArray(new Color[0])); customPalette.setColorScheme(newScheme); - customPalette.setName(Messages.StyleEditor_theme_custom); - customPalette.setDescription(Messages.StyleEditor_theme_custom_desc); + customPalette.setName(Messages.StyleEditor_theme_custom); + customPalette.setDescription(Messages.StyleEditor_theme_custom_desc); customPalette.setType(new PaletteType()); if (!getBrewer().hasPalette(Messages.StyleEditor_theme_custom)) { getBrewer().registerPalette(customPalette); @@ -1894,50 +1893,50 @@ private void setPaletteSelection(IMemento memento) { } private void setButtonSelection(IMemento memento, int widgetID, - String mementoKey) { - if( memento.getInteger(mementoKey)!=null ){ - Button button = getButton(widgetID); - boolean selected = memento.getInteger(mementoKey)>0; - button.setSelection(selected); - } - } - - private void setComboSelectionString(IMemento memento, int widgetId, String key) { - Combo control = getCombo(widgetId); - if( memento.getString(key)!=null ){ - String string = memento.getString(key); - String[] items = control.getItems(); - for (int i = 0; i < items.length; i++) { - if( items[i].equals(string)){ - control.select(i); - break; - } - } - } - }; - - - private void setComboSelectionInt(IMemento memento, int widgetId, String key) { - Combo control = getCombo(widgetId); - if( memento.getInteger(key)!=null ){ - Integer integer = memento.getInteger(key); - control.select(integer); - } - }; - + String mementoKey) { + if( memento.getInteger(mementoKey)!=null ){ + Button button = getButton(widgetID); + boolean selected = memento.getInteger(mementoKey)>0; + button.setSelection(selected); + } + } + + private void setComboSelectionString(IMemento memento, int widgetId, String key) { + Combo control = getCombo(widgetId); + if( memento.getString(key)!=null ){ + String string = memento.getString(key); + String[] items = control.getItems(); + for (int i = 0; i < items.length; i++) { + if( items[i].equals(string)){ + control.select(i); + break; + } + } + } + }; + + + private void setComboSelectionInt(IMemento memento, int widgetId, String key) { + Combo control = getCombo(widgetId); + if( memento.getInteger(key)!=null ){ + Integer integer = memento.getInteger(key); + control.select(integer); + } + }; + public boolean performApply() { - StyleBlackboard bb = getSelectedLayer().getStyleBlackboard(); - IMemento memento = (IMemento) bb.get(DialogSettingsStyleContent.EXTENSION_ID); - if(memento == null ){ - memento = XMLMemento.createWriteRoot("ThemeingData"); - } - - putIntFromCombo(memento, OPACITY_KEY, COMBO_OPACITY); - putStringFromCombo(memento, ATTRIBUTE_KEY, COMBO_ATTRIBUTES); - putIntFromCombo(memento, CLASSES_KEY, COMBO_CLASSES); - putStringFromCombo(memento, BREAK_KEY, COMBO_BREAKTYPE); - putStringFromCombo(memento, NORMALIZE_KEY, COMBO_NORMALIZE); - memento.putInteger(ELSE_KEY, getCombo(COMBO_ELSE).getSelectionIndex()); + StyleBlackboard bb = getSelectedLayer().getStyleBlackboard(); + IMemento memento = (IMemento) bb.get(DialogSettingsStyleContent.EXTENSION_ID); + if(memento == null ){ + memento = XMLMemento.createWriteRoot("ThemeingData"); + } + + putIntFromCombo(memento, OPACITY_KEY, COMBO_OPACITY); + putStringFromCombo(memento, ATTRIBUTE_KEY, COMBO_ATTRIBUTES); + putIntFromCombo(memento, CLASSES_KEY, COMBO_CLASSES); + putStringFromCombo(memento, BREAK_KEY, COMBO_BREAKTYPE); + putStringFromCombo(memento, NORMALIZE_KEY, COMBO_NORMALIZE); + memento.putInteger(ELSE_KEY, getCombo(COMBO_ELSE).getSelectionIndex()); putStringFromCombo(memento, PALETTE_CATEGORY_KEY, COMBO_PALETTES); putButton(memento, BUTTON_COLORBLIND, COLOR_BLIND_KEY); @@ -1975,16 +1974,15 @@ private void storeOutline( IMemento memento ) { memento.putString(BORDER_COLOR_KEY, ""); //$NON-NLS-1$ return; } - + String sep = "-"; //$NON-NLS-1$ String stringVal = rgb.red+sep+rgb.green+sep+rgb.blue; memento.putString(BORDER_COLOR_KEY, stringVal); } private void storeCustomBreak(IMemento memento) { - // TODO Auto-generated method stub if( customBreak!=null ){ - + } } @@ -2010,25 +2008,25 @@ private void storePalette(IMemento memento) { } } - private void putButton(IMemento memento, int buttonId, String key) { - boolean selection; - selection = getButton(buttonId).getSelection(); - memento.putInteger(key, selection?1:0); - } + private void putButton(IMemento memento, int buttonId, String key) { + boolean selection; + selection = getButton(buttonId).getSelection(); + memento.putInteger(key, selection?1:0); + } private void putStringFromCombo(IMemento memento, String key, - int comboID) { - Combo combo = getCombo(comboID); - int index = combo.getSelectionIndex(); - memento.putString(key, combo.getItem(index)); - } - - private void putIntFromCombo(IMemento memento, String key, - int comboID) { - memento.putInteger(key, getCombo(comboID).getSelectionIndex()); - } - - public void refresh() { + int comboID) { + Combo combo = getCombo(comboID); + int index = combo.getSelectionIndex(); + memento.putString(key, combo.getItem(index)); + } + + private void putIntFromCombo(IMemento memento, String key, + int comboID) { + memento.putInteger(key, getCombo(comboID).getSelectionIndex()); + } + + public void refresh() { //TODO: add refresh method } } diff --git a/plugins/org.locationtech.udig.tool.edit/src/org/locationtech/udig/tools/edit/commands/SelectFeaturesAtPointCommand.java b/plugins/org.locationtech.udig.tool.edit/src/org/locationtech/udig/tools/edit/commands/SelectFeaturesAtPointCommand.java index 0a827f89cc..699364439e 100644 --- a/plugins/org.locationtech.udig.tool.edit/src/org/locationtech/udig/tools/edit/commands/SelectFeaturesAtPointCommand.java +++ b/plugins/org.locationtech.udig.tool.edit/src/org/locationtech/udig/tools/edit/commands/SelectFeaturesAtPointCommand.java @@ -1,12 +1,12 @@ /* uDig - User Friendly Desktop Internet GIS client - * http://udig.refractions.net - * (C) 2004, Refractions Research Inc. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD - * License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). - */ +* http://udig.refractions.net +* (C) 2004, Refractions Research Inc. +* +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD +* License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). +*/ package org.locationtech.udig.tools.edit.commands; import java.io.IOException; @@ -136,43 +136,43 @@ public void run( IProgressMonitor monitor ) throws Exception { } setAndRun(monitor, command); - } finally { - try { - if (iter != null) { - iter.close(); - } - } finally { - if (animation != null) { - animation.setValid(false); - animation = null; - } - } - editBlackboard.fireBatchedEvents(); - } + } finally { + try { + if (iter != null) { + iter.close(); + } + } finally { + if (animation != null) { + animation.setValid(false); + animation = null; + } + } + editBlackboard.fireBatchedEvents(); + } } } /** - * Gets a feature iterator on the results of a BBox query. BBox is used because intersects occasionally throws a - * Side-conflict error so it is not a good query. - * + * Gets a feature iterator on the results of a BBox query. BBox is used because intersects occasionally throws a + * Side-conflict error so it is not a good query. + * * However maybe a better way is to try intersects then if that fails do a bbox? * For now we do bbox and test it with intersects - * + * * @return Pair of an option containing the first feature if it exists, and an iterator with the rest */ private FeatureIterator getFeatureIterator() throws IOException { ILayer editLayer = parameters.handler.getEditLayer(); FeatureStore store = getResource(editLayer); - - // transforms the bbox to the layer crs + + // transforms the bbox to the layer crs ReferencedEnvelope bbox = handler.getContext().getBoundingBox(event.getPoint(), SEARCH_SIZE); try { - bbox = bbox.transform(parameters.handler.getEditLayer().getCRS(), true); + bbox = bbox.transform(parameters.handler.getEditLayer().getCRS(), true); } catch (TransformException e) { - logTransformationWarning(e); + logTransformationWarning(e); } catch (FactoryException e) { - logTransformationWarning(e); + logTransformationWarning(e); } // creates a bbox filter using the bbox in the layer crs and grabs the features present in this bbox // but not the edit geoms @@ -190,16 +190,16 @@ private FeatureIterator getFeatureIterator() throws IOException { factory.not(factory.or(idFilterList)))); FeatureIterator reader = new IntersectTestingIterator(bbox, collection.features()); - + return reader; } - @SuppressWarnings("unchecked") - private FeatureStore getResource( - ILayer editLayer) throws IOException { - FeatureStore store = editLayer.getResource(FeatureStore.class, null); - return store; - } + @SuppressWarnings("unchecked") + private FeatureStore getResource( + ILayer editLayer) throws IOException { + FeatureStore store = editLayer.getResource(FeatureStore.class, null); + return store; + } private void runDeselectionStrategies( IProgressMonitor monitor ) { @@ -216,20 +216,20 @@ private void runSelectionStrategies(final IProgressMonitor monitor, FeatureItera final List strategies = parameters.selectionStrategies; final UndoableComposite compositeCommand = new UndoableComposite(); compositeCommand.setName(Messages.SelectGeometryCommand_name); - + /* SimpleFeature firstFeature = reader.next(); for( SelectionStrategy selectionStrategy : strategies ) { - selectionStrategy.run(monitor, compositeCommand, parameters, firstFeature, - true); + selectionStrategy.run(monitor, compositeCommand, parameters, firstFeature, + true); } - - + + while (reader.hasNext()){ - SimpleFeature nextFeature = reader.next(); + SimpleFeature nextFeature = reader.next(); for( SelectionStrategy selectionStrategy : strategies ) { - selectionStrategy.run(monitor, compositeCommand, parameters, nextFeature, - false); + selectionStrategy.run(monitor, compositeCommand, parameters, nextFeature, + false); } } */ @@ -239,7 +239,7 @@ private void runSelectionStrategies(final IProgressMonitor monitor, FeatureItera List featureList =new ArrayList(); while (reader.hasNext()){ featureList.add(reader.next()); - } + } final SimpleFeature[] features = featureList.toArray(new SimpleFeature[]{}); if (features.length == 1) { @@ -258,18 +258,18 @@ public void run() { MenuItem item = new MenuItem(menu, SWT.PUSH); //SimpleFeature feature=iter.next(); Object attribValue = attribName != null ? feat.getAttribute(attribName) : null; - item.setText(attribValue != null ? + item.setText(attribValue != null ? attribValue.toString() : feat.getID()); //add selection listener to execute selection logic upon menu item selection - item.addSelectionListener(new SelectionAdapter() { + item.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { for( SelectionStrategy selectionStrategy : strategies ) { selectionStrategy.run(monitor, compositeCommand, parameters, feat, true); } - //notify mother thread lock + //notify mother thread lock synchronized (lock) { lock.notify(); } @@ -279,7 +279,7 @@ public void widgetSelected(SelectionEvent e) { //add menu listener to dispose menu upon hide //dispose is called on a new UI thread - menu.addMenuListener(new MenuAdapter() { + menu.addMenuListener(new MenuAdapter() { @Override public void menuHidden(MenuEvent e) { e.display.asyncExec(new Runnable(){ @@ -292,16 +292,16 @@ public void menuHidden(MenuEvent e) { }); //add dispose listener that calls notify on lock - //object. This is needed in case no selection has - //occurred otherwise the lock object will never + //object. This is needed in case no selection has + //occurred otherwise the lock object will never //be relinquished menu.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { - //notify mother thread lock + //notify mother thread lock synchronized (lock) { lock.notify(); - } + } } }); @@ -311,12 +311,12 @@ public void widgetDisposed(DisposeEvent e) { }); //lock here waiting for users selection or menu popup dispose to occur - //THIS IS needed so that compositeCommand below can be properly populated + //THIS IS needed so that compositeCommand below can be properly populated synchronized (lock) { try { //add a 60 sec timeout just to ensure that if something weird //happens, the lock eventually will be released - lock.wait(60000); + lock.wait(60000); } catch (InterruptedException e) { e.printStackTrace(); } @@ -335,7 +335,7 @@ private void logTransformationWarning( Exception e ) { /** * Creates A geometry filter for the given layer. - * + * * @param boundingBox in the same crs as the viewport model. * @return a Geometry filter in the correct CRS or null if an exception occurs. */ @@ -347,9 +347,9 @@ public Filter createBBoxFilter( ReferencedEnvelope boundingBox, ILayer layer, Cl SimpleFeatureType schema = layer.getSchema(); Name geom = getGeometryAttDescriptor(schema).getName(); - + Filter bboxFilter =factory.bbox(factory.property(geom), boundingBox); - + return bboxFilter; } catch (Exception e) { @@ -375,61 +375,60 @@ public void rollback( IProgressMonitor monitor ) throws Exception { private static GeometryDescriptor getGeometryAttDescriptor( SimpleFeatureType schema ) { return schema.getGeometryDescriptor(); } - + private static class IntersectTestingIterator implements FeatureIterator{ - private final FeatureIterator wrappedIter; - private final ReferencedEnvelope bbox; - private SimpleFeature next; - - public IntersectTestingIterator(ReferencedEnvelope bbox, FeatureIterator wrapped) { - this.wrappedIter = wrapped; - this.bbox=bbox; - } - - public void close() { - wrappedIter.close(); - } - - public boolean hasNext() { - if( next!=null ){ - return true; - } - - while (wrappedIter.hasNext() && next==null ){ - SimpleFeature feature=wrappedIter.next(); - if(intersects(feature)){ - next=feature; - } - } - - // TODO Auto-generated method stub - return next!=null; - } - - private boolean intersects( SimpleFeature feature ) { - GeometryDescriptor geomDescriptor = getGeometryAttDescriptor(feature.getFeatureType()); - - Geometry bboxGeom = new GeometryFactory().toGeometry(bbox); - - Geometry geom = (Geometry) feature.getAttribute(geomDescriptor.getName()); - - try{ - return geom.intersects(bboxGeom); - }catch (Exception e) { - // ok so exception happened during intersection. This usually means geometry is a little crazy - // what to do?... - EditPlugin.log("Can't do intersection so I'm assuming they intersect", e); //$NON-NLS-1$ - return false; - } - } - public SimpleFeature next() throws NoSuchElementException { - if(!hasNext()){ - throw new NoSuchElementException(); - } - SimpleFeature f = next; - next=null; - return f; - } - + private final FeatureIterator wrappedIter; + private final ReferencedEnvelope bbox; + private SimpleFeature next; + + public IntersectTestingIterator(ReferencedEnvelope bbox, FeatureIterator wrapped) { + this.wrappedIter = wrapped; + this.bbox=bbox; + } + + public void close() { + wrappedIter.close(); + } + + public boolean hasNext() { + if( next!=null ){ + return true; + } + + while (wrappedIter.hasNext() && next==null ){ + SimpleFeature feature=wrappedIter.next(); + if(intersects(feature)){ + next=feature; + } + } + + return next!=null; + } + + private boolean intersects( SimpleFeature feature ) { + GeometryDescriptor geomDescriptor = getGeometryAttDescriptor(feature.getFeatureType()); + + Geometry bboxGeom = new GeometryFactory().toGeometry(bbox); + + Geometry geom = (Geometry) feature.getAttribute(geomDescriptor.getName()); + + try{ + return geom.intersects(bboxGeom); + }catch (Exception e) { + // ok so exception happened during intersection. This usually means geometry is a little crazy + // what to do?... + EditPlugin.log("Can't do intersection so I'm assuming they intersect", e); //$NON-NLS-1$ + return false; + } + } + public SimpleFeature next() throws NoSuchElementException { + if(!hasNext()){ + throw new NoSuchElementException(); + } + SimpleFeature f = next; + next=null; + return f; + } + } } diff --git a/plugins/org.locationtech.udig.tool.select/src/org/locationtech/udig/tool/select/ArrowSelectionWithPopup.java b/plugins/org.locationtech.udig.tool.select/src/org/locationtech/udig/tool/select/ArrowSelectionWithPopup.java index 4470f89345..4ea493a57c 100644 --- a/plugins/org.locationtech.udig.tool.select/src/org/locationtech/udig/tool/select/ArrowSelectionWithPopup.java +++ b/plugins/org.locationtech.udig.tool.select/src/org/locationtech/udig/tool/select/ArrowSelectionWithPopup.java @@ -46,9 +46,9 @@ import org.opengis.feature.simple.SimpleFeatureType; /** - * Selects and drags single features providing an appropriate selection popup + * Selects and drags single features providing an appropriate selection popup * in case there are multiple features located at the click point. - * + * * @author nprigour * @since 2.0.0 */ @@ -61,13 +61,12 @@ public ArrowSelectionWithPopup(){ super(DRAG_DROP|MOUSE); } - @Override public void mousePressed( MapMouseEvent e ) { if (e.button == MapMouseEvent.BUTTON3) ((ViewportPane) e.source).getMapEditor().openContextMenu(); else { - x=e.x; + x=e.x; y=e.y; } } @@ -78,7 +77,7 @@ public void mouseReleased( final MapMouseEvent e ) { if( e.x==x && e.y==y ){ final int selectionSearchSize = Platform.getPreferencesService().getInt( ProjectUIPlugin.ID, PreferenceConstants.FEATURE_SELECTION_SCALEFACTOR, PreferenceConstants.DEFAULT_FEATURE_SELECTION_SCALEFACTOR, null); - + final String featureAttributeName = Platform.getPreferencesService().getString( ProjectUIPlugin.ID, PreferenceConstants.FEATURE_ATTRIBUTE_NAME, "id", null); //$NON-NLS-1$ @@ -109,7 +108,7 @@ public void run( IProgressMonitor monitor ) throws InvocationTargetException, In if( !e.buttonsDown() ){ getContext().sendASyncCommand(getContext().getEditFactory().createNullEditFeatureCommand()); } - getContext().sendASyncCommand(getContext().getSelectionFactory().createNoSelectCommand()); + getContext().sendASyncCommand(getContext().getSelectionFactory().createNoSelectCommand()); return; } else { //if only one item then do normal UDIG action @@ -131,9 +130,9 @@ public void run() { for (final SimpleFeature feat : features) { MenuItem item = new MenuItem(menu, SWT.PUSH); Object attribValue = attribName != null ? feat.getAttribute(attribName) : null; - item.setText(attribValue != null ? + item.setText(attribValue != null ? attribValue.toString() : feat.getID()); - + item.addSelectionListener(new SelectionListener() { @Override @@ -144,7 +143,6 @@ public void widgetSelected(SelectionEvent e) { @Override public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub } }); diff --git a/plugins/org.locationtech.udig.tools.jgrass/src/org/locationtech/udig/tools/jgrass/featuremovieview/FeatureMovieView.java b/plugins/org.locationtech.udig.tools.jgrass/src/org/locationtech/udig/tools/jgrass/featuremovieview/FeatureMovieView.java index c283f546ff..8b1083be63 100644 --- a/plugins/org.locationtech.udig.tools.jgrass/src/org/locationtech/udig/tools/jgrass/featuremovieview/FeatureMovieView.java +++ b/plugins/org.locationtech.udig.tools.jgrass/src/org/locationtech/udig/tools/jgrass/featuremovieview/FeatureMovieView.java @@ -1,6 +1,6 @@ /* * uDig - User Friendly Desktop Internet GIS client - * (C) HydroloGIS - www.hydrologis.com + * (C) HydroloGIS - www.hydrologis.com * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -62,7 +62,7 @@ /** * A navigation view. - * + * * @author Andrea Antonello (www.hydrologis.com) * */ @@ -405,6 +405,7 @@ private synchronized void start() { playButton.setText("stop"); isRunning = true; } + private synchronized void stop() { playButton.setImage(playImage); playButton.setText("start"); @@ -433,7 +434,7 @@ private void updateZoomBuffer() { /** * Extracts features from a {@link FeatureCollection} into an {@link ArrayList}. - * + * * @param collection the feature collection. * @return the list with the features or an empty list if no features present. */ @@ -453,7 +454,6 @@ private List featureCollectionToList( SimpleFeatureCollection col @Override public void setFocus() { - // TODO Auto-generated method stub } diff --git a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/AcceptFeedbackBehaviour.java b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/AcceptFeedbackBehaviour.java index 39b17ccb5c..0aebd77626 100644 --- a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/AcceptFeedbackBehaviour.java +++ b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/AcceptFeedbackBehaviour.java @@ -3,7 +3,7 @@ * (C) 2012, Refractions Research Inc. * (C) 2006, Axios Engineering S.L. (Axios) * (C) 2006, County Council of Gipuzkoa, Department of Environment and Planning - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Axios BSD @@ -23,7 +23,7 @@ * AbstractEditTool.initAcceptBehaviours( List acceptBehaviours ) to * establish the feedback actions to run when the tool interaction ends up being accepted. *

- * + * * @author Aritz Davila (www.axios.es) * @author Mauricio Pazos (www.axios.es) * @since 1.1.0 @@ -61,7 +61,7 @@ public UndoableMapCommand getCommand( EditToolHandler handler ) { } public void handleError( EditToolHandler handler, Throwable error, UndoableMapCommand command ) { - // TODO Auto-generated method stub + } } diff --git a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/CancelFeedbakBehaviour.java b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/CancelFeedbakBehaviour.java index 849689d367..087a202869 100644 --- a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/CancelFeedbakBehaviour.java +++ b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/CancelFeedbakBehaviour.java @@ -3,7 +3,7 @@ * (C) 2012, Refractions Research Inc. * (C) 2006, Axios Engineering S.L. (Axios) * (C) 2006, County Council of Gipuzkoa, Department of Environment and Planning - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Axios BSD @@ -17,7 +17,7 @@ /** * Cancel {@link Behaviour} that operates over a given {@link EditToolFeedbackManager} - * + * * @author Aritz Davila (www.axios.es) * @author Mauricio Pazos (www.axios.es) * @since 1.1.0 @@ -45,7 +45,7 @@ public UndoableMapCommand getCommand( EditToolHandler handler ) { } public void handleError( EditToolHandler handler, Throwable error, UndoableMapCommand command ) { - // TODO Auto-generated method stub + } } diff --git a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/EditToolFeedbackBehaviour.java b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/EditToolFeedbackBehaviour.java index 90558af6c4..285cdf5848 100644 --- a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/EditToolFeedbackBehaviour.java +++ b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/arc/internal/beahaviour/EditToolFeedbackBehaviour.java @@ -3,7 +3,7 @@ * (C) 2012, Refractions Research Inc. * (C) 2006, Axios Engineering S.L. (Axios) * (C) 2006, County Council of Gipuzkoa, Department of Environment and Planning - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Axios BSD @@ -21,7 +21,7 @@ /** * Behaviour that draws the preview arc while the user specifies the anchor points - * + * * @author Aritz Davila (www.axios.es) * @author Mauricio Pazos (www.axios.es) * @since 1.1.0 @@ -31,12 +31,12 @@ public class EditToolFeedbackBehaviour implements EventBehaviour { private EditToolFeedbackManager feedbackManager; - + public EditToolFeedbackBehaviour(EditToolFeedbackManager feedbackManager){ assert feedbackManager != null; this.feedbackManager = feedbackManager; } - + /** * Valid if event type is mouse moved, handler's current state is * {@link EditState#CREATING}, and current editting shape has at leasr 1 point. @@ -47,7 +47,7 @@ public boolean isValid( EditToolHandler handler, MapMouseEvent e, EventType even /** * Sets the arc to be drawn on the {@link ViewportPane} - * + * * @return null, as no undoable map command is needed */ public UndoableMapCommand getCommand( EditToolHandler handler, MapMouseEvent e, @@ -58,7 +58,6 @@ public UndoableMapCommand getCommand( EditToolHandler handler, MapMouseEvent e, } public void handleError( EditToolHandler handler, Throwable error, UndoableMapCommand command ) { - // TODO Auto-generated method stub error.printStackTrace(); } diff --git a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/parallel/internal/command/SetReferenceFeatureCommand.java b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/parallel/internal/command/SetReferenceFeatureCommand.java index d20712b816..e8945dd9e6 100644 --- a/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/parallel/internal/command/SetReferenceFeatureCommand.java +++ b/plugins/org.locationtech.udig.tools/src/org/locationtech/udig/tools/parallel/internal/command/SetReferenceFeatureCommand.java @@ -3,7 +3,7 @@ * (C) 2012, Refractions Research Inc. * (C) 2006, Axios Engineering S.L. (Axios) * (C) 2006, County Council of Gipuzkoa, Department of Environment and Planning - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Axios BSD @@ -41,14 +41,14 @@ /** *

- * + * *

  * Get the feature that is under the cursor are. Store it on
  * {@link ParallelContext} and run the animation that highlight this feature.
  * 
- * + * *

- * + * * @author Aritz Davila (www.axios.es) * @author Mauricio Pazos (www.axios.es) */ @@ -59,14 +59,12 @@ public class SetReferenceFeatureCommand extends AbstractCommand implements Undoa private MapMouseEvent event = null; public SetReferenceFeatureCommand(ParallelContext paralleContext, EditToolHandler handler, MapMouseEvent event) { - this.parallelContext = paralleContext; this.handler = handler; this.event = event; } public String getName() { - return Messages.PrecisionParallelReferenceFeature; } @@ -113,7 +111,6 @@ public void run(IProgressMonitor monitor) throws Exception { } public void rollback(IProgressMonitor monitor) throws Exception { - // TODO Auto-generated method stub } diff --git a/plugins/org.locationtech.udig.tutorials.preferredzoomlevels/src/org/locationtech/udig/tutorials/preferredzoomlevels/ZoomToFeatures.java b/plugins/org.locationtech.udig.tutorials.preferredzoomlevels/src/org/locationtech/udig/tutorials/preferredzoomlevels/ZoomToFeatures.java index 0c8ba22b6e..a8b681b9e4 100644 --- a/plugins/org.locationtech.udig.tutorials.preferredzoomlevels/src/org/locationtech/udig/tutorials/preferredzoomlevels/ZoomToFeatures.java +++ b/plugins/org.locationtech.udig.tutorials.preferredzoomlevels/src/org/locationtech/udig/tutorials/preferredzoomlevels/ZoomToFeatures.java @@ -38,13 +38,11 @@ public void run() { } catch (IOException e) { e.printStackTrace(); } - } @Override public void dispose() { - // TODO Auto-generated method stub - + } }