Merge "Issue #875 - Create com.raytheon.uf.viz.points" into development
Former-commit-id:35c8d72efe
[formerly6e18c9d2b3
] [formerly34a3d7b141
] [formerly35c8d72efe
[formerly6e18c9d2b3
] [formerly34a3d7b141
] [formerly73e087494c
[formerly34a3d7b141
[formerly 78f6d94e5be35624e63960196ed3a56bd72306a9]]]] Former-commit-id:73e087494c
Former-commit-id:18776648ac
[formerly2ce79c4fbb
] [formerly 54cc51c8cadb8ca1e009af8ee7a580bde56aaff2 [formerly798ac5882f
]] Former-commit-id: ef613799b5e7f743055529c8f316ec410329c76e [formerly35bb79d4ab
] Former-commit-id:860c3982fc
This commit is contained in:
commit
c15cb7a864
41 changed files with 1409 additions and 869 deletions
|
@ -42,5 +42,10 @@
|
|||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
<plugin
|
||||
id="com.raytheon.uf.viz.points"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
</feature>
|
||||
|
|
|
@ -50,13 +50,16 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 4, 2010 mschenke Initial creation
|
||||
* Jul 11, 2012 #875 rferrel Return Value now only set
|
||||
* to bundle on Load. Prevents
|
||||
* the window's 'x' close from
|
||||
* trying to perform a load.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class AlterBundleDlg extends CaveSWTDialog {
|
||||
|
||||
private static class AlterBundleEntry {
|
||||
|
@ -95,11 +98,6 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
return mainLayout;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposed() {
|
||||
setReturnValue(bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
Composite mainComposite = new Composite(shell, SWT.NONE);
|
||||
|
@ -231,7 +229,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
entry.alterValue);
|
||||
}
|
||||
}
|
||||
|
||||
setReturnValue(bundle);
|
||||
shell.close();
|
||||
}
|
||||
|
||||
|
|
7
cave/com.raytheon.uf.viz.points/.classpath
Normal file
7
cave/com.raytheon.uf.viz.points/.classpath
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
cave/com.raytheon.uf.viz.points/.project
Normal file
28
cave/com.raytheon.uf.viz.points/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.viz.points</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,8 @@
|
|||
#Tue Jul 10 10:45:07 CDT 2012
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
19
cave/com.raytheon.uf.viz.points/META-INF/MANIFEST.MF
Normal file
19
cave/com.raytheon.uf.viz.points/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,19 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Points
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.points
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Activator: com.raytheon.uf.viz.points.Activator
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
org.geotools;bundle-version="2.6.4",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.awipstools;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.viz.points
|
4
cave/com.raytheon.uf.viz.points/build.properties
Normal file
4
cave/com.raytheon.uf.viz.points/build.properties
Normal file
|
@ -0,0 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -0,0 +1,50 @@
|
|||
package com.raytheon.uf.viz.points;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.uf.viz.points"; //$NON-NLS-1$
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.raytheon.uf.viz.points;
|
||||
|
||||
/*****************************************************************************************
|
||||
* COPYRIGHT (c), 2007, RAYTHEON COMPANY
|
||||
* ALL RIGHTS RESERVED, An Unpublished Work
|
||||
*
|
||||
* RAYTHEON PROPRIETARY
|
||||
* If the end user is not the U.S. Government or any agency thereof, use
|
||||
* or disclosure of data contained in this source code file is subject to
|
||||
* the proprietary restrictions set forth in the Master Rights File.
|
||||
*
|
||||
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
|
||||
* If the end user is the U.S. Government or any agency thereof, this source
|
||||
* code is provided to the U.S. Government with Government Purpose Rights.
|
||||
* Use or disclosure of data contained in this source code file is subject to
|
||||
* the "Government Purpose Rights" restriction in the Master Rights File.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* Use or disclosure of data contained in this source code file is subject to
|
||||
* the export restrictions set forth in the Master Rights File.
|
||||
******************************************************************************************/
|
||||
|
||||
/**
|
||||
* Interface for listening for tool changes. Register with PointsDataManager
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface IPointChangedListener {
|
||||
|
||||
public void pointChanged();
|
||||
|
||||
}
|
|
@ -0,0 +1,463 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.points;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
import org.geotools.referencing.datum.DefaultEllipsoid;
|
||||
|
||||
import com.raytheon.uf.common.awipstools.GetWfoCenterPoint;
|
||||
import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.core.CorePlugin;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* This manages maintaining localized files that contain information on points
|
||||
* including the special point home.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 10, 2012 #875 rferrel Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class PointsDataManager implements ILocalizationFileObserver,
|
||||
IPropertyChangeListener {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(PointsDataManager.class);
|
||||
|
||||
private static final GeodeticCalculator GC = new GeodeticCalculator(
|
||||
DefaultEllipsoid.WGS84);
|
||||
|
||||
private static final UnitConverter NM_TO_METERS = NonSI.NAUTICAL_MILE
|
||||
.getConverterTo(SI.METER);
|
||||
|
||||
private static PointsDataManager theManager;
|
||||
|
||||
private static final String MOVABLE_POINT_PREFIX = "movablePoint";
|
||||
|
||||
private static final String MOVABLE_POINT_EXT = ".txt";
|
||||
|
||||
private static final String HOME_LOCATION_FILE = "HomeLocation.dat";
|
||||
|
||||
private Map<String, Coordinate> points;
|
||||
|
||||
private ListenerList pointsListeners = new ListenerList();
|
||||
|
||||
private Coordinate home;
|
||||
|
||||
private ListenerList homeListeners = new ListenerList();
|
||||
|
||||
private Coordinate wfoCenter;
|
||||
|
||||
private String site;
|
||||
|
||||
private LocalizationFile userToolsDir;
|
||||
|
||||
private IPathManager pathMgr;
|
||||
|
||||
public static synchronized PointsDataManager getInstance() {
|
||||
if (theManager == null) {
|
||||
theManager = new PointsDataManager();
|
||||
}
|
||||
return theManager;
|
||||
}
|
||||
|
||||
private PointsDataManager() {
|
||||
site = LocalizationManager.getInstance().getCurrentSite();
|
||||
|
||||
pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationContext userCtx = pathMgr.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
|
||||
|
||||
userToolsDir = pathMgr.getLocalizationFile(userCtx, "awipsTools"
|
||||
+ File.separator + site);
|
||||
userToolsDir.addFileUpdatedObserver(this);
|
||||
|
||||
CorePlugin.getDefault().getPreferenceStore()
|
||||
.addPropertyChangeListener(this);
|
||||
}
|
||||
|
||||
public Collection<String> getPointNames() {
|
||||
return getPoints().keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @return the point coordinate associated with the given name, null if no
|
||||
* point exists by that name
|
||||
*/
|
||||
public Coordinate getPoint(String name) {
|
||||
if (points == null) {
|
||||
getPoints();
|
||||
}
|
||||
Coordinate pointCoordinate = points.get(name);
|
||||
if (pointCoordinate == null) {
|
||||
return null;
|
||||
}
|
||||
return new Coordinate(pointCoordinate);
|
||||
}
|
||||
|
||||
public void setPoint(String name, Coordinate point) {
|
||||
points.put(name, new Coordinate(point));
|
||||
storePoint(userToolsDir, point, MOVABLE_POINT_PREFIX + name
|
||||
+ MOVABLE_POINT_EXT);
|
||||
}
|
||||
|
||||
/**
|
||||
* A convince method to get the current WFO's coordinates from the server.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Coordinate getWfoCenter() {
|
||||
if (wfoCenter == null) {
|
||||
loadWfoCenter();
|
||||
}
|
||||
return new Coordinate(wfoCenter);
|
||||
}
|
||||
|
||||
public Coordinate getHome() {
|
||||
if (home == null) {
|
||||
loadHome();
|
||||
}
|
||||
return new Coordinate(home);
|
||||
}
|
||||
|
||||
public void setHome(Coordinate home) {
|
||||
if (home == null) {
|
||||
return;
|
||||
}
|
||||
this.home = new Coordinate(home);
|
||||
storeHome();
|
||||
}
|
||||
|
||||
private void storeHome() {
|
||||
storePoint(userToolsDir, home, HOME_LOCATION_FILE);
|
||||
}
|
||||
|
||||
private void storePoint(LocalizationFile dir, Coordinate point,
|
||||
String fileName) {
|
||||
|
||||
LocalizationFile lf = pathMgr.getLocalizationFile(dir.getContext(),
|
||||
dir.getName() + File.separator + fileName);
|
||||
File file = lf.getFile();
|
||||
|
||||
// create the local directory if necessary
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
BufferedWriter out = null;
|
||||
try {
|
||||
out = new BufferedWriter(new FileWriter(file));
|
||||
out.write(String.format("%f %f\n", point.y, point.x));
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Error writing to file: "
|
||||
+ file.getAbsolutePath(), e);
|
||||
} finally {
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
lf.save();
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error writing to file: " + file.getAbsolutePath(),
|
||||
e);
|
||||
} catch (LocalizationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error storing locatization file to server: " + lf,
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, Coordinate> getPoints() {
|
||||
if (points == null || points.isEmpty()) {
|
||||
loadPoints();
|
||||
if (points == null || points.isEmpty()) {
|
||||
createDefaultPoints();
|
||||
}
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
private void createDefaultPoints() {
|
||||
points = new HashMap<String, Coordinate>();
|
||||
Coordinate center = getHome();
|
||||
int baseRingSize = 120;
|
||||
int startAngle = -90;
|
||||
for (char label = 'A'; label <= 'J'; label++) {
|
||||
Coordinate point = getCoordinateOnCircle(center, baseRingSize,
|
||||
startAngle);
|
||||
setPoint(String.valueOf(label), point);
|
||||
startAngle += 36;
|
||||
}
|
||||
}
|
||||
|
||||
private void loadWfoCenter() {
|
||||
try {
|
||||
// Request WFO center point from server
|
||||
wfoCenter = (Coordinate) ThriftClient
|
||||
.sendLocalizationRequest(new GetWfoCenterPoint(site));
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to get WFO center for \"" + site + "\"", e);
|
||||
}
|
||||
if (wfoCenter == null) {
|
||||
wfoCenter = new Coordinate(-96.2, 41.2);
|
||||
}
|
||||
}
|
||||
|
||||
private Coordinate loadHome() {
|
||||
home = loadPoint(userToolsDir, HOME_LOCATION_FILE);
|
||||
if (home == null) {
|
||||
home = getWfoCenter();
|
||||
storeHome();
|
||||
}
|
||||
return home;
|
||||
}
|
||||
|
||||
private void loadPoints() {
|
||||
points = new HashMap<String, Coordinate>();
|
||||
|
||||
LocalizationFile[] files = pathMgr.listFiles(userToolsDir.getContext(),
|
||||
userToolsDir.getName(), new String[] { MOVABLE_POINT_EXT },
|
||||
false, true);
|
||||
for (LocalizationFile lf : files) {
|
||||
String fileName = lf.getFile().getName();
|
||||
if (fileName.startsWith(MOVABLE_POINT_PREFIX)) {
|
||||
Coordinate point = loadPoint(userToolsDir, fileName);
|
||||
String name = fileName.substring(MOVABLE_POINT_PREFIX.length())
|
||||
.replace(MOVABLE_POINT_EXT, "");
|
||||
points.put(name, point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Coordinate getCoordinateOnCircle(Coordinate coor, double radius,
|
||||
int angle) {
|
||||
|
||||
if (angle > 180) {
|
||||
angle = angle - 360;
|
||||
}
|
||||
GC.setStartingGeographicPoint(coor.x, coor.y);
|
||||
GC.setDirection(angle, NM_TO_METERS.convert(radius));
|
||||
|
||||
return new Coordinate(GC.getDestinationGeographicPoint().getX(), GC
|
||||
.getDestinationGeographicPoint().getY());
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.common.localization.ILocalizationFileObserver#fileUpdated
|
||||
* (com.raytheon.uf.common.localization.FileUpdatedMessage)
|
||||
*/
|
||||
@Override
|
||||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
String fileName = new File(message.getFileName()).getName();
|
||||
|
||||
if (fileName.startsWith(MOVABLE_POINT_PREFIX)) {
|
||||
pointsFileUpdated(fileName);
|
||||
} else if (fileName.startsWith(HOME_LOCATION_FILE)) {
|
||||
homeLocationFileUpdated(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
private void pointsFileUpdated(String fileName) {
|
||||
if (points != null) {
|
||||
Coordinate point = loadPoint(userToolsDir, fileName);
|
||||
String name = fileName.substring(MOVABLE_POINT_PREFIX.length())
|
||||
.replace(MOVABLE_POINT_EXT, "");
|
||||
points.put(name, point);
|
||||
|
||||
for (Object listener : pointsListeners.getListeners()) {
|
||||
((IPointChangedListener) listener).pointChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void homeLocationFileUpdated(String fileName) {
|
||||
if (home != null) {
|
||||
loadHome();
|
||||
|
||||
ArrayList<Thread> threads = new ArrayList<Thread>(
|
||||
homeListeners.size());
|
||||
for (final Object listener : homeListeners.getListeners()) {
|
||||
// fire listeners in separate threads to avoid waiting to draw
|
||||
// the updated location while waiting on another listener to
|
||||
// finish
|
||||
Thread t = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
((IPointChangedListener) listener).pointChanged();
|
||||
}
|
||||
|
||||
});
|
||||
threads.add(t);
|
||||
t.start();
|
||||
}
|
||||
|
||||
// join all threads before continuing so we can't fire listeners
|
||||
// again until all have finished
|
||||
for (Thread t : threads) {
|
||||
try {
|
||||
t.join();
|
||||
} catch (InterruptedException e) {
|
||||
statusHandler.handle(
|
||||
Priority.SIGNIFICANT,
|
||||
"Unexpected Interruption from: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Coordinate loadPoint(LocalizationFile dir, String fileName) {
|
||||
Coordinate point = null;
|
||||
|
||||
LocalizationFile lf = pathMgr.getLocalizationFile(dir.getContext(),
|
||||
dir.getName() + File.separator + fileName);
|
||||
File file = lf.getFile();
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
in = new BufferedReader(new FileReader(file));
|
||||
String line = in.readLine();
|
||||
line = line.trim();
|
||||
int p = line.indexOf(' ');
|
||||
double lat = Double.parseDouble(line.substring(0, p));
|
||||
double lon = Double.parseDouble(line.substring(p));
|
||||
|
||||
if (lat > 90.0 || lat < -90.0 || lon > 180.0 || lon < -180.0) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"Invalid lat/lon in wfo center point file, using default");
|
||||
} else {
|
||||
point = new Coordinate(lon, lat);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"Invalid number in wfo center point file, using default",
|
||||
e);
|
||||
} catch (FileNotFoundException e) {
|
||||
statusHandler.handle(Priority.EVENTA,
|
||||
"No wfo center point file found, creating default.");
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error reading wfo center point file, using default", e);
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void addPointsChangedListener(IPointChangedListener listener) {
|
||||
pointsListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void removePointsChangedListener(IPointChangedListener listener) {
|
||||
pointsListeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void addHomeChangedListener(IPointChangedListener listener) {
|
||||
homeListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void removeHomeChangedListener(IPointChangedListener listener) {
|
||||
homeListeners.remove(listener);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange
|
||||
* (org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
|
@ -17,7 +17,9 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.viz.core;bundle-version="1.11.7",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.11.7",
|
||||
javax.jms;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174"
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0"
|
||||
Export-Package: com.raytheon.uf.viz.radarapps.client,
|
||||
com.raytheon.uf.viz.radarapps.core,
|
||||
com.raytheon.uf.viz.radarapps.products.ui
|
||||
|
|
|
@ -75,8 +75,31 @@ import com.raytheon.uf.viz.radarapps.products.ui.PMenu.PMenuItem;
|
|||
import com.raytheon.uf.viz.radarapps.products.ui.PMenu.PProductItem;
|
||||
import com.raytheon.uf.viz.radarapps.products.ui.PMenu.PSeparator;
|
||||
import com.raytheon.uf.viz.radarapps.products.ui.PMenu.PSubMenu;
|
||||
import com.raytheon.viz.ui.widgets.MenuButton;
|
||||
import com.raytheon.viz.ui.widgets.MinimumSizeComposite;
|
||||
|
||||
public class BaseRadarProductUI {
|
||||
/**
|
||||
* This abstract class generates a consistent layout for various products.
|
||||
* Example of use is the One Time Request Dialog.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Jul 11, 2012 #875 rferrel Refactored for changes in MenuButton and
|
||||
* converted to abstract class making the
|
||||
* needed methods abstract.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ?
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public abstract class BaseRadarProductUI {
|
||||
private Composite productRequestUI;
|
||||
|
||||
private Composite productSelectorUI;
|
||||
|
@ -324,7 +347,7 @@ public class BaseRadarProductUI {
|
|||
if (mne != null)
|
||||
productMenuButton.setSelectedItem(productMenuItems.get(mne));
|
||||
else
|
||||
productMenuButton.setSelectedItem(null);
|
||||
productMenuButton.setSelectedItem((MenuItem) null);
|
||||
}
|
||||
sel = sel.narrow(new Selector(radarType, null, null, usage));
|
||||
|
||||
|
@ -2382,41 +2405,66 @@ public class BaseRadarProductUI {
|
|||
requestUIChange();
|
||||
}
|
||||
|
||||
private static String[] geomList = { "A", "B", "C", "D", "E", };
|
||||
/**
|
||||
* Get an array of baseline names to process.
|
||||
*
|
||||
* @return baselineNames
|
||||
*/
|
||||
abstract protected String[] getBaselineList();
|
||||
|
||||
protected String[] getBaselineList() {
|
||||
return geomList;
|
||||
}
|
||||
/**
|
||||
* Get an array of point names to process.
|
||||
*
|
||||
* @return pointNames
|
||||
*/
|
||||
abstract protected String[] getPointList();
|
||||
|
||||
protected String[] getPointList() {
|
||||
return geomList;
|
||||
}
|
||||
/**
|
||||
* Get point's azimuth and range from the radar.
|
||||
*
|
||||
* @param which
|
||||
* - point name
|
||||
* @return result - [0] azimuth of point, [1] range of point; or null if
|
||||
* unable to determine
|
||||
*/
|
||||
abstract protected int[] getPoint(String which);
|
||||
|
||||
protected int[] getPoint(String which) {
|
||||
int x = (int) which.charAt(0);
|
||||
int[] result = { x, x };
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Get the baseline's azimuth and range from the radar for the line's start
|
||||
* and end point.
|
||||
*
|
||||
* @param which
|
||||
* - baseline name
|
||||
* @return result - [0] azimuth start point, [1] range start point, [2]
|
||||
* azimuth end point, [3] range end point; or null if unable to
|
||||
* determine
|
||||
*/
|
||||
abstract protected int[] getBaseline(String which);
|
||||
|
||||
protected int[] getBaseline(String which) {
|
||||
int x = (int) which.charAt(0);
|
||||
int[] result = { x, x, x + 20, x + 100 };
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Get the radar's location.
|
||||
*
|
||||
* @param radar
|
||||
* @return array - [0] latitude, [1] longitude, [3] elevation
|
||||
*/
|
||||
abstract protected float[] getRadarLocation(String radar);
|
||||
|
||||
protected float[] getRadarLocation(String radar) {
|
||||
float[] result = { 0, 0 };
|
||||
return result;
|
||||
}
|
||||
|
||||
protected float[] getPointLatLon(String which) {
|
||||
float[] result = { 0, 0 };
|
||||
return result;
|
||||
}
|
||||
|
||||
protected float[] getBaselineLatLon(String which) {
|
||||
float[] result = { 0, 0, 0, 0 };
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Get point location
|
||||
*
|
||||
* @param which
|
||||
* - point name
|
||||
* @return array - [0] latitude, [1] longitude
|
||||
*/
|
||||
abstract protected float[] getPointLatLon(String which);
|
||||
|
||||
/**
|
||||
* Get location of baseline's start and end points.
|
||||
*
|
||||
* @param which
|
||||
* - baseline name
|
||||
* @return array - [0] start latitude, [1] start longitude, [2] end
|
||||
* latitude, [3] end longitude
|
||||
*/
|
||||
abstract protected float[] getBaselineLatLon(String which);
|
||||
}
|
||||
|
|
|
@ -1,176 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.radarapps.products.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
|
||||
public class MenuButton extends MinimumSizeComposite implements SelectionListener, DisposeListener {
|
||||
private Button button;
|
||||
|
||||
public MenuButton(Composite parent) {
|
||||
super(parent, SWT.NONE);
|
||||
setLayout(new FillLayout(SWT.HORIZONTAL));
|
||||
button = new Button(this, SWT.PUSH);
|
||||
/*// This produced annoying behavoir...
|
||||
button.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
if (e.button == 1) {
|
||||
doPopup();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
*/
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
doPopup();
|
||||
}
|
||||
});
|
||||
addDisposeListener(this);
|
||||
button.setText("Xxxx Xxxxx Xxxx Xxxxxxxxx (XXX)");
|
||||
setMinimumSize(button.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
button.setEnabled(enabled);
|
||||
}
|
||||
|
||||
private void doPopup() {
|
||||
boolean isEnabled = button.isEnabled();
|
||||
if (! isEnabled)
|
||||
return;
|
||||
/*
|
||||
button.setEnabled(false);
|
||||
button.setEnabled(true);
|
||||
*/
|
||||
Menu menu = getMenu();
|
||||
if (menu == null)
|
||||
return;
|
||||
Point sz = getSize();
|
||||
Point p = toDisplay(0, sz.y);
|
||||
menu.setLocation(p);
|
||||
menu.setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMenu(Menu menu) {
|
||||
//Menu oldMenu = getMenu();
|
||||
/*
|
||||
if (oldMenu != null)
|
||||
oldMenu.removeMenuListener(this);
|
||||
*/
|
||||
super.setMenu(menu);
|
||||
realizeMenu();
|
||||
}
|
||||
|
||||
public void updateMenu() {
|
||||
realizeMenu();
|
||||
}
|
||||
|
||||
private ArrayList<MenuItem> menuItems = new ArrayList<MenuItem>();
|
||||
private void realizeMenu() {
|
||||
unrealizeMenu();
|
||||
realizeMenu1(getMenu());
|
||||
}
|
||||
|
||||
private void realizeMenu1(Menu menu) {
|
||||
if (menu != null) {
|
||||
for (MenuItem mi : menu.getItems()) {
|
||||
if ((mi.getStyle() & SWT.CASCADE) == 0)
|
||||
mi.addSelectionListener(this);
|
||||
else
|
||||
realizeMenu1(mi.getMenu());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
widgetSelected(e);
|
||||
}
|
||||
|
||||
private ArrayList<SelectionListener> listeners =
|
||||
new ArrayList<SelectionListener>();
|
||||
private MenuItem selectedItem;
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
MenuItem mi;
|
||||
try {
|
||||
mi = (MenuItem) e.widget;
|
||||
} catch (ClassCastException exc) {
|
||||
return;
|
||||
}
|
||||
setSelectedItem(mi);
|
||||
|
||||
Event ev = new Event();
|
||||
ev.widget = this;
|
||||
ev.data = mi;
|
||||
|
||||
SelectionListener[] ls = listeners.toArray(new SelectionListener[listeners.size()]);
|
||||
for (SelectionListener l : ls) {
|
||||
l.widgetSelected(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
unrealizeMenu();
|
||||
}
|
||||
|
||||
private void unrealizeMenu() {
|
||||
for (MenuItem mi : menuItems) {
|
||||
mi.removeSelectionListener(this);
|
||||
}
|
||||
menuItems.clear();
|
||||
}
|
||||
|
||||
public void addSelectionListener(SelectionListener listener) {
|
||||
if (listener == null)
|
||||
throw new NullPointerException();
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
public MenuItem getSelectedItem() {
|
||||
return selectedItem;
|
||||
}
|
||||
|
||||
public void setSelectedItem(MenuItem selectedItem) {
|
||||
this.selectedItem = selectedItem;
|
||||
if (selectedItem != null)
|
||||
button.setText(selectedItem.getText());
|
||||
else
|
||||
button.setText("");
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.radarapps.products.ui;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
public class MinimumSizeComposite extends Composite {
|
||||
|
||||
private int minWidth = SWT.DEFAULT;
|
||||
private int minHeight = SWT.DEFAULT;
|
||||
|
||||
public MinimumSizeComposite(Composite parent) {
|
||||
this(parent, SWT.NONE);
|
||||
}
|
||||
|
||||
public MinimumSizeComposite(Composite parent, int style) {
|
||||
super(parent, style);
|
||||
GridLayout gd = new GridLayout(1, false);
|
||||
gd.marginWidth = 0;
|
||||
gd.marginHeight = 0;
|
||||
setLayout(gd);
|
||||
}
|
||||
|
||||
public void setControl(Control c) {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
if (minWidth != SWT.DEFAULT)
|
||||
gd.minimumWidth = minWidth;
|
||||
if (minHeight != SWT.DEFAULT)
|
||||
gd.minimumHeight = minHeight;
|
||||
c.setLayoutData(gd);
|
||||
}
|
||||
|
||||
public void setMinimumSizeFromComputedSize() {
|
||||
setMinimumSize(super.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point computeSize(int wHint, int hHint, boolean changed) {
|
||||
Point sz = super.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
|
||||
sz.x = Math.max(minWidth, sz.x);
|
||||
sz.y = Math.max(minHeight, sz.y);
|
||||
return sz;
|
||||
}
|
||||
|
||||
public void setMinimumSize(Point sz) {
|
||||
minWidth = sz.x;
|
||||
minHeight = sz.y;
|
||||
}
|
||||
|
||||
public void setMinimumSize(int width, int height) {
|
||||
minWidth = width;
|
||||
minHeight = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layout(boolean changed, boolean all) {
|
||||
super.layout(changed, all);
|
||||
}
|
||||
|
||||
}
|
|
@ -31,6 +31,8 @@ import org.eclipse.ui.commands.ICommandService;
|
|||
import org.geotools.referencing.GeodeticCalculator;
|
||||
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.radarapps.core.RadarApps;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
|
@ -40,7 +42,7 @@ public class RadarProductUI extends BaseRadarProductUI {
|
|||
|
||||
private IToolChangedListener baselineListener;
|
||||
|
||||
private IToolChangedListener pointListener;
|
||||
private IPointChangedListener pointListener;
|
||||
|
||||
@Override
|
||||
protected String[] getBaselineList() {
|
||||
|
@ -52,7 +54,7 @@ public class RadarProductUI extends BaseRadarProductUI {
|
|||
|
||||
@Override
|
||||
protected String[] getPointList() {
|
||||
ArrayList<String> pointNames = new ArrayList<String>(ToolsDataManager
|
||||
ArrayList<String> pointNames = new ArrayList<String>(PointsDataManager
|
||||
.getInstance().getPointNames());
|
||||
Collections.sort(pointNames);
|
||||
return pointNames.toArray(new String[pointNames.size()]);
|
||||
|
@ -87,16 +89,16 @@ public class RadarProductUI extends BaseRadarProductUI {
|
|||
VizApp.runAsync(runnable);
|
||||
}
|
||||
};
|
||||
pointListener = new IToolChangedListener() {
|
||||
pointListener = new IPointChangedListener() {
|
||||
@Override
|
||||
public void toolChanged() {
|
||||
public void pointChanged() {
|
||||
VizApp.runAsync(runnable);
|
||||
}
|
||||
};
|
||||
|
||||
ToolsDataManager.getInstance().addBaselinesChangedListener(
|
||||
baselineListener);
|
||||
ToolsDataManager.getInstance().addPointsChangedListener(
|
||||
PointsDataManager.getInstance().addPointsChangedListener(
|
||||
pointListener);
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +106,7 @@ public class RadarProductUI extends BaseRadarProductUI {
|
|||
@Override
|
||||
protected float[] getPointLatLon(String which) {
|
||||
maybeAddPrefListener();
|
||||
Coordinate c = ToolsDataManager.getInstance().getPoint(which);
|
||||
Coordinate c = PointsDataManager.getInstance().getPoint(which);
|
||||
if (c != null) {
|
||||
float[] result = { (float) c.y, (float) c.x };
|
||||
return result;
|
||||
|
@ -191,7 +193,7 @@ public class RadarProductUI extends BaseRadarProductUI {
|
|||
ToolsDataManager.getInstance().removeBaselinesChangedListener(
|
||||
baselineListener);
|
||||
if (pointListener != null)
|
||||
ToolsDataManager.getInstance().removePointsChangedListener(
|
||||
PointsDataManager.getInstance().removePointsChangedListener(
|
||||
pointListener);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ import org.eclipse.swt.widgets.Composite;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Scale;
|
||||
|
||||
import com.raytheon.viz.ui.widgets.MinimumSizeComposite;
|
||||
|
||||
// TODO: make label a spinner control for precise control
|
||||
public class ScaleWithLabel extends Composite {
|
||||
private MinimumSizeComposite msc;
|
||||
|
|
|
@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
com.raytheon.uf.viz.d2d.core,
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.core.maps;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.ui
|
||||
com.raytheon.uf.viz.d2d.ui,
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.awipstools,
|
||||
com.raytheon.viz.awipstools.capabilities,
|
||||
|
|
|
@ -28,8 +28,7 @@ package com.raytheon.viz.awipstools;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
*
|
||||
*
|
||||
* Initial creation
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.uf.viz.core.rsc.IPointsToolContainer;
|
|||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.LineString;
|
||||
|
||||
|
@ -47,6 +48,8 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Jul 11, 2012 #875 rferrel Bug fix.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -76,6 +79,7 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
public Map<String, String[]> getAlterables() {
|
||||
Map<String, String[]> alterables = new HashMap<String, String[]>();
|
||||
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
||||
PointsDataManager pdm = PointsDataManager.getInstance();
|
||||
Collection<String> blNames = tdm.getBaselineNames();
|
||||
String[] lines = new String[blNames.size()];
|
||||
int i = 0;
|
||||
|
@ -85,7 +89,7 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
}
|
||||
Arrays.sort(lines);
|
||||
|
||||
Collection<String> pNames = tdm.getPointNames();
|
||||
Collection<String> pNames = pdm.getPointNames();
|
||||
String[] points = new String[pNames.size()];
|
||||
i = 0;
|
||||
for (String point : pNames) {
|
||||
|
@ -99,7 +103,7 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
pointsValues[1] = ProcedureDlg.CURRENT;
|
||||
System.arraycopy(points, 0, pointsValues, 2, points.length);
|
||||
|
||||
String[] linesValues = new String[points.length + 2];
|
||||
String[] linesValues = new String[lines.length + 2];
|
||||
linesValues[0] = ProcedureDlg.ORIGINAL;
|
||||
linesValues[1] = ProcedureDlg.CURRENT;
|
||||
System.arraycopy(lines, 0, linesValues, 2, lines.length);
|
||||
|
@ -196,7 +200,7 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
*/
|
||||
private void alterContainer(IPointsToolContainer container,
|
||||
String selectedString) {
|
||||
Coordinate point = ToolsDataManager.getInstance().getPoint(
|
||||
Coordinate point = PointsDataManager.getInstance().getPoint(
|
||||
selectedString);
|
||||
container.setPointCoordinate(point);
|
||||
container.setPointLetter(selectedString);
|
||||
|
|
|
@ -22,7 +22,6 @@ package com.raytheon.viz.awipstools;
|
|||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
@ -36,10 +35,6 @@ import java.util.Map;
|
|||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
|
@ -48,10 +43,7 @@ import org.eclipse.core.runtime.jobs.Job;
|
|||
import org.eclipse.jface.preference.IPersistentPreferenceStore;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
import org.geotools.referencing.datum.DefaultEllipsoid;
|
||||
|
||||
import com.raytheon.uf.common.awipstools.GetWfoCenterPoint;
|
||||
import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
|
@ -70,7 +62,7 @@ import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.common.RangeRing;
|
||||
import com.raytheon.viz.awipstools.common.RangeRing.RangeRingType;
|
||||
import com.raytheon.viz.awipstools.common.StormTrackData;
|
||||
|
@ -93,6 +85,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 10-21-09 #1711 bsteffen Initial Creation
|
||||
* 04-07-10 #4614 randerso Reworked to use localization files
|
||||
* 07-11-12 #875 rferrel Move points to PointsDataManager.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -104,12 +97,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ToolsDataManager.class);
|
||||
|
||||
private static final String HOME_LOCATION_FILE = "HomeLocation.dat";
|
||||
|
||||
private static final String MOVABLE_POINT_PREFIX = "movablePoint";
|
||||
|
||||
private static final String MOVABLE_POINT_EXT = ".txt";
|
||||
|
||||
private static final String BASELINE_PREFIX = "baseline_";
|
||||
|
||||
private static final String BASELINE_EXT = ".txt";
|
||||
|
@ -135,27 +122,13 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
|
||||
private static final GeometryFactory GF = new GeometryFactory();
|
||||
|
||||
private static final GeodeticCalculator GC = new GeodeticCalculator(
|
||||
DefaultEllipsoid.WGS84);
|
||||
|
||||
private static final UnitConverter NM_TO_METERS = NonSI.NAUTICAL_MILE
|
||||
.getConverterTo(SI.METER);
|
||||
|
||||
private static ToolsDataManager theManager = null;
|
||||
|
||||
private Map<String, LineString> baselines;
|
||||
|
||||
private ListenerList baselineListeners = new ListenerList();
|
||||
|
||||
private Map<String, Coordinate> points;
|
||||
|
||||
private ListenerList pointsListeners = new ListenerList();
|
||||
|
||||
private Coordinate home;
|
||||
|
||||
private ListenerList homeListeners = new ListenerList();
|
||||
|
||||
private Coordinate center;
|
||||
private PointsDataManager pointsManager;
|
||||
|
||||
private Collection<RangeRing> rangeRings;
|
||||
|
||||
|
@ -184,6 +157,7 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
site = LocalizationManager.getInstance().getCurrentSite();
|
||||
|
||||
pathMgr = PathManagerFactory.getPathManager();
|
||||
pointsManager = PointsDataManager.getInstance();
|
||||
LocalizationContext userCtx = pathMgr.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
|
||||
|
||||
|
@ -195,55 +169,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
.addPropertyChangeListener(this);
|
||||
}
|
||||
|
||||
public Coordinate getWfoCenter() {
|
||||
if (center == null) {
|
||||
loadCenter();
|
||||
}
|
||||
return new Coordinate(center);
|
||||
}
|
||||
|
||||
public Coordinate getHome() {
|
||||
if (home == null) {
|
||||
loadHome();
|
||||
}
|
||||
return new Coordinate(home);
|
||||
}
|
||||
|
||||
public void setHome(Coordinate home) {
|
||||
if (home == null) {
|
||||
return;
|
||||
}
|
||||
this.home = new Coordinate(home);
|
||||
storeHome();
|
||||
}
|
||||
|
||||
public Collection<String> getPointNames() {
|
||||
return getPoints().keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @return the point coordinate associated with the given name, null if no
|
||||
* point exists by that name
|
||||
*/
|
||||
public Coordinate getPoint(String name) {
|
||||
if (points == null) {
|
||||
getPoints();
|
||||
}
|
||||
Coordinate pointCoordinate = points.get(name);
|
||||
if (pointCoordinate == null) {
|
||||
return null;
|
||||
}
|
||||
return new Coordinate(pointCoordinate);
|
||||
}
|
||||
|
||||
public void setPoint(String name, Coordinate point) {
|
||||
points.put(name, new Coordinate(point));
|
||||
storePoint(userToolsDir, point, MOVABLE_POINT_PREFIX + name
|
||||
+ MOVABLE_POINT_EXT);
|
||||
}
|
||||
|
||||
public Collection<String> getBaselineNames() {
|
||||
return getBaselines().keySet();
|
||||
}
|
||||
|
@ -270,11 +195,11 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
|
||||
public Collection<LineSegment> getDistanceBearings() {
|
||||
Collection<LineSegment> distanceBearings = new ArrayList<LineSegment>();
|
||||
Coordinate center = getHome();
|
||||
Coordinate center = pointsManager.getHome();
|
||||
for (int i = 0; i < 6; i++) {
|
||||
Coordinate start = getCoordinateOnCircle(center,
|
||||
Coordinate start = pointsManager.getCoordinateOnCircle(center,
|
||||
DEFAULT_LINE_RADIUS[i], DEFAULT_LINE_STARTDIR[i]);
|
||||
Coordinate end = getCoordinateOnCircle(center,
|
||||
Coordinate end = pointsManager.getCoordinateOnCircle(center,
|
||||
DEFAULT_LINE_RADIUS[i], DEFAULT_LINE_ENDDIR[i]);
|
||||
LineSegment line = new LineSegment(start, end);
|
||||
distanceBearings.add(line);
|
||||
|
@ -400,24 +325,14 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
return baselines;
|
||||
}
|
||||
|
||||
private Map<String, Coordinate> getPoints() {
|
||||
if (points == null || points.isEmpty()) {
|
||||
loadPoints();
|
||||
if (points == null || points.isEmpty()) {
|
||||
createDefaultPoints();
|
||||
}
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
private void createDefaultBaselines() {
|
||||
baselines = new LinkedHashMap<String, LineString>();
|
||||
Coordinate center = getHome();
|
||||
Coordinate center = pointsManager.getHome();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
String label = String.valueOf((char) ('A' + i));
|
||||
Coordinate start = getCoordinateOnCircle(center,
|
||||
Coordinate start = pointsManager.getCoordinateOnCircle(center,
|
||||
DEFAULT_LINE_RADIUS[i], DEFAULT_LINE_STARTDIR[i]);
|
||||
Coordinate end = getCoordinateOnCircle(center,
|
||||
Coordinate end = pointsManager.getCoordinateOnCircle(center,
|
||||
DEFAULT_LINE_RADIUS[i], DEFAULT_LINE_ENDDIR[i]);
|
||||
LineString baseline = GF.createLineString(new Coordinate[] { start,
|
||||
end });
|
||||
|
@ -426,19 +341,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
}
|
||||
}
|
||||
|
||||
private void createDefaultPoints() {
|
||||
points = new HashMap<String, Coordinate>();
|
||||
Coordinate center = getHome();
|
||||
int baseRingSize = 120;
|
||||
int startAngle = -90;
|
||||
for (char label = 'A'; label <= 'J'; label++) {
|
||||
Coordinate point = getCoordinateOnCircle(center, baseRingSize,
|
||||
startAngle);
|
||||
setPoint(String.valueOf(label), point);
|
||||
startAngle += 36;
|
||||
}
|
||||
}
|
||||
|
||||
private void createDefaultRangeRings() {
|
||||
LocalizationManager loc = LocalizationManager.getInstance();
|
||||
|
||||
|
@ -541,47 +443,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
baselineStoreJob.schedule();
|
||||
}
|
||||
|
||||
private void storeHome() {
|
||||
storePoint(userToolsDir, home, HOME_LOCATION_FILE);
|
||||
}
|
||||
|
||||
private void storePoint(LocalizationFile dir, Coordinate point,
|
||||
String fileName) {
|
||||
|
||||
LocalizationFile lf = pathMgr.getLocalizationFile(dir.getContext(),
|
||||
dir.getName() + File.separator + fileName);
|
||||
File file = lf.getFile();
|
||||
|
||||
// create the local directory if necessary
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
BufferedWriter out = null;
|
||||
try {
|
||||
out = new BufferedWriter(new FileWriter(file));
|
||||
out.write(String.format("%f %f\n", point.y, point.x));
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Error writing to file: "
|
||||
+ file.getAbsolutePath(), e);
|
||||
} finally {
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
lf.save();
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error writing to file: " + file.getAbsolutePath(),
|
||||
e);
|
||||
} catch (LocalizationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error storing locatization file to server: " + lf,
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void storeRangeRings() {
|
||||
StringBuilder pref = new StringBuilder();
|
||||
for (RangeRing ring : rangeRings) {
|
||||
|
@ -635,91 +496,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
}
|
||||
}
|
||||
|
||||
private void loadCenter() {
|
||||
try {
|
||||
// Request center point from server
|
||||
center = (Coordinate) ThriftClient
|
||||
.sendLocalizationRequest(new GetWfoCenterPoint(site));
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to get WFO center for \"" + site + "\"", e);
|
||||
}
|
||||
if (center == null) {
|
||||
center = new Coordinate(-96.2, 41.2);
|
||||
}
|
||||
}
|
||||
|
||||
private Coordinate loadHome() {
|
||||
home = loadPoint(userToolsDir, HOME_LOCATION_FILE);
|
||||
if (home == null) {
|
||||
home = getWfoCenter();
|
||||
storeHome();
|
||||
}
|
||||
return home;
|
||||
}
|
||||
|
||||
private void loadPoints() {
|
||||
points = new HashMap<String, Coordinate>();
|
||||
|
||||
LocalizationFile[] files = pathMgr.listFiles(userToolsDir.getContext(),
|
||||
userToolsDir.getName(), new String[] { MOVABLE_POINT_EXT },
|
||||
false, true);
|
||||
for (LocalizationFile lf : files) {
|
||||
String fileName = lf.getFile().getName();
|
||||
if (fileName.startsWith(MOVABLE_POINT_PREFIX)) {
|
||||
Coordinate point = loadPoint(userToolsDir, fileName);
|
||||
String name = fileName.substring(MOVABLE_POINT_PREFIX.length())
|
||||
.replace(MOVABLE_POINT_EXT, "");
|
||||
points.put(name, point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Coordinate loadPoint(LocalizationFile dir, String fileName) {
|
||||
Coordinate point = null;
|
||||
|
||||
LocalizationFile lf = pathMgr.getLocalizationFile(dir.getContext(),
|
||||
dir.getName() + File.separator + fileName);
|
||||
File file = lf.getFile();
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
in = new BufferedReader(new FileReader(file));
|
||||
String line = in.readLine();
|
||||
line = line.trim();
|
||||
int p = line.indexOf(' ');
|
||||
double lat = Double.parseDouble(line.substring(0, p));
|
||||
double lon = Double.parseDouble(line.substring(p));
|
||||
|
||||
if (lat > 90.0 || lat < -90.0 || lon > 180.0 || lon < -180.0) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"Invalid lat/lon in wfo center point file, using default");
|
||||
} else {
|
||||
point = new Coordinate(lon, lat);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"Invalid number in wfo center point file, using default",
|
||||
e);
|
||||
} catch (FileNotFoundException e) {
|
||||
statusHandler.handle(Priority.EVENTA,
|
||||
"No wfo center point file found, creating default.");
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error reading wfo center point file, using default", e);
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
private LineString loadBaseline(String fileName) {
|
||||
LineString baseline = null;
|
||||
|
||||
|
@ -806,20 +582,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
}
|
||||
}
|
||||
|
||||
private Coordinate getCoordinateOnCircle(Coordinate coor, double radius,
|
||||
int angle) {
|
||||
|
||||
if (angle > 180) {
|
||||
angle = angle - 360;
|
||||
}
|
||||
GC.setStartingGeographicPoint(coor.x, coor.y);
|
||||
GC.setDirection(angle, NM_TO_METERS.convert(radius));
|
||||
|
||||
return new Coordinate(GC.getDestinationGeographicPoint().getX(), GC
|
||||
.getDestinationGeographicPoint().getY());
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -830,26 +592,10 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
@Override
|
||||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
String fileName = new File(message.getFileName()).getName();
|
||||
|
||||
if (fileName.startsWith(MOVABLE_POINT_PREFIX)) {
|
||||
pointsFileUpdated(fileName);
|
||||
} else if (fileName.startsWith(BASELINE_PREFIX)) {
|
||||
if (fileName.startsWith(BASELINE_PREFIX)) {
|
||||
baselineFileUpdated(fileName);
|
||||
} else if (fileName.startsWith(HOME_LOCATION_FILE)) {
|
||||
homeLocationFileUpdated(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
private void pointsFileUpdated(String fileName) {
|
||||
if (points != null) {
|
||||
Coordinate point = loadPoint(userToolsDir, fileName);
|
||||
String name = fileName.substring(MOVABLE_POINT_PREFIX.length())
|
||||
.replace(MOVABLE_POINT_EXT, "");
|
||||
points.put(name, point);
|
||||
|
||||
for (Object listener : pointsListeners.getListeners()) {
|
||||
((IToolChangedListener) listener).toolChanged();
|
||||
}
|
||||
} else {
|
||||
pointsManager.fileUpdated(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -866,43 +612,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
}
|
||||
}
|
||||
|
||||
private void homeLocationFileUpdated(String fileName) {
|
||||
if (home != null) {
|
||||
loadHome();
|
||||
|
||||
ArrayList<Thread> threads = new ArrayList<Thread>(
|
||||
homeListeners.size());
|
||||
for (final Object listener : homeListeners.getListeners()) {
|
||||
// fire listeners in separate threads to avoid waiting to draw
|
||||
// the updated location while waiting on another listener to
|
||||
// finish
|
||||
Thread t = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
((IToolChangedListener) listener).toolChanged();
|
||||
}
|
||||
|
||||
});
|
||||
threads.add(t);
|
||||
t.start();
|
||||
}
|
||||
|
||||
// join all threads before continuing so we can't fire listeners
|
||||
// again until all have finished
|
||||
for (Thread t : threads) {
|
||||
try {
|
||||
t.join();
|
||||
} catch (InterruptedException e) {
|
||||
statusHandler.handle(
|
||||
Priority.SIGNIFICANT,
|
||||
"Unexpected Interruption from: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
|
@ -917,34 +626,6 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
baselineListeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void addPointsChangedListener(IToolChangedListener listener) {
|
||||
pointsListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void removePointsChangedListener(IToolChangedListener listener) {
|
||||
pointsListeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void addHomeChangedListener(IToolChangedListener listener) {
|
||||
homeListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
public void removeHomeChangedListener(IToolChangedListener listener) {
|
||||
homeListeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener
|
||||
*/
|
||||
|
@ -994,5 +675,4 @@ public class ToolsDataManager implements ILocalizationFileObserver,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.awipstools.ui.layer.HomeToolLayer;
|
||||
import com.raytheon.viz.awipstools.ui.layer.InteractiveBaselinesLayer;
|
||||
|
@ -193,7 +194,7 @@ public class ChooseByIdDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
private boolean isPoint() {
|
||||
return (!isBaseline && ToolsDataManager.getInstance().getPoint(
|
||||
return (!isBaseline && PointsDataManager.getInstance().getPoint(
|
||||
idName) != null);
|
||||
}
|
||||
|
||||
|
@ -307,7 +308,7 @@ public class ChooseByIdDialog extends CaveSWTDialog {
|
|||
private void updatePosition(List<Coordinate> stationCoordinates) {
|
||||
|
||||
if (isPoint()) {
|
||||
ToolsDataManager.getInstance().setPoint(idName,
|
||||
PointsDataManager.getInstance().setPoint(idName,
|
||||
stationCoordinates.get(0));
|
||||
refreshToolLayer(pointsToolLayer);
|
||||
|
||||
|
@ -320,7 +321,7 @@ public class ChooseByIdDialog extends CaveSWTDialog {
|
|||
refreshToolLayer(baselinesToolLayer);
|
||||
|
||||
} else if (isHome()) {
|
||||
ToolsDataManager.getInstance().setHome(
|
||||
PointsDataManager.getInstance().setHome(
|
||||
stationCoordinates.get(0));
|
||||
refreshToolLayer(homeToolLayer);
|
||||
}
|
||||
|
@ -512,14 +513,14 @@ public class ChooseByIdDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
if (isHome()) {
|
||||
Coordinate homeCoordinate = ToolsDataManager.getInstance()
|
||||
Coordinate homeCoordinate = PointsDataManager.getInstance()
|
||||
.getHome();
|
||||
|
||||
stationLocationHasChanged = (!homeCoordinate
|
||||
.equals(stationCoordinates.get(0)));
|
||||
|
||||
} else if (isPoint()) {
|
||||
Coordinate pointCoordinate = ToolsDataManager.getInstance()
|
||||
Coordinate pointCoordinate = PointsDataManager.getInstance()
|
||||
.getPoint(idName);
|
||||
|
||||
stationLocationHasChanged = (!pointCoordinate
|
||||
|
@ -635,7 +636,7 @@ public class ChooseByIdDialog extends CaveSWTDialog {
|
|||
|
||||
private void createIdBoxes() {
|
||||
|
||||
String[] pointNames = ToolsDataManager.getInstance().getPointNames()
|
||||
String[] pointNames = PointsDataManager.getInstance().getPointNames()
|
||||
.toArray(new String[] {});
|
||||
Arrays.sort(pointNames);
|
||||
for (String point : pointNames) {
|
||||
|
|
|
@ -75,7 +75,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
@ -164,7 +164,7 @@ public class PutHomeCursorDialog extends CaveJFACEDialog implements
|
|||
createCityChoice();
|
||||
createLatLonChoice();
|
||||
try {
|
||||
updateStationInfo(ToolsDataManager.getInstance().getHome());
|
||||
updateStationInfo(PointsDataManager.getInstance().getHome());
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ public class PutHomeCursorDialog extends CaveJFACEDialog implements
|
|||
longLabel.setText("Longitude:");
|
||||
lonTextField = new Text(comp, SWT.BORDER);
|
||||
lonTextField.setLayoutData(new GridData(80, SWT.DEFAULT));
|
||||
Coordinate point = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate point = PointsDataManager.getInstance().getHome();
|
||||
lonTextField.setText(String.valueOf(point.x));
|
||||
latTextField.setText(String.valueOf(point.y));
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ public class PutHomeCursorDialog extends CaveJFACEDialog implements
|
|||
"Could not find that Metar station");
|
||||
stationTextField.setFocus();
|
||||
} else {
|
||||
ToolsDataManager.getInstance().setHome(c);
|
||||
PointsDataManager.getInstance().setHome(c);
|
||||
resourceData.fireChangeListeners(ChangeType.DATA_UPDATE,
|
||||
null);
|
||||
stationTextField.setText(station);
|
||||
|
@ -400,7 +400,7 @@ public class PutHomeCursorDialog extends CaveJFACEDialog implements
|
|||
"Put Home Cursor Error", "Could not find that city");
|
||||
cityTextField.setFocus();
|
||||
} else {
|
||||
ToolsDataManager.getInstance().setHome(c);
|
||||
PointsDataManager.getInstance().setHome(c);
|
||||
resourceData.fireChangeListeners(ChangeType.DATA_UPDATE, null);
|
||||
cityTextField.setText(city);
|
||||
stateTextField.setText(state);
|
||||
|
@ -433,7 +433,7 @@ public class PutHomeCursorDialog extends CaveJFACEDialog implements
|
|||
latTextField.setFocus();
|
||||
return;
|
||||
}
|
||||
ToolsDataManager.getInstance().setHome(c);
|
||||
PointsDataManager.getInstance().setHome(c);
|
||||
resourceData.fireChangeListeners(ChangeType.DATA_UPDATE, null);
|
||||
}
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ public class PutHomeCursorDialog extends CaveJFACEDialog implements
|
|||
|
||||
@Override
|
||||
public void resourceChanged(ChangeType type, Object object) {
|
||||
Coordinate point = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate point = PointsDataManager.getInstance().getHome();
|
||||
lonTextField.setText(String.valueOf(point.x));
|
||||
latTextField.setText(String.valueOf(point.y));
|
||||
// find the nearest station and update the fields.
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.awipstools.common.RangeRing;
|
||||
import com.raytheon.viz.awipstools.common.RangeRing.RangeRingType;
|
||||
|
@ -54,20 +55,21 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
|||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Dialog for managing the displaying of points in the D2D's Range Rings view.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 10-21-09 #732 bsteffen Fixed Many issues
|
||||
* 07-11-12 #875 rferrel Bug fix for check box on
|
||||
* unapplied points.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class RangeRingDialog extends CaveJFACEDialog implements
|
||||
IResourceDataChanged {
|
||||
|
||||
|
@ -132,7 +134,10 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
|
||||
private final AbstractResourceData resourceData;
|
||||
|
||||
private ToolsDataManager dataManager = ToolsDataManager.getInstance();
|
||||
private ToolsDataManager toolsDataManager = ToolsDataManager.getInstance();
|
||||
|
||||
private PointsDataManager pointsDataManager = PointsDataManager
|
||||
.getInstance();
|
||||
|
||||
private Collection<FixedRingRow> fixedRings = new ArrayList<FixedRingRow>();
|
||||
|
||||
|
@ -234,13 +239,13 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
true, true, 1, 1));
|
||||
new Label(createComposite, SWT.NONE).setText("New at: ");
|
||||
Combo combo = new Combo(createComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||
Collection<String> points = dataManager.getPointNames();
|
||||
Collection<String> points = pointsDataManager.getPointNames();
|
||||
ArrayList<String> items = new ArrayList<String>();
|
||||
items.add(LATLON);
|
||||
for (String point : points) {
|
||||
items.add("Point " + point);
|
||||
}
|
||||
Collection<RangeRing> rangeRings = dataManager.getRangeRings();
|
||||
Collection<RangeRing> rangeRings = toolsDataManager.getRangeRings();
|
||||
for (RangeRing ring : rangeRings) {
|
||||
if (ring.getType() == RangeRingType.FIXED) {
|
||||
items.add(ring.getId());
|
||||
|
@ -293,7 +298,7 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
}
|
||||
row.id.setText(id);
|
||||
} else {
|
||||
Collection<String> points = dataManager.getPointNames();
|
||||
Collection<String> points = pointsDataManager.getPointNames();
|
||||
String selectedPoint = null;
|
||||
for (String point : points) {
|
||||
if (selection.equals("Point " + point)) {
|
||||
|
@ -303,7 +308,7 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
}
|
||||
if (selectedPoint != null) {
|
||||
row.id.setText(selection);
|
||||
Coordinate loc = dataManager.getPoint(selectedPoint);
|
||||
Coordinate loc = pointsDataManager.getPoint(selectedPoint);
|
||||
row.lon.setText(String.valueOf(loc.x));
|
||||
row.lat.setText(String.valueOf(loc.y));
|
||||
} else {
|
||||
|
@ -364,7 +369,9 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
row.ring.setVisible(row.enabled.getSelection());
|
||||
if (row.ring != null) {
|
||||
row.ring.setVisible(row.enabled.getSelection());
|
||||
}
|
||||
}
|
||||
});
|
||||
row.id = new Text(movableRingsComposite, SWT.SINGLE | SWT.BORDER);
|
||||
|
@ -462,7 +469,7 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
}
|
||||
fixedRings.clear();
|
||||
movableRings.clear();
|
||||
Collection<RangeRing> rangeRings = dataManager.getRangeRings();
|
||||
Collection<RangeRing> rangeRings = toolsDataManager.getRangeRings();
|
||||
for (RangeRing ring : rangeRings) {
|
||||
if (ring.getType() == RangeRingType.FIXED) {
|
||||
FixedRingRow row = getNewFixedRow();
|
||||
|
@ -499,7 +506,7 @@ public class RangeRingDialog extends CaveJFACEDialog implements
|
|||
String label = row.label.getText();
|
||||
rangeRings.add(new RangeRing(id, center, radius, label, enabled));
|
||||
}
|
||||
dataManager.setRangeRings(rangeRings);
|
||||
toolsDataManager.setRangeRings(rangeRings);
|
||||
resourceData.fireChangeListeners(ChangeType.DATA_UPDATE, null);
|
||||
load();
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.common.SunriseSunsetCalculator;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* 10-21-09 #1711 bsteffen Modified to use datamanager for home location
|
||||
* 25May2010 5603 bkowal Added additional timezones based on the timezones
|
||||
* that were present in AWIPSI.
|
||||
* 11Jul2012 875 rferrel Now uses PointsDataManager
|
||||
* </pre>
|
||||
*
|
||||
* @author Eric Babin
|
||||
|
@ -166,8 +167,6 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
private float latitudeValue;
|
||||
|
||||
private float longitudeValue;
|
||||
|
||||
|
||||
|
||||
private DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
||||
|
||||
|
@ -175,89 +174,45 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
// right.
|
||||
|
||||
/*
|
||||
String zoneStrings[] = {
|
||||
TimeZone.getTimeZone("Pacific/Guam").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (+" + TimeZone.getTimeZone("Pacific/Guam").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("HST").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("HST").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("AST").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("AST").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("AST").getDisplayName(true, TimeZone.SHORT)
|
||||
+ " ("
|
||||
+ (TimeZone.getTimeZone("AST").getRawOffset() + 100000)
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("PST").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("PST").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("PST").getDisplayName(true, TimeZone.SHORT)
|
||||
+ " ("
|
||||
+ (TimeZone.getTimeZone("PST").getRawOffset() + 100000)
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("MST").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("MST").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("MST").getDisplayName(true, TimeZone.SHORT)
|
||||
+ " ("
|
||||
+ (TimeZone.getTimeZone("MST").getRawOffset() + 100000)
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("CST").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("CST").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("CST").getDisplayName(true, TimeZone.SHORT)
|
||||
+ " ("
|
||||
+ (TimeZone.getTimeZone("CST").getRawOffset() + 100000)
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("EST").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("EST").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("EST").getDisplayName(true, TimeZone.SHORT)
|
||||
+ " ("
|
||||
+ (TimeZone.getTimeZone("EST").getRawOffset() + 100000)
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("SystemV/AST4").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (" + TimeZone.getTimeZone("SystemV/AST4").getRawOffset()
|
||||
/ 3600000 + ")",
|
||||
TimeZone.getTimeZone("GMT").getDisplayName(false, TimeZone.SHORT)
|
||||
+ " (0)" };
|
||||
*/
|
||||
final String timeZoneIDs[] =
|
||||
{
|
||||
"Pacific/Guam",
|
||||
"HST",
|
||||
"AST",
|
||||
"AST",
|
||||
"PST",
|
||||
"PST",
|
||||
"MST",
|
||||
"MST",
|
||||
"CST",
|
||||
"CST",
|
||||
"EST",
|
||||
"EST",
|
||||
"SystemV/AST4",
|
||||
"GMT"
|
||||
};
|
||||
final boolean daylightIndicators[] =
|
||||
{
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
};
|
||||
|
||||
* String zoneStrings[] = {
|
||||
* TimeZone.getTimeZone("Pacific/Guam").getDisplayName(false,
|
||||
* TimeZone.SHORT) + " (+" +
|
||||
* TimeZone.getTimeZone("Pacific/Guam").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("HST").getDisplayName(false, TimeZone.SHORT) + " ("
|
||||
* + TimeZone.getTimeZone("HST").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("AST").getDisplayName(false, TimeZone.SHORT) + " ("
|
||||
* + TimeZone.getTimeZone("AST").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("AST").getDisplayName(true, TimeZone.SHORT) + " (" +
|
||||
* (TimeZone.getTimeZone("AST").getRawOffset() + 100000) / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("PST").getDisplayName(false, TimeZone.SHORT) + " ("
|
||||
* + TimeZone.getTimeZone("PST").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("PST").getDisplayName(true, TimeZone.SHORT) + " (" +
|
||||
* (TimeZone.getTimeZone("PST").getRawOffset() + 100000) / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("MST").getDisplayName(false, TimeZone.SHORT) + " ("
|
||||
* + TimeZone.getTimeZone("MST").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("MST").getDisplayName(true, TimeZone.SHORT) + " (" +
|
||||
* (TimeZone.getTimeZone("MST").getRawOffset() + 100000) / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("CST").getDisplayName(false, TimeZone.SHORT) + " ("
|
||||
* + TimeZone.getTimeZone("CST").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("CST").getDisplayName(true, TimeZone.SHORT) + " (" +
|
||||
* (TimeZone.getTimeZone("CST").getRawOffset() + 100000) / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("EST").getDisplayName(false, TimeZone.SHORT) + " ("
|
||||
* + TimeZone.getTimeZone("EST").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("EST").getDisplayName(true, TimeZone.SHORT) + " (" +
|
||||
* (TimeZone.getTimeZone("EST").getRawOffset() + 100000) / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("SystemV/AST4").getDisplayName(false,
|
||||
* TimeZone.SHORT) + " (" +
|
||||
* TimeZone.getTimeZone("SystemV/AST4").getRawOffset() / 3600000 + ")",
|
||||
* TimeZone.getTimeZone("GMT").getDisplayName(false, TimeZone.SHORT) +
|
||||
* " (0)" };
|
||||
*/
|
||||
final String timeZoneIDs[] = { "Pacific/Guam", "HST", "AST", "AST", "PST",
|
||||
"PST", "MST", "MST", "CST", "CST", "EST", "EST", "SystemV/AST4",
|
||||
"GMT" };
|
||||
|
||||
final boolean daylightIndicators[] = { false, false, false, true, false,
|
||||
true, false, true, false, true, false, true, false, false };
|
||||
|
||||
private LinkedHashMap<String, String> timezonesMap;
|
||||
|
||||
public SunriseToolDialog(Shell parShell, String dialogTitle)
|
||||
|
@ -269,7 +224,7 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
yyyyMMdd = sdf.format(SimulatedTime.getSystemTime().getTime());
|
||||
|
||||
Coordinate center = ToolsDataManager.getInstance().getWfoCenter();
|
||||
Coordinate center = PointsDataManager.getInstance().getWfoCenter();
|
||||
latitudeValue = (float) center.y;
|
||||
longitudeValue = (float) center.x;
|
||||
|
||||
|
@ -298,36 +253,33 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
|
||||
return top;
|
||||
}
|
||||
|
||||
private void setupTimezones()
|
||||
{
|
||||
TimeZone timeZone = null;
|
||||
String displayName = null;
|
||||
String displayText = null;
|
||||
boolean dlIndicator = false;
|
||||
|
||||
int additionalOffset = -1;
|
||||
|
||||
timezonesMap = new LinkedHashMap<String, String>();
|
||||
for (int i = 0; i < timeZoneIDs.length; i++)
|
||||
{
|
||||
dlIndicator = daylightIndicators[i];
|
||||
|
||||
timeZone = TimeZone.getTimeZone(timeZoneIDs[i]);
|
||||
|
||||
additionalOffset = 0;
|
||||
if (dlIndicator)
|
||||
{
|
||||
additionalOffset = 1000000;
|
||||
}
|
||||
|
||||
displayName = timeZone.getDisplayName(
|
||||
dlIndicator, TimeZone.SHORT);
|
||||
displayText = displayName + "(" +
|
||||
(timeZone.getRawOffset() + additionalOffset) / 3600000 + ")";
|
||||
|
||||
timezonesMap.put(displayText, displayName);
|
||||
}
|
||||
|
||||
private void setupTimezones() {
|
||||
TimeZone timeZone = null;
|
||||
String displayName = null;
|
||||
String displayText = null;
|
||||
boolean dlIndicator = false;
|
||||
|
||||
int additionalOffset = -1;
|
||||
|
||||
timezonesMap = new LinkedHashMap<String, String>();
|
||||
for (int i = 0; i < timeZoneIDs.length; i++) {
|
||||
dlIndicator = daylightIndicators[i];
|
||||
|
||||
timeZone = TimeZone.getTimeZone(timeZoneIDs[i]);
|
||||
|
||||
additionalOffset = 0;
|
||||
if (dlIndicator) {
|
||||
additionalOffset = 1000000;
|
||||
}
|
||||
|
||||
displayName = timeZone.getDisplayName(dlIndicator, TimeZone.SHORT);
|
||||
displayText = displayName + "("
|
||||
+ (timeZone.getRawOffset() + additionalOffset) / 3600000
|
||||
+ ")";
|
||||
|
||||
timezonesMap.put(displayText, displayName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -397,9 +349,9 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
* Method for creating the month, day, ect labels and fields.
|
||||
*/
|
||||
private void createToolControls() {
|
||||
String[] zoneStrings = null;
|
||||
Iterator<String> tzIterator = null;
|
||||
|
||||
String[] zoneStrings = null;
|
||||
Iterator<String> tzIterator = null;
|
||||
|
||||
sunriseFieldComposite = new Composite(top, SWT.NONE);
|
||||
sunriseFieldComposite.setLayout(new FormLayout());
|
||||
sunriseFieldComposite.setSize(80, 360);
|
||||
|
@ -478,7 +430,7 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
setHomeLocButton.addListener(SWT.MouseUp, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
Coordinate home = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate home = PointsDataManager.getInstance().getHome();
|
||||
longitudeValue = (float) home.x;
|
||||
latitudeValue = (float) home.y;
|
||||
longitudeText.setText(String.valueOf(longitudeValue));
|
||||
|
@ -571,16 +523,15 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
zoneLabel = new Label(sunriseFieldComposite, SWT.NONE);
|
||||
zoneLabel.setText("Zone:");
|
||||
zoneLabel.setLayoutData(createFormLayoutLoc(true));
|
||||
|
||||
|
||||
zoneStrings = new String[timezonesMap.size()];
|
||||
tzIterator = timezonesMap.keySet().iterator();
|
||||
String key = null;
|
||||
for (int i = 0; i < zoneStrings.length; i++)
|
||||
{
|
||||
zoneStrings[i] = tzIterator.next();
|
||||
key = tzIterator.toString();
|
||||
for (int i = 0; i < zoneStrings.length; i++) {
|
||||
zoneStrings[i] = tzIterator.next();
|
||||
key = tzIterator.toString();
|
||||
}
|
||||
|
||||
|
||||
zoneCombo = new Combo(sunriseFieldComposite, SWT.DROP_DOWN);
|
||||
zoneCombo.setItems(zoneStrings);
|
||||
data = createFormLayoutLoc(false);
|
||||
|
@ -593,7 +544,7 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (zoneCombo.getSelectionIndex() != -1) {
|
||||
zone = timezonesMap.get(zoneCombo.getText());
|
||||
zone = timezonesMap.get(zoneCombo.getText());
|
||||
} else {
|
||||
zone = "GMT";
|
||||
}
|
||||
|
@ -614,18 +565,15 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
* the current.
|
||||
*/
|
||||
private void setCurrentTimeZone(String[] zoneStrings) {
|
||||
String lTimeZoneString = null;
|
||||
String lTimeZoneString = null;
|
||||
|
||||
lTimeZoneString = localTimeZoneString();
|
||||
if (timezonesMap.containsValue(lTimeZoneString))
|
||||
{
|
||||
for (int i = 0; i < zoneStrings.length; i++)
|
||||
{
|
||||
if (zoneStrings[i].contains(lTimeZoneString + "("))
|
||||
{
|
||||
zoneCombo.setText(zoneStrings[i]);
|
||||
}
|
||||
}
|
||||
if (timezonesMap.containsValue(lTimeZoneString)) {
|
||||
for (int i = 0; i < zoneStrings.length; i++) {
|
||||
if (zoneStrings[i].contains(lTimeZoneString + "(")) {
|
||||
zoneCombo.setText(zoneStrings[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -713,22 +661,26 @@ public class SunriseToolDialog extends CaveJFACEDialog {
|
|||
// e.gc.setFont(originalFont);
|
||||
e.gc.setLineWidth(2);
|
||||
// N-S line.
|
||||
e.gc.drawString("N", CIRCLE_X + CIRCLE_SIZE / 2
|
||||
- e.gc.getCharWidth('N') / 2, CIRCLE_Y
|
||||
- e.gc.getFontMetrics().getHeight());
|
||||
e.gc.drawString(
|
||||
"N",
|
||||
CIRCLE_X + CIRCLE_SIZE / 2 - e.gc.getCharWidth('N') / 2,
|
||||
CIRCLE_Y - e.gc.getFontMetrics().getHeight());
|
||||
e.gc.drawLine(CIRCLE_X + CIRCLE_SIZE / 2, CIRCLE_Y, CIRCLE_X
|
||||
+ CIRCLE_SIZE / 2, CIRCLE_Y + CIRCLE_SIZE);
|
||||
e.gc.drawString("S", CIRCLE_X + CIRCLE_SIZE / 2
|
||||
- e.gc.getCharWidth('S') / 2, CIRCLE_Y + CIRCLE_SIZE);
|
||||
e.gc.drawString(
|
||||
"S",
|
||||
CIRCLE_X + CIRCLE_SIZE / 2 - e.gc.getCharWidth('S') / 2,
|
||||
CIRCLE_Y + CIRCLE_SIZE);
|
||||
// W-E line.
|
||||
e.gc.drawString("W", CIRCLE_X - e.gc.getCharWidth('W'),
|
||||
CIRCLE_Y + CIRCLE_SIZE / 2
|
||||
- e.gc.getFontMetrics().getHeight() / 2);
|
||||
e.gc.drawLine(CIRCLE_X, CIRCLE_Y + CIRCLE_SIZE / 2, CIRCLE_X
|
||||
+ CIRCLE_SIZE, CIRCLE_Y + CIRCLE_SIZE / 2);
|
||||
e.gc.drawString("E", CIRCLE_X + CIRCLE_SIZE
|
||||
+ e.gc.getCharWidth('E') / 2, CIRCLE_Y + CIRCLE_SIZE
|
||||
/ 2 - e.gc.getFontMetrics().getHeight() / 2);
|
||||
e.gc.drawString("E",
|
||||
CIRCLE_X + CIRCLE_SIZE + e.gc.getCharWidth('E') / 2,
|
||||
CIRCLE_Y + CIRCLE_SIZE / 2
|
||||
- e.gc.getFontMetrics().getHeight() / 2);
|
||||
}
|
||||
});
|
||||
return canvas;
|
||||
|
|
|
@ -56,7 +56,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.common.stormtrack.StormTrackDisplay;
|
||||
import com.raytheon.viz.awipstools.common.stormtrack.StormTrackUIManager;
|
||||
import com.raytheon.viz.awipstools.ui.display.AwipsToolsResourceData;
|
||||
|
@ -192,7 +192,7 @@ public class AzimuthToolLayer extends
|
|||
super(data, props);
|
||||
setDescriptor(descriptor);
|
||||
data.addChangeListener(this);
|
||||
this.currCoordinate = ToolsDataManager.getInstance().getHome();
|
||||
this.currCoordinate = PointsDataManager.getInstance().getHome();
|
||||
this.centerPixel = descriptor.worldToPixel(new double[] {
|
||||
currCoordinate.x, currCoordinate.y });
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.ui.display.AwipsToolsResourceData;
|
||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
import com.raytheon.viz.ui.cmenu.IContextMenuContributor;
|
||||
|
@ -73,7 +73,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
|
||||
public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
|
||||
implements IContextMenuContributor, IToolChangedListener {
|
||||
implements IContextMenuContributor, IPointChangedListener {
|
||||
|
||||
public static final String DEFAULT_NAME = "Home Location";
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
|
|||
|
||||
private final AbstractRightClickAction moveElementAction;
|
||||
|
||||
private ToolsDataManager dataManager = ToolsDataManager.getInstance();
|
||||
private PointsDataManager dataManager = PointsDataManager.getInstance();
|
||||
|
||||
private GeodeticCalculator gc;
|
||||
|
||||
|
@ -121,7 +121,7 @@ public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
|
|||
}
|
||||
|
||||
private void resetHome() {
|
||||
Coordinate home = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate home = dataManager.getHome();
|
||||
Collection<Coordinate> dummy = new ArrayList<Coordinate>();
|
||||
dummy.add(home);
|
||||
setObjects(dummy);
|
||||
|
@ -182,7 +182,7 @@ public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
|
|||
|
||||
double azimuth = 000;
|
||||
|
||||
Coordinate home = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate home = dataManager.getHome();
|
||||
|
||||
gc.setStartingGeographicPoint(home.x, home.y);
|
||||
gc.setDestinationGeographicPoint(dest.x, dest.y);
|
||||
|
@ -219,7 +219,7 @@ public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
|
|||
}
|
||||
|
||||
@Override
|
||||
public void toolChanged() {
|
||||
public void pointChanged() {
|
||||
resetHome();
|
||||
issueRefresh();
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
|
|||
|
||||
@Override
|
||||
protected void save(Coordinate oldCoordinate, Coordinate coordinate) {
|
||||
ToolsDataManager.getInstance().setHome(coordinate);
|
||||
dataManager.setHome(coordinate);
|
||||
resourceData.fireChangeListeners(ChangeType.DATA_UPDATE, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
|||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.ui.display.AwipsToolsResourceData;
|
||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
import com.raytheon.viz.ui.cmenu.IContextMenuContributor;
|
||||
|
@ -77,7 +77,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* @version 1
|
||||
*/
|
||||
public class PointsToolLayer extends AbstractMovableToolLayer<Point> implements
|
||||
IContextMenuContributor, IToolChangedListener, IResourceDataChanged {
|
||||
IContextMenuContributor, IPointChangedListener, IResourceDataChanged {
|
||||
|
||||
public static final String DEFAULT_NAME = "Interactive Points";
|
||||
|
||||
|
@ -85,7 +85,7 @@ public class PointsToolLayer extends AbstractMovableToolLayer<Point> implements
|
|||
|
||||
private AbstractRightClickAction moveElementAction;
|
||||
|
||||
private ToolsDataManager dataManager = ToolsDataManager.getInstance();
|
||||
private PointsDataManager dataManager = PointsDataManager.getInstance();
|
||||
|
||||
private static GeometryFactory gf = new GeometryFactory();
|
||||
|
||||
|
@ -218,7 +218,7 @@ public class PointsToolLayer extends AbstractMovableToolLayer<Point> implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void toolChanged() {
|
||||
public void pointChanged() {
|
||||
resetPoints();
|
||||
issueRefresh();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ import com.raytheon.uf.viz.core.rsc.IInputHandler;
|
|||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.ui.display.AwipsToolsResourceData;
|
||||
import com.raytheon.viz.ui.input.EditableManager;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -276,7 +276,7 @@ public class ShearLayer extends
|
|||
|
||||
public LineString createDefaultBaseline() {
|
||||
|
||||
Coordinate center = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate center = PointsDataManager.getInstance().getHome();
|
||||
|
||||
gc.setStartingGeographicPoint(center.x, center.y);
|
||||
double meters = nmToMeter.convert(27);
|
||||
|
|
|
@ -21,7 +21,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.viz.radar,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.viz.productbrowser;bundle-version="1.11.31",
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.grid,
|
||||
com.raytheon.viz.grid.gridcache,
|
||||
|
|
|
@ -68,8 +68,8 @@ import com.raytheon.uf.viz.derivparam.tree.AbstractRequestableLevelNode;
|
|||
import com.raytheon.uf.viz.derivparam.tree.AbstractRequestableLevelNode.Dependency;
|
||||
import com.raytheon.uf.viz.derivparam.tree.CubeLevel;
|
||||
import com.raytheon.uf.viz.derivparam.tree.StaticDataLevelNode;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.grid.data.ImportRequestableData;
|
||||
import com.raytheon.viz.grid.data.StaticGridRequestableData;
|
||||
import com.raytheon.viz.grid.data.TiltRequestableData;
|
||||
|
@ -94,7 +94,7 @@ import com.raytheon.viz.grid.util.RadarAdapter;
|
|||
*/
|
||||
|
||||
public class GridInventory extends AbstractInventory implements
|
||||
IToolChangedListener {
|
||||
IPointChangedListener {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GridInventory.class);
|
||||
|
||||
|
@ -137,7 +137,10 @@ public class GridInventory extends AbstractInventory implements
|
|||
if (updater == null) {
|
||||
updater = new GridUpdater(this);
|
||||
updater.startObserving();
|
||||
ToolsDataManager.getInstance().addHomeChangedListener(this);
|
||||
// Currently only one instance of GridInventory is created by
|
||||
// the GribDataCubeAdapter and lasts for the life of
|
||||
// CAVE. Thus no need for removal of this listener.
|
||||
PointsDataManager.getInstance().addHomeChangedListener(this);
|
||||
} else {
|
||||
updater.refreshNodes();
|
||||
}
|
||||
|
@ -745,7 +748,7 @@ public class GridInventory extends AbstractInventory implements
|
|||
* com.raytheon.viz.awipstools.IHomeChangedListener#homeLocationChanged()
|
||||
*/
|
||||
@Override
|
||||
public void toolChanged() {
|
||||
public void pointChanged() {
|
||||
reinitTree();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ Require-Bundle: org.apache.batik;bundle-version="1.6.0",
|
|||
com.raytheon.uf.common.serialization.comm;bundle-version="1.11.22",
|
||||
com.raytheon.uf.viz.productbrowser;bundle-version="1.11.31",
|
||||
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1130",
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.edex.meteoLib,
|
||||
com.raytheon.uf.common.colormap,
|
||||
|
|
|
@ -49,8 +49,8 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||
import com.raytheon.viz.core.graphing.GraphProperties;
|
||||
import com.raytheon.viz.core.graphing.xy.XYData;
|
||||
|
@ -428,7 +428,7 @@ public class RadarGraphResource extends
|
|||
private CellTrendDataPacket getNearestCell(String point,
|
||||
Map<RadarDataKey, RadarDataPoint> symbologyData) {
|
||||
|
||||
Coordinate pointCoord = ToolsDataManager.getInstance().getPoint(point);
|
||||
Coordinate pointCoord = PointsDataManager.getInstance().getPoint(point);
|
||||
|
||||
CellTrendDataPacket nearestCell = null;
|
||||
CellTrendDataPacket currCell = null;
|
||||
|
|
|
@ -24,10 +24,9 @@ import com.raytheon.uf.common.dataplugin.radar.request.GetRadarSpatialRequest;
|
|||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -45,7 +44,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* @author rjpeter
|
||||
* @version 1.0
|
||||
*/
|
||||
public class StationUtils implements IToolChangedListener {
|
||||
public class StationUtils implements IPointChangedListener {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(StationUtils.class);
|
||||
|
||||
|
@ -62,17 +61,12 @@ public class StationUtils implements IToolChangedListener {
|
|||
}
|
||||
|
||||
private StationUtils() {
|
||||
ToolsDataManager.getInstance().addHomeChangedListener(this);
|
||||
PointsDataManager.getInstance().addHomeChangedListener(this);
|
||||
}
|
||||
|
||||
public synchronized RadarStation getHomeRadarStation() {
|
||||
if (station == null) {
|
||||
LocalizationManager lm = LocalizationManager.getInstance();
|
||||
// IPreferenceStore store = CorePlugin.getDefault()
|
||||
// .getPreferenceStore();
|
||||
// String site = lm.getCurrentSite();
|
||||
|
||||
Coordinate home = ToolsDataManager.getInstance().getHome();
|
||||
Coordinate home = PointsDataManager.getInstance().getHome();
|
||||
return getClosestRadarStation(home.x, home.y);
|
||||
}
|
||||
|
||||
|
@ -103,7 +97,7 @@ public class StationUtils implements IToolChangedListener {
|
|||
* com.raytheon.viz.awipstools.IHomeChangedListener#homeLocationChanged()
|
||||
*/
|
||||
@Override
|
||||
public void toolChanged() {
|
||||
public void pointChanged() {
|
||||
station = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,337 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.ui.widgets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
|
||||
/**
|
||||
* This creates a composite that displays a button which is associated with a
|
||||
* menu. This class will take responsibility for disposing any menus assigned to
|
||||
* it via the setMenu method. When a non-cascading menu item is selected the
|
||||
* button's text is updated to reflect the selection.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Jul 6, 2012 #875 rferrel Move to common package and made more robust.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
public class MenuButton extends MinimumSizeComposite implements
|
||||
SelectionListener, DisposeListener {
|
||||
private Button button;
|
||||
|
||||
private int defaultMinWidth = SWT.DEFAULT;
|
||||
|
||||
private int defaultMinHeight = SWT.DEFAULT;
|
||||
|
||||
private final ArrayList<SelectionListener> listeners = new ArrayList<SelectionListener>();
|
||||
|
||||
private MenuItem selectedItem;
|
||||
|
||||
public MenuButton(Composite parent) {
|
||||
super(parent, SWT.NONE);
|
||||
setLayout(new FillLayout(SWT.HORIZONTAL));
|
||||
button = new Button(this, SWT.PUSH);
|
||||
/*
|
||||
* // This produced annoying behavoir... button.addMouseListener(new
|
||||
* MouseAdapter() {
|
||||
*
|
||||
* @Override public void mouseDown(MouseEvent e) { if (e.button == 1) {
|
||||
* doPopup(); } }
|
||||
*
|
||||
* });
|
||||
*/
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
doPopup();
|
||||
}
|
||||
});
|
||||
addDisposeListener(this);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
button.setEnabled(enabled);
|
||||
}
|
||||
|
||||
private void doPopup() {
|
||||
boolean isEnabled = button.isEnabled();
|
||||
if (!isEnabled)
|
||||
return;
|
||||
/*
|
||||
* button.setEnabled(false); button.setEnabled(true);
|
||||
*/
|
||||
Menu menu = getMenu();
|
||||
if (menu == null)
|
||||
return;
|
||||
Point sz = getSize();
|
||||
Point p = toDisplay(0, sz.y);
|
||||
menu.setLocation(p);
|
||||
menu.setVisible(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.swt.widgets.Control#setMenu(org.eclipse.swt.widgets.Menu)
|
||||
*/
|
||||
@Override
|
||||
public void setMenu(Menu menu) {
|
||||
// Dispose of previous menu
|
||||
unrealizeMenu();
|
||||
super.setMenu(menu);
|
||||
realizeMenu();
|
||||
}
|
||||
|
||||
public void updateMenu() {
|
||||
realizeMenu();
|
||||
}
|
||||
|
||||
private void realizeMenu() {
|
||||
String text = button.getText();
|
||||
realizeMenu1(getMenu());
|
||||
// Minimize button's default size in so it will not interfere if
|
||||
// setSize is invoked.
|
||||
button.setText("");
|
||||
button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
button.setText(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive call to set listeners on non-CASCADE menu items.
|
||||
*
|
||||
* @param menu
|
||||
*/
|
||||
private void realizeMenu1(Menu menu) {
|
||||
if (menu != null) {
|
||||
for (MenuItem mi : menu.getItems()) {
|
||||
if ((mi.getStyle() & SWT.CASCADE) == 0) {
|
||||
mi.addSelectionListener(this);
|
||||
// Adjust size so largest item's text will fit in the button
|
||||
button.setText(mi.getText());
|
||||
Point pt = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
if (minWidth < pt.x) {
|
||||
minWidth = pt.x;
|
||||
}
|
||||
if (minHeight < pt.y) {
|
||||
minHeight = pt.y;
|
||||
}
|
||||
} else {
|
||||
realizeMenu1(mi.getMenu());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse
|
||||
* .swt.events.SelectionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
widgetSelected(e);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
|
||||
* .events.SelectionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
MenuItem mi;
|
||||
try {
|
||||
mi = (MenuItem) e.widget;
|
||||
} catch (ClassCastException exc) {
|
||||
return;
|
||||
}
|
||||
setSelectedItem(mi);
|
||||
|
||||
Event ev = new Event();
|
||||
ev.widget = this;
|
||||
ev.data = mi;
|
||||
|
||||
SelectionEvent selEvent = new SelectionEvent(ev);
|
||||
|
||||
SelectionListener[] ls = listeners
|
||||
.toArray(new SelectionListener[listeners.size()]);
|
||||
for (SelectionListener l : ls) {
|
||||
l.widgetSelected(selEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
unrealizeMenu();
|
||||
}
|
||||
|
||||
private void unrealizeMenu() {
|
||||
unrealizeMenu1(getMenu());
|
||||
super.setMinimumSize(defaultMinWidth, defaultMinHeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive call to remove listeners from menu items and dispose of menus.
|
||||
*
|
||||
* @param menu
|
||||
*/
|
||||
private void unrealizeMenu1(Menu menu) {
|
||||
if (menu != null) {
|
||||
for (MenuItem mi : menu.getItems()) {
|
||||
if (mi != null) {
|
||||
if ((mi.getStyle() & SWT.CASCADE) == 0) {
|
||||
mi.removeSelectionListener(this);
|
||||
} else {
|
||||
unrealizeMenu1(mi.getMenu());
|
||||
}
|
||||
}
|
||||
}
|
||||
menu.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The selection event sent to the listener will have its data object set to
|
||||
* the menu item that was selected.
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
public void addSelectionListener(SelectionListener listener) {
|
||||
if (listener == null)
|
||||
throw new NullPointerException();
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
public MenuItem getSelectedItem() {
|
||||
return selectedItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* This becomes the selected item and changes the button's text to the
|
||||
* item's text.
|
||||
*
|
||||
* @param selectedItem
|
||||
*/
|
||||
public void setSelectedItem(MenuItem selectedItem) {
|
||||
this.selectedItem = selectedItem;
|
||||
if (selectedItem != null)
|
||||
button.setText(selectedItem.getText());
|
||||
else
|
||||
button.setText("");
|
||||
}
|
||||
|
||||
/**
|
||||
* This changes the button's text to the selected text and the non-cascade
|
||||
* item whose text matches the selected text becomes the selected item. The
|
||||
* selected item is set to null when a match is not found.
|
||||
*
|
||||
* @param selectedText
|
||||
*/
|
||||
public void setSelectedItem(String selectedText) {
|
||||
if (selectedText == null) {
|
||||
button.setText("");
|
||||
this.selectedItem = null;
|
||||
button.setText(selectedText);
|
||||
} else {
|
||||
button.setText(selectedText);
|
||||
this.selectedItem = findItem(getMenu(), selectedText);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search menu and its sub-menus for a non-cascade menu item with the
|
||||
* desired text value.
|
||||
*
|
||||
* @param menu
|
||||
* @param text
|
||||
* @return item - null if no match is found
|
||||
*/
|
||||
private MenuItem findItem(Menu menu, String text) {
|
||||
if (menu != null) {
|
||||
for (MenuItem item : menu.getItems()) {
|
||||
if (item != null) {
|
||||
if ((item.getStyle() & SWT.CASCADE) != 0) {
|
||||
MenuItem foundItem = findItem(item.getMenu(), text);
|
||||
if (foundItem != null) {
|
||||
return foundItem;
|
||||
}
|
||||
} else if (text.equals(item.getText())) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.widgets.MinimumSizeComposite#setMinimumSize(org.eclipse
|
||||
* .swt.graphics.Point)
|
||||
*/
|
||||
@Override
|
||||
public void setMinimumSize(Point sz) {
|
||||
defaultMinWidth = sz.x;
|
||||
defaultMinHeight = sz.y;
|
||||
super.setMinimumSize(sz);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.widgets.MinimumSizeComposite#setMinimumSize(int,
|
||||
* int)
|
||||
*/
|
||||
@Override
|
||||
public void setMinimumSize(int width, int height) {
|
||||
defaultMinWidth = width;
|
||||
defaultMinHeight = height;
|
||||
super.setMinimumSize(width, height);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.ui.widgets;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
/**
|
||||
* This class extends Composite and prevents its computed size from being less
|
||||
* then the set minimum.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Jul 11, 2012 #875 rferrel Move to common package and
|
||||
* made minWidth and minHeight
|
||||
* accessible to subclasses.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
public class MinimumSizeComposite extends Composite {
|
||||
|
||||
protected int minWidth = SWT.DEFAULT;
|
||||
|
||||
protected int minHeight = SWT.DEFAULT;
|
||||
|
||||
public MinimumSizeComposite(Composite parent) {
|
||||
this(parent, SWT.NONE);
|
||||
}
|
||||
|
||||
public MinimumSizeComposite(Composite parent, int style) {
|
||||
super(parent, style);
|
||||
GridLayout gd = new GridLayout(1, false);
|
||||
gd.marginWidth = 0;
|
||||
gd.marginHeight = 0;
|
||||
setLayout(gd);
|
||||
}
|
||||
|
||||
public void setControl(Control c) {
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
if (minWidth != SWT.DEFAULT)
|
||||
gd.minimumWidth = minWidth;
|
||||
if (minHeight != SWT.DEFAULT)
|
||||
gd.minimumHeight = minHeight;
|
||||
c.setLayoutData(gd);
|
||||
}
|
||||
|
||||
public void setMinimumSizeFromComputedSize() {
|
||||
setMinimumSize(super.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point computeSize(int wHint, int hHint, boolean changed) {
|
||||
Point sz = super.computeSize(wHint, hHint, changed);
|
||||
sz.x = Math.max(minWidth, sz.x);
|
||||
sz.y = Math.max(minHeight, sz.y);
|
||||
return sz;
|
||||
}
|
||||
|
||||
public void setMinimumSize(Point sz) {
|
||||
minWidth = sz.x;
|
||||
minHeight = sz.y;
|
||||
}
|
||||
|
||||
public void setMinimumSize(int width, int height) {
|
||||
minWidth = width;
|
||||
minHeight = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layout(boolean changed, boolean all) {
|
||||
super.layout(changed, all);
|
||||
}
|
||||
|
||||
}
|
|
@ -31,7 +31,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.viz.objectiveanalysis,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
net.sf.swtaddons;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.volumebrowser,
|
||||
com.raytheon.viz.volumebrowser.catalog,
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.viz.core.style.ParamLevelMatchCriteria;
|
|||
import com.raytheon.uf.viz.core.style.StyleManager;
|
||||
import com.raytheon.uf.viz.core.style.StyleRule;
|
||||
import com.raytheon.uf.viz.core.style.VizStyleException;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
|
||||
import com.raytheon.uf.viz.xy.timeheight.rsc.TimeHeightResourceData;
|
||||
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData;
|
||||
|
@ -256,9 +257,9 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
|
|||
|
||||
String pointLetter = getPointLetter(catalogEntry);
|
||||
|
||||
Coordinate c = ToolsDataManager.getInstance().getPoint(pointLetter);
|
||||
Coordinate c = PointsDataManager.getInstance().getPoint(pointLetter);
|
||||
if (c == null) {
|
||||
c = ToolsDataManager.getInstance().getPoint("A");
|
||||
c = PointsDataManager.getInstance().getPoint("A");
|
||||
}
|
||||
return c;
|
||||
|
||||
|
@ -465,7 +466,7 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
|
|||
|
||||
public static Set<String> getPointLineKeys() {
|
||||
Set<String> keySet = new HashSet<String>();
|
||||
for (String letter : ToolsDataManager.getInstance().getPointNames()) {
|
||||
for (String letter : PointsDataManager.getInstance().getPointNames()) {
|
||||
keySet.add("Point" + letter);
|
||||
}
|
||||
for (String letter : ToolsDataManager.getInstance().getBaselineNames()) {
|
||||
|
|
|
@ -54,6 +54,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
|||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
|
||||
import com.raytheon.uf.viz.d2d.nsharp.rsc.GribNSharpResourceData;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.grid.inv.GridInventory;
|
||||
import com.raytheon.viz.grid.rsc.GribSkewTLoadProperties;
|
||||
|
@ -453,7 +454,7 @@ public class GribDataCatalog extends AbstractInventoryDataCatalog {
|
|||
.getCoordinateReferenceSystem());
|
||||
Envelope2D env = gridGeom.getEnvelope2D();
|
||||
for (String letter : pointLetters) {
|
||||
Coordinate c = ToolsDataManager.getInstance().getPoint(
|
||||
Coordinate c = PointsDataManager.getInstance().getPoint(
|
||||
letter);
|
||||
DirectPosition2D dp = new DirectPosition2D(c.x, c.y);
|
||||
llToCRS.transform(dp, dp);
|
||||
|
@ -519,6 +520,7 @@ public class GribDataCatalog extends AbstractInventoryDataCatalog {
|
|||
return results;
|
||||
}
|
||||
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
||||
PointsDataManager pdm = PointsDataManager.getInstance();
|
||||
Map<String, GridCoverage> coverages = new HashMap<String, GridCoverage>();
|
||||
try {
|
||||
coverages = CoverageUtils.getInstance().getCoverages(sources);
|
||||
|
@ -543,8 +545,8 @@ public class GribDataCatalog extends AbstractInventoryDataCatalog {
|
|||
MathTransform llToCRS = MapUtil.getTransformFromLatLon(gridGeom
|
||||
.getCoordinateReferenceSystem());
|
||||
Envelope2D env = gridGeom.getEnvelope2D();
|
||||
for (String letter : tdm.getPointNames()) {
|
||||
Coordinate c = tdm.getPoint(letter);
|
||||
for (String letter : pdm.getPointNames()) {
|
||||
Coordinate c = pdm.getPoint(letter);
|
||||
DirectPosition2D dp = new DirectPosition2D(c.x, c.y);
|
||||
llToCRS.transform(dp, dp);
|
||||
if (env.contains(dp.x, dp.y)) {
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
|
|||
import com.raytheon.uf.viz.d2d.nsharp.rsc.BufruaNSharpResourceData;
|
||||
import com.raytheon.uf.viz.d2d.nsharp.rsc.MdlSndNSharpResourceData;
|
||||
import com.raytheon.uf.viz.objectiveanalysis.rsc.OAResourceData;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
|
||||
import com.raytheon.uf.viz.xy.timeheight.rsc.TimeHeightResourceData;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
|
@ -450,7 +451,7 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
|
|||
.setPointCoordinate(closestCoord);
|
||||
|
||||
String pointLetter = getPointLetter(catalogEntry);
|
||||
ToolsDataManager.getInstance().setPoint(pointLetter, closestCoord);
|
||||
PointsDataManager.getInstance().setPoint(pointLetter, closestCoord);
|
||||
return resourceData;
|
||||
case CROSS_SECTION:
|
||||
resourceData = super.getResourceData(catalogEntry, resourceType);
|
||||
|
@ -569,7 +570,7 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
|
|||
continue;
|
||||
}
|
||||
for (String letter : pointLetters) {
|
||||
Coordinate c = ToolsDataManager.getInstance().getPoint(letter);
|
||||
Coordinate c = PointsDataManager.getInstance().getPoint(letter);
|
||||
if (getClosestStation(c, source) != null) {
|
||||
fileredSources.add(source);
|
||||
break;
|
||||
|
@ -605,17 +606,17 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
|
|||
return results;
|
||||
}
|
||||
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
||||
PointsDataManager pdm = PointsDataManager.getInstance();
|
||||
Set<String> validPlanes = new HashSet<String>(sources.size());
|
||||
for (String source : sources) {
|
||||
for (String letter : tdm.getPointNames()) {
|
||||
Coordinate c = ToolsDataManager.getInstance().getPoint(letter);
|
||||
for (String letter : pdm.getPointNames()) {
|
||||
Coordinate c = pdm.getPoint(letter);
|
||||
if (getClosestStation(c, source) != null) {
|
||||
validPlanes.add("Point" + letter);
|
||||
}
|
||||
}
|
||||
for (String letter : tdm.getBaselineNames()) {
|
||||
LineString ls = ToolsDataManager.getInstance().getBaseline(
|
||||
letter);
|
||||
LineString ls = tdm.getBaseline(letter);
|
||||
boolean failed = false;
|
||||
for (Coordinate c : ls.getCoordinates()) {
|
||||
if (getClosestStation(c, source) == null) {
|
||||
|
|
|
@ -56,6 +56,8 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
|
||||
|
@ -442,10 +444,10 @@ public class DataListsProdTableComp extends Composite implements
|
|||
});
|
||||
}
|
||||
});
|
||||
ToolsDataManager.getInstance().addPointsChangedListener(
|
||||
new IToolChangedListener() {
|
||||
PointsDataManager.getInstance().addPointsChangedListener(
|
||||
new IPointChangedListener() {
|
||||
@Override
|
||||
public void toolChanged() {
|
||||
public void pointChanged() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
public void run() {
|
||||
updateMenuInventory();
|
||||
|
@ -826,7 +828,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
tbContrib.xml.toolItemText = "Points";
|
||||
tbContrib.xml.id = "SoundingPointsButton";
|
||||
List<IContributionItem> items = new ArrayList<IContributionItem>();
|
||||
List<String> points = new ArrayList<String>(ToolsDataManager
|
||||
List<String> points = new ArrayList<String>(PointsDataManager
|
||||
.getInstance().getPointNames());
|
||||
Collections.sort(points);
|
||||
for (String point : points) {
|
||||
|
|
28
cots/org.apache.tomcat.nativ/.project
Normal file
28
cots/org.apache.tomcat.nativ/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.apache.tomcat.nativ</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
Loading…
Add table
Reference in a new issue