12.12.1-1 baseline
Former-commit-id: 7699acd8cfc5cfa4e902ba98d5fdc2f7c474a535
This commit is contained in:
parent
9ff9cb8aa3
commit
e1498006c7
297 changed files with 7806 additions and 6755 deletions
|
@ -123,7 +123,7 @@
|
||||||
|
|
||||||
<ini-substitutions>
|
<ini-substitutions>
|
||||||
<max-memory>
|
<max-memory>
|
||||||
<value>2048M</value>
|
<value>3072M</value>
|
||||||
</max-memory>
|
</max-memory>
|
||||||
|
|
||||||
<max-perm>
|
<max-perm>
|
||||||
|
|
|
@ -76,7 +76,10 @@
|
||||||
# Status: TEST
|
# Status: TEST
|
||||||
# Title: AvnFPS: TAF No Significant Weather (NSW) not QC'd correctly
|
# Title: AvnFPS: TAF No Significant Weather (NSW) not QC'd correctly
|
||||||
#
|
#
|
||||||
#
|
# Date Ticket# Engineer Description
|
||||||
|
# ------------ ---------- ----------- --------------------------
|
||||||
|
# Nov 02, 2012 15476 zhao Retrieve latest METAR record from database
|
||||||
|
##
|
||||||
import logging, time
|
import logging, time
|
||||||
import Avn, AvnLib, AvnParser, TafDecoder
|
import Avn, AvnLib, AvnParser, TafDecoder
|
||||||
|
|
||||||
|
@ -104,7 +107,8 @@ def updateTafs(bbb, fcsts):
|
||||||
|
|
||||||
AvnLib.adjustTimes(bbb, taf)
|
AvnLib.adjustTimes(bbb, taf)
|
||||||
evtime=taf['vtime']['str'][5:]
|
evtime=taf['vtime']['str'][5:]
|
||||||
metar = MetarData.retrieve(ident)[0]
|
# For DR15476: use 'maxSize=0' to indicate that the latest record is to be retrieved
|
||||||
|
metar = MetarData.retrieve(ident,0)[0]
|
||||||
AvnLib.updateTafWithMetar(taf['group'][0]['prev'], metar.dcd)
|
AvnLib.updateTafWithMetar(taf['group'][0]['prev'], metar.dcd)
|
||||||
lines = AvnLib.makeTafFromPeriods(ident, bbb, taf['group'],
|
lines = AvnLib.makeTafFromPeriods(ident, bbb, taf['group'],
|
||||||
tafDuration=tafDuration,
|
tafDuration=tafDuration,
|
||||||
|
|
|
@ -1411,9 +1411,12 @@ class FWS_Overrides:
|
||||||
|
|
||||||
for element, defaultFlag in self._weInfoHiddenList():
|
for element, defaultFlag in self._weInfoHiddenList():
|
||||||
if defaultFlag:
|
if defaultFlag:
|
||||||
self._periodElementDict["Today"].append(element)
|
if len(self._periodElementDict["Today"]) != 0:
|
||||||
self._periodElementDict["Tonight"].append(element)
|
self._periodElementDict["Today"].append(element)
|
||||||
self._periodElementDict["Tomorrow"].append(element)
|
if len(self._periodElementDict["Tonight"]) != 0:
|
||||||
|
self._periodElementDict["Tonight"].append(element)
|
||||||
|
if len(self._periodElementDict["Tomorrow"]) != 0:
|
||||||
|
self._periodElementDict["Tomorrow"].append(element)
|
||||||
self._periodAllElementDict["Today"].append(element)
|
self._periodAllElementDict["Today"].append(element)
|
||||||
self._periodAllElementDict["Tonight"].append(element)
|
self._periodAllElementDict["Tonight"].append(element)
|
||||||
self._periodAllElementDict["Tomorrow"].append(element)
|
self._periodAllElementDict["Tomorrow"].append(element)
|
||||||
|
|
|
@ -292,8 +292,9 @@ public class DbMapResource extends
|
||||||
}
|
}
|
||||||
QueryResult mappedResult = DbMapQueryFactory.getMapQuery(
|
QueryResult mappedResult = DbMapQueryFactory.getMapQuery(
|
||||||
resourceData.getTable(),
|
resourceData.getTable(),
|
||||||
resourceData.getGeomField()).queryWithinEnvelope(
|
getGeomField(levels[levels.length - 1]))
|
||||||
req.envelope, fields, constraints);
|
.queryWithinEnvelope(req.envelope, fields,
|
||||||
|
constraints);
|
||||||
Map<Integer, Geometry> gidMap = new HashMap<Integer, Geometry>(
|
Map<Integer, Geometry> gidMap = new HashMap<Integer, Geometry>(
|
||||||
mappedResult.getResultCount() * 2);
|
mappedResult.getResultCount() * 2);
|
||||||
List<Integer> toRequest = new ArrayList<Integer>(
|
List<Integer> toRequest = new ArrayList<Integer>(
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
<property name="socketTimeout" value="330000"/>
|
<property name="socketTimeout" value="330000"/>
|
||||||
<property name="connectionTimeout" value="10000"/>
|
<property name="connectionTimeout" value="10000"/>
|
||||||
<property name="maxConnectionsPerHost" value="10"/>
|
<property name="maxConnectionsPerHost" value="10"/>
|
||||||
|
<property name="compressRequests" value="false"/>
|
||||||
|
<property name="gzipResponseHandling" value="false"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="baosPool" class="com.raytheon.uf.common.util.ByteArrayOutputStreamPool" factory-method="getInstance">
|
<bean id="baosPool" class="com.raytheon.uf.common.util.ByteArrayOutputStreamPool" factory-method="getInstance">
|
||||||
|
|
|
@ -19,22 +19,11 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.core.alerts;
|
package com.raytheon.uf.viz.core.alerts;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
|
||||||
import com.raytheon.uf.viz.core.RecordFactory;
|
|
||||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
|
||||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -64,52 +53,7 @@ public class DataCubeAlertMessageParser extends AbstractAlertMessageParser {
|
||||||
public Object parseAlertMessage(AlertMessage message,
|
public Object parseAlertMessage(AlertMessage message,
|
||||||
AbstractRequestableResourceData reqResourceData)
|
AbstractRequestableResourceData reqResourceData)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
Object objectToSend = null;
|
return null;
|
||||||
Map<String, Object> attribs = new HashMap<String, Object>(
|
|
||||||
message.decodedAlert);
|
|
||||||
String dataURI = message.dataURI;
|
|
||||||
if (reqResourceData.isUpdatingOnMetadataOnly()) {
|
|
||||||
PluginDataObject record = RecordFactory.getInstance()
|
|
||||||
.loadRecordFromUri(dataURI);
|
|
||||||
objectToSend = record;
|
|
||||||
} else {
|
|
||||||
attribs.put("dataURI", message.dataURI);
|
|
||||||
Map<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
|
||||||
for (String column : attribs.keySet()) {
|
|
||||||
if (column.equals("dataURI")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((attribs.get(column) == null)
|
|
||||||
|| attribs.get(column).toString().equals("null")) {
|
|
||||||
vals.put(column, new RequestConstraint(null,
|
|
||||||
RequestConstraint.ConstraintType.ISNULL));
|
|
||||||
} else {
|
|
||||||
vals.put(column, new RequestConstraint(attribs.get(column)
|
|
||||||
.toString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Make sure there is really data before sending it to be loaded
|
|
||||||
DataTime[] availableTimes = DataCubeContainer.performTimeQuery(
|
|
||||||
vals, false);
|
|
||||||
if (availableTimes == null) {
|
|
||||||
return objectToSend;
|
|
||||||
}
|
|
||||||
for (DataTime time : availableTimes) {
|
|
||||||
if (time.equals(attribs.get("dataTime"))) {
|
|
||||||
LayerProperty lp = new LayerProperty();
|
|
||||||
|
|
||||||
lp.setDesiredProduct(ResourceType.PLAN_VIEW);
|
|
||||||
lp.setEntryQueryParameters(vals, false);
|
|
||||||
lp.setSelectedEntryTimes(new DataTime[] { time });
|
|
||||||
List<Object> resp = DataCubeContainer.getData(lp, 60000);
|
|
||||||
if (resp.size() == 0)
|
|
||||||
return null;
|
|
||||||
objectToSend = resp.get(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return objectToSend;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/**
|
||||||
|
* 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.core.procedures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to provide the keys of alter bundles that were changed.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Oct 3, 2012 1248 rferrel Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AlterBundleChangeEvent {
|
||||||
|
private String[] keys;
|
||||||
|
|
||||||
|
public AlterBundleChangeEvent(String[] keys) {
|
||||||
|
this.keys = keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getKeys() {
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,143 @@
|
||||||
|
/**
|
||||||
|
* 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.core.procedures;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An abstract class that implements IAlterBundleContributor. Default methods
|
||||||
|
* are provided for getAlterables(String key), addAlterBundleChangeListner(),
|
||||||
|
* and removeAlterBundleChangeListner. All other methods of the interface must
|
||||||
|
* be implemented in the subclass.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Oct 3, 2012 1248 rferrel Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public abstract class AlterBundleContributorAdapter implements
|
||||||
|
IAlterBundleContributor {
|
||||||
|
|
||||||
|
private List<IAlterBundleChangeListener> bundleListeners = new ArrayList<IAlterBundleChangeListener>();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.procedures.IAlterBundleContributor#getAlterables
|
||||||
|
* ()
|
||||||
|
*/
|
||||||
|
public abstract Map<String, String[]> getAlterables();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.procedures.IAlterBundleContributor#alterBundle
|
||||||
|
* (com.raytheon.uf.viz.core.procedures.Bundle, java.lang.String,
|
||||||
|
* java.lang.String)
|
||||||
|
*/
|
||||||
|
public abstract void alterBundle(Bundle bundleToAlter, String alterKey,
|
||||||
|
String alterValue);
|
||||||
|
|
||||||
|
public String[] getAlterables(String key) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||||
|
* addAlterBundleChangeListner
|
||||||
|
* (com.raytheon.uf.viz.core.procedures.IAlternateBundleChangeListener)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public final void addAlterBundleChangeListener(
|
||||||
|
IAlterBundleChangeListener listener) {
|
||||||
|
synchronized (bundleListeners) {
|
||||||
|
bundleListeners.add(listener);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||||
|
* removeAlterBundeChangeListner
|
||||||
|
* (com.raytheon.uf.viz.core.procedures.IAlternateBundleChangeListener)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public final void removeAlterBundeChangeListener(
|
||||||
|
IAlterBundleChangeListener listener) {
|
||||||
|
synchronized (bundleListeners) {
|
||||||
|
bundleListeners.remove(listener);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.procedures.IAlterBundleContributor#listenerSetup
|
||||||
|
* ()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void listenerSetup() {
|
||||||
|
// Default do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.procedures.IAlterBundleContributor#listenerShutdown
|
||||||
|
* ()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void listenerShutdown() {
|
||||||
|
// Default do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final void fireAlterBundleChangeListener(
|
||||||
|
final AlterBundleChangeEvent event) {
|
||||||
|
List<IAlterBundleChangeListener> listeners = null;
|
||||||
|
synchronized (bundleListeners) {
|
||||||
|
if (bundleListeners.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
listeners = new ArrayList<IAlterBundleChangeListener>(
|
||||||
|
bundleListeners);
|
||||||
|
}
|
||||||
|
for (IAlterBundleChangeListener listener : listeners) {
|
||||||
|
listener.changeBundle(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
/**
|
||||||
|
* 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.core.procedures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listener used in the IAlterBundleContributor to indicate changes in an alter
|
||||||
|
* bundle structure.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Oct 3, 2012 1248 rferrel Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface IAlterBundleChangeListener {
|
||||||
|
public void changeBundle(AlterBundleChangeEvent event);
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ package com.raytheon.uf.viz.core.procedures;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Interface for methods needed for handling alter bundles.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -31,6 +31,7 @@ import java.util.Map;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 4, 2010 mschenke Initial creation
|
* Jan 4, 2010 mschenke Initial creation
|
||||||
* Aug 8, 2012 875 rferrel Add separators for menu support.
|
* Aug 8, 2012 875 rferrel Add separators for menu support.
|
||||||
|
* Oct 3, 2012 1248 rferrel Added bundle change listeners.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -85,4 +86,34 @@ public interface IAlterBundleContributor {
|
||||||
*/
|
*/
|
||||||
public void alterBundle(Bundle bundleToAlter, String alterKey,
|
public void alterBundle(Bundle bundleToAlter, String alterKey,
|
||||||
String alterValue);
|
String alterValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Git the keys associated with the bundle.
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String[] getAlterables(String key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void addAlterBundleChangeListener(IAlterBundleChangeListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void removeAlterBundeChangeListener(
|
||||||
|
IAlterBundleChangeListener listener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows setup for handling of IAlterBundleChangeListener.
|
||||||
|
*/
|
||||||
|
public void listenerSetup();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows clean up of listener setup when bundle no longer needs to handler
|
||||||
|
* IAlterBundleChangeListeners.
|
||||||
|
*/
|
||||||
|
public void listenerShutdown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.core.rsc;
|
package com.raytheon.uf.viz.core.rsc;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -45,7 +46,9 @@ import com.raytheon.uf.common.time.BinOffset;
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
import com.raytheon.uf.viz.core.RecordFactory;
|
import com.raytheon.uf.viz.core.RecordFactory;
|
||||||
import com.raytheon.uf.viz.core.alerts.AbstractAlertMessageParser;
|
import com.raytheon.uf.viz.core.alerts.AbstractAlertMessageParser;
|
||||||
|
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||||
|
import com.raytheon.uf.viz.core.comm.Loader;
|
||||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
import com.raytheon.uf.viz.core.exception.NoDataAvailableException;
|
import com.raytheon.uf.viz.core.exception.NoDataAvailableException;
|
||||||
|
@ -97,6 +100,32 @@ public abstract class AbstractRequestableResourceData extends
|
||||||
*/
|
*/
|
||||||
private static int ENTRYTIMES_SLICE_SIZE = 500;
|
private static int ENTRYTIMES_SLICE_SIZE = 500;
|
||||||
|
|
||||||
|
private static class AlertMessageToPDOParser extends
|
||||||
|
AbstractAlertMessageParser {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object parseAlertMessage(AlertMessage message,
|
||||||
|
AbstractRequestableResourceData reqResourceData)
|
||||||
|
throws VizException {
|
||||||
|
Object objectToSend = null;
|
||||||
|
Map<String, Object> attribs = new HashMap<String, Object>(
|
||||||
|
message.decodedAlert);
|
||||||
|
String dataURI = message.dataURI;
|
||||||
|
if (reqResourceData.isUpdatingOnMetadataOnly()) {
|
||||||
|
PluginDataObject record = RecordFactory.getInstance()
|
||||||
|
.loadRecordFromUri(dataURI);
|
||||||
|
objectToSend = record;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
attribs.put("dataURI", message.dataURI);
|
||||||
|
objectToSend = Loader.loadData(attribs);
|
||||||
|
}
|
||||||
|
return objectToSend;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private static AlertMessageToPDOParser defaultParser = new AlertMessageToPDOParser();
|
||||||
|
|
||||||
/** the metadata criteria to retrieve the resource */
|
/** the metadata criteria to retrieve the resource */
|
||||||
@XmlJavaTypeAdapter(value = RequestableMetadataMarshaller.class)
|
@XmlJavaTypeAdapter(value = RequestableMetadataMarshaller.class)
|
||||||
protected HashMap<String, RequestConstraint> metadataMap;
|
protected HashMap<String, RequestConstraint> metadataMap;
|
||||||
|
@ -246,21 +275,52 @@ public abstract class AbstractRequestableResourceData extends
|
||||||
Validate.isTrue(updateData instanceof Object[],
|
Validate.isTrue(updateData instanceof Object[],
|
||||||
"Update expected Object[]");
|
"Update expected Object[]");
|
||||||
|
|
||||||
if (updateData instanceof PluginDataObject[]) {
|
this.fireChangeListeners(ChangeType.DATA_UPDATE, updateData);
|
||||||
for (PluginDataObject pdo : (PluginDataObject[]) updateData) {
|
}
|
||||||
DataTime time = pdo.getDataTime();
|
|
||||||
if (binOffset != null) {
|
public void update(AlertMessage... messages) {
|
||||||
time = binOffset.getNormalizedTime(time);
|
List<Object> objectsToSend = new ArrayList<Object>(messages.length);
|
||||||
|
boolean consistentCache = true;
|
||||||
|
for (AlertMessage message : messages) {
|
||||||
|
try {
|
||||||
|
AbstractAlertMessageParser parser = getAlertParser();
|
||||||
|
if (parser == null) {
|
||||||
|
parser = defaultParser;
|
||||||
}
|
}
|
||||||
synchronized (cachedAvailableTimes) {
|
Object timeObj = null;
|
||||||
if (!cachedAvailableTimes.contains(time)) {
|
// do not try to maintain the time cache if the alert does not
|
||||||
cachedAvailableTimes.add(time);
|
// parse.
|
||||||
|
Object objectToSend = parser.parseAlertMessage(message, this);
|
||||||
|
if (objectToSend != null) {
|
||||||
|
objectsToSend.add(objectToSend);
|
||||||
|
timeObj = message.decodedAlert.get("dataTime");
|
||||||
|
}
|
||||||
|
if (timeObj instanceof DataTime) {
|
||||||
|
DataTime time = (DataTime) timeObj;
|
||||||
|
if (binOffset != null) {
|
||||||
|
time = binOffset.getNormalizedTime(time);
|
||||||
}
|
}
|
||||||
|
synchronized (cachedAvailableTimes) {
|
||||||
|
if (!cachedAvailableTimes.contains(time)) {
|
||||||
|
cachedAvailableTimes.add(time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
consistentCache = false;
|
||||||
}
|
}
|
||||||
|
} catch (VizException e) {
|
||||||
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Error performing update: " + message.dataURI, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!consistentCache) {
|
||||||
this.fireChangeListeners(ChangeType.DATA_UPDATE, updateData);
|
invalidateAvailableTimesCache();
|
||||||
|
}
|
||||||
|
if (!objectsToSend.isEmpty()) {
|
||||||
|
Class<?> componentType = objectsToSend.get(0).getClass();
|
||||||
|
update(objectsToSend.toArray((Object[]) Array.newInstance(
|
||||||
|
componentType, objectsToSend.size())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 13, 2007 chammack Initial Creation.
|
* Sep 13, 2007 chammack Initial Creation.
|
||||||
|
* Oct 16, 2012 1229 rferrel Change to use ProcedureDlg.displayDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -57,10 +58,8 @@ public class AddAWIPSProcedure extends AbstractHandler {
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
Procedure procedure = new Procedure();
|
Procedure procedure = new Procedure();
|
||||||
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(null, procedure,
|
ProcedureDlg.displayDialog(null, procedure,
|
||||||
HandlerUtil.getActiveShell(event));
|
HandlerUtil.getActiveShell(event));
|
||||||
dlg.open();
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,13 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.ui.handlers.HandlerUtil;
|
import org.eclipse.ui.handlers.HandlerUtil;
|
||||||
|
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
|
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
||||||
|
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.d2d.ui.dialogs.procedures.ProcedureListDlg;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg.Mode;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg.Mode;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DeleteAWIPSProcedure
|
* DeleteAWIPSProcedure
|
||||||
|
@ -41,6 +46,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg.Mode;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 13, 2007 chammack Initial Creation.
|
* Sep 13, 2007 chammack Initial Creation.
|
||||||
* Jul 8, 2008 #1183 chammack Migrate to new localization
|
* Jul 8, 2008 #1183 chammack Migrate to new localization
|
||||||
|
* Oct 16, 2012 #1229 rferrel Changes for non-blocking ProcedureListDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -48,6 +54,10 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg.Mode;
|
||||||
* @version 1
|
* @version 1
|
||||||
*/
|
*/
|
||||||
public class DeleteAWIPSProcedure extends AbstractHandler {
|
public class DeleteAWIPSProcedure extends AbstractHandler {
|
||||||
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(DeleteAWIPSProcedure.class);
|
||||||
|
|
||||||
|
private ProcedureListDlg listDlg;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -58,18 +68,30 @@ public class DeleteAWIPSProcedure extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
ProcedureListDlg listDlg = new ProcedureListDlg("Delete Procedure",
|
if (listDlg == null || listDlg.getShell() == null
|
||||||
HandlerUtil.getActiveShell(event), Mode.DELETE);
|
|| listDlg.isDisposed()) {
|
||||||
listDlg.open();
|
listDlg = new ProcedureListDlg("Delete Procedure",
|
||||||
|
HandlerUtil.getActiveShell(event), Mode.DELETE);
|
||||||
|
listDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
LocalizationFile selectedFile = listDlg.getSelectedFile();
|
@Override
|
||||||
if (selectedFile != null && selectedFile.exists()) {
|
public void dialogClosed(Object returnValue) {
|
||||||
try {
|
if (returnValue instanceof LocalizationFile) {
|
||||||
selectedFile.delete();
|
LocalizationFile selectedFile = (LocalizationFile) returnValue;
|
||||||
} catch (Exception e) {
|
try {
|
||||||
throw new ExecutionException("Error deleting procedure: "
|
selectedFile.delete();
|
||||||
+ selectedFile.getName(), e);
|
} catch (LocalizationOpFailedException e) {
|
||||||
}
|
statusHandler.handle(
|
||||||
|
Priority.PROBLEM,
|
||||||
|
"Error deleting procedure: "
|
||||||
|
+ selectedFile.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
listDlg.open();
|
||||||
|
} else {
|
||||||
|
listDlg.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.tools.AbstractTool;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 8, 2009 bgonzale Initial creation
|
* Apr 8, 2009 bgonzale Initial creation
|
||||||
|
* Oct 15, 2012 1229 rferrel Changes for non-blocking DisplayPropertiesDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -57,13 +58,12 @@ public class DisplayPropertiesAction extends AbstractTool {
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
super.execute(arg0);
|
super.execute(arg0);
|
||||||
|
|
||||||
if (dialog == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new DisplayPropertiesDialog(VizWorkbenchManager
|
dialog = new DisplayPropertiesDialog(VizWorkbenchManager
|
||||||
.getInstance().getCurrentWindow().getShell());
|
.getInstance().getCurrentWindow().getShell());
|
||||||
dialog.open();
|
dialog.open();
|
||||||
dialog = null;
|
|
||||||
} else {
|
} else {
|
||||||
dialog.open();
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -24,8 +24,6 @@ import java.io.File;
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
import org.eclipse.core.commands.ExecutionEvent;
|
||||||
import org.eclipse.core.commands.ExecutionException;
|
import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.swt.widgets.Display;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
import org.eclipse.ui.handlers.HandlerUtil;
|
import org.eclipse.ui.handlers.HandlerUtil;
|
||||||
|
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
|
@ -33,9 +31,9 @@ import com.raytheon.uf.common.localization.LocalizationUtil;
|
||||||
import com.raytheon.uf.viz.core.procedures.Procedure;
|
import com.raytheon.uf.viz.core.procedures.Procedure;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.OpenProcedureListDlg;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.OpenProcedureListDlg;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg;
|
|
||||||
import com.raytheon.viz.ui.VizWorkbenchManager;
|
import com.raytheon.viz.ui.VizWorkbenchManager;
|
||||||
import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAWIPSProcedure
|
* OpenAWIPSProcedure
|
||||||
|
@ -47,6 +45,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 13, 2007 chammack Initial Creation.
|
* Sep 13, 2007 chammack Initial Creation.
|
||||||
|
* Oct 16, 2012 1229 rferrel Change to use ProcedureDlg.displayDialog.
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking ProcedureListDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -55,7 +55,7 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||||
*/
|
*/
|
||||||
public class OpenAWIPSProcedure extends AbstractHandler {
|
public class OpenAWIPSProcedure extends AbstractHandler {
|
||||||
|
|
||||||
private OpenProcedureListDlg dialog;
|
private OpenProcedureListDlg dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -66,25 +66,28 @@ public class OpenAWIPSProcedure extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
if(dialog != null){
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog.open();
|
dialog = new OpenProcedureListDlg(HandlerUtil.getActiveShell(event));
|
||||||
return null;
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
}
|
|
||||||
|
|
||||||
dialog = new OpenProcedureListDlg(
|
@Override
|
||||||
HandlerUtil.getActiveShell(event));
|
public void dialogClosed(Object returnValue) {
|
||||||
dialog.open();
|
if (returnValue instanceof LocalizationFile) {
|
||||||
|
LocalizationFile selectedFile = (LocalizationFile) returnValue;
|
||||||
LocalizationFile selectedFile = dialog.getSelectedFile();
|
File f = selectedFile.getFile();
|
||||||
dialog = null;
|
Procedure p = (Procedure) LoadSerializedXml
|
||||||
if (selectedFile != null) {
|
.deserialize(f);
|
||||||
File f = selectedFile.getFile();
|
ProcedureDlg.displayDialog(LocalizationUtil
|
||||||
Procedure p = (Procedure) LoadSerializedXml.deserialize(f);
|
.extractName(selectedFile.getName()), p,
|
||||||
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(
|
VizWorkbenchManager.getInstance()
|
||||||
LocalizationUtil.extractName(selectedFile.getName()), p,
|
.getCurrentWindow().getShell());
|
||||||
VizWorkbenchManager.getInstance().getCurrentWindow()
|
}
|
||||||
.getShell());
|
dialog = null;
|
||||||
dlg.open();
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.HistoryListDlg;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 13, 2007 chammack Initial Creation.
|
* Sep 13, 2007 chammack Initial Creation.
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking HistoryListDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,6 +47,8 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.HistoryListDlg;
|
||||||
*/
|
*/
|
||||||
public class ShowHistoryList extends AbstractHandler {
|
public class ShowHistoryList extends AbstractHandler {
|
||||||
|
|
||||||
|
private HistoryListDlg dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -55,9 +58,12 @@ public class ShowHistoryList extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
HistoryListDlg dlg = new HistoryListDlg(
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
HandlerUtil.getActiveShell(event));
|
dialog = new HistoryListDlg(HandlerUtil.getActiveShell(event));
|
||||||
dlg.open();
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.PrintDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 15, 2011 bkowal Initial creation
|
* Feb 15, 2011 bkowal Initial creation
|
||||||
|
* Oct 15, 2012 1229 rferrel Changes to work with non-blocking PrintDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.PrintDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowPrintDialog extends AbstractHandler {
|
public class ShowPrintDialog extends AbstractHandler {
|
||||||
|
PrintDialog printDialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -54,9 +56,13 @@ public class ShowPrintDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
PrintDialog printDialog = new PrintDialog(
|
if (printDialog == null || printDialog.getShell() == null
|
||||||
HandlerUtil.getActiveShell(event));
|
|| printDialog.isDisposed()) {
|
||||||
printDialog.open();
|
printDialog = new PrintDialog(HandlerUtil.getActiveShell(event));
|
||||||
|
printDialog.open();
|
||||||
|
} else {
|
||||||
|
printDialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,9 @@ import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
|
||||||
import com.raytheon.uf.viz.d2d.core.map.MapScales;
|
import com.raytheon.uf.viz.d2d.core.map.MapScales;
|
||||||
import com.raytheon.uf.viz.d2d.core.map.MapScales.MapScale;
|
import com.raytheon.uf.viz.d2d.core.map.MapScales.MapScale;
|
||||||
import com.raytheon.uf.viz.d2d.core.time.LoadMode;
|
import com.raytheon.uf.viz.d2d.core.time.LoadMode;
|
||||||
import com.raytheon.uf.viz.d2d.ui.Activator;
|
|
||||||
import com.raytheon.uf.viz.d2d.ui.DensityPopulator;
|
import com.raytheon.uf.viz.d2d.ui.DensityPopulator;
|
||||||
import com.raytheon.uf.viz.d2d.ui.MagnificationPopulator;
|
import com.raytheon.uf.viz.d2d.ui.MagnificationPopulator;
|
||||||
import com.raytheon.uf.viz.d2d.ui.actions.DensityHandler;
|
import com.raytheon.uf.viz.d2d.ui.actions.DensityHandler;
|
||||||
|
@ -78,6 +76,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 8, 2009 bgonzale Initial creation
|
* Apr 8, 2009 bgonzale Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -86,7 +85,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DisplayPropertiesDialog extends CaveSWTDialog {
|
public class DisplayPropertiesDialog extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(DisplayPropertiesDialog.class);
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(DisplayPropertiesDialog.class);
|
||||||
|
|
||||||
private Combo scale;
|
private Combo scale;
|
||||||
|
|
||||||
|
@ -171,7 +171,8 @@ public class DisplayPropertiesDialog extends CaveSWTDialog {
|
||||||
* @param editor
|
* @param editor
|
||||||
*/
|
*/
|
||||||
public DisplayPropertiesDialog(Shell parentShell) {
|
public DisplayPropertiesDialog(Shell parentShell) {
|
||||||
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL);
|
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Display Properties");
|
setText("Display Properties");
|
||||||
|
|
||||||
this.sHandler = new ScaleHandler();
|
this.sHandler = new ScaleHandler();
|
||||||
|
|
|
@ -52,7 +52,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.ColorData;
|
||||||
import com.raytheon.viz.ui.dialogs.colordialog.IColorBarAction;
|
import com.raytheon.viz.ui.dialogs.colordialog.IColorBarAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* This is a dialog to determine what range of a rendered display should blink.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -60,6 +60,8 @@ import com.raytheon.viz.ui.dialogs.colordialog.IColorBarAction;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 13, 2010 mschenke Initial creation
|
* Sep 13, 2010 mschenke Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Updated to use bringToTop to
|
||||||
|
* activate existing dialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -92,18 +94,36 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
|
||||||
|
|
||||||
private static Map<AbstractVizResource<?, ?>, ImageBlinkDialog> dialogMap = new HashMap<AbstractVizResource<?, ?>, ImageBlinkDialog>();
|
private static Map<AbstractVizResource<?, ?>, ImageBlinkDialog> dialogMap = new HashMap<AbstractVizResource<?, ?>, ImageBlinkDialog>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If needed creates an instance of this dialog and associates it with the
|
||||||
|
* resource and opens the dialog or activates the dialog if one already
|
||||||
|
* exists for the resource.
|
||||||
|
*
|
||||||
|
* @param rates
|
||||||
|
* @param currRate
|
||||||
|
* @param resource
|
||||||
|
* @param rscProps
|
||||||
|
* @param displays
|
||||||
|
*/
|
||||||
public static synchronized void openDialog(float[] rates, float currRate,
|
public static synchronized void openDialog(float[] rates, float currRate,
|
||||||
AbstractVizResource<?, ?> resource, ResourceProperties rscProps,
|
AbstractVizResource<?, ?> resource, ResourceProperties rscProps,
|
||||||
D2DMapRenderableDisplay[] displays) {
|
D2DMapRenderableDisplay[] displays) {
|
||||||
ImageBlinkDialog dlg = dialogMap.get(resource);
|
ImageBlinkDialog dlg = dialogMap.get(resource);
|
||||||
if (dlg == null) {
|
if (dlg == null || dlg.getShell() == null || dlg.isDisposed()) {
|
||||||
dlg = new ImageBlinkDialog(new Shell(Display.getCurrent()), rates,
|
dlg = new ImageBlinkDialog(new Shell(Display.getCurrent()), rates,
|
||||||
currRate, resource, rscProps, displays);
|
currRate, resource, rscProps, displays);
|
||||||
dialogMap.put(resource, dlg);
|
dialogMap.put(resource, dlg);
|
||||||
|
dlg.open();
|
||||||
|
} else {
|
||||||
|
dlg.bringToTop();
|
||||||
}
|
}
|
||||||
dlg.open();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the dialog associated with the resource.
|
||||||
|
*
|
||||||
|
* @param resource
|
||||||
|
*/
|
||||||
public static synchronized void removeDialog(
|
public static synchronized void removeDialog(
|
||||||
AbstractVizResource<?, ?> resource) {
|
AbstractVizResource<?, ?> resource) {
|
||||||
dialogMap.remove(resource);
|
dialogMap.remove(resource);
|
||||||
|
@ -146,10 +166,8 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
|
||||||
@Override
|
@Override
|
||||||
public void widgetDisposed(DisposeEvent e) {
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
removeDialog(resource);
|
removeDialog(resource);
|
||||||
resource
|
resource.unregisterListener((IDisposeListener) ImageBlinkDialog.this);
|
||||||
.unregisterListener((IDisposeListener) ImageBlinkDialog.this);
|
resource.unregisterListener((IPaintListener) ImageBlinkDialog.this);
|
||||||
resource
|
|
||||||
.unregisterListener((IPaintListener) ImageBlinkDialog.this);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Composite mainComp = new Composite(shell, SWT.NONE);
|
Composite mainComp = new Composite(shell, SWT.NONE);
|
||||||
|
@ -186,9 +204,8 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
|
||||||
|
|
||||||
cbo.add(BlinkToggleAction.NO_BLINK);
|
cbo.add(BlinkToggleAction.NO_BLINK);
|
||||||
|
|
||||||
cbo
|
cbo.setText(rate == BlinkToggleAction.NO_BLINK_VALUE ? BlinkToggleAction.NO_BLINK
|
||||||
.setText(rate == BlinkToggleAction.NO_BLINK_VALUE ? BlinkToggleAction.NO_BLINK
|
: "" + rate);
|
||||||
: "" + rate);
|
|
||||||
|
|
||||||
cbo.addSelectionListener(new SelectionAdapter() {
|
cbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -98,6 +98,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
* AWIPS2 DR Work
|
* AWIPS2 DR Work
|
||||||
* 08/15/2012 1053 jkorman Added capability to save/restore user
|
* 08/15/2012 1053 jkorman Added capability to save/restore user
|
||||||
* print settings.
|
* print settings.
|
||||||
|
* 10/12/2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -107,9 +108,10 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
|
|
||||||
public class PrintDialog extends CaveSWTDialog {
|
public class PrintDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(PrintDialog.class);
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(PrintDialog.class);
|
||||||
|
|
||||||
private static final String SETTINGS_FILENAME = "printSettings";
|
private final String SETTINGS_FILENAME = "printSettings";
|
||||||
|
|
||||||
private ArrayList<PrinterData> printerDataStore = null;
|
private ArrayList<PrinterData> printerDataStore = null;
|
||||||
|
|
||||||
|
@ -136,7 +138,6 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
private Button portraitRadioButton = null;
|
private Button portraitRadioButton = null;
|
||||||
|
|
||||||
|
|
||||||
/* Remaining Settings */
|
/* Remaining Settings */
|
||||||
private Spinner scaleSpinner = null;
|
private Spinner scaleSpinner = null;
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrintDialog(Shell shell) {
|
public PrintDialog(Shell shell) {
|
||||||
super(shell, SWT.DIALOG_TRIM);
|
super(shell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||||
this.setText("Print");
|
this.setText("Print");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,12 +506,12 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
FileDialog fileDialog = new FileDialog(this.shell, SWT.SAVE);
|
FileDialog fileDialog = new FileDialog(this.shell, SWT.SAVE);
|
||||||
|
|
||||||
if(fileName != null) {
|
if (fileName != null) {
|
||||||
int n = fileName.lastIndexOf(File.separator);
|
int n = fileName.lastIndexOf(File.separator);
|
||||||
String path = null;
|
String path = null;
|
||||||
if(n > 0) {
|
if (n > 0) {
|
||||||
path = fileName.substring(0,n);
|
path = fileName.substring(0, n);
|
||||||
fileName = fileName.substring(n+1);
|
fileName = fileName.substring(n + 1);
|
||||||
}
|
}
|
||||||
fileDialog.setFileName(fileName);
|
fileDialog.setFileName(fileName);
|
||||||
fileDialog.setFilterPath(path);
|
fileDialog.setFilterPath(path);
|
||||||
|
@ -710,8 +711,8 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printerSettings.invert) {
|
if (printerSettings.invert) {
|
||||||
// Only invert gray pixels, not colored pixels, awt doesn't not have a
|
// Only invert gray pixels, not colored pixels, awt doesn't not have
|
||||||
// good filter for this.
|
// a good filter for this.
|
||||||
for (int x = 0; x < bi.getWidth(); x += 1) {
|
for (int x = 0; x < bi.getWidth(); x += 1) {
|
||||||
for (int y = 0; y < bi.getHeight(); y += 1) {
|
for (int y = 0; y < bi.getHeight(); y += 1) {
|
||||||
Color color = new Color(bi.getRGB(x, y));
|
Color color = new Color(bi.getRGB(x, y));
|
||||||
|
@ -887,7 +888,8 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
settings.setInvertBlackWhite(invertCheckbox.getSelection());
|
settings.setInvertBlackWhite(invertCheckbox.getSelection());
|
||||||
settings.setPrintGrayScale(grayscaleRadioButton.getSelection());
|
settings.setPrintGrayScale(grayscaleRadioButton.getSelection());
|
||||||
settings.setOrientation(PRINT_ORIENTATION.getPrintOrientation(landscapeRadioButton.getSelection()));
|
settings.setOrientation(PRINT_ORIENTATION
|
||||||
|
.getPrintOrientation(landscapeRadioButton.getSelection()));
|
||||||
|
|
||||||
settings.setCopies(copiesSpinner.getSelection());
|
settings.setCopies(copiesSpinner.getSelection());
|
||||||
settings.setScale(scaleSpinner.getSelection());
|
settings.setScale(scaleSpinner.getSelection());
|
||||||
|
@ -895,7 +897,7 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
settings.setDensity(densityCombo.getSelectionIndex());
|
settings.setDensity(densityCombo.getSelectionIndex());
|
||||||
settings.setMag(magnificationCombo.getSelectionIndex());
|
settings.setMag(magnificationCombo.getSelectionIndex());
|
||||||
|
|
||||||
if(printerRadioButton.getSelection()) {
|
if (printerRadioButton.getSelection()) {
|
||||||
int idx = selectedPrinterCombo.getSelectionIndex();
|
int idx = selectedPrinterCombo.getSelectionIndex();
|
||||||
settings.setPrinterUsed(selectedPrinterCombo.getItem(idx));
|
settings.setPrinterUsed(selectedPrinterCombo.getItem(idx));
|
||||||
settings.setUsePrinterFile(false);
|
settings.setUsePrinterFile(false);
|
||||||
|
@ -907,7 +909,8 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
LocalizationContext ctx = initUserLocalization();
|
LocalizationContext ctx = initUserLocalization();
|
||||||
|
|
||||||
// Get a list of localization files!
|
// Get a list of localization files!
|
||||||
LocalizationFile f = PathManagerFactory.getPathManager().getLocalizationFile(ctx, SETTINGS_FILENAME);
|
LocalizationFile f = PathManagerFactory.getPathManager()
|
||||||
|
.getLocalizationFile(ctx, SETTINGS_FILENAME);
|
||||||
OutputStream strm = null;
|
OutputStream strm = null;
|
||||||
try {
|
try {
|
||||||
strm = f.openOutputStream();
|
strm = f.openOutputStream();
|
||||||
|
@ -917,11 +920,12 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error("Could not save user print settings", e);
|
statusHandler.error("Could not save user print settings", e);
|
||||||
} finally {
|
} finally {
|
||||||
if(f != null) {
|
if (f != null) {
|
||||||
try {
|
try {
|
||||||
strm.close();
|
strm.close();
|
||||||
} catch(IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
statusHandler.error("Could not close user print settings", ioe);
|
statusHandler.error("Could not close user print settings",
|
||||||
|
ioe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -935,53 +939,61 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
LocalizationContext ctx = initUserLocalization();
|
LocalizationContext ctx = initUserLocalization();
|
||||||
|
|
||||||
// Get a list of localization files!
|
// Get a list of localization files!
|
||||||
LocalizationFile f = PathManagerFactory.getPathManager().getLocalizationFile(ctx, SETTINGS_FILENAME);
|
LocalizationFile f = PathManagerFactory.getPathManager()
|
||||||
|
.getLocalizationFile(ctx, SETTINGS_FILENAME);
|
||||||
// If its not there, no previous settings have been saved. Just exit.
|
// If its not there, no previous settings have been saved. Just exit.
|
||||||
if(f.exists()) {
|
if (f.exists()) {
|
||||||
UserPrintSettings settings = null;
|
UserPrintSettings settings = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
settings = (UserPrintSettings) JAXB.unmarshal(f.openInputStream(),UserPrintSettings.class);
|
settings = (UserPrintSettings) JAXB.unmarshal(
|
||||||
|
f.openInputStream(), UserPrintSettings.class);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error("Could not read user print settings-using defaults", e);
|
statusHandler.error(
|
||||||
|
"Could not read user print settings-using defaults", e);
|
||||||
}
|
}
|
||||||
if(settings != null) {
|
if (settings != null) {
|
||||||
invertCheckbox.setSelection(settings.getInvertBlackWhite());
|
invertCheckbox.setSelection(settings.getInvertBlackWhite());
|
||||||
grayscaleRadioButton.setSelection(settings.isPrintGrayScale());
|
grayscaleRadioButton.setSelection(settings.isPrintGrayScale());
|
||||||
colorRadioButton.setSelection(!grayscaleRadioButton.getSelection());
|
colorRadioButton.setSelection(!grayscaleRadioButton
|
||||||
|
.getSelection());
|
||||||
|
|
||||||
landscapeRadioButton.setSelection(settings.getOrientation().isPrintLandscape());
|
landscapeRadioButton.setSelection(settings.getOrientation()
|
||||||
portraitRadioButton.setSelection(!landscapeRadioButton.getSelection());
|
.isPrintLandscape());
|
||||||
|
portraitRadioButton.setSelection(!landscapeRadioButton
|
||||||
|
.getSelection());
|
||||||
|
|
||||||
Integer n = settings.getCopies();
|
Integer n = settings.getCopies();
|
||||||
if(n != null) {
|
if (n != null) {
|
||||||
if(n >= copiesSpinner.getMinimum() && n <= copiesSpinner.getMaximum()) {
|
if (n >= copiesSpinner.getMinimum()
|
||||||
|
&& n <= copiesSpinner.getMaximum()) {
|
||||||
copiesSpinner.setSelection(n);
|
copiesSpinner.setSelection(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
n = settings.getScale();
|
n = settings.getScale();
|
||||||
if(n != null) {
|
if (n != null) {
|
||||||
if(n >= scaleSpinner.getMinimum() && n <= scaleSpinner.getMaximum()) {
|
if (n >= scaleSpinner.getMinimum()
|
||||||
|
&& n <= scaleSpinner.getMaximum()) {
|
||||||
scaleSpinner.setSelection(settings.getScale());
|
scaleSpinner.setSelection(settings.getScale());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
n = settings.getDensity();
|
n = settings.getDensity();
|
||||||
if(n != null) {
|
if (n != null) {
|
||||||
if((n >= 0) && (n < densityCombo.getItemCount())) {
|
if ((n >= 0) && (n < densityCombo.getItemCount())) {
|
||||||
densityCombo.select(n);
|
densityCombo.select(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
n = settings.getMag();
|
n = settings.getMag();
|
||||||
if(n != null) {
|
if (n != null) {
|
||||||
if((n >= 0) && (n < magnificationCombo.getItemCount())) {
|
if ((n >= 0) && (n < magnificationCombo.getItemCount())) {
|
||||||
magnificationCombo.select(n);
|
magnificationCombo.select(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String s = settings.getPrinterFile();
|
String s = settings.getPrinterFile();
|
||||||
if(s != null) {
|
if (s != null) {
|
||||||
destinationFileText.setText(s);
|
destinationFileText.setText(s);
|
||||||
destinationFileText.setToolTipText(s);
|
destinationFileText.setToolTipText(s);
|
||||||
destinationFileText.setEnabled(true);
|
destinationFileText.setEnabled(true);
|
||||||
|
@ -989,15 +1001,15 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
s = settings.getPrinterUsed();
|
s = settings.getPrinterUsed();
|
||||||
if(s != null) {
|
if (s != null) {
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
for(int i = 0;i < selectedPrinterCombo.getItemCount(); i++) {
|
for (int i = 0; i < selectedPrinterCombo.getItemCount(); i++) {
|
||||||
if(s.equals(selectedPrinterCombo.getItem(i))) {
|
if (s.equals(selectedPrinterCombo.getItem(i))) {
|
||||||
idx = i;
|
idx = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(idx > -1) {
|
if (idx > -1) {
|
||||||
selectedPrinterCombo.select(idx);
|
selectedPrinterCombo.select(idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1007,8 +1019,6 @@ public class PrintDialog extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialize the localization for user with the save/load functions
|
* initialize the localization for user with the save/load functions
|
||||||
*
|
*
|
||||||
|
|
|
@ -42,14 +42,17 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.procedures.AlterBundleChangeEvent;
|
||||||
import com.raytheon.uf.viz.core.procedures.AlterBundleFactory;
|
import com.raytheon.uf.viz.core.procedures.AlterBundleFactory;
|
||||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||||
|
import com.raytheon.uf.viz.core.procedures.IAlterBundleChangeListener;
|
||||||
import com.raytheon.uf.viz.core.procedures.IAlterBundleContributor;
|
import com.raytheon.uf.viz.core.procedures.IAlterBundleContributor;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
import com.raytheon.viz.ui.widgets.MenuButton;
|
import com.raytheon.viz.ui.widgets.MenuButton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog for selecting an alternate bundle.
|
* Dialog for altering a bundle.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -63,6 +66,8 @@ import com.raytheon.viz.ui.widgets.MenuButton;
|
||||||
* trying to perform a load.
|
* trying to perform a load.
|
||||||
* Jul 31, 2012 #875 rferrel Use MenuButton to organize entries
|
* Jul 31, 2012 #875 rferrel Use MenuButton to organize entries
|
||||||
* in menus.
|
* in menus.
|
||||||
|
* Oct 03, 2012 #1248 rferrel Bundle change listeners added.
|
||||||
|
* Oct 16, 2012 #1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -70,16 +75,16 @@ import com.raytheon.viz.ui.widgets.MenuButton;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class AlterBundleDlg extends CaveSWTDialog {
|
public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(AlterBundleDlg.class);
|
.getHandler(AlterBundleDlg.class);
|
||||||
|
|
||||||
private static final String Top_MENU_KEY = "<top>";
|
private final String Top_MENU_KEY = "<top>";
|
||||||
|
|
||||||
private static final String MENU_SEP = IAlterBundleContributor.MENU_SEPARATOR;
|
private final String MENU_SEP = IAlterBundleContributor.MENU_SEPARATOR;
|
||||||
|
|
||||||
private static final String MI_SEP = IAlterBundleContributor.MI_SEPARATOR;
|
private final String MI_SEP = IAlterBundleContributor.MI_SEPARATOR;
|
||||||
|
|
||||||
private static final int MENU_SEP_LEN = MENU_SEP.length();
|
private final int MENU_SEP_LEN = MENU_SEP.length();
|
||||||
|
|
||||||
private static class AlterBundleEntry {
|
private static class AlterBundleEntry {
|
||||||
|
|
||||||
|
@ -101,11 +106,17 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private Bundle bundle;
|
private Bundle bundle;
|
||||||
|
|
||||||
|
private Map<IAlterBundleContributor, IAlterBundleChangeListener> contribListenerMap;
|
||||||
|
|
||||||
|
private Map<String, MenuButton> menuButtonMap;
|
||||||
|
|
||||||
protected AlterBundleDlg(Bundle bundle, Shell parentShell) {
|
protected AlterBundleDlg(Bundle bundle, Shell parentShell) {
|
||||||
super(parentShell);
|
super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||||
setText("Alter Bundle on Loading");
|
setText("Alter Bundle on Loading");
|
||||||
|
|
||||||
this.bundle = bundle;
|
this.bundle = bundle;
|
||||||
|
this.contribListenerMap = new HashMap<IAlterBundleContributor, IAlterBundleChangeListener>();
|
||||||
|
this.menuButtonMap = new HashMap<String, MenuButton>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -136,6 +147,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
Map<String, String[]> alterables = contrib.getAlterables();
|
Map<String, String[]> alterables = contrib.getAlterables();
|
||||||
final List<AlterBundleEntry> contribEntries = new ArrayList<AlterBundleEntry>(
|
final List<AlterBundleEntry> contribEntries = new ArrayList<AlterBundleEntry>(
|
||||||
alterables.size());
|
alterables.size());
|
||||||
|
contrib.listenerSetup();
|
||||||
// Create Enable button
|
// Create Enable button
|
||||||
final Button enabledBtn = new Button(comp, SWT.CHECK);
|
final Button enabledBtn = new Button(comp, SWT.CHECK);
|
||||||
GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
|
GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
|
||||||
|
@ -157,13 +169,24 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
IAlterBundleChangeListener bundleListner = new IAlterBundleChangeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void changeBundle(AlterBundleChangeEvent event) {
|
||||||
|
menuButtonChanged(event.getKeys());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
contribListenerMap.put(contrib, bundleListner);
|
||||||
|
contrib.addAlterBundleChangeListener(bundleListner);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Entry<String, String[]> entry : alterables.entrySet()) {
|
for (Entry<String, String[]> entry : alterables.entrySet()) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
new Label(comp, SWT.NONE);
|
new Label(comp, SWT.NONE);
|
||||||
}
|
}
|
||||||
Label label = new Label(comp, SWT.CENTER);
|
Label label = new Label(comp, SWT.CENTER);
|
||||||
label.setText(entry.getKey() + " = ");
|
String key = entry.getKey();
|
||||||
|
label.setText(key + " = ");
|
||||||
|
|
||||||
final AlterBundleEntry abe = new AlterBundleEntry();
|
final AlterBundleEntry abe = new AlterBundleEntry();
|
||||||
abe.contributor = contrib;
|
abe.contributor = contrib;
|
||||||
|
@ -191,9 +214,11 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
menuButton.setLayoutData(gd);
|
menuButton.setLayoutData(gd);
|
||||||
menuButton.addSelectionListener(listener);
|
menuButton.addSelectionListener(listener);
|
||||||
Menu menu = new Menu(menuButton);
|
Menu menu = new Menu(menuButton);
|
||||||
MenuItem topMi = createMenu(menu, entry);
|
MenuItem topMi = createMenu(menu, entry.getValue());
|
||||||
menuButton.setMenu(menu);
|
menuButton.setMenu(menu);
|
||||||
menuButton.setSelectedItem(topMi);
|
menuButton.setSelectedItem(topMi);
|
||||||
|
menuButton.setData(contrib);
|
||||||
|
menuButtonMap.put(key, menuButton);
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +226,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private MenuItem createMenu(Menu topMenu, Entry<String, String[]> entry) {
|
private MenuItem createMenu(Menu topMenu, String[] values) {
|
||||||
Map<String, Menu> menuMap = new HashMap<String, Menu>();
|
Map<String, Menu> menuMap = new HashMap<String, Menu>();
|
||||||
|
|
||||||
menuMap.put(Top_MENU_KEY, topMenu);
|
menuMap.put(Top_MENU_KEY, topMenu);
|
||||||
|
@ -210,7 +235,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
MenuItem mi = null;
|
MenuItem mi = null;
|
||||||
MenuItem topMi = null;
|
MenuItem topMi = null;
|
||||||
|
|
||||||
for (String value : entry.getValue()) {
|
for (String value : values) {
|
||||||
if (value.startsWith(MENU_SEP)) {
|
if (value.startsWith(MENU_SEP)) {
|
||||||
value = value.substring(MENU_SEP_LEN);
|
value = value.substring(MENU_SEP_LEN);
|
||||||
}
|
}
|
||||||
|
@ -331,8 +356,36 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
||||||
shell.close();
|
shell.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void menuButtonChanged(final String[] keys) {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
for (String key : keys) {
|
||||||
|
MenuButton menuButton = menuButtonMap.get(key);
|
||||||
|
IAlterBundleContributor contrib = (IAlterBundleContributor) menuButton
|
||||||
|
.getData();
|
||||||
|
String[] values = contrib.getAlterables(key);
|
||||||
|
Menu menu = new Menu(menuButton);
|
||||||
|
MenuItem topMi = createMenu(menu, values);
|
||||||
|
menuButton.setMenu(menu);
|
||||||
|
menuButton.setSelectedItem(topMi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void cancel() {
|
private void cancel() {
|
||||||
bundle = null;
|
bundle = null;
|
||||||
shell.close();
|
shell.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void disposed() {
|
||||||
|
for (IAlterBundleContributor contrib : contribListenerMap.keySet()) {
|
||||||
|
contrib.removeAlterBundeChangeListener(contribListenerMap
|
||||||
|
.get(contrib));
|
||||||
|
contrib.listenerShutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,29 @@ import com.raytheon.viz.ui.UiUtil;
|
||||||
import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||||
import com.raytheon.viz.ui.actions.SaveBundle;
|
import com.raytheon.viz.ui.actions.SaveBundle;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dialog to get user options on history to display.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking AlterBundleDlg.
|
||||||
|
* Oct 16, 2012 1229 rferrel Make dialog non-blocking.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
public class HistoryListDlg extends CaveSWTDialog {
|
public class HistoryListDlg extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(HistoryListDlg.class);
|
.getHandler(HistoryListDlg.class);
|
||||||
|
|
||||||
private List dataList;
|
private List dataList;
|
||||||
|
@ -72,8 +91,10 @@ public class HistoryListDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private Button closeBtn;
|
private Button closeBtn;
|
||||||
|
|
||||||
|
private AlterBundleDlg alterDlg;
|
||||||
|
|
||||||
public HistoryListDlg(Shell parent) {
|
public HistoryListDlg(Shell parent) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE);
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
|
||||||
setText("History List");
|
setText("History List");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -273,7 +294,7 @@ public class HistoryListDlg extends CaveSWTDialog {
|
||||||
closeBtn.addSelectionListener(new SelectionAdapter() {
|
closeBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -284,14 +305,24 @@ public class HistoryListDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Bundle b = HistoryList.getInstance().getBundle(
|
if (mustCreate(alterDlg)) {
|
||||||
dataList.getSelectionIndex(), false);
|
Bundle b = HistoryList.getInstance().getBundle(
|
||||||
AlterBundleDlg dlg = new AlterBundleDlg(b, getParent());
|
dataList.getSelectionIndex(), false);
|
||||||
b = (Bundle) dlg.open();
|
alterDlg = new AlterBundleDlg(b, getShell());
|
||||||
|
alterDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
if (b != null) {
|
@Override
|
||||||
// Load was issued in alterBundleDlg
|
public void dialogClosed(Object returnValue) {
|
||||||
loadAlterBundle(b);
|
if (returnValue instanceof Bundle) {
|
||||||
|
// Load was issued in alterBundleDlg
|
||||||
|
Bundle b = (Bundle) returnValue;
|
||||||
|
loadAlterBundle(b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
alterDlg.open();
|
||||||
|
} else {
|
||||||
|
alterDlg.bringToTop();
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
final String err = "Error altering bundle";
|
final String err = "Error altering bundle";
|
||||||
|
|
|
@ -23,7 +23,7 @@ package com.raytheon.uf.viz.d2d.ui.dialogs.procedures;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -82,6 +82,7 @@ import com.raytheon.viz.ui.HistoryList;
|
||||||
import com.raytheon.viz.ui.UiUtil;
|
import com.raytheon.viz.ui.UiUtil;
|
||||||
import com.raytheon.viz.ui.actions.SaveBundle;
|
import com.raytheon.viz.ui.actions.SaveBundle;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,6 +95,10 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial Creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking AlterBundleDlg.
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes to have displayDialog method.
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking ProcedureListDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -102,7 +107,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
*/
|
*/
|
||||||
public class ProcedureDlg extends CaveSWTDialog {
|
public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ProcedureDlg.class);
|
.getHandler(ProcedureDlg.class);
|
||||||
|
|
||||||
public static final String ORIGINAL = "Original Location";
|
public static final String ORIGINAL = "Original Location";
|
||||||
|
@ -111,7 +116,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
public static final String PROCEDURES_DIR = "/procedures";
|
public static final String PROCEDURES_DIR = "/procedures";
|
||||||
|
|
||||||
private static Collection<ProcedureDlg> openDialogs = new ArrayList<ProcedureDlg>();
|
private static final Map<String, ProcedureDlg> openDialogs = new HashMap<String, ProcedureDlg>();
|
||||||
|
|
||||||
private Font font;
|
private Font font;
|
||||||
|
|
||||||
|
@ -131,9 +136,9 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private Button firstNextBtn;
|
private Button firstNextBtn;
|
||||||
|
|
||||||
private static final String FIRST = "First";
|
private final String FIRST = "First";
|
||||||
|
|
||||||
private static final String NEXT = "Next";
|
private final String NEXT = "Next";
|
||||||
|
|
||||||
private Button loadBtn;
|
private Button loadBtn;
|
||||||
|
|
||||||
|
@ -167,6 +172,10 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private final java.util.List<BundlePair> bundles;
|
private final java.util.List<BundlePair> bundles;
|
||||||
|
|
||||||
|
private AlterBundleDlg alterDlg;
|
||||||
|
|
||||||
|
private ProcedureListDlg saveAsDlg;
|
||||||
|
|
||||||
private ProcedureDlg(String fileName, Procedure p, Shell parent) {
|
private ProcedureDlg(String fileName, Procedure p, Shell parent) {
|
||||||
// Win32
|
// Win32
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
|
||||||
|
@ -223,7 +232,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
protected void disposed() {
|
protected void disposed() {
|
||||||
font.dispose();
|
font.dispose();
|
||||||
synchronized (openDialogs) {
|
synchronized (openDialogs) {
|
||||||
openDialogs.remove(this);
|
openDialogs.remove(fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -877,19 +886,34 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
BundlePair bp = new BundlePair();
|
if (mustCreate(alterDlg)) {
|
||||||
bp.name = bundles.get(dataList.getSelectionIndex()).name;
|
final BundlePair bp = new BundlePair();
|
||||||
bp.xml = bundles.get(dataList.getSelectionIndex()).xml;
|
bp.name = bundles.get(dataList.getSelectionIndex()).name;
|
||||||
Bundle b = Bundle.unmarshalBundle(bp.xml, null);
|
bp.xml = bundles.get(dataList.getSelectionIndex()).xml;
|
||||||
|
Bundle b = Bundle.unmarshalBundle(bp.xml, null);
|
||||||
|
|
||||||
AlterBundleDlg dlg = new AlterBundleDlg(b, getParent());
|
alterDlg = new AlterBundleDlg(b, getShell());
|
||||||
b = (Bundle) dlg.open();
|
alterDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
if (b != null) {
|
@Override
|
||||||
// Load was issued in alterBundleDlg
|
public void dialogClosed(Object returnValue) {
|
||||||
bp.xml = b.toXML();
|
if (returnValue instanceof Bundle) {
|
||||||
saveProcedure();
|
Bundle b = (Bundle) returnValue;
|
||||||
load(b);
|
try {
|
||||||
|
// Load was issued in alterBundleDlg
|
||||||
|
bp.xml = b.toXML();
|
||||||
|
saveProcedure();
|
||||||
|
load(b);
|
||||||
|
} catch (VizException e) {
|
||||||
|
final String err = "Error altering bundle";
|
||||||
|
statusHandler.handle(Priority.PROBLEM, err, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
alterDlg.open();
|
||||||
|
} else {
|
||||||
|
alterDlg.bringToTop();
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
final String err = "Error altering bundle";
|
final String err = "Error altering bundle";
|
||||||
|
@ -898,18 +922,38 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showSaveAsDlg() {
|
private void showSaveAsDlg() {
|
||||||
ProcedureListDlg dlg = new ProcedureListDlg("Save Procedure As...",
|
if (mustCreate(saveAsDlg)) {
|
||||||
shell, ProcedureListDlg.Mode.SAVE);
|
saveAsDlg = new ProcedureListDlg("Save Procedure As...", shell,
|
||||||
dlg.open();
|
ProcedureListDlg.Mode.SAVE);
|
||||||
|
|
||||||
String fn = dlg.getSelectedFileName();
|
saveAsDlg.setCloseCallback(new ICloseCallback() {
|
||||||
if (fn == null) {
|
|
||||||
return;
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
String fn = saveAsDlg.getSelectedFileName();
|
||||||
|
if (fn != null) {
|
||||||
|
ProcedureDlg oldDlg = getDialog(fn);
|
||||||
|
|
||||||
|
if (oldDlg != null) {
|
||||||
|
oldDlg.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update mapping to new file name.
|
||||||
|
synchronized (openDialogs) {
|
||||||
|
openDialogs.remove(fileName);
|
||||||
|
openDialogs.put(fn, ProcedureDlg.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
frozen = saveAsDlg.isFrozen();
|
||||||
|
fileName = fn;
|
||||||
|
saveProcedure();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
saveAsDlg.open();
|
||||||
|
} else {
|
||||||
|
saveAsDlg.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
frozen = dlg.isFrozen();
|
|
||||||
fileName = fn;
|
|
||||||
saveProcedure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1020,35 +1064,30 @@ public class ProcedureDlg extends CaveSWTDialog {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static ProcedureDlg getDialog(String fileName) {
|
public static ProcedureDlg getDialog(String fileName) {
|
||||||
synchronized (openDialogs) {
|
synchronized (ProcedureDlg.openDialogs) {
|
||||||
if (fileName != null) {
|
ProcedureDlg dialog = openDialogs.get(fileName);
|
||||||
for (ProcedureDlg dialog : openDialogs) {
|
return dialog;
|
||||||
if (fileName.equals(dialog.fileName)) {
|
|
||||||
return dialog;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the ProcedureDlg for the given fileName. If the fileName is null or if there is no open dialog, create a new ProcedureDlg.
|
* Get the ProcedureDlg for the given fileName and display it.
|
||||||
*
|
*
|
||||||
* @param fileName
|
* @param fileName
|
||||||
* @param p
|
* @param p
|
||||||
* @param parent
|
* @param parent
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public static ProcedureDlg getOrCreateDialog(String fileName, Procedure p,
|
public static void displayDialog(String fileName, Procedure p, Shell parent) {
|
||||||
Shell parent) {
|
|
||||||
synchronized (openDialogs) {
|
synchronized (openDialogs) {
|
||||||
ProcedureDlg dialog = getDialog(fileName);
|
ProcedureDlg dialog = getDialog(fileName);
|
||||||
if (dialog == null) {
|
if (dialog == null || dialog.getShell() == null
|
||||||
|
|| dialog.isDisposed()) {
|
||||||
dialog = new ProcedureDlg(fileName, p, parent);
|
dialog = new ProcedureDlg(fileName, p, parent);
|
||||||
openDialogs.add(dialog);
|
openDialogs.put(fileName, dialog);
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
return dialog;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* A dialog which displays a list of procedures for opening, saving, or deleting.
|
* A dialog which displays a list of procedures for opening, saving, or
|
||||||
|
* deleting.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -67,6 +68,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ??? Initial creation
|
* ??? Initial creation
|
||||||
* 07/31/2012 DR 15036 D. Friedman Ensure current user's procedures
|
* 07/31/2012 DR 15036 D. Friedman Ensure current user's procedures
|
||||||
* are visible.
|
* are visible.
|
||||||
|
* 10/16/2012 1229 rferrel Made dialog non-blocking.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author unknown
|
* @author unknown
|
||||||
|
@ -80,8 +82,6 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private Text procedureTF;
|
private Text procedureTF;
|
||||||
|
|
||||||
private LocalizationFile selectedFile;
|
|
||||||
|
|
||||||
private TreeViewer treeViewer;
|
private TreeViewer treeViewer;
|
||||||
|
|
||||||
private Button okBtn;
|
private Button okBtn;
|
||||||
|
@ -103,7 +103,7 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
private final Mode mode;
|
private final Mode mode;
|
||||||
|
|
||||||
public ProcedureListDlg(String title, Shell parent, Mode mode) {
|
public ProcedureListDlg(String title, Shell parent, Mode mode) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE); // Win32
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK); // Win32
|
||||||
setText(title);
|
setText(title);
|
||||||
|
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
@ -343,7 +343,8 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
public void run() {
|
public void run() {
|
||||||
TreeItem[] items = treeViewer.getTree().getItems();
|
TreeItem[] items = treeViewer.getTree().getItems();
|
||||||
if (items != null && items.length > 0)
|
if (items != null && items.length > 0)
|
||||||
treeViewer.getTree().showItem(items[items.length - 1]);
|
treeViewer.getTree().showItem(
|
||||||
|
items[items.length - 1]);
|
||||||
treeViewer.reveal(find);
|
treeViewer.reveal(find);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -401,7 +402,7 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
cancelBtn.addSelectionListener(new SelectionAdapter() {
|
cancelBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -420,13 +421,6 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the fileName
|
|
||||||
*/
|
|
||||||
public LocalizationFile getSelectedFile() {
|
|
||||||
return selectedFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the fileName
|
* @return the fileName
|
||||||
*/
|
*/
|
||||||
|
@ -492,21 +486,22 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
+ " already exists. Overwrite anyways?");
|
+ " already exists. Overwrite anyways?");
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
fileName = procedureTF.getText();
|
fileName = procedureTF.getText();
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fileName = procedureTF.getText();
|
fileName = procedureTF.getText();
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
} else if (mode == Mode.OPEN) {
|
} else if (mode == Mode.OPEN) {
|
||||||
fileName = procedureTF.getText();
|
fileName = procedureTF.getText();
|
||||||
if (tmp instanceof ProcedureTree) {
|
if (tmp instanceof ProcedureTree) {
|
||||||
// it must be a procedure tree, that is what the content
|
// it must be a procedure tree, that is what the content
|
||||||
// provider uses internally
|
// provider uses internally
|
||||||
selectedFile = ((ProcedureTree) tmp).getFile();
|
LocalizationFile selectedFile = ((ProcedureTree) tmp).getFile();
|
||||||
|
setReturnValue(selectedFile);
|
||||||
}
|
}
|
||||||
shell.dispose();
|
close();
|
||||||
} else if (mode == Mode.DELETE) {
|
} else if (mode == Mode.DELETE) {
|
||||||
|
|
||||||
TreeItem[] selection = treeViewer.getTree().getSelection();
|
TreeItem[] selection = treeViewer.getTree().getSelection();
|
||||||
|
@ -520,9 +515,11 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
||||||
if (tmp instanceof ProcedureTree) {
|
if (tmp instanceof ProcedureTree) {
|
||||||
// it must be a procedure tree, that is what the content
|
// it must be a procedure tree, that is what the content
|
||||||
// provider uses internally
|
// provider uses internally
|
||||||
selectedFile = ((ProcedureTree) tmp).getFile();
|
LocalizationFile selectedFile = ((ProcedureTree) tmp)
|
||||||
|
.getFile();
|
||||||
|
setReturnValue(selectedFile);
|
||||||
}
|
}
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,32 @@ import org.eclipse.ui.PlatformUI;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.CreateProjectionDialog;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.CreateProjectionDialog;
|
||||||
import com.raytheon.viz.ui.tools.AbstractTool;
|
import com.raytheon.viz.ui.tools.AbstractTool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler class for controlling the Create Projection dialog.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
||||||
|
private CreateProjectionDialog dlg;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see com.raytheon.viz.ui.tools.AbstractTool#execute(org.eclipse.core.commands.ExecutionEvent)
|
* @see
|
||||||
|
* com.raytheon.viz.ui.tools.AbstractTool#execute(org.eclipse.core.commands
|
||||||
|
* .ExecutionEvent)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
@ -42,9 +62,13 @@ public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
|
|
||||||
CreateProjectionDialog dlg = new CreateProjectionDialog(shell);
|
if (dlg == null || dlg.getShell() == null || dlg.isDisposed()) {
|
||||||
|
dlg = new CreateProjectionDialog(shell);
|
||||||
dlg.open();
|
dlg.setBlockOnOpen(false);
|
||||||
|
dlg.open();
|
||||||
|
} else {
|
||||||
|
dlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.Display;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||||
import com.raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode;
|
import com.raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +39,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 1, 2009 mschenke Initial creation
|
* Sep 1, 2009 mschenke Initial creation
|
||||||
|
* Oct 16, 2012 1229 rferrel Changes for non-blocking BackgroundColorDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -67,12 +69,18 @@ public class SetBackgroundColorAction extends AbstractRightClickAction {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
BackgroundColorDialog dialog = dialogMap.get(container);
|
BackgroundColorDialog dialog = dialogMap.get(container);
|
||||||
if (dialog == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new BackgroundColorDialog(Display.getCurrent()
|
dialog = new BackgroundColorDialog(Display.getCurrent()
|
||||||
.getActiveShell(), container, mode);
|
.getActiveShell(), container, mode);
|
||||||
dialogMap.put(container, dialog);
|
dialogMap.put(container, dialog);
|
||||||
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
dialogMap.remove(container);
|
||||||
|
}
|
||||||
|
});
|
||||||
dialog.open();
|
dialog.open();
|
||||||
dialogMap.remove(container);
|
|
||||||
} else {
|
} else {
|
||||||
dialog.bringToTop();
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTWizardDlg;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 14, 2010 mschenke Initial creation
|
* Dec 14, 2010 mschenke Initial creation
|
||||||
|
* Oct 22, 2012 1229 rferrel Changes for non-blocking CaveSWTWizardDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTWizardDlg;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class NewDerivedParameterAction extends Action {
|
public class NewDerivedParameterAction extends Action {
|
||||||
|
private CaveSWTWizardDlg dialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -55,9 +57,13 @@ public class NewDerivedParameterAction extends Action {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
DerivedParamWizard wizard = new DerivedParamWizard();
|
DerivedParamWizard wizard = new DerivedParamWizard();
|
||||||
CaveSWTWizardDlg dialog = new CaveSWTWizardDlg(VizWorkbenchManager
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getInstance().getCurrentWindow().getShell(), wizard);
|
dialog = new CaveSWTWizardDlg(VizWorkbenchManager.getInstance()
|
||||||
dialog.open();
|
.getCurrentWindow().getShell(), wizard);
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,11 +99,8 @@ public class KmlColormappedImageExtension extends
|
||||||
|
|
||||||
private static class Generator extends KmlGroundOverlayGenerator {
|
private static class Generator extends KmlGroundOverlayGenerator {
|
||||||
|
|
||||||
private final DrawableImage[] images;
|
|
||||||
|
|
||||||
public Generator(float alpha, DrawableImage[] images) {
|
public Generator(float alpha, DrawableImage[] images) {
|
||||||
super(alpha);
|
super(alpha, images);
|
||||||
this.images = images;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -40,6 +40,8 @@ import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
||||||
|
import com.raytheon.uf.viz.core.DrawableImage;
|
||||||
|
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||||
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapData;
|
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapData;
|
||||||
import com.raytheon.uf.viz.core.data.prep.Colormapper;
|
import com.raytheon.uf.viz.core.data.prep.Colormapper;
|
||||||
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
||||||
|
@ -74,7 +76,21 @@ public abstract class KmlGroundOverlayGenerator extends KmlFeatureGenerator {
|
||||||
|
|
||||||
protected final double alpha;
|
protected final double alpha;
|
||||||
|
|
||||||
public KmlGroundOverlayGenerator(double alpha) {
|
protected final DrawableImage[] images;
|
||||||
|
|
||||||
|
public KmlGroundOverlayGenerator(double alpha, DrawableImage[] images) {
|
||||||
|
this.images = new DrawableImage[images.length];
|
||||||
|
for (int i = 0; i < images.length; i += 1) {
|
||||||
|
// Clone the DrawableImage so that if whatever is drawing modifies
|
||||||
|
// or disposes of it then when the generator runs it will still draw
|
||||||
|
// what was rendered.
|
||||||
|
PixelCoverage oldCov = images[i].getCoverage();
|
||||||
|
PixelCoverage newCov = new PixelCoverage(oldCov.getUl(),
|
||||||
|
oldCov.getUr(), oldCov.getLr(), oldCov.getLl());
|
||||||
|
newCov.setMesh(oldCov.getMesh());
|
||||||
|
this.images[i] = new DrawableImage(images[i].getImage(), newCov,
|
||||||
|
images[i].getMode());
|
||||||
|
}
|
||||||
this.alpha = alpha;
|
this.alpha = alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.kml.export.graphics.ext;
|
package com.raytheon.uf.viz.kml.export.graphics.ext;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
@ -34,7 +33,6 @@ import org.opengis.referencing.operation.TransformException;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.AbstractDataWrapper;
|
import com.raytheon.uf.common.geospatial.interpolation.data.AbstractDataWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteBufferWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
||||||
|
@ -121,11 +119,8 @@ public class KmlMosaicImageExtension extends
|
||||||
|
|
||||||
private final ColorMapParameters parameters;
|
private final ColorMapParameters parameters;
|
||||||
|
|
||||||
private final DrawableImage[] images;
|
|
||||||
|
|
||||||
public Generator(float alpha, KmlMosaicImage image) {
|
public Generator(float alpha, KmlMosaicImage image) {
|
||||||
super(alpha);
|
super(alpha, image.getImagesToMosaic());
|
||||||
this.images = image.getImagesToMosaic();
|
|
||||||
this.parameters = image.getColorMapParameters();
|
this.parameters = image.getColorMapParameters();
|
||||||
this.mosaicComparator = image.getMosaicComparator();
|
this.mosaicComparator = image.getMosaicComparator();
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,11 +77,8 @@ public class KmlRasterImageExtension extends
|
||||||
|
|
||||||
private static class Generator extends KmlGroundOverlayGenerator {
|
private static class Generator extends KmlGroundOverlayGenerator {
|
||||||
|
|
||||||
private final DrawableImage[] images;
|
|
||||||
|
|
||||||
public Generator(float alpha, DrawableImage[] images) {
|
public Generator(float alpha, DrawableImage[] images) {
|
||||||
super(alpha);
|
super(alpha, images);
|
||||||
this.images = images;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 2009-12-02 vkorolev Initial creation.
|
* 2009-12-02 vkorolev Initial creation.
|
||||||
* 2010-01-21 4268 vkorolev Fixed Trend Plot
|
* 2010-01-21 4268 vkorolev Fixed Trend Plot
|
||||||
|
* 2012-10-15 1229 vkorolev Changes for non-blocking TrendPlotDlg
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author vkorolev
|
* @author vkorolev
|
||||||
|
@ -65,9 +66,12 @@ public class TrendPlotDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
public Date curdate;
|
public Date curdate;
|
||||||
|
|
||||||
|
public String var;
|
||||||
|
|
||||||
public TrendPlotDlg(Shell parent, String selectedZone, String station,
|
public TrendPlotDlg(Shell parent, String selectedZone, String station,
|
||||||
ArrayList<String> product, String dataName) {
|
ArrayList<String> product, String dataName) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE);
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK
|
||||||
|
| CAVE.INDEPENDENT_SHELL);
|
||||||
setText(getTrendPlotName(product) + " Trend Plot for " + station + "#"
|
setText(getTrendPlotName(product) + " Trend Plot for " + station + "#"
|
||||||
+ dataName);
|
+ dataName);
|
||||||
|
|
||||||
|
@ -89,13 +93,13 @@ public class TrendPlotDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initializeComponents(Shell shell) {
|
protected void initializeComponents(Shell shell) {
|
||||||
setReturnValue(false);
|
setReturnValue(product);
|
||||||
// Initialize all layouts
|
// Initialize all layouts
|
||||||
Iterator<String> prodVar = product.iterator();
|
Iterator<String> prodVar = product.iterator();
|
||||||
while (prodVar.hasNext()) {
|
while (prodVar.hasNext()) {
|
||||||
String varname = prodVar.next();
|
String var = prodVar.next();
|
||||||
new TrendPlotCanvas(shell, selectedZone, station, varname,
|
new TrendPlotCanvas(shell, selectedZone, station, var, dataName,
|
||||||
dataName, obData);
|
obData);
|
||||||
}
|
}
|
||||||
addCloseBtn();
|
addCloseBtn();
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,6 +168,7 @@ public class PointsToolLayer extends AbstractMovableToolLayer<Point> implements
|
||||||
for (IFont font : fonts.values()) {
|
for (IFont font : fonts.values()) {
|
||||||
font.dispose();
|
font.dispose();
|
||||||
}
|
}
|
||||||
|
fonts.clear();
|
||||||
this.resourceData.removeChangeListener(this);
|
this.resourceData.removeChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,8 @@ import com.raytheon.rcm.products.RadarProduct;
|
||||||
import com.raytheon.rcm.products.RadarProduct.Param;
|
import com.raytheon.rcm.products.RadarProduct.Param;
|
||||||
import com.raytheon.rcm.products.Usage;
|
import com.raytheon.rcm.products.Usage;
|
||||||
import com.raytheon.rcm.request.Request;
|
import com.raytheon.rcm.request.Request;
|
||||||
|
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.points.PointsDataManager;
|
||||||
import com.raytheon.uf.viz.points.data.IPointNode;
|
import com.raytheon.uf.viz.points.data.IPointNode;
|
||||||
import com.raytheon.uf.viz.radarapps.core.RadarApps;
|
import com.raytheon.uf.viz.radarapps.core.RadarApps;
|
||||||
|
@ -95,6 +97,7 @@ import com.raytheon.viz.ui.widgets.MinimumSizeComposite;
|
||||||
* converted to abstract class making the
|
* converted to abstract class making the
|
||||||
* needed methods abstract.
|
* needed methods abstract.
|
||||||
* Jul 31, 2012 #875 rferrel Points now group in menu items.
|
* Jul 31, 2012 #875 rferrel Points now group in menu items.
|
||||||
|
* Oct 04, 2012 #1248 rferrel Added Point change listener.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -1176,7 +1179,7 @@ public abstract class BaseRadarProductUI {
|
||||||
});
|
});
|
||||||
geomCombo = c;
|
geomCombo = c;
|
||||||
} else {
|
} else {
|
||||||
MenuButton mb = new MenuButton(r2);
|
final MenuButton mb = new MenuButton(r2);
|
||||||
mb.addSelectionListener(new SelectionAdapter() {
|
mb.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
MenuItem item = (MenuItem) e.data;
|
MenuItem item = (MenuItem) e.data;
|
||||||
|
@ -1186,9 +1189,43 @@ public abstract class BaseRadarProductUI {
|
||||||
mb.setMinimumSize(SWT.DEFAULT, SWT.DEFAULT);
|
mb.setMinimumSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||||
|
|
||||||
Menu menu = new Menu(mb);
|
Menu menu = new Menu(mb);
|
||||||
createMenuItems(menu, null);
|
MenuItem firstItem = createMenuItems(menu, null);
|
||||||
mb.setMenu(menu);
|
mb.setMenu(menu);
|
||||||
|
mb.setSelectedItem(firstItem);
|
||||||
|
|
||||||
|
final IPointChangedListener pointChangeListener = new IPointChangedListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pointChanged() {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
String name = mb.getSelectedItem().getText();
|
||||||
|
Menu menu = new Menu(mb);
|
||||||
|
MenuItem firstItem = createMenuItems(menu, null);
|
||||||
|
mb.setMenu(menu);
|
||||||
|
mb.setSelectedItem(name);
|
||||||
|
if (mb.getSelectedItem() == null) {
|
||||||
|
mb.setSelectedItem(firstItem);
|
||||||
|
onGeomSelected(firstItem.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
PointsDataManager.getInstance().addPointsChangedListener(
|
||||||
|
pointChangeListener);
|
||||||
geomCombo = mb;
|
geomCombo = mb;
|
||||||
|
mb.addDisposeListener(new DisposeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
|
PointsDataManager.getInstance()
|
||||||
|
.removePointsChangedListener(pointChangeListener);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
azRanLabel = new Label(r2, SWT.LEFT);
|
azRanLabel = new Label(r2, SWT.LEFT);
|
||||||
|
@ -1220,10 +1257,11 @@ public abstract class BaseRadarProductUI {
|
||||||
setupRow(r, r2, b);
|
setupRow(r, r2, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createMenuItems(Menu menu, IPointNode root) {
|
private MenuItem createMenuItems(Menu menu, IPointNode root) {
|
||||||
MenuItem item = null;
|
MenuItem item = null;
|
||||||
for (IPointNode node : PointsDataManager.getInstance().getChildren(
|
MenuItem firstItem = null;
|
||||||
root)) {
|
for (IPointNode node : PointsDataManager.getInstance()
|
||||||
|
.getChildren(root)) {
|
||||||
if (node.isGroup()) {
|
if (node.isGroup()) {
|
||||||
if (PointsDataManager.getInstance().getChildren(node).size() == 0) {
|
if (PointsDataManager.getInstance().getChildren(node).size() == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1231,13 +1269,20 @@ public abstract class BaseRadarProductUI {
|
||||||
Menu childMenu = new Menu(menu);
|
Menu childMenu = new Menu(menu);
|
||||||
item = new MenuItem(menu, SWT.CASCADE);
|
item = new MenuItem(menu, SWT.CASCADE);
|
||||||
item.setMenu(childMenu);
|
item.setMenu(childMenu);
|
||||||
createMenuItems(childMenu, node);
|
MenuItem it = createMenuItems(childMenu, node);
|
||||||
|
if (firstItem == null) {
|
||||||
|
firstItem = it;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
item = new MenuItem(menu, SWT.PUSH);
|
item = new MenuItem(menu, SWT.PUSH);
|
||||||
|
if (firstItem == null) {
|
||||||
|
firstItem = item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
item.setText(node.getName());
|
item.setText(node.getName());
|
||||||
item.setData(node);
|
item.setData(node);
|
||||||
}
|
}
|
||||||
|
return firstItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onLoadBaselines() {
|
protected void onLoadBaselines() {
|
||||||
|
@ -2003,7 +2048,14 @@ public abstract class BaseRadarProductUI {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MenuButton mb = (MenuButton) geomCombo;
|
MenuButton mb = (MenuButton) geomCombo;
|
||||||
|
|
||||||
|
// Check to see if desired point still exists.
|
||||||
|
MenuItem item = mb.getSelectedItem();
|
||||||
mb.setSelectedItem(desiredGeom);
|
mb.setSelectedItem(desiredGeom);
|
||||||
|
if (mb.getSelectedItem() == null) {
|
||||||
|
mb.setSelectedItem(item);
|
||||||
|
onGeomSelected(item.getText());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupServers() throws VizException {
|
protected void setupServers() throws VizException {
|
||||||
HttpClient.getInstance().enableGzipResponseHandling();
|
HttpClient.getInstance().setGzipResponseHandling(true);
|
||||||
if (promptUI) {
|
if (promptUI) {
|
||||||
ThinClientConnectivityDialog dlg = new ThinClientConnectivityDialog(
|
ThinClientConnectivityDialog dlg = new ThinClientConnectivityDialog(
|
||||||
checkAlertviz);
|
checkAlertviz);
|
||||||
|
@ -100,10 +100,10 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
||||||
.getString(ThinClientPreferenceConstants.P_SERVICES_PROXY));
|
.getString(ThinClientPreferenceConstants.P_SERVICES_PROXY));
|
||||||
VizApp.setPypiesServer(store
|
VizApp.setPypiesServer(store
|
||||||
.getString(ThinClientPreferenceConstants.P_PYPIES_PROXY));
|
.getString(ThinClientPreferenceConstants.P_PYPIES_PROXY));
|
||||||
if (store
|
boolean compressRequests = store
|
||||||
.getBoolean(ThinClientPreferenceConstants.P_ENABLE_REQUEST_COMPRESSION)) {
|
.getBoolean(ThinClientPreferenceConstants.P_ENABLE_REQUEST_COMPRESSION);
|
||||||
HttpClient.getInstance().enableRequestCompression();
|
HttpClient.getInstance().setCompressRequests(compressRequests);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
GetServersRequest req = new GetServersRequest();
|
GetServersRequest req = new GetServersRequest();
|
||||||
GetServersResponse resp = (GetServersResponse) ThriftClient
|
GetServersResponse resp = (GetServersResponse) ThriftClient
|
||||||
|
|
|
@ -19,28 +19,21 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.alerts.jobs;
|
package com.raytheon.viz.alerts.jobs;
|
||||||
|
|
||||||
import java.lang.reflect.Array;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.IdentityHashMap;
|
import java.util.IdentityHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.uf.viz.core.RecordFactory;
|
|
||||||
import com.raytheon.uf.viz.core.alerts.AbstractAlertMessageParser;
|
|
||||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||||
import com.raytheon.uf.viz.core.comm.Loader;
|
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
|
@ -76,39 +69,13 @@ public class AutoUpdater implements IAlertObserver {
|
||||||
|
|
||||||
private static final int MAX_ERRORS = 10;
|
private static final int MAX_ERRORS = 10;
|
||||||
|
|
||||||
private static class AlertMessageToPDOParser extends
|
|
||||||
AbstractAlertMessageParser {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object parseAlertMessage(AlertMessage message,
|
|
||||||
AbstractRequestableResourceData reqResourceData)
|
|
||||||
throws VizException {
|
|
||||||
Object objectToSend = null;
|
|
||||||
Map<String, Object> attribs = new HashMap<String, Object>(
|
|
||||||
message.decodedAlert);
|
|
||||||
String dataURI = message.dataURI;
|
|
||||||
if (reqResourceData.isUpdatingOnMetadataOnly()) {
|
|
||||||
PluginDataObject record = RecordFactory.getInstance()
|
|
||||||
.loadRecordFromUri(dataURI);
|
|
||||||
objectToSend = record;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
attribs.put("dataURI", message.dataURI);
|
|
||||||
objectToSend = Loader.loadData(attribs);
|
|
||||||
}
|
|
||||||
return objectToSend;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private static AlertMessageToPDOParser defaultParser = new AlertMessageToPDOParser();
|
|
||||||
|
|
||||||
public AutoUpdater() {
|
public AutoUpdater() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void alertArrived(Collection<AlertMessage> alertMessages) {
|
public void alertArrived(Collection<AlertMessage> alertMessages) {
|
||||||
Set<IDescriptor> displayList = new HashSet<IDescriptor>();
|
Set<IDescriptor> displayList = new HashSet<IDescriptor>();
|
||||||
Map<AbstractRequestableResourceData, List<Object>> pdoSendMap = new IdentityHashMap<AbstractRequestableResourceData, List<Object>>();
|
Map<AbstractRequestableResourceData, List<AlertMessage>> pdoSendMap = new IdentityHashMap<AbstractRequestableResourceData, List<AlertMessage>>();
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
|
|
||||||
for (AlertMessage message : alertMessages) {
|
for (AlertMessage message : alertMessages) {
|
||||||
|
@ -130,34 +97,25 @@ public class AutoUpdater implements IAlertObserver {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AbstractRequestableResourceData reqResourceData = (AbstractRequestableResourceData) resourceData;
|
AbstractRequestableResourceData reqResourceData = (AbstractRequestableResourceData) resourceData;
|
||||||
AbstractAlertMessageParser parserToUse = null;
|
|
||||||
if ((parserToUse = reqResourceData.getAlertParser()) == null) {
|
if (md.getTimeMatcher() != null) {
|
||||||
parserToUse = defaultParser;
|
md.getTimeMatcher().redoTimeMatching(r1);
|
||||||
}
|
}
|
||||||
Object objectToSend = parserToUse.parseAlertMessage(
|
displayList.add(md);
|
||||||
message, reqResourceData);
|
|
||||||
|
|
||||||
if (objectToSend != null) {
|
List<AlertMessage> list = pdoSendMap
|
||||||
if (md.getTimeMatcher() != null) {
|
.get(reqResourceData);
|
||||||
md.getTimeMatcher().redoTimeMatching(r1);
|
if (list == null) {
|
||||||
}
|
list = new ArrayList<AlertMessage>();
|
||||||
displayList.add(md);
|
pdoSendMap.put(reqResourceData, list);
|
||||||
|
}
|
||||||
|
list.add(message);
|
||||||
|
|
||||||
List<Object> list = pdoSendMap.get(reqResourceData);
|
if (list.size() > 100) {
|
||||||
if (list == null) {
|
// update with objects
|
||||||
list = new ArrayList<Object>();
|
reqResourceData.update(list
|
||||||
pdoSendMap.put(reqResourceData, list);
|
.toArray(new AlertMessage[list.size()]));
|
||||||
}
|
list.clear();
|
||||||
list.add(objectToSend);
|
|
||||||
|
|
||||||
if (list.size() > 100) {
|
|
||||||
// update with objects
|
|
||||||
Class<?> componentType = list.get(0).getClass();
|
|
||||||
reqResourceData.update(list
|
|
||||||
.toArray((Object[]) Array.newInstance(
|
|
||||||
componentType, list.size())));
|
|
||||||
list.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -174,13 +132,11 @@ public class AutoUpdater implements IAlertObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AbstractRequestableResourceData arrd : pdoSendMap.keySet()) {
|
for (AbstractRequestableResourceData arrd : pdoSendMap.keySet()) {
|
||||||
List<Object> pdos = pdoSendMap.get(arrd);
|
List<AlertMessage> pdos = pdoSendMap.get(arrd);
|
||||||
if (pdos == null || pdos.size() < 1) {
|
if (pdos == null || pdos.size() < 1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Class<?> componentType = pdos.get(0).getClass();
|
arrd.update(pdos.toArray(new AlertMessage[pdos.size()]));
|
||||||
arrd.update(pdos.toArray((Object[]) Array.newInstance(
|
|
||||||
componentType, pdos.size())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<IDescriptor> refreshedDescriptors = new ArrayList<IDescriptor>();
|
List<IDescriptor> refreshedDescriptors = new ArrayList<IDescriptor>();
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action for Aviation Plug-in
|
* Action for Aviation Plug-in
|
||||||
|
@ -79,11 +80,16 @@ public class AviationAction extends AbstractHandler {
|
||||||
.getShell();
|
.getShell();
|
||||||
if (aviationDlg == null || aviationDlg.getShell().isDisposed()) {
|
if (aviationDlg == null || aviationDlg.getShell().isDisposed()) {
|
||||||
aviationDlg = new AviationDialog(shell);
|
aviationDlg = new AviationDialog(shell);
|
||||||
|
aviationDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
aviationDlg = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
aviationDlg.open();
|
aviationDlg.open();
|
||||||
aviationDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
aviationDlg.setVisible(true);
|
aviationDlg.bringToTop();
|
||||||
aviationDlg.setFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package com.raytheon.viz.aviation;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEDialogComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class starts AviationDialog as a stand alone component with runtime mode
|
* This class starts AviationDialog as a stand alone component with runtime mode
|
||||||
|
@ -35,6 +35,9 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 28, 2011 mschenke Initial creation
|
* Apr 28, 2011 mschenke Initial creation
|
||||||
|
* Oct 08, 2012 1229 rferrel Make a blocking dialog.
|
||||||
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||||
|
* AviationDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -42,7 +45,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AviationComponent extends AbstractCAVEComponent {
|
public class AviationComponent extends AbstractCAVEDialogComponent {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -56,6 +59,7 @@ public class AviationComponent extends AbstractCAVEComponent {
|
||||||
AviationDialog aviationDlg = new AviationDialog(new Shell(
|
AviationDialog aviationDlg = new AviationDialog(new Shell(
|
||||||
Display.getCurrent()));
|
Display.getCurrent()));
|
||||||
aviationDlg.open();
|
aviationDlg.open();
|
||||||
|
blockUntilClosed(aviationDlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -63,6 +63,7 @@ import com.raytheon.viz.avnconfig.AvnConfigFileUtil;
|
||||||
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Aviation Dialog class that displays the start up menu for AvnFPS.
|
* The Aviation Dialog class that displays the start up menu for AvnFPS.
|
||||||
|
@ -92,6 +93,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* for both stand alone and from Cave.
|
* for both stand alone and from Cave.
|
||||||
* 8/31/2011 10837 rferrel Added checks to see if the avnImage
|
* 8/31/2011 10837 rferrel Added checks to see if the avnImage
|
||||||
* file exists.
|
* file exists.
|
||||||
|
* 10/02/2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
* 10/09/2012 1229 rferrel Changes for non-blocking TafMonitorDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -161,7 +164,7 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
public static boolean USERTRANSMIT = true;
|
public static boolean USERTRANSMIT = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List control containing forcaster names.
|
* List control containing forecaster names.
|
||||||
*/
|
*/
|
||||||
private List forecasterList;
|
private List forecasterList;
|
||||||
|
|
||||||
|
@ -171,14 +174,13 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
private final AtomicInteger dlgCount = new AtomicInteger(0);
|
private final AtomicInteger dlgCount = new AtomicInteger(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Create a non-blocking dialog.
|
||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
* Parent Shell.
|
|
||||||
*/
|
*/
|
||||||
public AviationDialog(Shell parent) {
|
public AviationDialog(Shell parent) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
| CAVE.INDEPENDENT_SHELL);
|
| CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Menu");
|
setText("AvnFPS Menu");
|
||||||
|
|
||||||
ForecastModel.getInstance().setBackupRestartUtility(this);
|
ForecastModel.getInstance().setBackupRestartUtility(this);
|
||||||
|
@ -339,7 +341,7 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
loadTafSiteConfig();
|
loadTafSiteConfig();
|
||||||
displayTafMonitorDialog();
|
displayTafMonitorDialog();
|
||||||
} else {
|
} else {
|
||||||
tafMonitorDlg.showDialog();
|
tafMonitorDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -355,8 +357,8 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
shell.setVisible(false);
|
shell.setVisible(false);
|
||||||
if (climateMenuDlg == null
|
if (climateMenuDlg == null || climateMenuDlg.getShell() == null
|
||||||
|| climateMenuDlg.getShell().isDisposed()) {
|
|| climateMenuDlg.isDisposed()) {
|
||||||
// Create an array of message types
|
// Create an array of message types
|
||||||
StatusMessageType[] msgTypes = new StatusMessageType[4];
|
StatusMessageType[] msgTypes = new StatusMessageType[4];
|
||||||
msgTypes[0] = StatusMessageType.Metar;
|
msgTypes[0] = StatusMessageType.Metar;
|
||||||
|
@ -367,13 +369,19 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
// Create the climate menu dialog.
|
// Create the climate menu dialog.
|
||||||
dlgCount.incrementAndGet();
|
dlgCount.incrementAndGet();
|
||||||
climateMenuDlg = new ClimateMenuDlg(shell, msgTypes, null);
|
climateMenuDlg = new ClimateMenuDlg(shell, msgTypes, null);
|
||||||
|
climateMenuDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
climateMenuDlg = null;
|
||||||
|
if (dlgCount.decrementAndGet() == 0) {
|
||||||
|
shell.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
climateMenuDlg.open();
|
climateMenuDlg.open();
|
||||||
climateMenuDlg = null;
|
|
||||||
if (dlgCount.decrementAndGet() == 0) {
|
|
||||||
shell.dispose();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
climateMenuDlg.showDialog();
|
climateMenuDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -562,7 +570,12 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void restartTafMonitor() {
|
public void restartTafMonitor() {
|
||||||
|
// This prevents tafMonitorDlg from closing this shell when closing the
|
||||||
|
// TaMonitorDlg prior to the restart.
|
||||||
|
dlgCount.incrementAndGet();
|
||||||
if (tafMonitorDlg.closeDisplay() == false) {
|
if (tafMonitorDlg.closeDisplay() == false) {
|
||||||
|
// adjust the count.
|
||||||
|
dlgCount.decrementAndGet();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -595,7 +608,12 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!emptyStationList) {
|
if (!emptyStationList) {
|
||||||
|
// This prevents tafMonitorDlg from closing this shell when closing
|
||||||
|
// the TaMonitorDlg prior to the restart.
|
||||||
|
dlgCount.incrementAndGet();
|
||||||
if (tafMonitorDlg.closeDisplay() == false) {
|
if (tafMonitorDlg.closeDisplay() == false) {
|
||||||
|
// adjust the count.
|
||||||
|
dlgCount.decrementAndGet();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,25 +647,28 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
||||||
}
|
}
|
||||||
for (String product : productDisplayList) {
|
for (String product : productDisplayList) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error no stations configured for " + product);
|
"Error no stations configured for " + product);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tafMonitorDlg = new TafMonitorDlg(shell, stationList,
|
if (tafMonitorDlg == null || tafMonitorDlg.getShell() == null
|
||||||
productDisplayList);
|
|| tafMonitorDlg.isDisposed()) {
|
||||||
tafMonitorDlg.open();
|
tafMonitorDlg = new TafMonitorDlg(shell, stationList,
|
||||||
tafMonitorDlg = null;
|
productDisplayList);
|
||||||
|
tafMonitorDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
tafMonitorDlg = null;
|
||||||
|
if (dlgCount.decrementAndGet() == 0
|
||||||
|
&& !productDisplayList.isEmpty()) {
|
||||||
|
shell.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tafMonitorDlg.open();
|
||||||
|
} else {
|
||||||
|
tafMonitorDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dlgCount.decrementAndGet() == 0 && !productDisplayList.isEmpty()) {
|
|
||||||
shell.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFocus() {
|
|
||||||
shell.setFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVisible(boolean visible) {
|
|
||||||
shell.setVisible(visible);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
* Jul 9, 2010 5078 rferrel Check for existence of
|
* Jul 9, 2010 5078 rferrel Check for existence of
|
||||||
* config files in execute.
|
* config files in execute.
|
||||||
* Oct 19, 2010 7347 rferrel Replace reference to TAF_SITE_CONFIG
|
* Oct 19, 2010 7347 rferrel Replace reference to TAF_SITE_CONFIG
|
||||||
|
* Oct 08, 2012 1229 rferrel Changes to work with non-blocking AvnConfigDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -73,12 +74,12 @@ public class AvnconfigAction extends AbstractHandler {
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
if (avnfspSetupDlg == null || avnfspSetupDlg.isDisposed()) {
|
if (avnfspSetupDlg == null || avnfspSetupDlg.getShell() == null
|
||||||
|
|| avnfspSetupDlg.isDisposed()) {
|
||||||
avnfspSetupDlg = new AvnconfigDlg(shell);
|
avnfspSetupDlg = new AvnconfigDlg(shell);
|
||||||
avnfspSetupDlg.open();
|
avnfspSetupDlg.open();
|
||||||
avnfspSetupDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
avnfspSetupDlg.setFocus();
|
avnfspSetupDlg.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package com.raytheon.viz.aviation;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEDialogComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is a run configuration component to launch the AvnFPS monitor.
|
* This class is a run configuration component to launch the AvnFPS monitor.
|
||||||
|
@ -34,14 +34,15 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 28, 2011 mschenke Initial creation
|
* Apr 28, 2011 mschenke Initial creation
|
||||||
*
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||||
|
* AvnconfigDlg.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AvnconfigComponent extends AbstractCAVEComponent {
|
public class AvnconfigComponent extends AbstractCAVEDialogComponent {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -55,6 +56,7 @@ public class AvnconfigComponent extends AbstractCAVEComponent {
|
||||||
AvnconfigDlg avnfspSetupDlg = new AvnconfigDlg(new Shell(
|
AvnconfigDlg avnfspSetupDlg = new AvnconfigDlg(new Shell(
|
||||||
Display.getCurrent()));
|
Display.getCurrent()));
|
||||||
avnfspSetupDlg.open();
|
avnfspSetupDlg.open();
|
||||||
|
blockUntilClosed(avnfspSetupDlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -26,8 +26,6 @@ import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Dialog;
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
|
@ -42,6 +40,7 @@ import com.raytheon.viz.avnconfig.MonitoringCriteriaDlg;
|
||||||
import com.raytheon.viz.avnconfig.TafProductConfigDlg;
|
import com.raytheon.viz.avnconfig.TafProductConfigDlg;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteInfoEditorDlg;
|
import com.raytheon.viz.avnconfig.TafSiteInfoEditorDlg;
|
||||||
import com.raytheon.viz.avnconfig.TextEditorSetupDlg;
|
import com.raytheon.viz.avnconfig.TextEditorSetupDlg;
|
||||||
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is the main AvnFPS configuration dialog. It contains the controls
|
* This class is the main AvnFPS configuration dialog. It contains the controls
|
||||||
|
@ -54,6 +53,14 @@ import com.raytheon.viz.avnconfig.TextEditorSetupDlg;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 22 MAY 2008 1119 lvenable Initial creation
|
* 22 MAY 2008 1119 lvenable Initial creation
|
||||||
* 01 OCT 2010 4345 rferrel Bring existing dialog to the front.
|
* 01 OCT 2010 4345 rferrel Bring existing dialog to the front.
|
||||||
|
* 04 OCT 2012 1229 rferrel Work with non-blocking ClimateDataMenuDlg.
|
||||||
|
* 08 Oct 2012 1229 rferrel Make sub-class of CaveSWTDialog and
|
||||||
|
* make non-blocking.
|
||||||
|
* 11 Oct 2012 1229 rferrel Changes for non-blocking MonitoringCriteriaDlg.
|
||||||
|
* 12 Oct 2012 1229 rferrel Changes for non-blocking TafProductConfigDlg.
|
||||||
|
* 12 Oct 2012 1229 rferrel Changes for non-blocking TafSiteInfoEditorDlg.
|
||||||
|
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||||
|
* 15 Oct 2012 1229 rferrel Changed for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -61,17 +68,7 @@ import com.raytheon.viz.avnconfig.TextEditorSetupDlg;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AvnconfigDlg extends Dialog {
|
public class AvnconfigDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
/**
|
|
||||||
* Dialog shell.
|
|
||||||
*/
|
|
||||||
private Shell shell;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The display control.
|
|
||||||
*/
|
|
||||||
private Display display;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite containing message status controls.
|
* Composite containing message status controls.
|
||||||
|
@ -104,6 +101,8 @@ public class AvnconfigDlg extends Dialog {
|
||||||
*/
|
*/
|
||||||
private ClimateDataMenuDlg climateDataDlg;
|
private ClimateDataMenuDlg climateDataDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -111,20 +110,13 @@ public class AvnconfigDlg extends Dialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public AvnconfigDlg(Shell parent) {
|
public AvnconfigDlg(Shell parent) {
|
||||||
super(parent, 0);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK);
|
||||||
|
setText("AvnFPS Setup");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Open method used set up components and display the dialog.
|
protected void initializeComponents(Shell shell) {
|
||||||
*
|
|
||||||
* @return Null.
|
|
||||||
*/
|
|
||||||
public Object open() {
|
|
||||||
Shell parent = getParent();
|
|
||||||
display = parent.getDisplay();
|
|
||||||
shell = new Shell(parent, SWT.DIALOG_TRIM);
|
|
||||||
shell.setText("AvnFPS Setup");
|
|
||||||
|
|
||||||
// Create the main layout for the shell.
|
// Create the main layout for the shell.
|
||||||
GridLayout mainLayout = new GridLayout(1, false);
|
GridLayout mainLayout = new GridLayout(1, false);
|
||||||
mainLayout.marginHeight = 3;
|
mainLayout.marginHeight = 3;
|
||||||
|
@ -132,25 +124,6 @@ public class AvnconfigDlg extends Dialog {
|
||||||
mainLayout.verticalSpacing = 5;
|
mainLayout.verticalSpacing = 5;
|
||||||
shell.setLayout(mainLayout);
|
shell.setLayout(mainLayout);
|
||||||
|
|
||||||
// Initialize all of the controls and layouts
|
|
||||||
initializeComponents();
|
|
||||||
|
|
||||||
shell.pack();
|
|
||||||
|
|
||||||
shell.open();
|
|
||||||
while (!shell.isDisposed()) {
|
|
||||||
if (!display.readAndDispatch()) {
|
|
||||||
display.sleep();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the components on the display.
|
|
||||||
*/
|
|
||||||
private void initializeComponents() {
|
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
// Create the menus at the top of the dialog.
|
// Create the menus at the top of the dialog.
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
|
@ -244,11 +217,16 @@ public class AvnconfigDlg extends Dialog {
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS Setup Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This application is used to configure AvnFPS.\n\nButton description:\n\nText Editor: use to modify forecaster list and default resource\nfile.\n\nMonitoring rules: use to edit watch rules for TAF monitoring.\n\nTAF Site Info: use to create TAF definition files\n\nTAF Products: use to create lists of TAFs to load into forecast\neditor\n\nTriggers: use to create and install Postgres trigger file.\n\nClimate Data: use to create and update HDF5 climate files.";
|
String description = "AvnFPS Setup Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This application is used to configure AvnFPS.\n\nButton description:\n\nText Editor: use to modify forecaster list and default resource\nfile.\n\nMonitoring rules: use to edit watch rules for TAF monitoring.\n\nTAF Site Info: use to create TAF definition files\n\nTAF Products: use to create lists of TAFs to load into forecast\neditor\n\nTriggers: use to create and install Postgres trigger file.\n\nClimate Data: use to create and update HDF5 climate files.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description,
|
||||||
|
helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -293,13 +271,11 @@ public class AvnconfigDlg extends Dialog {
|
||||||
textEditorBtn.addSelectionListener(new SelectionAdapter() {
|
textEditorBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (editorDlg == null || editorDlg.getParent().isDisposed()) {
|
if (mustCreate(editorDlg)) {
|
||||||
editorDlg = new TextEditorSetupDlg(shell);
|
editorDlg = new TextEditorSetupDlg(shell);
|
||||||
editorDlg.open();
|
editorDlg.open();
|
||||||
editorDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
editorDlg.getParent().forceActive();
|
editorDlg.bringToTop();
|
||||||
editorDlg.getParent().forceFocus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -311,14 +287,11 @@ public class AvnconfigDlg extends Dialog {
|
||||||
monitorRulesBtn.addSelectionListener(new SelectionAdapter() {
|
monitorRulesBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (monCriteriaDlg == null
|
if (mustCreate(monCriteriaDlg)) {
|
||||||
|| monCriteriaDlg.getParent().isDisposed()) {
|
|
||||||
monCriteriaDlg = new MonitoringCriteriaDlg(shell);
|
monCriteriaDlg = new MonitoringCriteriaDlg(shell);
|
||||||
monCriteriaDlg.open();
|
monCriteriaDlg.open();
|
||||||
monCriteriaDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
monCriteriaDlg.getParent().forceActive();
|
monCriteriaDlg.bringToTop();
|
||||||
monCriteriaDlg.getParent().forceFocus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -330,13 +303,11 @@ public class AvnconfigDlg extends Dialog {
|
||||||
tafSiteInfoBtn.addSelectionListener(new SelectionAdapter() {
|
tafSiteInfoBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (siteInfoDlg == null || siteInfoDlg.getParent().isDisposed()) {
|
if (mustCreate(siteInfoDlg)) {
|
||||||
siteInfoDlg = new TafSiteInfoEditorDlg(shell);
|
siteInfoDlg = new TafSiteInfoEditorDlg(shell);
|
||||||
siteInfoDlg.open();
|
siteInfoDlg.open();
|
||||||
siteInfoDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
siteInfoDlg.getParent().forceActive();
|
siteInfoDlg.bringToTop();
|
||||||
siteInfoDlg.getParent().forceFocus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -348,13 +319,11 @@ public class AvnconfigDlg extends Dialog {
|
||||||
tafProductsBtn.addSelectionListener(new SelectionAdapter() {
|
tafProductsBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (productsDlg == null || productsDlg.getParent().isDisposed()) {
|
if (mustCreate(productsDlg)) {
|
||||||
productsDlg = new TafProductConfigDlg(shell);
|
productsDlg = new TafProductConfigDlg(shell);
|
||||||
productsDlg.open();
|
productsDlg.open();
|
||||||
productsDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
productsDlg.getParent().forceActive();
|
productsDlg.bringToTop();
|
||||||
productsDlg.getParent().forceFocus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -366,10 +335,11 @@ public class AvnconfigDlg extends Dialog {
|
||||||
climateBtn.addSelectionListener(new SelectionAdapter() {
|
climateBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (climateDataDlg == null) {
|
if (mustCreate(climateDataDlg)) {
|
||||||
climateDataDlg = new ClimateDataMenuDlg(shell);
|
climateDataDlg = new ClimateDataMenuDlg(shell);
|
||||||
climateDataDlg.open();
|
climateDataDlg.open();
|
||||||
climateDataDlg = null;
|
} else {
|
||||||
|
climateDataDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -381,12 +351,4 @@ public class AvnconfigDlg extends Dialog {
|
||||||
private void createBottomMessageControls() {
|
private void createBottomMessageControls() {
|
||||||
msgStatusComp = new MessageStatusComp(shell, null, null);
|
msgStatusComp = new MessageStatusComp(shell, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFocus() {
|
|
||||||
shell.setFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDisposed() {
|
|
||||||
return shell.isDisposed();
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.viz.aviation.climatology.CigVisDistributionDlg;
|
import com.raytheon.viz.aviation.climatology.CigVisDistributionDlg;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEDialogComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a component class for launching the CigVisDistributionDlg dialog.
|
* This is a component class for launching the CigVisDistributionDlg dialog.
|
||||||
|
@ -39,6 +39,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 28, 2011 mschenke Initial creation
|
* Apr 28, 2011 mschenke Initial creation
|
||||||
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||||
|
* CigVisDistributionDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,7 +48,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CigVisDistComponent extends AbstractCAVEComponent {
|
public class CigVisDistComponent extends AbstractCAVEDialogComponent {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -63,6 +65,7 @@ public class CigVisDistComponent extends AbstractCAVEComponent {
|
||||||
new Shell(Display.getCurrent()), siteList,
|
new Shell(Display.getCurrent()), siteList,
|
||||||
StatusMessageType.Metar, null);
|
StatusMessageType.Metar, null);
|
||||||
cigVisDistDialog.open();
|
cigVisDistDialog.open();
|
||||||
|
blockUntilClosed(cigVisDistDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.viz.aviation.climatology.CigVisTrendDlg;
|
import com.raytheon.viz.aviation.climatology.CigVisTrendDlg;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEDialogComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a component class for lanuching the CigVisTrendDlg dialog.
|
* This is a component class for lanuching the CigVisTrendDlg dialog.
|
||||||
|
@ -39,14 +39,15 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 28, 2011 mschenke Initial creation
|
* Apr 28, 2011 mschenke Initial creation
|
||||||
*
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||||
|
* CigVisTrendDlg.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CigVisTrendComponent extends AbstractCAVEComponent {
|
public class CigVisTrendComponent extends AbstractCAVEDialogComponent {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -62,6 +63,7 @@ public class CigVisTrendComponent extends AbstractCAVEComponent {
|
||||||
CigVisTrendDlg cigVisTrendDialog = new CigVisTrendDlg(new Shell(
|
CigVisTrendDlg cigVisTrendDialog = new CigVisTrendDlg(new Shell(
|
||||||
Display.getCurrent()), siteList, StatusMessageType.Metar, null);
|
Display.getCurrent()), siteList, StatusMessageType.Metar, null);
|
||||||
cigVisTrendDialog.open();
|
cigVisTrendDialog.open();
|
||||||
|
blockUntilClosed(cigVisTrendDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.viz.aviation.climatology.MetarDisplayDialog;
|
import com.raytheon.viz.aviation.climatology.MetarDisplayDialog;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEDialogComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a component class for launching the Climate's MetarDisplayDialog.
|
* This is a component class for launching the Climate's MetarDisplayDialog.
|
||||||
|
@ -39,6 +39,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 28, 2011 mschenke Initial creation
|
* Apr 28, 2011 mschenke Initial creation
|
||||||
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||||
|
* MetarDisplayDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,7 +48,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MetarComponent extends AbstractCAVEComponent {
|
public class MetarComponent extends AbstractCAVEDialogComponent {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -62,6 +64,7 @@ public class MetarComponent extends AbstractCAVEComponent {
|
||||||
MetarDisplayDialog metarDialog = new MetarDisplayDialog(new Shell(
|
MetarDisplayDialog metarDialog = new MetarDisplayDialog(new Shell(
|
||||||
Display.getCurrent()), siteList, StatusMessageType.Metar, null);
|
Display.getCurrent()), siteList, StatusMessageType.Metar, null);
|
||||||
metarDialog.open();
|
metarDialog.open();
|
||||||
|
blockUntilClosed(metarDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.viz.aviation.climatology.WindRosePlotDlg;
|
import com.raytheon.viz.aviation.climatology.WindRosePlotDlg;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEDialogComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component class for launching the Climate's WindRoseDlg.
|
* Component class for launching the Climate's WindRoseDlg.
|
||||||
|
@ -39,6 +39,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 28, 2011 mschenke Initial creation
|
* Apr 28, 2011 mschenke Initial creation
|
||||||
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||||
|
* WindRosePlotDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,7 +48,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class WindRoseComponent extends AbstractCAVEComponent {
|
public class WindRoseComponent extends AbstractCAVEDialogComponent {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -63,6 +65,7 @@ public class WindRoseComponent extends AbstractCAVEComponent {
|
||||||
Display.getCurrent()), siteList, StatusMessageType.WindRose,
|
Display.getCurrent()), siteList, StatusMessageType.WindRose,
|
||||||
null);
|
null);
|
||||||
windRoseDialog.open();
|
windRoseDialog.open();
|
||||||
|
blockUntilClosed(windRoseDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -73,6 +73,7 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class displays the main Climate Data dialog.
|
* This class displays the main Climate Data dialog.
|
||||||
|
@ -91,6 +92,15 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Mar 18, 2011 #8681 rferrel Corrected checkSite to prevent exception.
|
* Mar 18, 2011 #8681 rferrel Corrected checkSite to prevent exception.
|
||||||
* May 24, 2011 #9075 rferrel Changed getObsHistoryFromInv() to scan
|
* May 24, 2011 #9075 rferrel Changed getObsHistoryFromInv() to scan
|
||||||
* ish-inventory.txt only one time.
|
* ish-inventory.txt only one time.
|
||||||
|
* Oct 04, 2012 #1229 rferrel Made non-blocking.
|
||||||
|
* Oct 04, 2012 #1229 rferrel Changes for non-blocking ClimateHistoryDlg.
|
||||||
|
* Oct 08, 2012 #1229 rferrel Changes for non-blocking GenScriptsDlg.
|
||||||
|
* Oct 08, 2012 #1229 rferrel Changes for non-blocking NCDCInvHistDlg.
|
||||||
|
* Oct 08, 2012 #1229 rferrel Changes for non-blocking CigVisDistributionDlg.
|
||||||
|
* Oct 08, 2012 #1229 rferrel Changes for non-blocking WindRosePlotDlg.
|
||||||
|
* Oct 09, 2012 #1229 rferrel Changes for non-blocking MetarDisplayDialog.
|
||||||
|
* Oct 09, 2012 #1229 rferrel Changes for non-blocking CigVisTrendDlg.
|
||||||
|
* Oct 15, 2012 #1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -98,10 +108,11 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class ClimateDataMenuDlg extends CaveSWTDialog {
|
public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
|
||||||
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ClimateDataMenuDlg.class);
|
.getHandler(ClimateDataMenuDlg.class);
|
||||||
|
|
||||||
private static final Pattern SP_PAT = Pattern.compile("\\s+");
|
private final Pattern SP_PAT = Pattern.compile("\\s+");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Text font.
|
* Text font.
|
||||||
|
@ -222,6 +233,8 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private int waitCnt = 0;
|
private int waitCnt = 0;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -229,7 +242,8 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public ClimateDataMenuDlg(Shell parentShell) {
|
public ClimateDataMenuDlg(Shell parentShell) {
|
||||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Climate Data Menu");
|
setText("AvnFPS Climate Data Menu");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,6 +261,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
darkBlueBgColor.dispose();
|
darkBlueBgColor.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||||
|
* .eclipse.swt.widgets.Shell)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void initializeComponents(Shell shell) {
|
protected void initializeComponents(Shell shell) {
|
||||||
// Initialize all of the data, controls, and layouts
|
// Initialize all of the data, controls, and layouts
|
||||||
|
@ -381,11 +402,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
metarsMI.addSelectionListener(new SelectionAdapter() {
|
metarsMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (metarDlg == null) {
|
if (metarDlg == null || metarDlg.getShell() == null
|
||||||
|
|| metarDlg.isDisposed()) {
|
||||||
metarDlg = new MetarDisplayDialog(shell, siteList,
|
metarDlg = new MetarDisplayDialog(shell, siteList,
|
||||||
StatusMessageType.Metar, null);
|
StatusMessageType.Metar, null);
|
||||||
metarDlg.open();
|
metarDlg.open();
|
||||||
metarDlg = null;
|
} else {
|
||||||
|
metarDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -396,11 +419,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
windRoseMI.addSelectionListener(new SelectionAdapter() {
|
windRoseMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (windRose == null || windRose.isDisposed()) {
|
if (windRose == null || windRose.getShell() == null
|
||||||
|
|| windRose.isDisposed()) {
|
||||||
windRose = new WindRosePlotDlg(shell, siteList,
|
windRose = new WindRosePlotDlg(shell, siteList,
|
||||||
StatusMessageType.WindRose, null);
|
StatusMessageType.WindRose, null);
|
||||||
windRose.open();
|
windRose.open();
|
||||||
windRose = null;
|
} else {
|
||||||
|
windRose.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -411,11 +436,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
cigVisDistMI.addSelectionListener(new SelectionAdapter() {
|
cigVisDistMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (cigVisDist == null) {
|
if (cigVisDist == null || cigVisDist.getShell() == null
|
||||||
|
|| cigVisDist.isDisposed()) {
|
||||||
cigVisDist = new CigVisDistributionDlg(shell, siteList,
|
cigVisDist = new CigVisDistributionDlg(shell, siteList,
|
||||||
StatusMessageType.CigVis, null);
|
StatusMessageType.CigVis, null);
|
||||||
cigVisDist.open();
|
cigVisDist.open();
|
||||||
cigVisDist = null;
|
} else {
|
||||||
|
cigVisDist.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -426,11 +453,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
cigVisTrendMI.addSelectionListener(new SelectionAdapter() {
|
cigVisTrendMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (cigVisTrend == null) {
|
if (cigVisTrend == null || cigVisTrend.getShell() == null
|
||||||
|
|| cigVisTrend.isDisposed()) {
|
||||||
cigVisTrend = new CigVisTrendDlg(shell, siteList,
|
cigVisTrend = new CigVisTrendDlg(shell, siteList,
|
||||||
StatusMessageType.CigVisTrend, null);
|
StatusMessageType.CigVisTrend, null);
|
||||||
cigVisTrend.open();
|
cigVisTrend.open();
|
||||||
cigVisTrend = null;
|
} else {
|
||||||
|
cigVisTrend.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -475,11 +504,15 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "CLimate Data Update Dialog Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This dialog is used to create and append climatology data files.\n\nMenu Bar\nFile:\n\tQuit: Close the dialog immediately\n\nCommands:\n\tShow observations history: Opens a graphical display showing the current\n\t\t\t\t\tinventory of climate data available.\n\tUpdate NCDC \"ish\" files: Opens a dialog allowing the user to generate\n\t\t\t\t\tautomated scripts for downloading the Integrated\n\t\t\t\t\tSurface Hourly (ISH) Database.\n\nTools:\n\tPulldown menu consist of the AvnFPS Climate Tools that read the HDF5 climate\n\t\tfiles.\n\nOptions:\n\tAppend: Add new data to existing climate data file\n\tCreate: Generate new climate data files, regardless of whether a file for\n\t\t\tthat site already exists\n\nFields:\n\tSITE ID: Site ID of the site currently selected, or \n\t\t\ta user entered site ID if creating a new data file\n\tMETAR AFOS ID: The AFOS ID used to retrieve location's METAR product for\n\t\t\tuse in AvnFPS's climate Cig/Vis Trend tool.\n\nIdents:\n\tList of current site IDs.\n\nSite info list:\n\tList of IDs and years of data available for each selected site\n\nMonitor area:\n\tArea where all informative messages are displayed.\n\nButtons:\n\n\tAssess Data:\n\tAfter sites are selected, click this to start the creation\n\t\tor append process\n\n\tGenerate Scripts:\n\tGenerate download scripts to retrieve data files from NCDC\n\n\tProcess Data:\n\tIncorporate NCDC data into HDF5 file(s).\n\n\tValidate Data:\n\tTemporarily move newly changed/created files to a location\n\t\tso that AvnFPS climate tools can examine the new climate\n\t\tfile.\n\n\tCommit:\n\tMove newly changed/created files to its permanent location. \n\tClicking this will also generate new station climate qc \n\t\tfiles (files that end in .nc in the data/climate directory)\n\n\tReject:\n\tReject the newly created files in favor of the original file(s),\n\t\tif available. This action deletes newly created files.\n\n\tSave Log:\n\tSave all output in the Monitor area to a file";
|
String description = "CLimate Data Update Dialog Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This dialog is used to create and append climatology data files.\n\nMenu Bar\nFile:\n\tQuit: Close the dialog immediately\n\nCommands:\n\tShow observations history: Opens a graphical display showing the current\n\t\t\t\t\tinventory of climate data available.\n\tUpdate NCDC \"ish\" files: Opens a dialog allowing the user to generate\n\t\t\t\t\tautomated scripts for downloading the Integrated\n\t\t\t\t\tSurface Hourly (ISH) Database.\n\nTools:\n\tPulldown menu consist of the AvnFPS Climate Tools that read the HDF5 climate\n\t\tfiles.\n\nOptions:\n\tAppend: Add new data to existing climate data file\n\tCreate: Generate new climate data files, regardless of whether a file for\n\t\t\tthat site already exists\n\nFields:\n\tSITE ID: Site ID of the site currently selected, or \n\t\t\ta user entered site ID if creating a new data file\n\tMETAR AFOS ID: The AFOS ID used to retrieve location's METAR product for\n\t\t\tuse in AvnFPS's climate Cig/Vis Trend tool.\n\nIdents:\n\tList of current site IDs.\n\nSite info list:\n\tList of IDs and years of data available for each selected site\n\nMonitor area:\n\tArea where all informative messages are displayed.\n\nButtons:\n\n\tAssess Data:\n\tAfter sites are selected, click this to start the creation\n\t\tor append process\n\n\tGenerate Scripts:\n\tGenerate download scripts to retrieve data files from NCDC\n\n\tProcess Data:\n\tIncorporate NCDC data into HDF5 file(s).\n\n\tValidate Data:\n\tTemporarily move newly changed/created files to a location\n\t\tso that AvnFPS climate tools can examine the new climate\n\t\tfile.\n\n\tCommit:\n\tMove newly changed/created files to its permanent location. \n\tClicking this will also generate new station climate qc \n\t\tfiles (files that end in .nc in the data/climate directory)\n\n\tReject:\n\tReject the newly created files in favor of the original file(s),\n\t\tif available. This action deletes newly created files.\n\n\tSave Log:\n\tSave all output in the Monitor area to a file";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -842,10 +875,12 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (climateHistoryDlg == null) {
|
if (climateHistoryDlg == null || climateHistoryDlg.getShell() == null
|
||||||
|
|| climateHistoryDlg.isDisposed()) {
|
||||||
climateHistoryDlg = new ClimateHistoryDlg(shell, data);
|
climateHistoryDlg = new ClimateHistoryDlg(shell, data);
|
||||||
climateHistoryDlg.open();
|
climateHistoryDlg.open();
|
||||||
climateHistoryDlg = null;
|
} else {
|
||||||
|
climateHistoryDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -853,10 +888,12 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
* Display the NCDC inventory/history dialog.
|
* Display the NCDC inventory/history dialog.
|
||||||
*/
|
*/
|
||||||
private void displayNCDCInventoryHistoryDialog() {
|
private void displayNCDCInventoryHistoryDialog() {
|
||||||
if (invHistoryDlg == null) {
|
if (invHistoryDlg == null || invHistoryDlg.getShell() == null
|
||||||
|
|| invHistoryDlg.isDisposed()) {
|
||||||
invHistoryDlg = new NCDCInvHistDlg(shell);
|
invHistoryDlg = new NCDCInvHistDlg(shell);
|
||||||
invHistoryDlg.open();
|
invHistoryDlg.open();
|
||||||
invHistoryDlg = null;
|
} else {
|
||||||
|
invHistoryDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,12 +901,20 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
* Display the generate scripts dialog.
|
* Display the generate scripts dialog.
|
||||||
*/
|
*/
|
||||||
private void displayGenerateScriptDialog() {
|
private void displayGenerateScriptDialog() {
|
||||||
if (generateScriptsDlg == null) {
|
if (generateScriptsDlg == null || generateScriptsDlg.getShell() == null
|
||||||
|
|| generateScriptsDlg.isDisposed()) {
|
||||||
ClimateDataManager.getInstance().assessStationsMap(this);
|
ClimateDataManager.getInstance().assessStationsMap(this);
|
||||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
generateScriptsDlg = new GenScriptsDlg(shell, "data");
|
||||||
Boolean bool = (Boolean) generateScriptsDlg.open("data");
|
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||||
generateScriptsDlg = null;
|
|
||||||
genScriptsBtn.setEnabled(bool);
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
genScriptsBtn.setEnabled((Boolean) returnValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
generateScriptsDlg.open();
|
||||||
|
} else {
|
||||||
|
generateScriptsDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -881,11 +926,11 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||||
identList.add(siteList.get(i));
|
identList.add(siteList.get(i));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getMessage());
|
statusHandler.handle(Priority.PROBLEM, e.getMessage());
|
||||||
} catch (ConfigurationException e) {
|
} catch (ConfigurationException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.toString());
|
statusHandler.handle(Priority.PROBLEM, e.toString());
|
||||||
} catch (LocalizationOpFailedException e) {
|
} catch (LocalizationOpFailedException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getMessage());
|
statusHandler.handle(Priority.PROBLEM, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 16, 2009 #3438 lvenable Initial creation
|
* Nov 16, 2009 #3438 lvenable Initial creation
|
||||||
|
* Oct 06, 2012 #1229 rferrel Made non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -87,7 +88,8 @@ public class ClimateHistoryDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public ClimateHistoryDlg(Shell parentShell,
|
public ClimateHistoryDlg(Shell parentShell,
|
||||||
ClimateHistoryData climateHistData) {
|
ClimateHistoryData climateHistData) {
|
||||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Climate History");
|
setText("Climate History");
|
||||||
|
|
||||||
this.climateHistData = climateHistData;
|
this.climateHistData = climateHistData;
|
||||||
|
|
|
@ -70,6 +70,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* to the correct directory.
|
* to the correct directory.
|
||||||
* May 10, 2011 #8844 rferrel Display error message when unable
|
* May 10, 2011 #8844 rferrel Display error message when unable
|
||||||
* to save a script.
|
* to save a script.
|
||||||
|
* Oct 08, 2012 #1229 rferrel Made non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -132,23 +133,16 @@ public class GenScriptsDlg extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
* @param style
|
||||||
* @param parentShell
|
* @param parentShell
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public GenScriptsDlg(Shell parentShell) {
|
public GenScriptsDlg(Shell parentShell, String style) {
|
||||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Generate Scripts");
|
setText("Generate Scripts");
|
||||||
initFtpArgs();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open the dialog.
|
|
||||||
*
|
|
||||||
* @return null.
|
|
||||||
*/
|
|
||||||
public Object open(String style) {
|
|
||||||
this.style = style;
|
this.style = style;
|
||||||
return open();
|
initFtpArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preOpened() {
|
public void preOpened() {
|
||||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class displays the NCDC Inventory/History dialog.
|
* This class displays the NCDC Inventory/History dialog.
|
||||||
|
@ -53,6 +54,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 16, 2009 #3438 lvenable Initial creation
|
* Nov 16, 2009 #3438 lvenable Initial creation
|
||||||
|
* Oct 08, 2012 #1229 rferrel Changes for non-blocking GenScriptsDlg.
|
||||||
|
* Oct 08, 2012 #1229 rferrel Make dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -133,7 +136,8 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public NCDCInvHistDlg(Shell parentShell) {
|
public NCDCInvHistDlg(Shell parentShell) {
|
||||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("NCDC Inventory/History");
|
setText("NCDC Inventory/History");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,10 +229,22 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
||||||
invScriptBtn.addSelectionListener(new SelectionAdapter() {
|
invScriptBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (generateScriptsDlg == null) {
|
if (generateScriptsDlg == null
|
||||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
|| generateScriptsDlg.getShell() == null
|
||||||
generateScriptsDlg.open("inv");
|
|| generateScriptsDlg.isDisposed()) {
|
||||||
generateScriptsDlg = null;
|
histScriptBtn.setEnabled(false);
|
||||||
|
|
||||||
|
generateScriptsDlg = new GenScriptsDlg(shell, "inv");
|
||||||
|
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
histScriptBtn.setEnabled(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
generateScriptsDlg.open();
|
||||||
|
} else {
|
||||||
|
generateScriptsDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -300,10 +316,21 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
||||||
histScriptBtn.addSelectionListener(new SelectionAdapter() {
|
histScriptBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (generateScriptsDlg == null) {
|
if (generateScriptsDlg == null
|
||||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
|| generateScriptsDlg.getShell() == null
|
||||||
generateScriptsDlg.open("his");
|
|| generateScriptsDlg.isDisposed()) {
|
||||||
generateScriptsDlg = null;
|
invScriptBtn.setEnabled(false);
|
||||||
|
generateScriptsDlg = new GenScriptsDlg(shell, "his");
|
||||||
|
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
invScriptBtn.setEnabled(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
generateScriptsDlg.open();
|
||||||
|
} else {
|
||||||
|
generateScriptsDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -86,6 +86,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
||||||
* 4/4/2011 8896 rferrel Made timeout configurable
|
* 4/4/2011 8896 rferrel Made timeout configurable
|
||||||
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
||||||
|
* 04/08/2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -95,7 +97,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
*/
|
*/
|
||||||
public class CigVisDistributionDlg extends CaveSWTDialog implements
|
public class CigVisDistributionDlg extends CaveSWTDialog implements
|
||||||
PyProcessListener {
|
PyProcessListener {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(CigVisDistributionDlg.class);
|
.getHandler(CigVisDistributionDlg.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,6 +207,8 @@ public class CigVisDistributionDlg extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
private SaveImageDlg siDlg;
|
private SaveImageDlg siDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -220,7 +224,7 @@ public class CigVisDistributionDlg extends CaveSWTDialog implements
|
||||||
public CigVisDistributionDlg(Shell parent, java.util.List<String> icaos,
|
public CigVisDistributionDlg(Shell parent, java.util.List<String> icaos,
|
||||||
StatusMessageType msgType, RGB statusCompRGB) {
|
StatusMessageType msgType, RGB statusCompRGB) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS - Ceiling/Visibility Distribution");
|
setText("AvnFPS - Ceiling/Visibility Distribution");
|
||||||
|
|
||||||
this.icaos = icaos;
|
this.icaos = icaos;
|
||||||
|
@ -383,11 +387,15 @@ public class CigVisDistributionDlg extends CaveSWTDialog implements
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This application displays ceiling and visiblity distribution for\nselected time range.\n\nThe distribution is plotted in a form of stacked histogram. \nPlot Type \n By Month - the X axis is month. The category frequency is \n calculated for a selected range of hours.\n By Hour - the X axis is hour of day. The category frequency \n is calculated for a selected range of months.\n By Wind Dir - the X axis is 16 point wind direction. The category \n frequency is calculated for a selected range of \n months and hours.\n\nAuto Redraw \n Forces screen redraw every time a new sites selected or date/time \n widgets are modified.\n\nElement\n Visibility - only visibility thresholds are checked to determine \n flight category\n Ceiling - only ceiling thresholds are checked to determine \n flight category\n Joint - both ceiling and visibility thresholds are checked \n to determine flight category\n\ny-axis scale\n Sets maximum value for the vertical axis. If 'auto' toggle is set,\n the value is computed. Behaves sensibly if selected value is too \n low.";
|
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This application displays ceiling and visiblity distribution for\nselected time range.\n\nThe distribution is plotted in a form of stacked histogram. \nPlot Type \n By Month - the X axis is month. The category frequency is \n calculated for a selected range of hours.\n By Hour - the X axis is hour of day. The category frequency \n is calculated for a selected range of months.\n By Wind Dir - the X axis is 16 point wind direction. The category \n frequency is calculated for a selected range of \n months and hours.\n\nAuto Redraw \n Forces screen redraw every time a new sites selected or date/time \n widgets are modified.\n\nElement\n Visibility - only visibility thresholds are checked to determine \n flight category\n Ceiling - only ceiling thresholds are checked to determine \n flight category\n Joint - both ceiling and visibility thresholds are checked \n to determine flight category\n\ny-axis scale\n Sets maximum value for the vertical axis. If 'auto' toggle is set,\n the value is computed. Behaves sensibly if selected value is too \n low.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 9/12/2008 1444 grichard Accommodate separate message logs.
|
* 9/12/2008 1444 grichard Accommodate separate message logs.
|
||||||
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
||||||
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
||||||
|
* 10/09/2912 1229 rferrel Made non-blocking
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -204,6 +206,8 @@ public class CigVisTrendDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private SaveImageDlg siDlg;
|
private SaveImageDlg siDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -218,7 +222,8 @@ public class CigVisTrendDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public CigVisTrendDlg(Shell parent, java.util.List<String> icaos,
|
public CigVisTrendDlg(Shell parent, java.util.List<String> icaos,
|
||||||
StatusMessageType msgType, RGB statusCompRGB) {
|
StatusMessageType msgType, RGB statusCompRGB) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS - Ceiling/Visibility Trend");
|
setText("AvnFPS - Ceiling/Visibility Trend");
|
||||||
|
|
||||||
this.icaos = icaos;
|
this.icaos = icaos;
|
||||||
|
@ -357,11 +362,14 @@ public class CigVisTrendDlg extends CaveSWTDialog {
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This application displays ceiling/visibility trend based\non selected initial conditions.\n\nUse \"Get\" button to retrieve METAR for a selected site.\nThe METAR can be modified.\nUse \"Decode\" button to initialize selection widgets.\nThe initial conditions can be adjusted either by typing\nin the \"value\" and \"range\" windows, or by mouse actions.\nLeft button moves value or an edge of range (red area on\nthe element widget). Middle button is used to move both\nvalue and range. In the \"Wind Direction\" widget use right\nbutton to toggle between wind arrow and a circle representing\ncalm and variable wind.\nUse \"Element\" radiobuttons to select forecasted element.\nPress \"Draw\" to display the forecast.\n\nThe displayed image can be printed or stored in a graphic file.\nUse \"File\" menu for that purpose.";
|
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
String helpText = "This application displays ceiling/visibility trend based\non selected initial conditions.\n\nUse \"Get\" button to retrieve METAR for a selected site.\nThe METAR can be modified.\nUse \"Decode\" button to initialize selection widgets.\nThe initial conditions can be adjusted either by typing\nin the \"value\" and \"range\" windows, or by mouse actions.\nLeft button moves value or an edge of range (red area on\nthe element widget). Middle button is used to move both\nvalue and range. In the \"Wind Direction\" widget use right\nbutton to toggle between wind arrow and a circle representing\ncalm and variable wind.\nUse \"Element\" radiobuttons to select forecasted element.\nPress \"Draw\" to display the forecast.\n\nThe displayed image can be printed or stored in a graphic file.\nUse \"File\" menu for that purpose.";
|
||||||
helpText);
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
usageDlg.open();
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,11 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* in initializeComponents
|
* in initializeComponents
|
||||||
* 10/12/2010 6009 rferrel Code clean up from making TafSiteConfig
|
* 10/12/2010 6009 rferrel Code clean up from making TafSiteConfig
|
||||||
* a singleton
|
* a singleton
|
||||||
|
* 10/04/2012 1229 rferrel Made non-blocking.
|
||||||
|
* 10/08/2012 1229 rferrel Changes for non-blocking WindRosePlotDlg.
|
||||||
|
* 10/09/2012 1229 rferrel Changes for non-blocking MetarDisplayDialog.
|
||||||
|
* 10/09/2012 1229 rferrel Changes for non-blocking CigVisTrendDlg.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -102,6 +107,8 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private CigVisTrendDlg cigVisTrend;
|
private CigVisTrendDlg cigVisTrend;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -114,7 +121,8 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public ClimateMenuDlg(Shell parent, StatusMessageType[] statusMsgTypes,
|
public ClimateMenuDlg(Shell parent, StatusMessageType[] statusMsgTypes,
|
||||||
RGB statusCompRGB) {
|
RGB statusCompRGB) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Climate Menu");
|
setText("AvnFPS Climate Menu");
|
||||||
|
|
||||||
this.statusMsgTypes = statusMsgTypes;
|
this.statusMsgTypes = statusMsgTypes;
|
||||||
|
@ -229,11 +237,15 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
usageMenuItem.addSelectionListener(new SelectionAdapter() {
|
usageMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS Climate Menu - Usage";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This master menu GUI is used to launch applications that display NCDC\nclimatological data for observation sites in a variety of formats.\n\nButton description:\n\nMETARs: use to display reconstructed METARs for a user-defined\n span of days\nWind Rose: displays Wind Rose for selected dates, times and flight\n category conditions\nCigVis Dist: displays ceiling, visibility and flight category\n distributions by month, hour and wind direction\nCigVis Trend: displays 3-12 hour ceiling, visibility and flight\n category forecast based on initial conditions";
|
String description = "AvnFPS Climate Menu - Usage";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This master menu GUI is used to launch applications that display NCDC\nclimatological data for observation sites in a variety of formats.\n\nButton description:\n\nMETARs: use to display reconstructed METARs for a user-defined\n span of days\nWind Rose: displays Wind Rose for selected dates, times and flight\n category conditions\nCigVis Dist: displays ceiling, visibility and flight category\n distributions by month, hour and wind direction\nCigVis Trend: displays 3-12 hour ceiling, visibility and flight\n category forecast based on initial conditions";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -258,11 +270,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
metarsBtn.addSelectionListener(new SelectionAdapter() {
|
metarsBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (metarDlg == null) {
|
if (metarDlg == null || metarDlg.getShell() == null
|
||||||
|
|| metarDlg.isDisposed()) {
|
||||||
metarDlg = new MetarDisplayDialog(shell, stationList,
|
metarDlg = new MetarDisplayDialog(shell, stationList,
|
||||||
statusMsgTypes[0], statusCompRGB);
|
statusMsgTypes[0], statusCompRGB);
|
||||||
metarDlg.open();
|
metarDlg.open();
|
||||||
metarDlg = null;
|
} else {
|
||||||
|
metarDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -277,11 +291,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
windRoseBtn.addSelectionListener(new SelectionAdapter() {
|
windRoseBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (windRose == null || windRose.isDisposed()) {
|
if (windRose == null || windRose.getShell() == null
|
||||||
|
|| windRose.isDisposed()) {
|
||||||
windRose = new WindRosePlotDlg(shell, stationList,
|
windRose = new WindRosePlotDlg(shell, stationList,
|
||||||
statusMsgTypes[1], statusCompRGB);
|
statusMsgTypes[1], statusCompRGB);
|
||||||
windRose.open();
|
windRose.open();
|
||||||
windRose = null;
|
} else {
|
||||||
|
windRose.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -296,11 +312,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
distBtn.addSelectionListener(new SelectionAdapter() {
|
distBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (cigVisDist == null) {
|
if (cigVisDist == null || cigVisDist.getShell() == null
|
||||||
|
|| cigVisDist.isDisposed()) {
|
||||||
cigVisDist = new CigVisDistributionDlg(shell, stationList,
|
cigVisDist = new CigVisDistributionDlg(shell, stationList,
|
||||||
statusMsgTypes[2], statusCompRGB);
|
statusMsgTypes[2], statusCompRGB);
|
||||||
cigVisDist.open();
|
cigVisDist.open();
|
||||||
cigVisDist = null;
|
} else {
|
||||||
|
cigVisDist.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -315,11 +333,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
||||||
trendBtn.addSelectionListener(new SelectionAdapter() {
|
trendBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (cigVisTrend == null) {
|
if (cigVisTrend == null || cigVisTrend.getShell() == null
|
||||||
|
|| cigVisTrend.isDisposed()) {
|
||||||
cigVisTrend = new CigVisTrendDlg(shell, stationList,
|
cigVisTrend = new CigVisTrendDlg(shell, stationList,
|
||||||
statusMsgTypes[3], statusCompRGB);
|
statusMsgTypes[3], statusCompRGB);
|
||||||
cigVisTrend.open();
|
cigVisTrend.open();
|
||||||
cigVisTrend = null;
|
} else {
|
||||||
|
cigVisTrend.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -90,6 +90,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 4/4/2011 8896 rferrel Made timeout configurable
|
* 4/4/2011 8896 rferrel Made timeout configurable
|
||||||
* 4/8/2011 8838 rferrel Properly set up "Show Display"
|
* 4/8/2011 8838 rferrel Properly set up "Show Display"
|
||||||
* 4/12/2011 8861 rferrel Added file permission check in savedata
|
* 4/12/2011 8861 rferrel Added file permission check in savedata
|
||||||
|
* 10/09/2012 1229 rferrel Change to non-blocking dialog.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -98,7 +100,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
*/
|
*/
|
||||||
public class MetarDisplayDialog extends CaveSWTDialog implements
|
public class MetarDisplayDialog extends CaveSWTDialog implements
|
||||||
PyProcessListener {
|
PyProcessListener {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(MetarDisplayDialog.class);
|
.getHandler(MetarDisplayDialog.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,6 +167,8 @@ public class MetarDisplayDialog extends CaveSWTDialog implements
|
||||||
|
|
||||||
private PythonProcess pythonScript = null;
|
private PythonProcess pythonScript = null;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -179,7 +183,8 @@ public class MetarDisplayDialog extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
public MetarDisplayDialog(Shell parent, java.util.List<String> icaos,
|
public MetarDisplayDialog(Shell parent, java.util.List<String> icaos,
|
||||||
StatusMessageType msgType, RGB statusCompRGB) {
|
StatusMessageType msgType, RGB statusCompRGB) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS - METAR Display");
|
setText("AvnFPS - METAR Display");
|
||||||
|
|
||||||
this.icaos = icaos;
|
this.icaos = icaos;
|
||||||
|
@ -484,11 +489,16 @@ public class MetarDisplayDialog extends CaveSWTDialog implements
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "METAR Display Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This dialog is used to display METARs reconstructed from climate data.\n\nMenu Bar\nFile:\n Print: invokes printer selection dialog.\n Save As: invokes file selection dialog.\n\nOptions:\n Show Decoded: toggles between METAR and decoded (ARONET) display \n format\n Update on Selection: when selected, \"Station\", \"Month\", \"Day\" \n and \"Num Days\" changes update the display without \n pressing \"Show\"\n\nDate Selection\n Year: select start year.\n Month: select start month.\n Day: select start day. Range of days is always 1-31, \n year 2000, month 2, day 31 results in data for \n March 2, 2000.\n Num Days: number of days of data to display.\n\nShow: displays reconstructed METARs for the selected dates and \n display format.";
|
String description = "METAR Display Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This dialog is used to display METARs reconstructed from climate data.\n\nMenu Bar\nFile:\n Print: invokes printer selection dialog.\n Save As: invokes file selection dialog.\n\nOptions:\n Show Decoded: toggles between METAR and decoded (ARONET) display \n format\n Update on Selection: when selected, \"Station\", \"Month\", \"Day\" \n and \"Num Days\" changes update the display without \n pressing \"Show\"\n\nDate Selection\n Year: select start year.\n Month: select start month.\n Day: select start day. Range of days is always 1-31, \n year 2000, month 2, day 31 results in data for \n March 2, 2000.\n Num Days: number of days of data to display.\n\nShow: displays reconstructed METARs for the selected dates and \n display format.";
|
||||||
usageDlg.open();
|
|
||||||
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||||
import com.raytheon.viz.avnconfig.MessageStatusComp;
|
import com.raytheon.viz.avnconfig.MessageStatusComp;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WeatherPlotDialog class displays the Weather Plot dialog for AvnFPS.
|
* WeatherPlotDialog class displays the Weather Plot dialog for AvnFPS.
|
||||||
|
@ -84,6 +85,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 11/18/2010 6701 rferrel Now uses the same wxPlotCfg
|
* 11/18/2010 6701 rferrel Now uses the same wxPlotCfg
|
||||||
* as WeatherPlotDataManager.
|
* as WeatherPlotDataManager.
|
||||||
* 04/28/2011 8065 rferrel Use cache data.
|
* 04/28/2011 8065 rferrel Use cache data.
|
||||||
|
* 10/02/2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
* 10/10/2012 1229 rferrel Changes for non-blocking TimeSelectorDlg.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -173,16 +177,6 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private Label siteTimeLbl;
|
private Label siteTimeLbl;
|
||||||
|
|
||||||
/**
|
|
||||||
* Scrolled composite width.
|
|
||||||
*/
|
|
||||||
private final int SCROLLED_COMP_WIDTH = 1120;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scrolled composite height.
|
|
||||||
*/
|
|
||||||
private final int SCROLLED_COMP_HEIGHT = 610;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scrolled composite containing plot data.
|
* Scrolled composite containing plot data.
|
||||||
*/
|
*/
|
||||||
|
@ -223,6 +217,10 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private List<String> icaos;
|
private List<String> icaos;
|
||||||
|
|
||||||
|
private TimeSelectorDialog timeDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -234,7 +232,8 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
||||||
public WeatherPlotDialog(Shell parent, StatusMessageType msgType,
|
public WeatherPlotDialog(Shell parent, StatusMessageType msgType,
|
||||||
List<String> stationList) {
|
List<String> stationList) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Weather Plot");
|
setText("AvnFPS Weather Plot");
|
||||||
|
|
||||||
this.msgType = msgType;
|
this.msgType = msgType;
|
||||||
|
@ -419,10 +418,25 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
||||||
timesBtn.addSelectionListener(new SelectionAdapter() {
|
timesBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
TimeSelectorDialog timeDlg = new TimeSelectorDialog(shell,
|
if (timeDlg == null || timeDlg.getShell() == null
|
||||||
wxPlotCfg);
|
|| timeDlg.isDisposed()) {
|
||||||
if ((Boolean) timeDlg.open()) {
|
timeDlg = new TimeSelectorDialog(shell, wxPlotCfg);
|
||||||
displayData();
|
timeDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof Boolean) {
|
||||||
|
boolean value = (Boolean) returnValue;
|
||||||
|
if (value) {
|
||||||
|
displayData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
timeDlg.open();
|
||||||
|
} else {
|
||||||
|
timeDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -456,11 +470,14 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
||||||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String text = "This dialog is used to display TAFs, METARs and guidance forecasts.\n\nMenus:\n Site ID - pulldown menu displaying list of all TAF sites.\n Selection of a site from the list redraws the window.\n zoom - zoom factor (time scale). \n\nButtons:\n Display - Redraws the window.\n Times - Displays forecast time selection window\n Print - Dumps an image of the window to a command specified in\n the configration file etc/wxplot.cfg.\n Close - Closes this dialog.\n Help - Displays this help.\n\nData Sources - selection of available data sources. ";
|
if (mustCreate(usageDlg)) {
|
||||||
String description = "Help";
|
String description = "Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
String helpText = "This dialog is used to display TAFs, METARs and guidance forecasts.\n\nMenus:\n Site ID - pulldown menu displaying list of all TAF sites.\n Selection of a site from the list redraws the window.\n zoom - zoom factor (time scale). \n\nButtons:\n Display - Redraws the window.\n Times - Displays forecast time selection window\n Print - Dumps an image of the window to a command specified in\n the configration file etc/wxplot.cfg.\n Close - Closes this dialog.\n Help - Displays this help.\n\nData Sources - selection of available data sources. ";
|
||||||
text);
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
usageDlg.open();
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 28 FEB 2008 938 lvenable Initial creation
|
* 28 FEB 2008 938 lvenable Initial creation
|
||||||
* 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes.
|
* 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes.
|
||||||
|
* 04 OCT 2012 1229 rferrel Made non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -162,7 +163,8 @@ public class WindRoseConfigDlg extends CaveSWTDialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public WindRoseConfigDlg(Shell parent, WindRoseConfigData windRoseConfigData) {
|
public WindRoseConfigDlg(Shell parent, WindRoseConfigData windRoseConfigData) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Config");
|
setText("Config");
|
||||||
|
|
||||||
this.windRoseConfigData = windRoseConfigData;
|
this.windRoseConfigData = windRoseConfigData;
|
||||||
|
|
|
@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.MessageBox;
|
import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Spinner;
|
import org.eclipse.swt.widgets.Spinner;
|
||||||
|
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||||
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
||||||
|
@ -81,6 +82,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
||||||
* 23JUL2012 15169 zhao Use Combo for 'Month' and 'Number of Months'
|
* 23JUL2012 15169 zhao Use Combo for 'Month' and 'Number of Months'
|
||||||
* & disabled site controls while drawing
|
* & disabled site controls while drawing
|
||||||
|
* 04OCT2012 1229 rferrel Changes for non-blocking WindRoseConfigDlg.
|
||||||
|
* 08OCT2012 1229 rferrel Made non-blocking.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -183,6 +187,10 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private RGB statusCompRGB;
|
private RGB statusCompRGB;
|
||||||
|
|
||||||
|
private WindRoseConfigDlg configDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -197,7 +205,8 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public WindRosePlotDlg(Shell parent, java.util.List<String> icaos,
|
public WindRosePlotDlg(Shell parent, java.util.List<String> icaos,
|
||||||
StatusMessageType msgType, RGB statusCompRGB) {
|
StatusMessageType msgType, RGB statusCompRGB) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Wind Rose Plot");
|
setText("Wind Rose Plot");
|
||||||
|
|
||||||
this.icaos = icaos;
|
this.icaos = icaos;
|
||||||
|
@ -321,9 +330,13 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
configureMI.addSelectionListener(new SelectionAdapter() {
|
configureMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
WindRoseConfigDlg configDlg = new WindRoseConfigDlg(shell,
|
if (configDlg == null || configDlg.getShell() == null
|
||||||
windRoseConfigData);
|
|| configDlg.isDisposed()) {
|
||||||
configDlg.open();
|
configDlg = new WindRoseConfigDlg(shell, windRoseConfigData);
|
||||||
|
configDlg.open();
|
||||||
|
} else {
|
||||||
|
configDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -367,11 +380,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS - Wind Rose Display Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This application displays wind rose for selected month and hour,\nor range of hours. \n\nTime selection\n Month - selects month.\n Num Months - select number of months of data to display\n Hour - selects hour. \n Num Hours - selects number of hours of data to display\n\nFlight Cat\n This option menu restricts the search to flight category\n conditions at or below the selected value. \"All\" means no\n restrictions.\n\nIf Auto Redraw is selected, changing month, hour, or number of hours\nfields will cause the wind rose to be redrawn for any valid value in\nthese fields.\n\nUse the\"Draw\" button to display wind rose after selecting new site,\nor flight category.\n\nThe displayed image can be printed or stored in a graphic file.\nUse the options under the \"File\" menu for that purpose.";
|
String description = "AvnFPS - Wind Rose Display Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This application displays wind rose for selected month and hour,\nor range of hours. \n\nTime selection\n Month - selects month.\n Num Months - select number of months of data to display\n Hour - selects hour. \n Num Hours - selects number of hours of data to display\n\nFlight Cat\n This option menu restricts the search to flight category\n conditions at or below the selected value. \"All\" means no\n restrictions.\n\nIf Auto Redraw is selected, changing month, hour, or number of hours\nfields will cause the wind rose to be redrawn for any valid value in\nthese fields.\n\nUse the\"Draw\" button to display wind rose after selecting new site,\nor flight category.\n\nThe displayed image can be printed or stored in a graphic file.\nUse the options under the \"File\" menu for that purpose.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -431,16 +448,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
gd = new GridData(66, SWT.DEFAULT);
|
gd = new GridData(66, SWT.DEFAULT);
|
||||||
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
monthCbo.setLayoutData(gd);
|
monthCbo.setLayoutData(gd);
|
||||||
for ( int i = 1; i <= 12; i++ ) {
|
for (int i = 1; i <= 12; i++) {
|
||||||
monthCbo.add(""+i, i-1);
|
monthCbo.add("" + i, i - 1);
|
||||||
}
|
}
|
||||||
monthCbo.select(cal.get(Calendar.MONTH));
|
monthCbo.select(cal.get(Calendar.MONTH));
|
||||||
monthCbo.addSelectionListener(new SelectionAdapter() {
|
monthCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
//System.out.println(" *************** monthsCbo.getText() = " + monthCbo.getText() );
|
|
||||||
if (autoRedrawChk.getSelection()) {
|
if (autoRedrawChk.getSelection()) {
|
||||||
redrawWindRose();
|
redrawWindRose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -451,16 +467,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
gd = new GridData(66, SWT.DEFAULT);
|
gd = new GridData(66, SWT.DEFAULT);
|
||||||
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
numMonthsCbo.setLayoutData(gd);
|
numMonthsCbo.setLayoutData(gd);
|
||||||
for ( int i = 1; i <= 12; i++ ) {
|
for (int i = 1; i <= 12; i++) {
|
||||||
numMonthsCbo.add(""+i, i-1);
|
numMonthsCbo.add("" + i, i - 1);
|
||||||
}
|
}
|
||||||
numMonthsCbo.select(0);
|
numMonthsCbo.select(0);
|
||||||
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
|
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
//System.out.println(" *************** numMonthsCbo.getText() = " + numMonthsCbo.getText() );
|
|
||||||
if (autoRedrawChk.getSelection()) {
|
if (autoRedrawChk.getSelection()) {
|
||||||
redrawWindRose();
|
redrawWindRose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -585,11 +600,9 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
generateWindRoseHeader();
|
generateWindRoseHeader();
|
||||||
|
|
||||||
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
||||||
windRoseHeader,
|
windRoseHeader, monthCbo.getText(), numMonthsCbo.getText(),
|
||||||
monthCbo.getText(),
|
hourSpnr.getText(), numHoursSpnr.getText(),
|
||||||
numMonthsCbo.getText(),
|
flightCatCbo.getSelectionIndex(),
|
||||||
hourSpnr.getText(),
|
|
||||||
numHoursSpnr.getText(), flightCatCbo.getSelectionIndex(),
|
|
||||||
siteList.getItem(siteList.getSelectionIndex()), this);
|
siteList.getItem(siteList.getSelectionIndex()), this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -647,18 +660,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
header.append(MONTHS[monthCbo.getSelectionIndex()]);
|
header.append(MONTHS[monthCbo.getSelectionIndex()]);
|
||||||
|
|
||||||
if ( numMonthsCbo.getSelectionIndex() == 0 ) {
|
if (numMonthsCbo.getSelectionIndex() == 0) {
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
} else {
|
} else {
|
||||||
header.append("-");
|
header.append("-");
|
||||||
|
|
||||||
int endMonth = 0;
|
int endMonth = 0;
|
||||||
|
|
||||||
if ( ( numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() ) > 11 ) {
|
if ((numMonthsCbo.getSelectionIndex() + monthCbo
|
||||||
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() - 12;
|
.getSelectionIndex()) > 11) {
|
||||||
|
endMonth = numMonthsCbo.getSelectionIndex()
|
||||||
|
+ monthCbo.getSelectionIndex() - 12;
|
||||||
header.append(MONTHS[endMonth]);
|
header.append(MONTHS[endMonth]);
|
||||||
} else {
|
} else {
|
||||||
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex();
|
endMonth = numMonthsCbo.getSelectionIndex()
|
||||||
|
+ monthCbo.getSelectionIndex();
|
||||||
header.append(MONTHS[endMonth]);
|
header.append(MONTHS[endMonth]);
|
||||||
}
|
}
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
|
|
|
@ -71,6 +71,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 7/26/2010 6693 rferrel Apply now checks for Delay.
|
* 7/26/2010 6693 rferrel Apply now checks for Delay.
|
||||||
* 9/9/2010 5468 rferrel Check for no TAF loaded for a site
|
* 9/9/2010 5468 rferrel Check for no TAF loaded for a site
|
||||||
* 10/1/2010 4345 rferrel Made products display the same as AWIPS I
|
* 10/1/2010 4345 rferrel Made products display the same as AWIPS I
|
||||||
|
* 10/04/2012 1229 rferrel Made non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -141,7 +142,8 @@ public class LoaderDialog extends CaveSWTDialog {
|
||||||
* Parent Shell.
|
* Parent Shell.
|
||||||
*/
|
*/
|
||||||
public LoaderDialog(Shell parent, TafViewerEditorDlg tveDlg) {
|
public LoaderDialog(Shell parent, TafViewerEditorDlg tveDlg) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Loader");
|
setText("AvnFPS Loader");
|
||||||
|
|
||||||
this.tveDlg = tveDlg;
|
this.tveDlg = tveDlg;
|
||||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 1/17/2011 7782 rferrel Dialog now has open return null or
|
* 1/17/2011 7782 rferrel Dialog now has open return null or
|
||||||
* the desired check list; removed the use
|
* the desired check list; removed the use
|
||||||
* of sites to be like OB9.2.X.
|
* of sites to be like OB9.2.X.
|
||||||
|
* 10/09/2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -89,7 +90,8 @@ public class QcDialog extends CaveSWTDialog {
|
||||||
* - parent composite
|
* - parent composite
|
||||||
*/
|
*/
|
||||||
public QcDialog(Shell parent, Map<String, String> items) {
|
public QcDialog(Shell parent, Map<String, String> items) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS QC");
|
setText("AvnFPS QC");
|
||||||
|
|
||||||
this.items = items;
|
this.items = items;
|
||||||
|
@ -217,7 +219,7 @@ public class QcDialog extends CaveSWTDialog {
|
||||||
qcItems.put("impact", "0");
|
qcItems.put("impact", "0");
|
||||||
}
|
}
|
||||||
setReturnValue(qcItems);
|
setReturnValue(qcItems);
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -229,7 +231,7 @@ public class QcDialog extends CaveSWTDialog {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
setReturnValue(null);
|
setReturnValue(null);
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Dialog;
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.FileDialog;
|
import org.eclipse.swt.widgets.FileDialog;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
@ -134,6 +133,8 @@ import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||||
import com.raytheon.viz.avnconfig.TafSiteData;
|
import com.raytheon.viz.avnconfig.TafSiteData;
|
||||||
import com.raytheon.viz.texteditor.TextDisplayModel;
|
import com.raytheon.viz.texteditor.TextDisplayModel;
|
||||||
import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
||||||
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class displays the TAF Viewer and Editor dialog.
|
* This class displays the TAF Viewer and Editor dialog.
|
||||||
|
@ -214,6 +215,14 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
||||||
* 11/29/2011 11612 rferrel Added getViewerTabList.
|
* 11/29/2011 11612 rferrel Added getViewerTabList.
|
||||||
* 20JUL2012 14570 gzhang/zhao Highlight correct time groups in TAF Viewer
|
* 20JUL2012 14570 gzhang/zhao Highlight correct time groups in TAF Viewer
|
||||||
* 08AGU2012 15613 zhao Modified highlightTAF()
|
* 08AGU2012 15613 zhao Modified highlightTAF()
|
||||||
|
* 04OCT2012 1229 rferrel Changes for non-blocking LoaderDialog.
|
||||||
|
* 09OCT2012 1229 rferrel Changes for non-blocking QcDialog.
|
||||||
|
* 09OCT2012 1229 rferrel Changes for non-blocking SendDialog.
|
||||||
|
* 11OCT2012 1229 rferrel Converted to a subclass of CaveSWTDialog and
|
||||||
|
* 12OCT2012 1229 rferrel Changes for non-blocking FindReplaceDlg.
|
||||||
|
* made non-blocking.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
|
* 11/05/2012 15477 zhao Trim blank lines in text in Editor when check Syntax
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -221,12 +230,12 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
|
||||||
IEditActions {
|
IEditActions {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(TafViewerEditorDlg.class);
|
.getHandler(TafViewerEditorDlg.class);
|
||||||
|
|
||||||
private static final String SPLIT_REGEX = "=+[\\s\n]*|\n{2,}|\n$";
|
private final String SPLIT_REGEX = "=+[\\s\n]*|\n{2,}|\n$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of editor tabs
|
* The number of editor tabs
|
||||||
|
@ -249,11 +258,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
return PATH_MANAGER.getFile(baseCommonCtx, "python").getPath();
|
return PATH_MANAGER.getFile(baseCommonCtx, "python").getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Dialog shell.
|
|
||||||
*/
|
|
||||||
private Shell shell;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The display control.
|
* The display control.
|
||||||
*/
|
*/
|
||||||
|
@ -449,6 +453,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
*/
|
*/
|
||||||
private boolean pythonModifiedTAF = false;
|
private boolean pythonModifiedTAF = false;
|
||||||
|
|
||||||
|
private FindReplaceDlg findDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TAF editor enumeration
|
* TAF editor enumeration
|
||||||
*/
|
*/
|
||||||
|
@ -515,21 +521,30 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
|
|
||||||
private PythonScript parsePythonScript;
|
private PythonScript parsePythonScript;
|
||||||
|
|
||||||
|
private LoaderDialog loadDlg;
|
||||||
|
|
||||||
|
private QcDialog qcDlg;
|
||||||
|
|
||||||
|
private SendDialog sendDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg keyBindingUsageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
* Parent Shell.
|
* Parent Shell.
|
||||||
* @param disposeOnExit
|
|
||||||
* Flag to indicate whether to dispose dialog on exit.
|
|
||||||
*/
|
*/
|
||||||
public TafViewerEditorDlg(Shell parent, boolean disposeOnExit,
|
public TafViewerEditorDlg(Shell parent, List<String> stationList,
|
||||||
List<String> stationList) {
|
int caveStyle) {
|
||||||
super(parent, 0);
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS, caveStyle
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
|
|
||||||
this.stationList = stationList;
|
this.stationList = stationList;
|
||||||
|
|
||||||
init();
|
setText("AvnFPS TAF Editor");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -542,34 +557,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
|
|
||||||
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
||||||
|
|
||||||
boolean transientDialog = configMgr
|
|
||||||
.getDataAsBoolean(ResourceTag.TransientDialogs);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check the transient dialog setting. If the transient dialog is true
|
|
||||||
* then the parent dialog cannot be display on top of this dialog. If
|
|
||||||
* the transient is false the parent dialog can be displayed on top of
|
|
||||||
* this dialog.
|
|
||||||
*/
|
|
||||||
if (transientDialog == true) {
|
|
||||||
// Parent dialog cannot be displayed on top of this dialog.
|
|
||||||
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE
|
|
||||||
| SWT.MODELESS);
|
|
||||||
} else {
|
|
||||||
// Parent dialog can be displayed on top of this dialog.
|
|
||||||
shell = new Shell(parent.getDisplay(), SWT.DIALOG_TRIM | SWT.RESIZE
|
|
||||||
| SWT.MODELESS);
|
|
||||||
|
|
||||||
parent.addDisposeListener(new DisposeListener() {
|
|
||||||
@Override
|
|
||||||
public void widgetDisposed(DisposeEvent e) {
|
|
||||||
disposeDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
shell.setText("AvnFPS TAF Editor");
|
|
||||||
|
|
||||||
shell.addShellListener(new ShellAdapter() {
|
shell.addShellListener(new ShellAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void shellClosed(ShellEvent event) {
|
public void shellClosed(ShellEvent event) {
|
||||||
|
@ -586,7 +573,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Block the disposal of this dialog.
|
// Block the disposal of this dialog.
|
||||||
shell.setVisible(false);
|
hideDialog();
|
||||||
event.doit = false;
|
event.doit = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -630,8 +617,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
// Initialize all of the controls and layouts
|
// Initialize all of the controls and layouts
|
||||||
initializeComponents();
|
initializeComponents();
|
||||||
|
|
||||||
shell.pack();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
*
|
*
|
||||||
|
@ -662,6 +647,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateSettings(TafSettings setting, String stationName) {
|
public void updateSettings(TafSettings setting, String stationName) {
|
||||||
|
checkDlg();
|
||||||
|
|
||||||
String previousStationName = this.stationName;
|
String previousStationName = this.stationName;
|
||||||
this.stationName = stationName;
|
this.stationName = stationName;
|
||||||
|
|
||||||
|
@ -780,6 +767,9 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearAll() {
|
public void clearAll() {
|
||||||
|
if (shell == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Clear all tab items within all editor tabs on the tab folder.
|
// Clear all tab items within all editor tabs on the tab folder.
|
||||||
tabFolder.setSelection(editorTab);
|
tabFolder.setSelection(editorTab);
|
||||||
|
|
||||||
|
@ -880,8 +870,31 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void showDialog() {
|
public void showDialog() {
|
||||||
|
|
||||||
|
checkDlg();
|
||||||
|
|
||||||
if (shell.isVisible() == false) {
|
if (shell.isVisible() == false) {
|
||||||
shell.setVisible(true);
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(qcDlg) == false) {
|
||||||
|
qcDlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(sendDlg) == false) {
|
||||||
|
sendDlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(findDlg) == false) {
|
||||||
|
findDlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(keyBindingUsageDlg) == false) {
|
||||||
|
keyBindingUsageDlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(usageDlg) == false) {
|
||||||
|
usageDlg.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
shell.setActive();
|
shell.setActive();
|
||||||
|
@ -893,12 +906,34 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
@Override
|
@Override
|
||||||
public void hideDialog() {
|
public void hideDialog() {
|
||||||
|
|
||||||
// if (disposeOnExit == true) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (shell.isVisible() == true) {
|
if (shell.isVisible() == true) {
|
||||||
shell.setVisible(false);
|
setVisible(false);
|
||||||
|
}
|
||||||
|
if (mustCreate(qcDlg) == false) {
|
||||||
|
qcDlg.hide();
|
||||||
|
}
|
||||||
|
if (mustCreate(sendDlg) == false) {
|
||||||
|
sendDlg.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(findDlg) == false) {
|
||||||
|
findDlg.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(keyBindingUsageDlg) == false) {
|
||||||
|
keyBindingUsageDlg.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustCreate(usageDlg) == false) {
|
||||||
|
usageDlg.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setVisible(boolean state) {
|
||||||
|
shell.setVisible(state);
|
||||||
|
if (loadDlg != null && loadDlg.getShell() != null
|
||||||
|
&& !loadDlg.isDisposed()) {
|
||||||
|
loadDlg.getShell().setVisible(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -916,8 +951,17 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
fltCatFontColor.dispose();
|
fltCatFontColor.dispose();
|
||||||
fltCatFontColor = null;
|
fltCatFontColor = null;
|
||||||
}
|
}
|
||||||
shell.dispose();
|
|
||||||
clipboard.dispose();
|
close();
|
||||||
|
|
||||||
|
if (clipboard != null) {
|
||||||
|
clipboard.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initializeComponents(Shell shell) {
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1107,7 +1151,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
closeMI.addSelectionListener(new SelectionAdapter() {
|
closeMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
// shell.dispose();
|
|
||||||
hideDialog();
|
hideDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1250,9 +1293,13 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
findMI.addSelectionListener(new SelectionAdapter() {
|
findMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
FindReplaceDlg findDlg = new FindReplaceDlg(shell,
|
if (mustCreate(findDlg)) {
|
||||||
editorTafTabComp.getTextEditorControl());
|
findDlg = new FindReplaceDlg(shell, editorTafTabComp
|
||||||
findDlg.open();
|
.getTextEditorControl());
|
||||||
|
findDlg.open();
|
||||||
|
} else {
|
||||||
|
findDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1304,53 +1351,57 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
keyBindingMI.addSelectionListener(new SelectionAdapter() {
|
keyBindingMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String text = "Ctrl-u Undo changes.\n"
|
if (mustCreate(keyBindingUsageDlg)) {
|
||||||
+ "Ctrl-r Redo changes.\n"
|
String description = "Key Bindings";
|
||||||
+ "Insert Toggles insert/overwrite mode.\n"
|
String helpText = "Ctrl-u Undo changes.\n"
|
||||||
+ "Any-Key Insert normal printing characters.\n"
|
+ "Ctrl-r Redo changes.\n"
|
||||||
+ "Button1 Sets the insert point, clear the selection, set focus.\n"
|
+ "Insert Toggles insert/overwrite mode.\n"
|
||||||
+ "Ctrl-Button1 Set the insert point without affecting the selection.\n"
|
+ "Any-Key Insert normal printing characters.\n"
|
||||||
+ "Button1-Motion Sweep out a selection from the insert point.\n"
|
+ "Button1 Sets the insert point, clear the selection, set focus.\n"
|
||||||
+ "Double-Button1 Select the word under the mouse.\n"
|
+ "Ctrl-Button1 Set the insert point without affecting the selection.\n"
|
||||||
+ "Triple-Button1 Select the line under the mouse.\n"
|
+ "Button1-Motion Sweep out a selection from the insert point.\n"
|
||||||
+ "Shift-Button1 Adjust the end of selection closest to the mouse.\n"
|
+ "Double-Button1 Select the word under the mouse.\n"
|
||||||
+ "Shift-Button1-Motion Continue to adjust the selection.\n"
|
+ "Triple-Button1 Select the line under the mouse.\n"
|
||||||
+ "Button2 Paste the selection, or set the scrolling anchor.\n"
|
+ "Shift-Button1 Adjust the end of selection closest to the mouse.\n"
|
||||||
+ "Button2-Motion Scroll the window.\n"
|
+ "Shift-Button1-Motion Continue to adjust the selection.\n"
|
||||||
+ "Left or Ctrl-b Move the cursor left one character. Clear selection.\n"
|
+ "Button2 Paste the selection, or set the scrolling anchor.\n"
|
||||||
+ "Shift-Left Move the cursor and extend the selection.\n"
|
+ "Button2-Motion Scroll the window.\n"
|
||||||
+ "Ctrl-Left Move the cursor by words. Clear the selection.\n"
|
+ "Left or Ctrl-b Move the cursor left one character. Clear selection.\n"
|
||||||
+ "Ctrl-Shift-Left Move the cursor by words. Extend the selection.\n"
|
+ "Shift-Left Move the cursor and extend the selection.\n"
|
||||||
+ "Right or Ctrl-f Right bindings are analogous to Left bindings.\n"
|
+ "Ctrl-Left Move the cursor by words. Clear the selection.\n"
|
||||||
+ "Alt-b or Alt Same as Ctrl-Left, Ctrl-Right.\n"
|
+ "Ctrl-Shift-Left Move the cursor by words. Extend the selection.\n"
|
||||||
+ "Up or Ctrl-p Move the cursor up one line. Clear the selection.\n"
|
+ "Right or Ctrl-f Right bindings are analogous to Left bindings.\n"
|
||||||
+ "Ctrl-Up Move the cursor by paragraph which are group of lines separated by a blank line.\n"
|
+ "Alt-b or Alt Same as Ctrl-Left, Ctrl-Right.\n"
|
||||||
+ "Ctrl-Shift-Up Move the cursor by paragraph. Extend selection.\n"
|
+ "Up or Ctrl-p Move the cursor up one line. Clear the selection.\n"
|
||||||
+ "Down or Ctrl-n All Down bindings are analogous to Up bindings.\n"
|
+ "Ctrl-Up Move the cursor by paragraph which are group of lines separated by a blank line.\n"
|
||||||
+ "PgUp, PgDn Move the cursor by one screen. Clear the selection.\n"
|
+ "Ctrl-Shift-Up Move the cursor by paragraph. Extend selection.\n"
|
||||||
+ "Shift-PgUp, Move the cursor by one screen. Extend the selection.\n"
|
+ "Down or Ctrl-n All Down bindings are analogous to Up bindings.\n"
|
||||||
+ "Shift-PgDn\n"
|
+ "PgUp, PgDn Move the cursor by one screen. Clear the selection.\n"
|
||||||
+ "Home or Ctrl-a Move the cursor to line start. Clear the selection.\n"
|
+ "Shift-PgUp, Move the cursor by one screen. Extend the selection.\n"
|
||||||
+ "Shift-Home Move the cursor to line start. Extend the selection.\n"
|
+ "Shift-PgDn\n"
|
||||||
+ "End or Ctrl-e Move the cursor to line end. Clear the selection.\n"
|
+ "Home or Ctrl-a Move the cursor to line start. Clear the selection.\n"
|
||||||
+ "Shift-End Move the cursor to line end. Extend the selection.\n"
|
+ "Shift-Home Move the cursor to line start. Extend the selection.\n"
|
||||||
+ "Ctrl-Home Move the cursor to the beginning of text. Clear the selection.\n"
|
+ "End or Ctrl-e Move the cursor to line end. Clear the selection.\n"
|
||||||
+ "Ctrl-End Move the cursor to the beginning of text. Extend the selection.\n"
|
+ "Shift-End Move the cursor to line end. Extend the selection.\n"
|
||||||
+ "Ctrl-/ Select everything in the text widget.\n"
|
+ "Ctrl-Home Move the cursor to the beginning of text. Clear the selection.\n"
|
||||||
+ "Ctrl-\\ Clear the selection.\n"
|
+ "Ctrl-End Move the cursor to the beginning of text. Extend the selection.\n"
|
||||||
+ "Delete Delete the selection, if any. Otherwise delete the character to the right of the cursor.\n"
|
+ "Ctrl-/ Select everything in the text widget.\n"
|
||||||
+ "Backspace or Ctrl-h Delete the selection, if any. Otherwise delete the character to the left of the cursor.\n"
|
+ "Ctrl-\\ Clear the selection.\n"
|
||||||
+ "Ctrl-d Delete character to the right of the cursor.\n"
|
+ "Delete Delete the selection, if any. Otherwise delete the character to the right of the cursor.\n"
|
||||||
+ "Alt-d Delete word to the right of the cursor.\n"
|
+ "Backspace or Ctrl-h Delete the selection, if any. Otherwise delete the character to the left of the cursor.\n"
|
||||||
+ "Ctrl-k Delete from cursor to the end of the line. If you are at the end of the line, delete the newline\n"
|
+ "Ctrl-d Delete character to the right of the cursor.\n"
|
||||||
+ " character.\n"
|
+ "Alt-d Delete word to the right of the cursor.\n"
|
||||||
+ "Ctrl-o Insert a newline but do not advance the cursor.\n"
|
+ "Ctrl-k Delete from cursor to the end of the line. If you are at the end of the line, delete the newline\n"
|
||||||
+ "Alt-Delete Delete the word to the left of the cursor.\n"
|
+ " character.\n"
|
||||||
+ "Ctrl-t Transpose the characters on either side of the cursor.";
|
+ "Ctrl-o Insert a newline but do not advance the cursor.\n"
|
||||||
String description = "Key Bindings";
|
+ "Alt-Delete Delete the word to the left of the cursor.\n"
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
+ "Ctrl-t Transpose the characters on either side of the cursor.";
|
||||||
text);
|
keyBindingUsageDlg = new HelpUsageDlg(shell, description,
|
||||||
usageDlg.open();
|
helpText);
|
||||||
|
keyBindingUsageDlg.open();
|
||||||
|
} else {
|
||||||
|
keyBindingUsageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1360,101 +1411,104 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String text = "This is a text editor specialized for composing and checking TAFs.\n"
|
if (mustCreate(usageDlg)) {
|
||||||
+ "\n"
|
String description = "Usage";
|
||||||
+ "The dialog consists of two areas. The top part is for viewing and\n"
|
String helpText = "This is a text editor specialized for composing and checking TAFs.\n"
|
||||||
+ "editing TAFs, the bottom part displays guidance data.\n"
|
+ "\n"
|
||||||
+ "\n"
|
+ "The dialog consists of two areas. The top part is for viewing and\n"
|
||||||
+ "The text editor consists of 4 independent pages. Each one displays WMO\n"
|
+ "editing TAFs, the bottom part displays guidance data.\n"
|
||||||
+ "header. The 'Rtn', ..., 'Cor' toggles change forecast type. Use\n"
|
+ "\n"
|
||||||
+ "'Clear' button to clear the text window. The 'Tools' combo box\n"
|
+ "The text editor consists of 4 independent pages. Each one displays WMO\n"
|
||||||
+ "displays list of site-specific utilities to modify the forecast.\n"
|
+ "header. The 'Rtn', ..., 'Cor' toggles change forecast type. Use\n"
|
||||||
+ "\n"
|
+ "'Clear' button to clear the text window. The 'Tools' combo box\n"
|
||||||
+ "Menus:\n"
|
+ "displays list of site-specific utilities to modify the forecast.\n"
|
||||||
+ " Most of the items are relevant when the 'Editor' tab is selected. \n"
|
+ "\n"
|
||||||
+ " File:\n"
|
+ "Menus:\n"
|
||||||
+ " Print - call print dialog\n"
|
+ " Most of the items are relevant when the 'Editor' tab is selected. \n"
|
||||||
+ " Clear Errors - clears error tags set by the formatting \n"
|
+ " File:\n"
|
||||||
+ " (quality check) action. Can be used to force \n"
|
+ " Print - call print dialog\n"
|
||||||
+ " transmission of forecasts that did not pass\n"
|
+ " Clear Errors - clears error tags set by the formatting \n"
|
||||||
+ " the Syntax check. It also reverses colors in\n"
|
+ " (quality check) action. Can be used to force \n"
|
||||||
+ " the editor window to normal after forecast is\n"
|
+ " transmission of forecasts that did not pass\n"
|
||||||
+ " sent\n"
|
+ " the Syntax check. It also reverses colors in\n"
|
||||||
+ " Update Times - updates issue and valid times\n"
|
+ " the editor window to normal after forecast is\n"
|
||||||
+ " Save As - allows to save edited forecast to a file. \n"
|
+ " sent\n"
|
||||||
+ " Restore From - use to restore forecast from a backup file\n"
|
+ " Update Times - updates issue and valid times\n"
|
||||||
+ " Store in DB - use to store forecast in AWIPS text database\n"
|
+ " Save As - allows to save edited forecast to a file. \n"
|
||||||
+ " Close - closes the editor window\n"
|
+ " Restore From - use to restore forecast from a backup file\n"
|
||||||
+ "\n"
|
+ " Store in DB - use to store forecast in AWIPS text database\n"
|
||||||
+ " Options: \n"
|
+ " Close - closes the editor window\n"
|
||||||
+ " Auto Save - toggles auto-save feature\n"
|
+ "\n"
|
||||||
+ " Auto Print - toggles automatic printout of sent forecasts\n"
|
+ " Options: \n"
|
||||||
+ " Update Times on Format - if selected, the issue and valid times in \n"
|
+ " Auto Save - toggles auto-save feature\n"
|
||||||
+ " the forecast are updated before quality control\n"
|
+ " Auto Print - toggles automatic printout of sent forecasts\n"
|
||||||
+ " checks\n"
|
+ " Update Times on Format - if selected, the issue and valid times in \n"
|
||||||
+ " Send in Collective - Toggles collective versus split bulletin\n"
|
+ " the forecast are updated before quality control\n"
|
||||||
+ " transmission. Intended for OCONUS sites only.\n"
|
+ " checks\n"
|
||||||
+ "\n"
|
+ " Send in Collective - Toggles collective versus split bulletin\n"
|
||||||
+ " Edit:\n"
|
+ " transmission. Intended for OCONUS sites only.\n"
|
||||||
+ " Provides the usual editing functions (i.e. Cut, Copy, Paste, \n"
|
+ "\n"
|
||||||
+ " and Find/Replace)\n"
|
+ " Edit:\n"
|
||||||
+ "\n"
|
+ " Provides the usual editing functions (i.e. Cut, Copy, Paste, \n"
|
||||||
+ "TAF editor area:\n"
|
+ " and Find/Replace)\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Buttons:\n"
|
+ "TAF editor area:\n"
|
||||||
+ " Load: invokes forecast selection dialog. Bulletin (or product) \n"
|
+ "\n"
|
||||||
+ " is selected from 'Bulletins' menu. To load bulletin from \n"
|
+ "Buttons:\n"
|
||||||
+ " previously saved file, set the 'From file' toggle.\n"
|
+ " Load: invokes forecast selection dialog. Bulletin (or product) \n"
|
||||||
+ " Otherwise the forecasts will be loaded depending on \n"
|
+ " is selected from 'Bulletins' menu. To load bulletin from \n"
|
||||||
+ " the 'Load Order' selecton:\n"
|
+ " previously saved file, set the 'From file' toggle.\n"
|
||||||
+ " Latest: first an attempt is made to access the most \n"
|
+ " Otherwise the forecasts will be loaded depending on \n"
|
||||||
+ " recent previous forecast. If one cannot be found,\n"
|
+ " the 'Load Order' selecton:\n"
|
||||||
+ " a template file is loaded.\n"
|
+ " Latest: first an attempt is made to access the most \n"
|
||||||
+ " Merge: loads previous forecast, then appends template.\n"
|
+ " recent previous forecast. If one cannot be found,\n"
|
||||||
+ " The intent is to allow phrases such as\n"
|
+ " a template file is loaded.\n"
|
||||||
+ " AMD NOT SKED AFT D1HHZ.\n"
|
+ " Merge: loads previous forecast, then appends template.\n"
|
||||||
+ " Template: loads forecasts from template file.\n"
|
+ " The intent is to allow phrases such as\n"
|
||||||
+ " 'Forecast Type' selection is used to initialize WMO\n"
|
+ " AMD NOT SKED AFT D1HHZ.\n"
|
||||||
+ " header (DDHHMM and BBB) fields. These fields will be \n"
|
+ " Template: loads forecasts from template file.\n"
|
||||||
+ " updated when forecast is sent. \n"
|
+ " 'Forecast Type' selection is used to initialize WMO\n"
|
||||||
+ "\n"
|
+ " header (DDHHMM and BBB) fields. These fields will be \n"
|
||||||
+ " Syntax: Performs syntax check and assures proper indentation \n"
|
+ " updated when forecast is sent. \n"
|
||||||
+ " and maximum line length. If Syntax Check fails the forecast, \n"
|
+ "\n"
|
||||||
+ " the problem areas will be highlighted. The color \n"
|
+ " Syntax: Performs syntax check and assures proper indentation \n"
|
||||||
+ " corresponds to the severity of the problem. Red means \n"
|
+ " and maximum line length. If Syntax Check fails the forecast, \n"
|
||||||
+ " the forecast could not be parsed sucessfully. Orange \n"
|
+ " the problem areas will be highlighted. The color \n"
|
||||||
+ " means error according to NWSI 10-813. Green is a warning.\n"
|
+ " corresponds to the severity of the problem. Red means \n"
|
||||||
+ "\n"
|
+ " the forecast could not be parsed sucessfully. Orange \n"
|
||||||
+ " QC: Performs selected quality control checks\n"
|
+ " means error according to NWSI 10-813. Green is a warning.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ " Send: Splits the bulletin into separate files, one per site, \n"
|
+ " QC: Performs selected quality control checks\n"
|
||||||
+ " which are written to directory 'xmit/pending'. \n"
|
+ "\n"
|
||||||
+ " The transmission program running on the data server is \n"
|
+ " Send: Splits the bulletin into separate files, one per site, \n"
|
||||||
+ " responsible for actual transmission.\n"
|
+ " which are written to directory 'xmit/pending'. \n"
|
||||||
+ " The program will check whether a regular forecast is \n"
|
+ " The transmission program running on the data server is \n"
|
||||||
+ " sent within the transmission time window. If not, an \n"
|
+ " responsible for actual transmission.\n"
|
||||||
+ " error dialog is displayed.\n"
|
+ " The program will check whether a regular forecast is \n"
|
||||||
+ "\n"
|
+ " sent within the transmission time window. If not, an \n"
|
||||||
+ " Save: Stores bulletin as a work TAF in a file\n"
|
+ " error dialog is displayed.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ " Restore: Restores bulletin from the work file\n"
|
+ " Save: Stores bulletin as a work TAF in a file\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Toggles:\n"
|
+ " Restore: Restores bulletin from the work file\n"
|
||||||
+ " Insert - toggles insert/overwrite mode\n"
|
+ "\n"
|
||||||
+ " Wrap - if selected, the line is folded when its length\n"
|
+ "Toggles:\n"
|
||||||
+ " exceedes window width. Has no effect on \n"
|
+ " Insert - toggles insert/overwrite mode\n"
|
||||||
+ " the final format.\n"
|
+ " Wrap - if selected, the line is folded when its length\n"
|
||||||
+ "\n"
|
+ " exceedes window width. Has no effect on \n"
|
||||||
+ "Viewer area:\n"
|
+ " the final format.\n"
|
||||||
+ " Use 'Site ID' combo box to view site data from the list of \n"
|
+ "\n"
|
||||||
+ " currently monitored sites. \n"
|
+ "Viewer area:\n"
|
||||||
+ " Select page in the notebook for a specific data source. The list \n"
|
+ " Use 'Site ID' combo box to view site data from the list of \n"
|
||||||
+ " of data sources is configurable. A set of display options is \n"
|
+ " currently monitored sites. \n"
|
||||||
+ " available, depending on the data source.";
|
+ " Select page in the notebook for a specific data source. The list \n"
|
||||||
String description = "Usage";
|
+ " of data sources is configurable. A set of display options is \n"
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
+ " available, depending on the data source.";
|
||||||
text);
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
usageDlg.open();
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1654,9 +1708,12 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
loadBtn.addSelectionListener(new SelectionAdapter() {
|
loadBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
LoaderDialog loadDlg = new LoaderDialog(shell,
|
if (mustCreate(loadDlg)) {
|
||||||
TafViewerEditorDlg.this);
|
loadDlg = new LoaderDialog(shell, TafViewerEditorDlg.this);
|
||||||
loadDlg.open();
|
loadDlg.open();
|
||||||
|
} else {
|
||||||
|
loadDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1752,14 +1809,26 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
printForecast(editorTafTabComp.getTextEditorControl()
|
printForecast(editorTafTabComp.getTextEditorControl()
|
||||||
.getText());
|
.getText());
|
||||||
}
|
}
|
||||||
SendDialog sendDlg = new SendDialog(shell,
|
|
||||||
editorTafTabComp, msgStatComp, sendCollectMI
|
if (mustCreate(sendDlg)) {
|
||||||
.getSelection());
|
sendDlg = new SendDialog(shell, editorTafTabComp,
|
||||||
sendDlg.open();
|
msgStatComp, sendCollectMI.getSelection());
|
||||||
// sendDlg sets the "taf sent" field only
|
sendDlg.setCloseCallback(new ICloseCallback() {
|
||||||
if (editorTafTabComp.isTafSent()) {
|
|
||||||
editorTafTabComp.updateTafSent(true);
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
// sendDlg sets the "taf sent" field only
|
||||||
|
if (editorTafTabComp.isTafSent()) {
|
||||||
|
editorTafTabComp.updateTafSent(true);
|
||||||
|
}
|
||||||
|
sendDlg = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
sendDlg.open();
|
||||||
|
} else {
|
||||||
|
sendDlg.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
putMessageToForecaster("Cannot send forecast: Press Syntax before transmission");
|
putMessageToForecaster("Cannot send forecast: Press Syntax before transmission");
|
||||||
}
|
}
|
||||||
|
@ -2491,6 +2560,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void populateViewerStation(String theStation) {
|
public void populateViewerStation(String theStation) {
|
||||||
|
checkDlg();
|
||||||
siteIdCbo.select(siteIdCbo.indexOf(theStation));
|
siteIdCbo.select(siteIdCbo.indexOf(theStation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2684,7 +2754,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
private boolean checkSyntaxInEditor(boolean doLogMessage) {
|
private boolean checkSyntaxInEditor(boolean doLogMessage) {
|
||||||
// Get the content of the Taf Editor.
|
// Get the content of the Taf Editor.
|
||||||
// Assume editorTafTabComp is for the active tab.
|
// Assume editorTafTabComp is for the active tab.
|
||||||
String in = (editorTafTabComp.getTextEditorControl().getText());
|
// DR15477: trim blank lines before Syntax Checking
|
||||||
|
String in = (editorTafTabComp.getTextEditorControl().getText().trim());
|
||||||
// Declare variables for processing the editor's contents.
|
// Declare variables for processing the editor's contents.
|
||||||
boolean errorInTaf = false;
|
boolean errorInTaf = false;
|
||||||
int idx1 = 0;
|
int idx1 = 0;
|
||||||
|
@ -3265,33 +3336,40 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String tafText = editorTafTabComp.getTextEditorControl().getText();
|
|
||||||
List<String> sitesInTaf = getSitesInTaf(tafText);
|
|
||||||
HashMap<String, HashMap<String, String>> qcMap = null;
|
|
||||||
|
|
||||||
if (doQcDialog) {
|
if (doQcDialog) {
|
||||||
QcDialog qcDlg = new QcDialog(shell, savedQcItems);
|
if (mustCreate(qcDlg)) {
|
||||||
Object o = qcDlg.open();
|
qcDlg = new QcDialog(shell, savedQcItems);
|
||||||
if (o == null) {
|
qcDlg.setCloseCallback(new ICloseCallback() {
|
||||||
return;
|
|
||||||
}
|
@Override
|
||||||
HashMap<String, String> qcItems = (HashMap<String, String>) o;
|
public void dialogClosed(Object returnValue) {
|
||||||
qcMap = new HashMap<String, HashMap<String, String>>();
|
String tafText = editorTafTabComp
|
||||||
for (String site : sitesInTaf) {
|
.getTextEditorControl().getText();
|
||||||
qcMap.put(site, qcItems);
|
List<String> sitesInTaf = getSitesInTaf(tafText);
|
||||||
|
if (returnValue instanceof HashMap<?, ?>) {
|
||||||
|
HashMap<String, String> qcItems = (HashMap<String, String>) returnValue;
|
||||||
|
HashMap<String, HashMap<String, String>> qcMap = new HashMap<String, HashMap<String, String>>();
|
||||||
|
for (String site : sitesInTaf) {
|
||||||
|
qcMap.put(site, qcItems);
|
||||||
|
}
|
||||||
|
qcCheck(qcMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
qcDlg.open();
|
||||||
|
} else {
|
||||||
|
qcDlg.bringToTop();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
String tafText = editorTafTabComp.getTextEditorControl().getText();
|
||||||
|
List<String> sitesInTaf = getSitesInTaf(tafText);
|
||||||
|
HashMap<String, HashMap<String, String>> qcMap = null;
|
||||||
qcMap = new HashMap<String, HashMap<String, String>>();
|
qcMap = new HashMap<String, HashMap<String, String>>();
|
||||||
|
|
||||||
for (String site : sitesInTaf) {
|
for (String site : sitesInTaf) {
|
||||||
qcMap.put(site, null);
|
qcMap.put(site, null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
try {
|
|
||||||
setWaitCursor(true);
|
|
||||||
qcCheck(qcMap);
|
qcCheck(qcMap);
|
||||||
} finally {
|
|
||||||
setWaitCursor(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3301,6 +3379,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void qcCheck(HashMap<String, HashMap<String, String>> qcMap) {
|
private void qcCheck(HashMap<String, HashMap<String, String>> qcMap) {
|
||||||
try {
|
try {
|
||||||
|
setWaitCursor(true);
|
||||||
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
||||||
ArrayList<Object> tafs = new ArrayList<Object>();
|
ArrayList<Object> tafs = new ArrayList<Object>();
|
||||||
HashMap<String, Object> siteInfo = new HashMap<String, Object>();
|
HashMap<String, Object> siteInfo = new HashMap<String, Object>();
|
||||||
|
@ -3538,6 +3617,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
setMessageStatusError("An Error occured while performing the QC check.");
|
setMessageStatusError("An Error occured while performing the QC check.");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
setMessageStatusError("An Error occured while performing the QC check.");
|
setMessageStatusError("An Error occured while performing the QC check.");
|
||||||
|
} finally {
|
||||||
|
setWaitCursor(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3646,7 +3727,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
sb.append(TafUtil.safeFormatTaf(t, showHeaders));
|
sb.append(TafUtil.safeFormatTaf(t, showHeaders));
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
}
|
}
|
||||||
}//System.out.println("TEMPO "+sb.toString().indexOf("TEMPO")+"/"+sb.toString().indexOf("\n",72));
|
}// System.out.println("TEMPO "+sb.toString().indexOf("TEMPO")+"/"+sb.toString().indexOf("\n",72));
|
||||||
|
|
||||||
tafViewerStTxt.setText(sb.toString());
|
tafViewerStTxt.setText(sb.toString());
|
||||||
hightlightTAF();
|
hightlightTAF();
|
||||||
|
@ -3677,8 +3758,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
||||||
String taf = tafViewerStTxt.getText();
|
String taf = tafViewerStTxt.getText();
|
||||||
int offset = taf.indexOf("TAF");
|
int offset = taf.indexOf("TAF");
|
||||||
if ( showHeadersChk.getSelection() ) {
|
if (showHeadersChk.getSelection()) {
|
||||||
offset = taf.indexOf("TAF", offset + 3);
|
offset = taf.indexOf("TAF", offset + 3);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
int end = taf.indexOf("TAF", offset + 3);
|
int end = taf.indexOf("TAF", offset + 3);
|
||||||
|
@ -3692,84 +3773,103 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String,String> alertTimeMap=TafMonitorDlg.getCurrentAlertTimeMap(stationName);// DR 14570
|
Map<String, String> alertTimeMap = TafMonitorDlg
|
||||||
|
.getCurrentAlertTimeMap(stationName);// DR 14570
|
||||||
|
|
||||||
// 20120712 for TEMPO
|
// 20120712 for TEMPO
|
||||||
String TEMPO_TXT = "TEMPO";
|
String TEMPO_TXT = "TEMPO";
|
||||||
|
|
||||||
if(taf.contains(TEMPO_TXT)){
|
if (taf.contains(TEMPO_TXT)) {
|
||||||
|
|
||||||
Map<String,String[]> tempoMap = TafMonitorDlg.getCurrentTempoMap(stationName);//20120711
|
Map<String, String[]> tempoMap = TafMonitorDlg
|
||||||
if(tempoMap != null){
|
.getCurrentTempoMap(stationName);// 20120711
|
||||||
int tempoStart = taf.indexOf(TEMPO_TXT);
|
if (tempoMap != null) {
|
||||||
int tempoEnd = taf.indexOf(TafUtil.LINE_BREAK, tempoStart);//end of the TEMPO line
|
int tempoStart = taf.indexOf(TEMPO_TXT);
|
||||||
|
int tempoEnd = taf.indexOf(TafUtil.LINE_BREAK, tempoStart);// end
|
||||||
|
// of
|
||||||
|
// the
|
||||||
|
// TEMPO
|
||||||
|
// line
|
||||||
|
|
||||||
StringBuilder str = new StringBuilder(" ");
|
StringBuilder str = new StringBuilder(" ");
|
||||||
|
|
||||||
for (String alertKey : tempoMap.keySet()) {
|
for (String alertKey : tempoMap.keySet()) {
|
||||||
//System.out.println("2___alertKey: "+ alertKey);
|
// System.out.println("2___alertKey: "+ alertKey);
|
||||||
for (String value : tempoMap.get(alertKey)) {
|
for (String value : tempoMap.get(alertKey)) {
|
||||||
//System.out.println("3___value: "+ value);
|
// System.out.println("3___value: "+ value);
|
||||||
str.setLength(1);
|
str.setLength(1);
|
||||||
str.append(value);
|
str.append(value);
|
||||||
int len = str.length();
|
int len = str.length();
|
||||||
str.append(" ");
|
str.append(" ");
|
||||||
|
|
||||||
int startIndex = taf.indexOf(str.toString(),tempoStart);// for tempo only
|
int startIndex = taf
|
||||||
|
.indexOf(str.toString(), tempoStart);// for
|
||||||
|
// tempo
|
||||||
|
// only
|
||||||
|
|
||||||
if (startIndex < 0) {
|
if (startIndex < 0) {
|
||||||
str.setLength(len);
|
str.setLength(len);
|
||||||
str.append("\n");
|
str.append("\n");
|
||||||
startIndex = taf.indexOf(str.toString());
|
startIndex = taf.indexOf(str.toString());
|
||||||
}
|
}
|
||||||
if (startIndex >= 0 /*within tempo line*/&& startIndex<tempoEnd) {
|
if (startIndex >= 0 /* within tempo line */
|
||||||
StyleRange sr = new StyleRange(offset + startIndex + 1,
|
&& startIndex < tempoEnd) {
|
||||||
len - 1, null, configMgr.getViwerAlertColor());
|
StyleRange sr = new StyleRange(offset + startIndex
|
||||||
|
+ 1, len - 1, null,
|
||||||
|
configMgr.getViwerAlertColor());
|
||||||
|
|
||||||
tafViewerStTxt.setStyleRange(sr);
|
tafViewerStTxt.setStyleRange(sr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}// END 20120712 for TEMPO
|
}// END 20120712 for TEMPO
|
||||||
|
|
||||||
|
|
||||||
StringBuilder str = new StringBuilder(" ");
|
StringBuilder str = new StringBuilder(" ");
|
||||||
for (String alertKey : alertMap.keySet()) {
|
for (String alertKey : alertMap.keySet()) {
|
||||||
for (String value : alertMap.get(alertKey)) {
|
for (String value : alertMap.get(alertKey)) {
|
||||||
str.setLength(1);
|
str.setLength(1);
|
||||||
str.append(value);
|
str.append(value);
|
||||||
int len = str.length();
|
int len = str.length();
|
||||||
str.append(" ");
|
str.append(" ");
|
||||||
String time = alertTimeMap.get(alertKey);// DR 14570
|
String time = alertTimeMap.get(alertKey);// DR 14570
|
||||||
int idx=taf.indexOf(time);// DR 14570
|
int idx = taf.indexOf(time);// DR 14570
|
||||||
int startIndex = taf.indexOf(str.toString(),idx);// DR 14570: highlight after the correct time group
|
int startIndex = taf.indexOf(str.toString(), idx);// DR 14570:
|
||||||
int endIndex = taf.indexOf(TafUtil.LINE_BREAK, idx);// DR 14570: a line ends with a line_break
|
// highlight
|
||||||
if (startIndex < 0) {
|
// after the
|
||||||
str.setLength(len);
|
// correct
|
||||||
str.append("\n");
|
// time group
|
||||||
startIndex = taf.indexOf(str.toString());
|
int endIndex = taf.indexOf(TafUtil.LINE_BREAK, idx);// DR 14570:
|
||||||
if (startIndex < 0) {
|
// a line
|
||||||
str.setLength(len);
|
// ends with
|
||||||
str.append("=");
|
// a
|
||||||
startIndex = taf.indexOf(str.toString());
|
// line_break
|
||||||
}
|
if (startIndex < 0) {
|
||||||
}
|
str.setLength(len);
|
||||||
|
str.append("\n");
|
||||||
|
startIndex = taf.indexOf(str.toString());
|
||||||
|
if (startIndex < 0) {
|
||||||
|
str.setLength(len);
|
||||||
|
str.append("=");
|
||||||
|
startIndex = taf.indexOf(str.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (startIndex >= 0 /*within the same line*/&& startIndex < endIndex) {
|
if (startIndex >= 0 /* within the same line */
|
||||||
StyleRange sr = new StyleRange(offset + startIndex + 1,
|
&& startIndex < endIndex) {
|
||||||
len - 1, null, configMgr.getViwerAlertColor());
|
StyleRange sr = new StyleRange(offset + startIndex + 1,
|
||||||
|
len - 1, null, configMgr.getViwerAlertColor());
|
||||||
|
|
||||||
tafViewerStTxt.setStyleRange(sr);
|
tafViewerStTxt.setStyleRange(sr);
|
||||||
} else {
|
} else {
|
||||||
// Should not get here. The first TAF in the viewer and the
|
// Should not get here. The first TAF in the viewer and the
|
||||||
// values in the alertMap should both be from the latest
|
// values in the alertMap should both be from the latest
|
||||||
// TAF. This indicates a program bug.
|
// TAF. This indicates a program bug.
|
||||||
System.out.println("highlightTAF unable to find: \""
|
System.out.println("highlightTAF unable to find: \""
|
||||||
+ str.toString() + "\" in the first TAF");
|
+ str.toString() + "\" in the first TAF");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4166,6 +4266,18 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||||
syntaxErrorLevel = 0;
|
syntaxErrorLevel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This dialog is created but not immediately displayed thus components have
|
||||||
|
* not been created. Some of the ITafSettable methods attempt to access
|
||||||
|
* components prior to showing the dialog. This check must be done to force
|
||||||
|
* the compoents creation.
|
||||||
|
*/
|
||||||
|
private final void checkDlg() {
|
||||||
|
if (shell == null) {
|
||||||
|
open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal class to up date the Viewer tab highlights when the Metar tab
|
* Internal class to up date the Viewer tab highlights when the Metar tab
|
||||||
* selections change what should be highlighted.
|
* selections change what should be highlighted.
|
||||||
|
|
|
@ -69,6 +69,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 4/15/2009 1982 grichard Provide feedback when saving a working TAF.
|
* 4/15/2009 1982 grichard Provide feedback when saving a working TAF.
|
||||||
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
||||||
* 08AUG2012 15613 zhao Determine proper BBB for transmission
|
* 08AUG2012 15613 zhao Determine proper BBB for transmission
|
||||||
|
* 09OCT2012 1229 rferrel Make dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -146,7 +147,7 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
public SendDialog(Shell parent, EditorTafTabComp tabComp,
|
public SendDialog(Shell parent, EditorTafTabComp tabComp,
|
||||||
IStatusSettable msgStatComp, boolean sendCollective) {
|
IStatusSettable msgStatComp, boolean sendCollective) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Send");
|
setText("AvnFPS Send");
|
||||||
|
|
||||||
this.tabComp = tabComp;
|
this.tabComp = tabComp;
|
||||||
|
@ -365,7 +366,7 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
String siteWmoId = tabComp.getWmoId();
|
String siteWmoId = tabComp.getWmoId();
|
||||||
// WMO Site
|
// WMO Site
|
||||||
String siteNode = null;
|
String siteNode = null;
|
||||||
//java.util.List<String> stationIds = new ArrayList<String>();
|
// java.util.List<String> stationIds = new ArrayList<String>();
|
||||||
|
|
||||||
ArrayList<String> tafs = new ArrayList<String>();
|
ArrayList<String> tafs = new ArrayList<String>();
|
||||||
ArrayList<String> updatedTafs = new ArrayList<String>();
|
ArrayList<String> updatedTafs = new ArrayList<String>();
|
||||||
|
@ -407,12 +408,11 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
* If "AAX" or "CCX" or "RRX", determine BBB for transmission
|
* If "AAX" or "CCX" or "RRX", determine BBB for transmission
|
||||||
*/
|
*/
|
||||||
String xmitBbb = bbb;
|
String xmitBbb = bbb;
|
||||||
if ( bbb.equals("AAX") || bbb.equals("CCX") || bbb.equals("RRX") ) {
|
if (bbb.equals("AAX") || bbb.equals("CCX") || bbb.equals("RRX")) {
|
||||||
String type = bbb.substring(0, 2);
|
String type = bbb.substring(0, 2);
|
||||||
xmitBbb = getXmitBbb( type, siteId);
|
xmitBbb = getXmitBbb(type, siteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update Header Time to transmission time.
|
// Update Header Time to transmission time.
|
||||||
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
||||||
xmitTimestamp);
|
xmitTimestamp);
|
||||||
|
@ -467,40 +467,41 @@ public class SendDialog extends CaveSWTDialog {
|
||||||
shell.dispose();
|
shell.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private String getXmitBbb(String type, String siteId) {
|
private String getXmitBbb(String type, String siteId) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TafQueueRequest request = new TafQueueRequest();
|
TafQueueRequest request = new TafQueueRequest();
|
||||||
request.setType(Type.GET_LIST);
|
request.setType(Type.GET_LIST);
|
||||||
request.setState(TafQueueRecord.TafQueueState.SENT);
|
request.setState(TafQueueRecord.TafQueueState.SENT);
|
||||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient.sendRequest(request);
|
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||||
java.util.List<String> payload = response.getPayload();
|
.sendRequest(request);
|
||||||
String [] records = (String []) payload.toArray(new String[0]);
|
java.util.List<String> payload = response.getPayload();
|
||||||
int numRecords = records.length;
|
String[] records = (String[]) payload.toArray(new String[0]);
|
||||||
for ( int i = numRecords-1; i >=0; i-- ) {
|
int numRecords = records.length;
|
||||||
if ( records[i].contains(siteId) ) {
|
for (int i = numRecords - 1; i >= 0; i--) {
|
||||||
String [] texts = records[i].split("-");
|
if (records[i].contains(siteId)) {
|
||||||
String bbb = texts[texts.length-2];
|
String[] texts = records[i].split("-");
|
||||||
if ( bbb.equals(" ") ) {
|
String bbb = texts[texts.length - 2];
|
||||||
return type+"A";
|
if (bbb.equals(" ")) {
|
||||||
}
|
return type + "A";
|
||||||
if ( bbb.subSequence(0, 2).equals(type) ) {
|
}
|
||||||
char[] newX = new char[] { bbb.charAt(2) };
|
if (bbb.subSequence(0, 2).equals(type)) {
|
||||||
if ( newX[0] == 'X' ) {
|
char[] newX = new char[] { bbb.charAt(2) };
|
||||||
newX[0] = 'A';
|
if (newX[0] == 'X') {
|
||||||
} else {
|
newX[0] = 'A';
|
||||||
newX[0]++;
|
} else {
|
||||||
}
|
newX[0]++;
|
||||||
return type + new String( newX );
|
}
|
||||||
}
|
return type + new String(newX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
}
|
||||||
// TODO Auto-generated catch block
|
} catch (VizException e) {
|
||||||
e.printStackTrace();
|
// TODO Auto-generated catch block
|
||||||
}
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
return type + "A";
|
return type + "A";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||||
import com.raytheon.viz.avnconfig.IStatusSettable;
|
import com.raytheon.viz.avnconfig.IStatusSettable;
|
||||||
import com.raytheon.viz.avnconfig.MessageStatusComp;
|
import com.raytheon.viz.avnconfig.MessageStatusComp;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TafMonitorDlg (Terminal Aerodome Forecast Monitor Dialog) class.
|
* TafMonitorDlg (Terminal Aerodome Forecast Monitor Dialog) class.
|
||||||
|
@ -129,7 +130,15 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 3/14/2011 8588 rferrel Allow monitoring multiple products.
|
* 3/14/2011 8588 rferrel Allow monitoring multiple products.
|
||||||
* 11/29/2011 11612 rferrel Added observers to update viewer tabs.
|
* 11/29/2011 11612 rferrel Added observers to update viewer tabs.
|
||||||
* 20JUL2012 14570 gzhang/zhao Added methods for highlighting in TAF viewer
|
* 20JUL2012 14570 gzhang/zhao Added methods for highlighting in TAF viewer
|
||||||
*
|
* 10/02/2012 1229 rferrel Changes to work with non-blocking WeatherPlotDialog.
|
||||||
|
* 10/04/2012 1229 rferrel Changes for non-blocking ClimateMenuDlg.
|
||||||
|
* 10/09/2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
* 10/10/2012 1229 rferrel Changes for non-blocking ResourceEditorDlg.
|
||||||
|
* 10/10/2012 1229 rferrel Changes for non-blocking TransmissionQueueDlg.
|
||||||
|
* 10/10/2012 1229 jkorman Changes for AlertDialog to support non-blocking.
|
||||||
|
* 10/11/2012 1229 jkorman Changes for BackupDialog to support non-blocking.
|
||||||
|
* 10/11/2012 1229 rferrel Changes for non-blocking TafViewerEditorDlg.
|
||||||
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grichard
|
* @author grichard
|
||||||
|
@ -187,6 +196,16 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private ResourceEditorDlg resDlg;
|
private ResourceEditorDlg resDlg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private BackupDialog backupDialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alert configuration dialog.
|
||||||
|
*/
|
||||||
|
private AlertDialog alertDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource configuration manager.
|
* Resource configuration manager.
|
||||||
*/
|
*/
|
||||||
|
@ -235,6 +254,12 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private List<String> productDisplayList;
|
private List<String> productDisplayList;
|
||||||
|
|
||||||
|
private ClimateMenuDlg climateMenuDlg;
|
||||||
|
|
||||||
|
private TransmissionQueueDlg tqDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -247,7 +272,7 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
List<String> productDispalyList) {
|
List<String> productDispalyList) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||||
| CAVE.INDEPENDENT_SHELL);
|
| CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Monitor");
|
setText("AvnFPS Monitor");
|
||||||
|
|
||||||
this.stationList = stationList;
|
this.stationList = stationList;
|
||||||
|
@ -373,7 +398,23 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
configMgr = ResourceConfigMgr.getInstance();
|
configMgr = ResourceConfigMgr.getInstance();
|
||||||
|
|
||||||
tveDlg = new TafViewerEditorDlg(shell, false, stationList);
|
boolean transientDialog = configMgr
|
||||||
|
.getDataAsBoolean(ResourceTag.TransientDialogs);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check the transient dialog setting. If the transient dialog is true
|
||||||
|
* then the parent dialog cannot be display on top of this dialog. If
|
||||||
|
* the transient is false the parent dialog can be displayed on top of
|
||||||
|
* this dialog.
|
||||||
|
*/
|
||||||
|
if (transientDialog == true) {
|
||||||
|
// Parent dialog cannot be displayed on top of this dialog
|
||||||
|
tveDlg = new TafViewerEditorDlg(shell, stationList, CAVE.NONE);
|
||||||
|
} else {
|
||||||
|
// Parent dialog can be displayed on top of this dialog.
|
||||||
|
tveDlg = new TafViewerEditorDlg(shell, stationList,
|
||||||
|
CAVE.INDEPENDENT_SHELL);
|
||||||
|
}
|
||||||
|
|
||||||
createMenus();
|
createMenus();
|
||||||
createButtonsComposite();
|
createButtonsComposite();
|
||||||
|
@ -480,13 +521,11 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
setupMenuItem.addSelectionListener(new SelectionAdapter() {
|
setupMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (resDlg == null) {
|
if (mustCreate(resDlg)) {
|
||||||
resDlg = new ResourceEditorDlg(shell);
|
resDlg = new ResourceEditorDlg(shell);
|
||||||
resDlg.open();
|
resDlg.open();
|
||||||
|
|
||||||
resDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
resDlg.showDialog();
|
resDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -499,8 +538,14 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
alertMenuItem.addSelectionListener(new SelectionAdapter() {
|
alertMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
AlertDialog alertDialog = new AlertDialog(shell);
|
// Do we need to create a new dialog?
|
||||||
alertDialog.open();
|
if (mustCreate(alertDialog)) {
|
||||||
|
alertDialog = new AlertDialog(shell);
|
||||||
|
alertDialog.open();
|
||||||
|
} else {
|
||||||
|
// No, so use the existing dialog.
|
||||||
|
alertDialog.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -560,11 +605,15 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
usageMenuItem.addSelectionListener(new SelectionAdapter() {
|
usageMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String text = "This is the main interface to AvnFPS.\n\nAll menus and buttons have associated help. When the mouse cursor is\nplaced over context sensitive help's 'hot spot', a 'balloon' message\nwill appear.\n\nSuccessful completion of a task is usually shown in a message window\nat the bottom of the main GUI or dialogs. Important system messages\nwill be shown there also. When an error occurs, a warning/error\ndialog will pop up which requires acknowledgment before one can\ninteract further with the application.\n\nMenu options:\n File:\n Check Now: Forces check of all TAFs and transmission\n status.\n Restart: Restarts the program, using current \n configuration\n Quit: Terminates the application.\n\n Options:\n Setup: Calls setup configuration dialog which \n allows for setting configuration \n resources: fonts, colors and values that \n affect program behavior.\n Alert: Used to select alert criteria 'on-the-fly' \n when the program detects a condition \n requiring forecaster's action.\n Blink: If selected, station id button will blink\n when new notification arrives\n Help:\n Used to provide version number and location of AvnFPS\n documentation web sites and this help window.\n\nTAF Editor: Starts TAF editor\nClimate: Displays Climate GUI\nPlot: Displays Weather Plot GUI\nBackup: Invokes list dialog allowing selection of products to \n monitor.\n\nServer status indicators. green means server is running, red indicates\nserious misconfiguration of a server(s) or a large (> 1 minute) clock\ndifference (skew) between px2f and workstations.\n\nDATA-xxx: Provides data to the GUI. The monitor will not function \n without this server running.\n \nINGEST-xxx: Data ingest server. You may still issue forecasts when \n this server is not running, although program will not update\n with new information as it arrives.\n \nXMIT-xxx: Forecast transmission server\n\nQueue: Background color indicates whether last issued forecast was \n successfully transmitted. The button invokes transmission queue\n control dialog.\n\nProduct monitoring window consists of the following units:\n\nSite Id button: used to invoke TAF editor. Its background color is used \n to indicate problem with data. A new alert will cause the button \n to blink. Press right mouse button to stop blinking.\n \nLast TAF and METAR time labels: those display issue time. When either\n one is late, the corresponding label is highlighted. If there \n is no TAF, or TAF is older than 24 hours, time is set to None \n for both TAF and MTR. \n\nFor each monitored data source there is a set of labels indicating \nwhether a particular weather element is in agreement with the forecast.\n\nThe following data sources are currently available:\n\nCurrent Observation: Most recent observation\nNhr Persistence: Most recent observation compared to forecast N hours \n ahead\nltg: Real-time CG lightning strikes\nrltg: Radar-based 3 hour lightning probability forecast\nNDFD Grids: GFE generated grids\nllws: Low Level Wind Shear, based on METAR and radars', profilers'\n or aircrafts' vertical wind profile data\nccfp: Collaborative Convective Forecast Product from AWC\n\nDepending on configuration, some of the above can be accessed through \npopup menus associated with the data source heading labels. Use right \nmouse button to display the menu. Not all labels have an associated \nmenu.\n\nBy pointing mouse cursor at a particular data source you will get \nthe forecast, that data values and list of violated rules, if any,\ndisplayed in a balloon message.\n\nOptional shortcut buttons to the TAF Editor.\nAmd: call TAF editor initialized for amended TAF for selected site.\nRtd: call TAF editor initialized for delayed TAF for selected site.\nCor: call TAF editor initialized for corrected TAF for selected site.";
|
if (mustCreate(usageDlg)) {
|
||||||
String description = "Usage";
|
String descrription = "Usage";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
text);
|
String helpText = "This is the main interface to AvnFPS.\n\nAll menus and buttons have associated help. When the mouse cursor is\nplaced over context sensitive help's 'hot spot', a 'balloon' message\nwill appear.\n\nSuccessful completion of a task is usually shown in a message window\nat the bottom of the main GUI or dialogs. Important system messages\nwill be shown there also. When an error occurs, a warning/error\ndialog will pop up which requires acknowledgment before one can\ninteract further with the application.\n\nMenu options:\n File:\n Check Now: Forces check of all TAFs and transmission\n status.\n Restart: Restarts the program, using current \n configuration\n Quit: Terminates the application.\n\n Options:\n Setup: Calls setup configuration dialog which \n allows for setting configuration \n resources: fonts, colors and values that \n affect program behavior.\n Alert: Used to select alert criteria 'on-the-fly' \n when the program detects a condition \n requiring forecaster's action.\n Blink: If selected, station id button will blink\n when new notification arrives\n Help:\n Used to provide version number and location of AvnFPS\n documentation web sites and this help window.\n\nTAF Editor: Starts TAF editor\nClimate: Displays Climate GUI\nPlot: Displays Weather Plot GUI\nBackup: Invokes list dialog allowing selection of products to \n monitor.\n\nServer status indicators. green means server is running, red indicates\nserious misconfiguration of a server(s) or a large (> 1 minute) clock\ndifference (skew) between px2f and workstations.\n\nDATA-xxx: Provides data to the GUI. The monitor will not function \n without this server running.\n \nINGEST-xxx: Data ingest server. You may still issue forecasts when \n this server is not running, although program will not update\n with new information as it arrives.\n \nXMIT-xxx: Forecast transmission server\n\nQueue: Background color indicates whether last issued forecast was \n successfully transmitted. The button invokes transmission queue\n control dialog.\n\nProduct monitoring window consists of the following units:\n\nSite Id button: used to invoke TAF editor. Its background color is used \n to indicate problem with data. A new alert will cause the button \n to blink. Press right mouse button to stop blinking.\n \nLast TAF and METAR time labels: those display issue time. When either\n one is late, the corresponding label is highlighted. If there \n is no TAF, or TAF is older than 24 hours, time is set to None \n for both TAF and MTR. \n\nFor each monitored data source there is a set of labels indicating \nwhether a particular weather element is in agreement with the forecast.\n\nThe following data sources are currently available:\n\nCurrent Observation: Most recent observation\nNhr Persistence: Most recent observation compared to forecast N hours \n ahead\nltg: Real-time CG lightning strikes\nrltg: Radar-based 3 hour lightning probability forecast\nNDFD Grids: GFE generated grids\nllws: Low Level Wind Shear, based on METAR and radars', profilers'\n or aircrafts' vertical wind profile data\nccfp: Collaborative Convective Forecast Product from AWC\n\nDepending on configuration, some of the above can be accessed through \npopup menus associated with the data source heading labels. Use right \nmouse button to display the menu. Not all labels have an associated \nmenu.\n\nBy pointing mouse cursor at a particular data source you will get \nthe forecast, that data values and list of violated rules, if any,\ndisplayed in a balloon message.\n\nOptional shortcut buttons to the TAF Editor.\nAmd: call TAF editor initialized for amended TAF for selected site.\nRtd: call TAF editor initialized for delayed TAF for selected site.\nCor: call TAF editor initialized for corrected TAF for selected site.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, descrription, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -617,9 +666,13 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
msgTypes[2] = StatusMessageType.TafMonCigVis;
|
msgTypes[2] = StatusMessageType.TafMonCigVis;
|
||||||
msgTypes[3] = StatusMessageType.TafMonCigVisTrend;
|
msgTypes[3] = StatusMessageType.TafMonCigVisTrend;
|
||||||
|
|
||||||
ClimateMenuDlg climateMenuDlg = new ClimateMenuDlg(shell,
|
if (mustCreate(climateMenuDlg)) {
|
||||||
msgTypes, configMgr.getDefaultBackgroundRGB());
|
climateMenuDlg = new ClimateMenuDlg(shell, msgTypes,
|
||||||
climateMenuDlg.open();
|
configMgr.getDefaultBackgroundRGB());
|
||||||
|
climateMenuDlg.open();
|
||||||
|
} else {
|
||||||
|
climateMenuDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -632,11 +685,19 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
|
||||||
if (avnPlotDlg == null) {
|
if (mustCreate(avnPlotDlg)) {
|
||||||
avnPlotDlg = new WeatherPlotDialog(shell,
|
avnPlotDlg = new WeatherPlotDialog(shell,
|
||||||
StatusMessageType.WeatherPlot, stationList);
|
StatusMessageType.WeatherPlot, stationList);
|
||||||
|
avnPlotDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
avnPlotDlg = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
avnPlotDlg.open();
|
avnPlotDlg.open();
|
||||||
avnPlotDlg = null;
|
} else {
|
||||||
|
avnPlotDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -649,9 +710,13 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
backupBtn.addSelectionListener(new SelectionAdapter() {
|
backupBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
BackupDialog backup = new BackupDialog(shell,
|
if (mustCreate(backupDialog)) {
|
||||||
productDisplayList);
|
backupDialog = new BackupDialog(shell, productDisplayList);
|
||||||
backup.open();
|
backupDialog.open();
|
||||||
|
} else {
|
||||||
|
// No, so use the existing dialog.
|
||||||
|
backupDialog.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -664,8 +729,12 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
queueBtn.addSelectionListener(new SelectionAdapter() {
|
queueBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
TransmissionQueueDlg tqd = new TransmissionQueueDlg(shell);
|
if (mustCreate(tqDlg)) {
|
||||||
tqd.open();
|
tqDlg = new TransmissionQueueDlg(shell);
|
||||||
|
tqDlg.open();
|
||||||
|
} else {
|
||||||
|
tqDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -823,7 +892,8 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
tveDlg.disposeDialog();
|
tveDlg.disposeDialog();
|
||||||
shell.dispose();
|
// shell.dispose();
|
||||||
|
close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -919,9 +989,9 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
return tveDlg.getViewerTabList();
|
return tveDlg.getViewerTabList();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------- DR 14570:
|
// ------------------------- DR 14570:
|
||||||
|
|
||||||
public static Map<String,String> getCurrentAlertTimeMap(String siteID){
|
public static Map<String, String> getCurrentAlertTimeMap(String siteID) {
|
||||||
Map<String, String> alertTimeMap = null;
|
Map<String, String> alertTimeMap = null;
|
||||||
if (currentDlg != null) {
|
if (currentDlg != null) {
|
||||||
if (currentDlg.getDisplay().isDisposed()) {
|
if (currentDlg.getDisplay().isDisposed()) {
|
||||||
|
@ -936,8 +1006,9 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
return alertTimeMap;
|
return alertTimeMap;
|
||||||
}
|
}
|
||||||
//20120711
|
|
||||||
public static Map<String,String[]> getCurrentTempoMap(String siteID){
|
// 20120711
|
||||||
|
public static Map<String, String[]> getCurrentTempoMap(String siteID) {
|
||||||
Map<String, String[]> tempoMap = null;
|
Map<String, String[]> tempoMap = null;
|
||||||
if (currentDlg != null) {
|
if (currentDlg != null) {
|
||||||
if (currentDlg.getDisplay().isDisposed()) {
|
if (currentDlg.getDisplay().isDisposed()) {
|
||||||
|
@ -945,7 +1016,7 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
} else {
|
} else {
|
||||||
for (TafSiteComp siteRow : currentDlg.getTafSiteComps()) {
|
for (TafSiteComp siteRow : currentDlg.getTafSiteComps()) {
|
||||||
if (siteRow.getStationName().equals(siteID)) {
|
if (siteRow.getStationName().equals(siteID)) {
|
||||||
tempoMap= siteRow.getTempoMap();
|
tempoMap = siteRow.getTempoMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,23 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.viz.aviation.AviationDialog;
|
import com.raytheon.viz.aviation.AviationDialog;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a dialog changing the values for the AvnFPS resources.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial creation
|
||||||
|
* Oct 10, 2012 1229 rferrel Make dialog non-blocking.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
||||||
|
|
||||||
private ScrolledComposite scrolledComp;
|
private ScrolledComposite scrolledComp;
|
||||||
|
@ -52,7 +69,8 @@ public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
||||||
private ResourceEditorHelpDlg helpDlg;
|
private ResourceEditorHelpDlg helpDlg;
|
||||||
|
|
||||||
public ResourceEditorDlg(Shell parent) {
|
public ResourceEditorDlg(Shell parent) {
|
||||||
super(parent, SWT.SHELL_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.SHELL_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Resource Editor");
|
setText("AvnFPS Resource Editor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,13 +162,11 @@ public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
||||||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (helpDlg == null) {
|
if (mustCreate(helpDlg)) {
|
||||||
helpDlg = new ResourceEditorHelpDlg(shell);
|
helpDlg = new ResourceEditorHelpDlg(shell);
|
||||||
helpDlg.open();
|
helpDlg.open();
|
||||||
|
|
||||||
helpDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
helpDlg.showDialog();
|
helpDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -198,8 +214,4 @@ public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
||||||
scrolledComp.setMinSize(resourceComp.computeSize(SWT.DEFAULT,
|
scrolledComp.setMinSize(resourceComp.computeSize(SWT.DEFAULT,
|
||||||
SWT.DEFAULT));
|
SWT.DEFAULT));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showDialog() {
|
|
||||||
shell.setFocus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,25 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display help text for the ResourceEditor dialog within the AvnFPS
|
||||||
|
* TAFMonitor dialog.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* ************ ********** *********** No previous software history.
|
||||||
|
* Oct 11, 2012 1229 jkorman Make dialog non-blocking.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
public class ResourceEditorHelpDlg extends CaveSWTDialog {
|
public class ResourceEditorHelpDlg extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* Main composite for the controls.
|
* Main composite for the controls.
|
||||||
|
@ -48,9 +67,14 @@ public class ResourceEditorHelpDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private Cursor textCursor;
|
private Cursor textCursor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct the ResourceEditor help dialog.
|
||||||
|
* @param parentShell The shell containing this dialog.
|
||||||
|
*/
|
||||||
public ResourceEditorHelpDlg(Shell parentShell) {
|
public ResourceEditorHelpDlg(Shell parentShell) {
|
||||||
super(parentShell, SWT.SHELL_TRIM | SWT.RESIZE,
|
super(parentShell, SWT.SHELL_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Help");
|
setText("AvnFPS Help");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 1/24/2008 817 grichard Initial creation.
|
* 1/24/2008 817 grichard Initial creation.
|
||||||
|
* 20121010 1229 jkorman Added DO_NOT_BLOCK so dialog does not block on open.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -72,7 +73,7 @@ public class AlertDialog extends CaveSWTDialog {
|
||||||
* Parent Shell.
|
* Parent Shell.
|
||||||
*/
|
*/
|
||||||
public AlertDialog(Shell parent) {
|
public AlertDialog(Shell parent) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Alert Dialog");
|
setText("AvnFPS Alert Dialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* in initializeComponents.
|
* in initializeComponents.
|
||||||
* 10/06/2010 6009 rferrel Use product to get initial selected item.
|
* 10/06/2010 6009 rferrel Use product to get initial selected item.
|
||||||
* 3/14/2011 8588 rferrel Allow selection of multiple products.
|
* 3/14/2011 8588 rferrel Allow selection of multiple products.
|
||||||
*
|
* 20121010 1229 jkorman Added DO_NOT_BLOCK so dialog does not block on open.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -88,7 +88,7 @@ public class BackupDialog extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public BackupDialog(Shell parent, java.util.List<String> productDisplayList) {
|
public BackupDialog(Shell parent, java.util.List<String> productDisplayList) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Backup");
|
setText("AvnFPS Backup");
|
||||||
this.productDisplayList = productDisplayList;
|
this.productDisplayList = productDisplayList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 28 FEB 2008 938 lvenable Initial creation.
|
* 28 FEB 2008 938 lvenable Initial creation.
|
||||||
* 3/27/2008 1033 grichard Added ETA-MOS label.
|
* 3/27/2008 1033 grichard Added ETA-MOS label.
|
||||||
|
* 10/10/2012 1229 rferrel Make dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -95,7 +96,8 @@ public class TimeSelectorDialog extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public TimeSelectorDialog(Shell parent, WxPlotCfg wxPlotCfg) {
|
public TimeSelectorDialog(Shell parent, WxPlotCfg wxPlotCfg) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Time Selector");
|
setText("AvnFPS Time Selector");
|
||||||
this.wxPlotCfg = wxPlotCfg;
|
this.wxPlotCfg = wxPlotCfg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,8 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 28 FEB 2008 938 lvenable Initial creation
|
* 28 FEB 2008 938 lvenable Initial creation
|
||||||
* 14 MAY 2012 14715 rferrel Use EDEX to perform requests.
|
* 14 MAY 2012 14715 rferrel Use EDEX to perform requests.
|
||||||
|
* 10 OCT 2012 1229 rferrel Make dialog non-blocking.
|
||||||
|
* 10 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -68,26 +70,6 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TransmissionQueueDlg extends CaveSWTDialog {
|
public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
private static String helpText = "This dialog is used to manage transmission and transmission log files.\n\n"
|
|
||||||
+ "The top area manages the forecast files written by the forecast editor.\n"
|
|
||||||
+ "The 'Files' scrolled list window lists files in one of 'pending', 'sent'\n"
|
|
||||||
+ "and 'bad' directories. The time is when the file was written. The file\n"
|
|
||||||
+ "name is \n"
|
|
||||||
+ " xxx-CCCCNNNXXX-yymmddHHMM-BBB\n"
|
|
||||||
+ "where xxx is the forecaster number. The transmission program \n"
|
|
||||||
+ "avnxmitserv uses NNN to determine the transmission window for regular\n"
|
|
||||||
+ "forecasts.\n\n"
|
|
||||||
+ "The bottom area is used to view transmission log files. There is one\n"
|
|
||||||
+ "file for each day of the week. By default, log files for the current day\n"
|
|
||||||
+ "are shown.\n\nButtons:\n"
|
|
||||||
+ " Refresh: refreshes both the directory list and log file windows.\n"
|
|
||||||
+ " View: allows to view selected transmission file(s)\n"
|
|
||||||
+ " Remove: deletes transmission files\n"
|
|
||||||
+ " Retransmit: forces the transmission program to send selected files.\n"
|
|
||||||
+ " If the file is in the 'bad' or 'sent' directory, it is \n"
|
|
||||||
+ " moved back to 'pending'. The transmission time (the last\n"
|
|
||||||
+ " part of the file name) is updated to the current time.\n"
|
|
||||||
+ " Help: displays this window";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pending radio button.
|
* Pending radio button.
|
||||||
|
@ -149,6 +131,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private IStatusSettable msgStatComp;
|
private IStatusSettable msgStatComp;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -157,7 +141,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public TransmissionQueueDlg(Shell parent) {
|
public TransmissionQueueDlg(Shell parent) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Transmission Queue");
|
setText("AvnFPS Transmission Queue");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,10 +283,35 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "Help";
|
if (mustCreate(usageDlg)) {
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
String description = "Help";
|
||||||
helpText);
|
|
||||||
usageDlg.open();
|
String helpText = "This dialog is used to manage transmission and transmission log files.\n\n"
|
||||||
|
+ "The top area manages the forecast files written by the forecast editor.\n"
|
||||||
|
+ "The 'Files' scrolled list window lists files in one of 'pending', 'sent'\n"
|
||||||
|
+ "and 'bad' directories. The time is when the file was written. The file\n"
|
||||||
|
+ "name is \n"
|
||||||
|
+ " xxx-CCCCNNNXXX-yymmddHHMM-BBB\n"
|
||||||
|
+ "where xxx is the forecaster number. The transmission program \n"
|
||||||
|
+ "avnxmitserv uses NNN to determine the transmission window for regular\n"
|
||||||
|
+ "forecasts.\n\n"
|
||||||
|
+ "The bottom area is used to view transmission log files. There is one\n"
|
||||||
|
+ "file for each day of the week. By default, log files for the current day\n"
|
||||||
|
+ "are shown.\n\nButtons:\n"
|
||||||
|
+ " Refresh: refreshes both the directory list and log file windows.\n"
|
||||||
|
+ " View: allows to view selected transmission file(s)\n"
|
||||||
|
+ " Remove: deletes transmission files\n"
|
||||||
|
+ " Retransmit: forces the transmission program to send selected files.\n"
|
||||||
|
+ " If the file is in the 'bad' or 'sent' directory, it is \n"
|
||||||
|
+ " moved back to 'pending'. The transmission time (the last\n"
|
||||||
|
+ " part of the file name) is updated to the current time.\n"
|
||||||
|
+ " Help: displays this window";
|
||||||
|
usageDlg = new HelpUsageDlg(shell, description,
|
||||||
|
helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -387,6 +397,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
||||||
tafInfo = "Viewing multiple forecasts";
|
tafInfo = "Viewing multiple forecasts";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow multiple instances of this dialog.
|
||||||
TransmissionViewerDlg tvd = new TransmissionViewerDlg(shell,
|
TransmissionViewerDlg tvd = new TransmissionViewerDlg(shell,
|
||||||
tafText, tafInfo);
|
tafText, tafInfo);
|
||||||
tvd.open();
|
tvd.open();
|
||||||
|
|
|
@ -36,6 +36,23 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
||||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A dialog to display the forecast(s) details.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial creation
|
||||||
|
* Oct 10, 2012 1229 rferrel Made dialog non-blocking
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rferrel
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
public class TransmissionViewerDlg extends CaveSWTDialog {
|
public class TransmissionViewerDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +72,8 @@ public class TransmissionViewerDlg extends CaveSWTDialog {
|
||||||
public TransmissionViewerDlg(Shell parentShell, String tafText,
|
public TransmissionViewerDlg(Shell parentShell, String tafText,
|
||||||
String tafInfo) {
|
String tafInfo) {
|
||||||
super(parentShell, SWT.SHELL_TRIM | SWT.RESIZE,
|
super(parentShell, SWT.SHELL_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText(tafInfo);
|
setText(tafInfo);
|
||||||
|
|
||||||
this.tafText = tafText;
|
this.tafText = tafText;
|
||||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 28 FEB 2008 938 lvenable Initial creation.
|
* 28 FEB 2008 938 lvenable Initial creation.
|
||||||
* 6/19/2008 937 grichard Implemented 'replace all'.
|
* 6/19/2008 937 grichard Implemented 'replace all'.
|
||||||
|
* 10/11/2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -119,7 +120,8 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
||||||
* Text editor containing the text to be searched.
|
* Text editor containing the text to be searched.
|
||||||
*/
|
*/
|
||||||
public FindReplaceDlg(Shell parent, StyledText textEditor) {
|
public FindReplaceDlg(Shell parent, StyledText textEditor) {
|
||||||
super(parent, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.NONE, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Find and Replace");
|
setText("Find and Replace");
|
||||||
|
|
||||||
this.textEditor = textEditor;
|
this.textEditor = textEditor;
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 28 FEB 2008 938 lvenable Initial creation.
|
* 28 FEB 2008 938 lvenable Initial creation.
|
||||||
|
* 15 OCT 2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -83,7 +84,7 @@ public class HelpUsageDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public HelpUsageDlg(Shell parent, String helpDesc, String helpText) {
|
public HelpUsageDlg(Shell parent, String helpDesc, String helpText) {
|
||||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Help");
|
setText("AvnFPS Help");
|
||||||
|
|
||||||
this.helpDesc = helpDesc;
|
this.helpDesc = helpDesc;
|
||||||
|
|
|
@ -67,6 +67,9 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
* 2/6/2008 817 lvenable Initial creation.
|
* 2/6/2008 817 lvenable Initial creation.
|
||||||
* 4/7/2008 934 grichard Added IStatusSettable implementation.
|
* 4/7/2008 934 grichard Added IStatusSettable implementation.
|
||||||
* 8/11/2008 1314 grichard Used PathManager for pathnames.
|
* 8/11/2008 1314 grichard Used PathManager for pathnames.
|
||||||
|
* 10/04/2012 1229 rferrel Added dispose check needed for
|
||||||
|
* non-blocking dialogs.
|
||||||
|
* 10/12/2012 1229 rferrel Changes for non-blocking MessageViewerDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -341,17 +344,19 @@ public class MessageStatusComp extends Composite implements IStatusSettable {
|
||||||
currentMsgColor.dispose();
|
currentMsgColor.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
currentMsgColor = new Color(parent.getDisplay(), rgbColor);
|
if (!parent.isDisposed()) {
|
||||||
|
currentMsgColor = new Color(parent.getDisplay(), rgbColor);
|
||||||
|
|
||||||
msgTF.setText(String.valueOf(msg));
|
msgTF.setText(String.valueOf(msg));
|
||||||
|
|
||||||
blinkAndClear();
|
blinkAndClear();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(calculateIssueTime());
|
StringBuilder sb = new StringBuilder(calculateIssueTime());
|
||||||
sb.append(" ").append(msg);
|
sb.append(" ").append(msg);
|
||||||
|
|
||||||
AvnMessageMgr msgMgr = AvnMessageMgr.getInstance();
|
AvnMessageMgr msgMgr = AvnMessageMgr.getInstance();
|
||||||
msgMgr.addMessage(msgType, sb.toString());
|
msgMgr.addMessage(msgType, sb.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -419,12 +424,12 @@ public class MessageStatusComp extends Composite implements IStatusSettable {
|
||||||
* Create the message viewer dialog.
|
* Create the message viewer dialog.
|
||||||
*/
|
*/
|
||||||
private void createMessageViewerDialog() {
|
private void createMessageViewerDialog() {
|
||||||
if (msgViewerDlg == null || msgViewerDlg.getShell().isDisposed()) {
|
if (msgViewerDlg == null || msgViewerDlg.getShell() == null
|
||||||
|
|| msgViewerDlg.isDisposed()) {
|
||||||
msgViewerDlg = new MessageViewerDlg(this, msgType);
|
msgViewerDlg = new MessageViewerDlg(this, msgType);
|
||||||
msgViewerDlg.open();
|
msgViewerDlg.open();
|
||||||
msgViewerDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
msgViewerDlg.showDialog();
|
msgViewerDlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 28 FEB 2008 938 lvenable Initial creation.
|
* 28 FEB 2008 938 lvenable Initial creation.
|
||||||
* 4/8/2008 934 grichard Added IStatusViewable interface.
|
* 4/8/2008 934 grichard Added IStatusViewable interface.
|
||||||
* 9/12/2008 1444 grichard Accommodate separate message logs.
|
* 9/12/2008 1444 grichard Accommodate separate message logs.
|
||||||
|
* 10/12/2012 1229 rferrel Make dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -81,7 +82,7 @@ public class MessageViewerDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public MessageViewerDlg(Composite parent, StatusMessageType msgType) {
|
public MessageViewerDlg(Composite parent, StatusMessageType msgType) {
|
||||||
super(parent.getShell(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS,
|
super(parent.getShell(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS,
|
||||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||||
setText("Message Log");
|
setText("Message Log");
|
||||||
|
|
||||||
this.msgType = msgType;
|
this.msgType = msgType;
|
||||||
|
@ -178,16 +179,4 @@ public class MessageViewerDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
msgList.setSelection(0);
|
msgList.setSelection(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the dialog.
|
|
||||||
*/
|
|
||||||
public void showDialog() {
|
|
||||||
|
|
||||||
if (shell.isVisible() == false) {
|
|
||||||
shell.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
shell.setActive();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,6 @@ import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Dialog;
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
import org.eclipse.swt.widgets.TabFolder;
|
||||||
|
@ -46,6 +44,7 @@ import org.eclipse.swt.widgets.Text;
|
||||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.AvnConfigConstants.DataSource;
|
import com.raytheon.viz.avnconfig.AvnConfigConstants.DataSource;
|
||||||
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog displaying the monitoring criteria controls. The dialog has a tab
|
* Dialog displaying the monitoring criteria controls. The dialog has a tab
|
||||||
|
@ -59,6 +58,9 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.DataSource;
|
||||||
* 16 Mar 2011 8599 rferrel Create msgStatusComp then load tabs.
|
* 16 Mar 2011 8599 rferrel Create msgStatusComp then load tabs.
|
||||||
* 27 Sep 2011 10958 rferrel Display more details when handling
|
* 27 Sep 2011 10958 rferrel Display more details when handling
|
||||||
* ConfigurationException.
|
* ConfigurationException.
|
||||||
|
* 12 Oct 2012 1229 rferrel Convert to subclass of CaveSWTDialog
|
||||||
|
* and made non-blocking.
|
||||||
|
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -66,16 +68,7 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.DataSource;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MonitoringCriteriaDlg extends Dialog {
|
public class MonitoringCriteriaDlg extends CaveSWTDialog {
|
||||||
/**
|
|
||||||
* Dialog shell.
|
|
||||||
*/
|
|
||||||
private Shell shell;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The display control.
|
|
||||||
*/
|
|
||||||
private Display display;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite containing message status controls.
|
* Composite containing message status controls.
|
||||||
|
@ -108,6 +101,8 @@ public class MonitoringCriteriaDlg extends Dialog {
|
||||||
*/
|
*/
|
||||||
private DefaultRuleData defaultRuleData;
|
private DefaultRuleData defaultRuleData;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -115,20 +110,12 @@ public class MonitoringCriteriaDlg extends Dialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public MonitoringCriteriaDlg(Shell parent) {
|
public MonitoringCriteriaDlg(Shell parent) {
|
||||||
super(parent, 0);
|
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||||
|
setText("AvnFPS Monitoring Criteria");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Open method used to display the dialog.
|
protected void initializeComponents(Shell shell) {
|
||||||
*
|
|
||||||
* @return Null.
|
|
||||||
*/
|
|
||||||
public Object open() {
|
|
||||||
Shell parent = getParent();
|
|
||||||
display = parent.getDisplay();
|
|
||||||
shell = new Shell(parent, SWT.DIALOG_TRIM);
|
|
||||||
shell.setText("AvnFPS Monitoring Criteria");
|
|
||||||
|
|
||||||
// Create the main layout for the shell.
|
// Create the main layout for the shell.
|
||||||
GridLayout mainLayout = new GridLayout(1, false);
|
GridLayout mainLayout = new GridLayout(1, false);
|
||||||
mainLayout.marginHeight = 3;
|
mainLayout.marginHeight = 3;
|
||||||
|
@ -138,17 +125,6 @@ public class MonitoringCriteriaDlg extends Dialog {
|
||||||
|
|
||||||
// Initialize all of the controls and layouts
|
// Initialize all of the controls and layouts
|
||||||
initializeComponents();
|
initializeComponents();
|
||||||
|
|
||||||
shell.pack();
|
|
||||||
|
|
||||||
shell.open();
|
|
||||||
while (!shell.isDisposed()) {
|
|
||||||
if (!display.readAndDispatch()) {
|
|
||||||
display.sleep();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -329,11 +305,15 @@ public class MonitoringCriteriaDlg extends Dialog {
|
||||||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS - Monitoring Criteria Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This dialog is used to define and configure TAF monitoring\nrules.\n\nTo load current configuration, enter site id and press\n<Enter> or use the \"Load\" button. Site id XXXX loads\ndefault rules.\n\nSelect a tab for the monitoring module you wish to modify\nthe rules. The top list displays current rules: severity\nlevels (colors) and associated messages. The list is sorted\nwith respect to the severity level.\n\nTo view detailed rule description, select an item on this\nlist. All rule parameters will be displayed in the \"Rule\nEditor\" window. You may modify editable parameters. Press \n\"Replace\" when finished. To remove a rule from the list,\npress \"Remove\". To add a new rule, first select one of\nthe available methods, then modify rule parameters as\ndesired. You must enter a message. Press \"Add\" to add the\nrule to the list.\n\nNOTE: \n1. argument types and values are not verified by the\n editor.\n2. if an argument is a list, the separators are commas.\n \nPress 'Save' when finished.\n\nTo restore default rules for a TAF Site and a currently\nselected monitoring module, use the \"Delete\" button.";
|
String description = "AvnFPS - Monitoring Criteria Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This dialog is used to define and configure TAF monitoring\nrules.\n\nTo load current configuration, enter site id and press\n<Enter> or use the \"Load\" button. Site id XXXX loads\ndefault rules.\n\nSelect a tab for the monitoring module you wish to modify\nthe rules. The top list displays current rules: severity\nlevels (colors) and associated messages. The list is sorted\nwith respect to the severity level.\n\nTo view detailed rule description, select an item on this\nlist. All rule parameters will be displayed in the \"Rule\nEditor\" window. You may modify editable parameters. Press \n\"Replace\" when finished. To remove a rule from the list,\npress \"Remove\". To add a new rule, first select one of\nthe available methods, then modify rule parameters as\ndesired. You must enter a message. Press \"Add\" to add the\nrule to the list.\n\nNOTE: \n1. argument types and values are not verified by the\n editor.\n2. if an argument is a list, the separators are commas.\n \nPress 'Save' when finished.\n\nTo restore default rules for a TAF Site and a currently\nselected monitoring module, use the \"Delete\" button.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,242 @@
|
||||||
|
/**
|
||||||
|
* 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.avnconfig;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
import org.eclipse.swt.graphics.Font;
|
||||||
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
import org.eclipse.swt.widgets.List;
|
||||||
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
|
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.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class generates a list of localized files that can be opened in the
|
||||||
|
* AvnFPS Text Editor.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Initial creation.
|
||||||
|
* Oct 12, 2012 1229 rferrel Made subclass of CaveSWTDialog
|
||||||
|
* and non-blocking.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public class OpenDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Font used to display file list.
|
||||||
|
*/
|
||||||
|
private Font controlFont;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of localized files that can be edited.
|
||||||
|
*/
|
||||||
|
private List cfgFileList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of localized files used to generate the file list.
|
||||||
|
*/
|
||||||
|
private LocalizationFile[] locFiles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uses file's display name as key to get the associated localized file.
|
||||||
|
*/
|
||||||
|
private Map<String, LocalizationFile> locFileMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param parent
|
||||||
|
* shell
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public OpenDlg(Shell parent) {
|
||||||
|
super(parent, SWT.TITLE, CAVE.DO_NOT_BLOCK);
|
||||||
|
setText("Open Configuration File");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initializeComponents(Shell shell) {
|
||||||
|
// Create the main layout for the shell.
|
||||||
|
GridLayout mainLayout = new GridLayout(1, false);
|
||||||
|
mainLayout.marginHeight = 2;
|
||||||
|
mainLayout.marginWidth = 2;
|
||||||
|
mainLayout.verticalSpacing = 2;
|
||||||
|
shell.setLayout(mainLayout);
|
||||||
|
|
||||||
|
// Initialize all of the controls and layouts
|
||||||
|
initializeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void disposed() {
|
||||||
|
if (controlFont != null) {
|
||||||
|
controlFont.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up the dialog's display components.
|
||||||
|
*/
|
||||||
|
private void initializeComponents() {
|
||||||
|
locFileMap = new TreeMap<String, LocalizationFile>();
|
||||||
|
controlFont = new Font(shell.getDisplay(), "Monospace", 10, SWT.NORMAL);
|
||||||
|
|
||||||
|
createListControl();
|
||||||
|
|
||||||
|
// Create the buttons at the bottom of the display.
|
||||||
|
createBottomButtons();
|
||||||
|
|
||||||
|
getAvailableConfigFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the label and the scroll list that will contain the files the user
|
||||||
|
* can edit.
|
||||||
|
*/
|
||||||
|
private void createListControl() {
|
||||||
|
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||||
|
Composite listComp = new Composite(shell, SWT.NONE);
|
||||||
|
listComp.setLayout(new GridLayout(1, false));
|
||||||
|
listComp.setLayoutData(gd);
|
||||||
|
|
||||||
|
Label listLbl = new Label(listComp, SWT.NONE);
|
||||||
|
listLbl.setText("Available Config Files:");
|
||||||
|
|
||||||
|
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||||
|
gd.widthHint = 400;
|
||||||
|
gd.heightHint = 400;
|
||||||
|
gd.horizontalSpan = 2;
|
||||||
|
cfgFileList = new List(listComp, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL
|
||||||
|
| SWT.H_SCROLL);
|
||||||
|
cfgFileList.setLayoutData(gd);
|
||||||
|
cfgFileList.setFont(controlFont);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine based on DialogType what kind of action button to place at the
|
||||||
|
* bottom of the dialog.
|
||||||
|
*/
|
||||||
|
private void createBottomButtons() {
|
||||||
|
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||||
|
Composite mainButtonComp = new Composite(shell, SWT.NONE);
|
||||||
|
mainButtonComp.setLayout(new GridLayout(1, false));
|
||||||
|
mainButtonComp.setLayoutData(gd);
|
||||||
|
|
||||||
|
gd = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
|
||||||
|
Composite buttonComp = new Composite(shell, SWT.NONE);
|
||||||
|
buttonComp.setLayout(new GridLayout(2, false));
|
||||||
|
buttonComp.setLayoutData(gd);
|
||||||
|
|
||||||
|
gd = new GridData(100, SWT.DEFAULT);
|
||||||
|
Button openBtn = new Button(buttonComp, SWT.PUSH);
|
||||||
|
openBtn.setText("Open");
|
||||||
|
openBtn.setLayoutData(gd);
|
||||||
|
openBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
int selectedIndex = cfgFileList.getSelectionIndex();
|
||||||
|
String str = cfgFileList.getItem(selectedIndex);
|
||||||
|
LocalizationFile selectedFile = locFileMap.get(str);
|
||||||
|
setReturnValue(selectedFile);
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gd = new GridData(100, SWT.DEFAULT);
|
||||||
|
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
|
||||||
|
cancelBtn.setText("Cancel");
|
||||||
|
cancelBtn.setLayoutData(gd);
|
||||||
|
cancelBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
shell.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain from localization the configuration file information and populate
|
||||||
|
* the dialog scroll list.
|
||||||
|
*/
|
||||||
|
private void getAvailableConfigFiles() {
|
||||||
|
String[] extensions = new String[] { ".xml", ".cfg" };
|
||||||
|
LocalizationType[] types = new LocalizationType[] {
|
||||||
|
LocalizationType.CAVE_CONFIG, LocalizationType.CAVE_STATIC,
|
||||||
|
LocalizationType.COMMON_STATIC };
|
||||||
|
ArrayList<LocalizationFile> localFiles = new ArrayList<LocalizationFile>();
|
||||||
|
for (LocalizationType type : types) {
|
||||||
|
LocalizationContext[] contexts = PathManagerFactory
|
||||||
|
.getPathManager().getLocalSearchHierarchy(type);
|
||||||
|
for (LocalizationContext context : contexts) {
|
||||||
|
localFiles.addAll(Arrays.asList(PathManagerFactory
|
||||||
|
.getPathManager().listFiles(context, "aviation",
|
||||||
|
extensions, true, true)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
locFiles = localFiles.toArray(new LocalizationFile[0]);
|
||||||
|
if (locFiles == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < locFiles.length; i++) {
|
||||||
|
if (locFiles[i].getName().startsWith("aviation/avnsetup") == false) {
|
||||||
|
String contextName = locFiles[i].getContext().getContextName();
|
||||||
|
if (contextName == null) {
|
||||||
|
contextName = " - " + "BASE";
|
||||||
|
} else {
|
||||||
|
contextName = " - " + contextName;
|
||||||
|
}
|
||||||
|
locFileMap
|
||||||
|
.put(locFiles[i].getName() + contextName, locFiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String str : locFileMap.keySet()) {
|
||||||
|
cfgFileList.add(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cfgFileList.getSelectionCount() > 0) {
|
||||||
|
cfgFileList.setSelection(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,7 +36,6 @@ import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Dialog;
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
@ -55,6 +54,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TAF product configuration dialog.
|
* TAF product configuration dialog.
|
||||||
|
@ -66,6 +66,9 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
* 22 MAY 2008 1119 lvenable Initial creation
|
* 22 MAY 2008 1119 lvenable Initial creation
|
||||||
* 9 Jul 2010 5078 rferrel Added catches for File Not Found.
|
* 9 Jul 2010 5078 rferrel Added catches for File Not Found.
|
||||||
* 1 Oct 2010 4345 rferrel Cleanup to work like AWIPS I.
|
* 1 Oct 2010 4345 rferrel Cleanup to work like AWIPS I.
|
||||||
|
* 12 Oct 2012 1229 rferrel Convert to CaveSWTDialog subclass
|
||||||
|
* and make non-blocking.
|
||||||
|
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -73,20 +76,10 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TafProductConfigDlg extends Dialog {
|
public class TafProductConfigDlg extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(TafProductConfigDlg.class);
|
.getHandler(TafProductConfigDlg.class);
|
||||||
|
|
||||||
/**
|
|
||||||
* Dialog shell.
|
|
||||||
*/
|
|
||||||
private Shell shell;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The display control.
|
|
||||||
*/
|
|
||||||
private Display display;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite containing message status controls.
|
* Composite containing message status controls.
|
||||||
*/
|
*/
|
||||||
|
@ -132,26 +125,20 @@ public class TafProductConfigDlg extends Dialog {
|
||||||
*/
|
*/
|
||||||
private Map<String, java.util.List<String>> productsMap;
|
private Map<String, java.util.List<String>> productsMap;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public TafProductConfigDlg(Shell parent) {
|
public TafProductConfigDlg(Shell parent) {
|
||||||
super(parent, 0);
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
|
||||||
|
setText("AvnFPS TAF Product Configuration");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Open method used to display the dialog.
|
protected void initializeComponents(Shell shell) {
|
||||||
*
|
|
||||||
* @return Null.
|
|
||||||
*/
|
|
||||||
public Object open() {
|
|
||||||
Shell parent = getParent();
|
|
||||||
display = parent.getDisplay();
|
|
||||||
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE);
|
|
||||||
shell.setText("AvnFPS TAF Product Configuration");
|
|
||||||
|
|
||||||
// Create the main layout for the shell.
|
// Create the main layout for the shell.
|
||||||
GridLayout mainLayout = new GridLayout(1, false);
|
GridLayout mainLayout = new GridLayout(1, false);
|
||||||
mainLayout.marginHeight = 3;
|
mainLayout.marginHeight = 3;
|
||||||
|
@ -161,25 +148,18 @@ public class TafProductConfigDlg extends Dialog {
|
||||||
|
|
||||||
// Initialize all of the controls and layouts
|
// Initialize all of the controls and layouts
|
||||||
initializeComponents();
|
initializeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
shell.pack();
|
@Override
|
||||||
|
protected void disposed() {
|
||||||
shell.open();
|
|
||||||
while (!shell.isDisposed()) {
|
|
||||||
if (!display.readAndDispatch()) {
|
|
||||||
display.sleep();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
listFont.dispose();
|
listFont.dispose();
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the components on the display.
|
* Initialize the components on the display.
|
||||||
*/
|
*/
|
||||||
private void initializeComponents() {
|
private void initializeComponents() {
|
||||||
|
Display display = getParent().getDisplay();
|
||||||
listFont = new Font(display, "Monospace", 10, SWT.NORMAL);
|
listFont = new Font(display, "Monospace", 10, SWT.NORMAL);
|
||||||
|
|
||||||
createBottomMessageControls();
|
createBottomMessageControls();
|
||||||
|
@ -562,11 +542,16 @@ public class TafProductConfigDlg extends Dialog {
|
||||||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "TAF Product Configuration Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This dialog is used to define TAF/TWEB product (list of\nforecasts).\n\nThee products should be defined AFTER relevant site/route\nconfiguration files have been created.\n\nTo add a new product, enter product label in the \"Products\"\nentry field and press <Enter>. Then enter all TAF ids or\nTWEB routes in the \"Idents\" entry field, press <Enter>\nafter typing one item. Press \"Save\" button to save\nconfiguration file.\n\nTo remove a product, press \"Delede\" below \"Products\" list.\n\nTo remove an ident from the product definition, use\n\"Delete\" button in the \"Idents\" column. You must then save\nthe product. This will NOT delete TAF/TWEB configuration\nfiles, this can only be done from the command line.\n\nThe \"Verify\" button can be used to check for existence and\nproper syntax of all relevant files.";
|
String description = "TAF Product Configuration Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This dialog is used to define TAF/TWEB product (list of\nforecasts).\n\nThee products should be defined AFTER relevant site/route\nconfiguration files have been created.\n\nTo add a new product, enter product label in the \"Products\"\nentry field and press <Enter>. Then enter all TAF ids or\nTWEB routes in the \"Idents\" entry field, press <Enter>\nafter typing one item. Press \"Save\" button to save\nconfiguration file.\n\nTo remove a product, press \"Delede\" below \"Products\" list.\n\nTo remove an ident from the product definition, use\n\"Delete\" button in the \"Idents\" column. You must then save\nthe product. This will NOT delete TAF/TWEB configuration\nfiles, this can only be done from the command line.\n\nThe \"Verify\" button can be used to check for existence and\nproper syntax of all relevant files.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description,
|
||||||
|
helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.configuration.ConfigurationException;
|
import org.apache.commons.configuration.ConfigurationException;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
@ -39,7 +40,6 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Dialog;
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
@ -63,6 +63,8 @@ import com.raytheon.uf.viz.core.comm.Loader;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.vividsolutions.jts.geom.Point;
|
import com.vividsolutions.jts.geom.Point;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,6 +80,10 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* Make and Edit buttons to work.
|
* Make and Edit buttons to work.
|
||||||
* 10 Dec 2010 7662 rferrel Create and use getObStation.
|
* 10 Dec 2010 7662 rferrel Create and use getObStation.
|
||||||
* 9 May 2011 8856 rferrel Code cleanup
|
* 9 May 2011 8856 rferrel Code cleanup
|
||||||
|
* 12 Oct 2012 1229 rferrel Now a subclass of CaveSWTDialog
|
||||||
|
* and made non-blocking.
|
||||||
|
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||||
|
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -85,24 +91,14 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TafSiteInfoEditorDlg extends Dialog {
|
public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(TafSiteInfoEditorDlg.class);
|
.getHandler(TafSiteInfoEditorDlg.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A site's template hours.
|
* A site's template hours.
|
||||||
*/
|
*/
|
||||||
private final static String[] START_HOURS = { "00", "06", "12", "18" };
|
private final String[] START_HOURS = { "00", "06", "12", "18" };
|
||||||
|
|
||||||
/**
|
|
||||||
* Dialog shell.
|
|
||||||
*/
|
|
||||||
private Shell shell;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The display control.
|
|
||||||
*/
|
|
||||||
private Display display;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite containing message status controls.
|
* Composite containing message status controls.
|
||||||
|
@ -241,6 +237,13 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
||||||
*/
|
*/
|
||||||
private Color correctColor;
|
private Color correctColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible to have a different dialog for each issue time.
|
||||||
|
*/
|
||||||
|
private Map<String, TextEditorSetupDlg> editorDlgMap;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -248,19 +251,13 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public TafSiteInfoEditorDlg(Shell parent) {
|
public TafSiteInfoEditorDlg(Shell parent) {
|
||||||
super(parent, 0);
|
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||||
|
setText("AvnFPS TAF Site Info Editor");
|
||||||
|
editorDlgMap = new HashMap<String, TextEditorSetupDlg>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Open method used to display the dialog.
|
protected void initializeComponents(Shell shell) {
|
||||||
*
|
|
||||||
* @return Null.
|
|
||||||
*/
|
|
||||||
public Object open() {
|
|
||||||
Shell parent = getParent();
|
|
||||||
display = parent.getDisplay();
|
|
||||||
shell = new Shell(parent, SWT.DIALOG_TRIM);
|
|
||||||
shell.setText("AvnFPS TAF Site Info Editor");
|
|
||||||
|
|
||||||
// Create the main layout for the shell.
|
// Create the main layout for the shell.
|
||||||
GridLayout mainLayout = new GridLayout(1, false);
|
GridLayout mainLayout = new GridLayout(1, false);
|
||||||
|
@ -271,25 +268,25 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
||||||
|
|
||||||
// Initialize all of the controls and layouts
|
// Initialize all of the controls and layouts
|
||||||
initializeComponents();
|
initializeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
shell.pack();
|
@Override
|
||||||
|
protected void disposed() {
|
||||||
shell.open();
|
if (incorrectColor != null) {
|
||||||
while (!shell.isDisposed()) {
|
incorrectColor.dispose();
|
||||||
if (!display.readAndDispatch()) {
|
|
||||||
display.sleep();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
incorrectColor.dispose();
|
if (correctColor != null) {
|
||||||
|
correctColor.dispose();
|
||||||
return null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the components on the display.
|
* Initialize the components on the display.
|
||||||
*/
|
*/
|
||||||
private void initializeComponents() {
|
private void initializeComponents() {
|
||||||
|
Display display = getParent().getDisplay();
|
||||||
|
|
||||||
incorrectColor = new Color(display, new RGB(255, 215, 220));
|
incorrectColor = new Color(display, new RGB(255, 215, 220));
|
||||||
|
|
||||||
createTopControls();
|
createTopControls();
|
||||||
|
@ -486,11 +483,16 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
||||||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "AvnFPS - Site Info Editor Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This dialog is used to define TAF site information.\n\nTo add a new site, enter site id and press \"Update\". Edit\ndisplayed entries and press \"Save\". Create default template\nfiles.\n\nTo change an existing TAF site attribute, enter site id and\npress the \"Load\" button.\n\nTo create template files, press \"Make\" in the \"Templates\"\narea.\n\nTo edit template file, select issue hour, then press \"Edit\"\nin the \"Templates\" area.\n\nYou can use \"Update\" button to extract information from\nAWIPS configuration files. Only non-empty fields will be\noverwritten.";
|
String description = "AvnFPS - Site Info Editor Help";
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
|
||||||
helpText);
|
String helpText = "This dialog is used to define TAF site information.\n\nTo add a new site, enter site id and press \"Update\". Edit\ndisplayed entries and press \"Save\". Create default template\nfiles.\n\nTo change an existing TAF site attribute, enter site id and\npress the \"Load\" button.\n\nTo create template files, press \"Make\" in the \"Templates\"\narea.\n\nTo edit template file, select issue hour, then press \"Edit\"\nin the \"Templates\" area.\n\nYou can use \"Update\" button to extract information from\nAWIPS configuration files. Only non-empty fields will be\noverwritten.";
|
||||||
usageDlg.open();
|
usageDlg = new HelpUsageDlg(shell, description,
|
||||||
|
helpText);
|
||||||
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -877,15 +879,30 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (isSiteIdValid()) {
|
if (isSiteIdValid()) {
|
||||||
try {
|
try {
|
||||||
String issueTime = issueCbo.getText().substring(0, 2);
|
final String issueTime = issueCbo.getText().substring(
|
||||||
ITafSiteConfig config = TafSiteConfigFactory
|
0, 2);
|
||||||
.getInstance();
|
TextEditorSetupDlg editorDlg = editorDlgMap
|
||||||
String siteId = siteIdTF.getText();
|
.get(issueTime);
|
||||||
LocalizationFile lFile = config.getTemplateFile(siteId,
|
if (mustCreate(editorDlg)) {
|
||||||
issueTime);
|
ITafSiteConfig config = TafSiteConfigFactory
|
||||||
TextEditorSetupDlg editorDlg = new TextEditorSetupDlg(
|
.getInstance();
|
||||||
shell, lFile);
|
String siteId = siteIdTF.getText();
|
||||||
editorDlg.open();
|
LocalizationFile lFile = config.getTemplateFile(
|
||||||
|
siteId, issueTime);
|
||||||
|
editorDlg = new TextEditorSetupDlg(shell, lFile);
|
||||||
|
editorDlgMap.put(issueTime, editorDlg);
|
||||||
|
editorDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
editorDlgMap.remove(issueTime);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
editorDlg.open();
|
||||||
|
} else {
|
||||||
|
editorDlg.bringToTop();
|
||||||
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
msgStatusComp.setMessageText(e.getMessage(), new RGB(
|
msgStatusComp.setMessageText(e.getMessage(), new RGB(
|
||||||
255, 0, 0));
|
255, 0, 0));
|
||||||
|
@ -1109,6 +1126,7 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
||||||
* @return boolean - True if all the data is valid.
|
* @return boolean - True if all the data is valid.
|
||||||
*/
|
*/
|
||||||
private boolean validateData() {
|
private boolean validateData() {
|
||||||
|
Display display = getParent().getDisplay();
|
||||||
boolean isValid = true;
|
boolean isValid = true;
|
||||||
correctColor = new Color(display, new RGB(255, 255, 255));
|
correctColor = new Color(display, new RGB(255, 255, 255));
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
import com.raytheon.viz.avnconfig.OpenSaveDlg.DialogType;
|
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple text Editor dialog allowing the user to modify a localized file.
|
* A simple text Editor dialog allowing the user to modify a localized file.
|
||||||
|
@ -75,6 +75,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 7 DEC 2010 7621 rferrel Modified constructor to take a
|
* 7 DEC 2010 7621 rferrel Modified constructor to take a
|
||||||
* LocalizedFile and added preOpen() to
|
* LocalizedFile and added preOpen() to
|
||||||
* open the LocalizedFile.
|
* open the LocalizedFile.
|
||||||
|
* 11 OCT 2012 1229 rferrel Changes for non-blocking FindReplaceDlg.
|
||||||
|
* 15 OCT 2012 1229 rferrel Made dialog non-blocking.
|
||||||
|
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -141,6 +144,12 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
private String template;
|
private String template;
|
||||||
|
|
||||||
|
private FindReplaceDlg findDlg;
|
||||||
|
|
||||||
|
private OpenDlg openDlg;
|
||||||
|
|
||||||
|
private HelpUsageDlg usageDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -160,7 +169,8 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
* When not null a localized file to load into the editor.
|
* When not null a localized file to load into the editor.
|
||||||
*/
|
*/
|
||||||
public TextEditorSetupDlg(Shell parent, LocalizationFile lFile) {
|
public TextEditorSetupDlg(Shell parent, LocalizationFile lFile) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS Text Editor");
|
setText("AvnFPS Text Editor");
|
||||||
|
|
||||||
this.template = null;
|
this.template = null;
|
||||||
|
@ -323,8 +333,12 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
// Use the AvnFPS Find/Replace dialog
|
// Use the AvnFPS Find/Replace dialog
|
||||||
FindReplaceDlg findDlg = new FindReplaceDlg(shell, editorStTxt);
|
if (mustCreate(findDlg)) {
|
||||||
findDlg.open();
|
findDlg = new FindReplaceDlg(shell, editorStTxt);
|
||||||
|
findDlg.open();
|
||||||
|
} else {
|
||||||
|
findDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -383,33 +397,36 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
usageMI.addSelectionListener(new SelectionAdapter() {
|
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
String description = "Text Editor Help";
|
if (mustCreate(usageDlg)) {
|
||||||
String helpText = "This is a generic text editor. Edit any text file via the file\n";
|
String description = "Text Editor Help";
|
||||||
helpText += "selection dialog that is invoked by pressing the 'Open' button.\n";
|
String helpText = "This is a generic text editor. Edit any text file via the file\n"
|
||||||
helpText += "\n";
|
+ "selection dialog that is invoked by pressing the 'Open' button.\n"
|
||||||
helpText += "Menu items:\n";
|
+ "\n"
|
||||||
helpText += " File:\n";
|
+ "Menu items:\n"
|
||||||
helpText += " Print invokes print dialog\n";
|
+ " File:\n"
|
||||||
helpText += " Edit:\n";
|
+ " Print invokes print dialog\n"
|
||||||
helpText += " provides the usual editing functions (i.e. Cut, Copy, Paste,\n";
|
+ " Edit:\n"
|
||||||
helpText += " and Find/Replace). The menu can be also invoked by pressing\n";
|
+ " provides the usual editing functions (i.e. Cut, Copy, Paste,\n"
|
||||||
helpText += " right mouse button within the text window area.\n";
|
+ " and Find/Replace). The menu can be also invoked by pressing\n"
|
||||||
helpText += "\n";
|
+ " right mouse button within the text window area.\n"
|
||||||
helpText += "Buttons:\n";
|
+ "\n"
|
||||||
helpText += " Clear: clears text window.\n";
|
+ "Buttons:\n"
|
||||||
helpText += " Open: invokes file selection dialog\n";
|
+ " Clear: clears text window.\n"
|
||||||
helpText += " Save: saves content of the text window\n";
|
+ " Open: invokes file selection dialog\n"
|
||||||
helpText += " Save as: invokes file selection dialog\n";
|
+ " Save: saves content of the text window\n"
|
||||||
helpText += "\n";
|
+ " Save as: invokes file selection dialog\n"
|
||||||
helpText += "Toggles:\n";
|
+ "\n"
|
||||||
helpText += " Insert: toggles insert/overwrite mode\n";
|
+ "Toggles:\n"
|
||||||
helpText += " Wrap: toggles word wrap\n";
|
+ " Insert: toggles insert/overwrite mode\n"
|
||||||
helpText += "\n";
|
+ " Wrap: toggles word wrap\n"
|
||||||
helpText += "The currently loaded (if any) file name is displayed in a label above the\n";
|
+ "\n"
|
||||||
helpText += "text window.";
|
+ "The currently loaded (if any) file name is displayed in a label above the\n"
|
||||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
+ "text window.";
|
||||||
helpText);
|
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||||
usageDlg.open();
|
usageDlg.open();
|
||||||
|
} else {
|
||||||
|
usageDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -509,7 +526,6 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
Button saveAsBtn = new Button(buttonComp, SWT.PUSH);
|
Button saveAsBtn = new Button(buttonComp, SWT.PUSH);
|
||||||
saveAsBtn.setText("Save As");
|
saveAsBtn.setText("Save As");
|
||||||
saveAsBtn.setToolTipText("Save file with new name");
|
saveAsBtn.setToolTipText("Save file with new name");
|
||||||
// saveAsBtn.setEnabled(false);
|
|
||||||
saveAsBtn.setLayoutData(gd);
|
saveAsBtn.setLayoutData(gd);
|
||||||
saveAsBtn.addSelectionListener(new SelectionAdapter() {
|
saveAsBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -799,8 +815,6 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
path = path.substring(1, path.lastIndexOf('/'));
|
path = path.substring(1, path.lastIndexOf('/'));
|
||||||
|
|
||||||
dlg.setFilterPath(path);
|
dlg.setFilterPath(path);
|
||||||
// dlg.setFilterNames(FILTER_NAMES);
|
|
||||||
// dlg.setFilterExtensions(FILTER_EXTS);
|
|
||||||
String fn = dlg.open();
|
String fn = dlg.open();
|
||||||
if (fn != null) {
|
if (fn != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -839,9 +853,23 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
* Show the 'Open' file dialog.
|
* Show the 'Open' file dialog.
|
||||||
*/
|
*/
|
||||||
private void openFile() {
|
private void openFile() {
|
||||||
OpenSaveDlg dlg = new OpenSaveDlg(shell, DialogType.OPEN);
|
if (mustCreate(openDlg)) {
|
||||||
dlg.open();
|
openDlg = new OpenDlg(shell);
|
||||||
openFile(dlg.getSelectedFile());
|
openDlg.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
LocalizationFile selectedFile = null;
|
||||||
|
if (returnValue instanceof LocalizationFile) {
|
||||||
|
selectedFile = (LocalizationFile) returnValue;
|
||||||
|
}
|
||||||
|
openFile(selectedFile);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
openDlg.open();
|
||||||
|
} else {
|
||||||
|
openDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -880,41 +908,4 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void openFile() {
|
|
||||||
// FileDialog dlg = new FileDialog(shell, SWT.OPEN);
|
|
||||||
// IPathManager pm = PathManagerFactory.getPathManager();
|
|
||||||
// String path = pm.getFile(
|
|
||||||
// pm.getContext(LocalizationType.CAVE_STATIC,
|
|
||||||
// LocalizationLevel.BASE), "aviation").getAbsolutePath();
|
|
||||||
// dlg.setFilterPath(path);
|
|
||||||
// String fn = dlg.open();
|
|
||||||
// StringBuilder contents = new StringBuilder();
|
|
||||||
//
|
|
||||||
// if (fn != null) {
|
|
||||||
// try {
|
|
||||||
// BufferedReader input = new BufferedReader(new FileReader(
|
|
||||||
// new File(fn)));
|
|
||||||
// String line = null;
|
|
||||||
//
|
|
||||||
// while ((line = input.readLine()) != null) {
|
|
||||||
// contents.append(line);
|
|
||||||
// contents.append(System.getProperty("line.separator"));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// editorStTxt.setText(contents.toString());
|
|
||||||
//
|
|
||||||
// input.close();
|
|
||||||
// msgStatusComp.setMessageText("File " + fn
|
|
||||||
// + " opened successfully.", new RGB(0, 255, 0));
|
|
||||||
// } catch (FileNotFoundException e) {
|
|
||||||
// msgStatusComp.setMessageText("File " + fn + " not found.",
|
|
||||||
// new RGB(255, 0, 0));
|
|
||||||
// } catch (IOException e) {
|
|
||||||
// msgStatusComp.setMessageText(
|
|
||||||
// "An error occured while opening file " + fn, new RGB(
|
|
||||||
// 255, 0, 0));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@ import java.util.regex.Pattern;
|
||||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
|
import com.raytheon.uf.viz.core.procedures.AlterBundleChangeEvent;
|
||||||
|
import com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter;
|
||||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||||
import com.raytheon.uf.viz.core.procedures.IAlterBundleContributor;
|
import com.raytheon.uf.viz.core.procedures.IAlterBundleContributor;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||||
|
@ -39,6 +41,7 @@ import com.raytheon.uf.viz.core.rsc.IPointsToolContainer;
|
||||||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
||||||
|
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||||
import com.raytheon.uf.viz.points.PointUtilities;
|
import com.raytheon.uf.viz.points.PointUtilities;
|
||||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||||
import com.raytheon.uf.viz.points.data.IPointNode;
|
import com.raytheon.uf.viz.points.data.IPointNode;
|
||||||
|
@ -46,8 +49,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
import com.vividsolutions.jts.geom.LineString;
|
import com.vividsolutions.jts.geom.LineString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class generates the alternate bundle's contributions for points and
|
* This class generates the alter bundle's contributions for points and lines.
|
||||||
* lines.
|
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -57,6 +59,7 @@ import com.vividsolutions.jts.geom.LineString;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Initial creation
|
* Initial creation
|
||||||
* Aug 08, 2012 #875 rferrel Generate menu entries for points.
|
* Aug 08, 2012 #875 rferrel Generate menu entries for points.
|
||||||
|
* Oct 03, 2012 #1248 rferrel Added listener for when points change.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -65,7 +68,7 @@ import com.vividsolutions.jts.geom.LineString;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
||||||
|
|
||||||
private static final String POINTS_PREFIX = "Point-";
|
private static final String POINTS_PREFIX = "Point-";
|
||||||
|
|
||||||
|
@ -75,6 +78,8 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
|
|
||||||
private static final String LINES_KEY = "line";
|
private static final String LINES_KEY = "line";
|
||||||
|
|
||||||
|
private IPointChangedListener pointChangedListener;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -85,37 +90,8 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String[]> getAlterables() {
|
public Map<String, String[]> getAlterables() {
|
||||||
Map<String, String[]> alterables = new HashMap<String, String[]>();
|
Map<String, String[]> alterables = new HashMap<String, String[]>();
|
||||||
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
String[] linesValues = createLineArray();
|
||||||
PointsDataManager pdm = PointsDataManager.getInstance();
|
String[] pointsValues = createPointArray();
|
||||||
Collection<String> blNames = tdm.getBaselineNames();
|
|
||||||
String[] lines = new String[blNames.size()];
|
|
||||||
int i = 0;
|
|
||||||
for (String line : blNames) {
|
|
||||||
lines[i] = LINES_PREFIX + line;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
Arrays.sort(lines);
|
|
||||||
|
|
||||||
Collection<String> pNames = pdm.getPointNames();
|
|
||||||
String[] points = new String[pNames.size()];
|
|
||||||
i = 0;
|
|
||||||
for (String point : pNames) {
|
|
||||||
points[i] = POINTS_PREFIX + point;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
Arrays.sort(points);
|
|
||||||
|
|
||||||
List<String> pointsList = new ArrayList<String>();
|
|
||||||
pointsList.add(ProcedureDlg.ORIGINAL);
|
|
||||||
pointsList.add(ProcedureDlg.CURRENT);
|
|
||||||
pointsList.add(IAlterBundleContributor.MI_SEPARATOR);
|
|
||||||
pointsList.addAll(createChildrenList(pdm, null));
|
|
||||||
String[] pointsValues = pointsList.toArray(new String[0]);
|
|
||||||
|
|
||||||
String[] linesValues = new String[lines.length + 2];
|
|
||||||
linesValues[0] = ProcedureDlg.ORIGINAL;
|
|
||||||
linesValues[1] = ProcedureDlg.CURRENT;
|
|
||||||
System.arraycopy(lines, 0, linesValues, 2, lines.length);
|
|
||||||
|
|
||||||
alterables.put(LINES_KEY, linesValues);
|
alterables.put(LINES_KEY, linesValues);
|
||||||
alterables.put(POINTS_KEY, pointsValues);
|
alterables.put(POINTS_KEY, pointsValues);
|
||||||
|
@ -149,6 +125,39 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
return childrenList;
|
return childrenList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String[] createLineArray() {
|
||||||
|
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
||||||
|
Collection<String> blNames = tdm.getBaselineNames();
|
||||||
|
String[] lines = new String[blNames.size()];
|
||||||
|
int i = 0;
|
||||||
|
for (String line : blNames) {
|
||||||
|
lines[i] = LINES_PREFIX + line;
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
Arrays.sort(lines);
|
||||||
|
String[] linesValues = new String[lines.length + 2];
|
||||||
|
linesValues[0] = ProcedureDlg.ORIGINAL;
|
||||||
|
linesValues[1] = ProcedureDlg.CURRENT;
|
||||||
|
System.arraycopy(lines, 0, linesValues, 2, lines.length);
|
||||||
|
return linesValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return pointsValues
|
||||||
|
*/
|
||||||
|
private String[] createPointArray() {
|
||||||
|
PointsDataManager pdm = PointsDataManager.getInstance();
|
||||||
|
|
||||||
|
List<String> pointsList = new ArrayList<String>();
|
||||||
|
pointsList.add(ProcedureDlg.ORIGINAL);
|
||||||
|
pointsList.add(ProcedureDlg.CURRENT);
|
||||||
|
pointsList.add(IAlterBundleContributor.MI_SEPARATOR);
|
||||||
|
pointsList.addAll(createChildrenList(pdm, null));
|
||||||
|
String[] pointsValues = pointsList.toArray(new String[0]);
|
||||||
|
return pointsValues;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -183,6 +192,9 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
private void replaceWithCurrentPoints(ResourceList list) {
|
private void replaceWithCurrentPoints(ResourceList list) {
|
||||||
for (ResourcePair rp : list) {
|
for (ResourcePair rp : list) {
|
||||||
AbstractResourceData rData = rp.getResourceData();
|
AbstractResourceData rData = rp.getResourceData();
|
||||||
|
@ -196,6 +208,9 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param b
|
||||||
|
*/
|
||||||
private void replaceWithCurrentLines(Bundle b) {
|
private void replaceWithCurrentLines(Bundle b) {
|
||||||
for (AbstractRenderableDisplay display : b.getDisplays()) {
|
for (AbstractRenderableDisplay display : b.getDisplays()) {
|
||||||
IDescriptor desc = display.getDescriptor();
|
IDescriptor desc = display.getDescriptor();
|
||||||
|
@ -219,6 +234,10 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list
|
||||||
|
* @param selectedString
|
||||||
|
*/
|
||||||
private void alterResourceList(ResourceList list, String selectedString) {
|
private void alterResourceList(ResourceList list, String selectedString) {
|
||||||
for (ResourcePair rp : list) {
|
for (ResourcePair rp : list) {
|
||||||
AbstractResourceData rData = rp.getResourceData();
|
AbstractResourceData rData = rp.getResourceData();
|
||||||
|
@ -256,6 +275,10 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param container
|
||||||
|
* @param selectedString
|
||||||
|
*/
|
||||||
private void alterContainer(IBaseLinesContainer container,
|
private void alterContainer(IBaseLinesContainer container,
|
||||||
String selectedString) {
|
String selectedString) {
|
||||||
LineString line = ToolsDataManager.getInstance().getBaseline(
|
LineString line = ToolsDataManager.getInstance().getBaseline(
|
||||||
|
@ -264,4 +287,65 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||||
container.setBaseLineString(line);
|
container.setBaseLineString(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||||
|
* getAlterables(java.lang.String)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String[] getAlterables(String key) {
|
||||||
|
if (key == POINTS_KEY) {
|
||||||
|
return createPointArray();
|
||||||
|
} else if (key == LINES_KEY) {
|
||||||
|
return createLineArray();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||||
|
* listenerSetup()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void listenerSetup() {
|
||||||
|
if (pointChangedListener == null) {
|
||||||
|
pointChangedListener = new IPointChangedListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pointChanged() {
|
||||||
|
notifyBundleListeners();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
PointsDataManager.getInstance().addPointsChangedListener(
|
||||||
|
pointChangedListener);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||||
|
* listenerShutdown()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void listenerShutdown() {
|
||||||
|
if (pointChangedListener != null) {
|
||||||
|
PointsDataManager.getInstance().removePointsChangedListener(
|
||||||
|
pointChangedListener);
|
||||||
|
pointChangedListener = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Received notification of changes to points notify anyone interested in
|
||||||
|
* the change.
|
||||||
|
*/
|
||||||
|
private void notifyBundleListeners() {
|
||||||
|
AlterBundleChangeEvent event = new AlterBundleChangeEvent(
|
||||||
|
new String[] { POINTS_KEY });
|
||||||
|
fireAlterBundleChangeListener(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||||
*
|
*
|
||||||
* This memory-based tileset pulls a small raster from an hdf5 file and
|
* This memory-based tileset pulls a small raster from an hdf5 file and
|
||||||
* interpolates it to a larger size. The raster is then split once it is already
|
* interpolates it to a larger size. The raster is then split once it is already
|
||||||
* loaded in memory.
|
* loaded in memory.git pull
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -116,23 +116,28 @@ public class MemoryBasedTileSet extends AbstractTileSet {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void preloadDataObject(int level) throws StorageException {
|
protected void preloadDataObject(int level) throws StorageException {
|
||||||
IDataRecord rec = getDataRecord();
|
synchronized (isLoaded) {
|
||||||
|
if (isLoaded[level]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDataRecord rec = getDataRecord();
|
||||||
|
|
||||||
if (loadedData == null) {
|
if (loadedData == null) {
|
||||||
loadedData = new Object[levels];
|
loadedData = new Object[levels];
|
||||||
dims = new int[levels][];
|
dims = new int[levels][];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rec != null) {
|
||||||
|
|
||||||
|
loadedData[level] = rec.getDataObject();
|
||||||
|
|
||||||
|
long[] d = rec.getSizes();
|
||||||
|
dims[level] = new int[] { (int) d[0], (int) d[1] };
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
isLoaded[level] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec != null) {
|
|
||||||
|
|
||||||
loadedData[level] = rec.getDataObject();
|
|
||||||
|
|
||||||
long[] d = rec.getSizes();
|
|
||||||
dims[level] = new int[] { (int) d[0], (int) d[1] };
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoaded[level] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IDataRecord getDataRecord() throws StorageException {
|
protected IDataRecord getDataRecord() throws StorageException {
|
||||||
|
|
|
@ -34,9 +34,14 @@
|
||||||
</equals>
|
</equals>
|
||||||
</iterate>
|
</iterate>
|
||||||
</with>
|
</with>
|
||||||
<with variable="activeEditor">
|
<or>
|
||||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
<with variable="activePart">
|
||||||
</with>
|
<instanceof value="com.raytheon.viz.gfe.GridManagerView"/>
|
||||||
|
</with>
|
||||||
|
<with variable="activeEditor">
|
||||||
|
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||||
|
</with>
|
||||||
|
</or>
|
||||||
</and>
|
</and>
|
||||||
</definition>
|
</definition>
|
||||||
</extension>
|
</extension>
|
||||||
|
@ -356,12 +361,6 @@
|
||||||
optional="false">
|
optional="false">
|
||||||
</commandParameter>
|
</commandParameter>
|
||||||
</command>
|
</command>
|
||||||
<command
|
|
||||||
categoryId="com.raytheon.viz.gfe.GFECategory"
|
|
||||||
description="Start GFE Service Backup"
|
|
||||||
id="com.raytheon.viz.gfe.StartServiceBackup"
|
|
||||||
name="Start GFE Service Backup">
|
|
||||||
</command>
|
|
||||||
<command
|
<command
|
||||||
categoryId="com.raytheon.viz.gfe.GFECategory"
|
categoryId="com.raytheon.viz.gfe.GFECategory"
|
||||||
description="Site Activation"
|
description="Site Activation"
|
||||||
|
@ -993,15 +992,6 @@
|
||||||
</reference>
|
</reference>
|
||||||
</activeWhen>
|
</activeWhen>
|
||||||
</handler>
|
</handler>
|
||||||
<handler
|
|
||||||
class="com.raytheon.viz.gfe.actions.ShowServiceBackupDlg"
|
|
||||||
commandId="com.raytheon.viz.gfe.StartServiceBackup">
|
|
||||||
<activeWhen>
|
|
||||||
<reference
|
|
||||||
definitionId="com.raytheon.viz.gfe.inGFEActionSet">
|
|
||||||
</reference>
|
|
||||||
</activeWhen>
|
|
||||||
</handler>
|
|
||||||
<handler
|
<handler
|
||||||
class="com.raytheon.viz.gfe.actions.ShowSiteActivationDlg"
|
class="com.raytheon.viz.gfe.actions.ShowSiteActivationDlg"
|
||||||
commandId="com.raytheon.viz.gfe.SiteActivation">
|
commandId="com.raytheon.viz.gfe.SiteActivation">
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.raytheon.viz.gfe.dialogs.sbu.SiteActivationDlg;
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Display Activate Site dialog standalone and blocked.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 15, 2011 bphillip Initial creation
|
* Aug 15, 2011 bphillip Initial creation
|
||||||
|
* Oct 26, 2012 1287 rferrel Force blocking of SiteActivationDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -55,6 +56,7 @@ public class ActivateSiteComponent extends AbstractCAVEComponent {
|
||||||
protected void startInternal(String componentName) throws Exception {
|
protected void startInternal(String componentName) throws Exception {
|
||||||
SiteActivationDlg dlg = new SiteActivationDlg(new Shell(
|
SiteActivationDlg dlg = new SiteActivationDlg(new Shell(
|
||||||
Display.getCurrent()));
|
Display.getCurrent()));
|
||||||
|
dlg.setBlockOnOpen(true);
|
||||||
dlg.open();
|
dlg.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,11 @@ package com.raytheon.viz.gfe;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
|
||||||
import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg;
|
import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg;
|
||||||
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Bring up the Service Backup Dialog in stand alone mode as a blocking dialog.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -36,6 +35,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 12, 2011 bphillip Initial creation
|
* Aug 12, 2011 bphillip Initial creation
|
||||||
|
* Oct 26, 2012 1287 rferrel Change to force blocking of ServiceBackupDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -56,6 +56,7 @@ public class ServiceBackupComponent extends AbstractCAVEComponent {
|
||||||
protected void startInternal(String componentName) throws Exception {
|
protected void startInternal(String componentName) throws Exception {
|
||||||
ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(new Shell(
|
ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(new Shell(
|
||||||
Display.getCurrent()));
|
Display.getCurrent()));
|
||||||
|
svcBuDlg.setBlockOnOpen(true);
|
||||||
svcBuDlg.open();
|
svcBuDlg.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
|
||||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Action to bring up the Dispaly attributes dialog.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 13, 2009 mschenke Initial creation
|
* Jan 13, 2009 mschenke Initial creation
|
||||||
|
* Oct 22, 2012 1287 rferrel Changes for non-blocking DisplayAttributesDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,6 +47,8 @@ public class DisplayAttributesAction extends AbstractRightClickAction {
|
||||||
|
|
||||||
private GFEResource rsc;
|
private GFEResource rsc;
|
||||||
|
|
||||||
|
private DisplayAttributesDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -53,14 +56,18 @@ public class DisplayAttributesAction extends AbstractRightClickAction {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
rsc = ((GFEResource) this.getSelectedRsc());
|
rsc = ((GFEResource) this.getSelectedRsc());
|
||||||
|
|
||||||
DisplayAttributesDialog dad = new DisplayAttributesDialog(shell, rsc);
|
dialog = new DisplayAttributesDialog(shell, rsc);
|
||||||
dad.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dad.open();
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 11, 2008 Eric Babin Initial Creation
|
* Apr 11, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 23, 2012 1287 rferrel Changes for non-blocking FormatterLauncherDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -56,20 +57,14 @@ public class FormatterlauncherAction extends AbstractHandler {
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
if (dialog == null) {
|
|
||||||
dialog = new FormatterLauncherDialog(shell);
|
dialog = new FormatterLauncherDialog(shell);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
|
||||||
dialog.dispose();
|
|
||||||
dialog = null;
|
|
||||||
} else if (dialog.getShell() == null) {
|
|
||||||
dialog.open();
|
dialog.open();
|
||||||
} else {
|
} else {
|
||||||
dialog.getShell().setVisible(true);
|
dialog.bringToTop();
|
||||||
dialog.getShell().setActive();
|
|
||||||
if (dialog.buttonBar != null) {
|
if (dialog.buttonBar != null) {
|
||||||
dialog.buttonBar.moveAbove(null);
|
dialog.buttonBar.moveAbove(null);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +72,16 @@ public class FormatterlauncherAction extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FormatterLauncherDialog getFormatterLauncher() {
|
public static void closeFormatters() {
|
||||||
return dialog;
|
if (dialog != null && dialog.getShell() != null && !dialog.isDisposed()) {
|
||||||
|
dialog.closeFormatters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void closeDialog() {
|
||||||
|
if (dialog != null && dialog.getShell() != null && !dialog.isDisposed()) {
|
||||||
|
dialog.closeDialog();
|
||||||
|
}
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.ui.PlatformUI;
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.AutoSaveIntervalDialog;
|
import com.raytheon.viz.gfe.dialogs.AutoSaveIntervalDialog;
|
||||||
import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action for launching auto save dialog
|
* Action for launching auto save dialog
|
||||||
|
@ -40,6 +41,7 @@ import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 23, 2008 Eric Babin Initial Creation
|
* Jan 23, 2008 Eric Babin Initial Creation
|
||||||
* Jul 8, 2008 randerso reworked
|
* Jul 8, 2008 randerso reworked
|
||||||
|
* Oct 23, 2012 1287 rferrel Changes for non-blocking AutoSaveIntervalDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -47,6 +49,7 @@ import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class ShowAutoSaveIntervalDialog extends AbstractHandler {
|
public class ShowAutoSaveIntervalDialog extends AbstractHandler {
|
||||||
|
private AutoSaveIntervalDialog dialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -58,36 +61,50 @@ public class ShowAutoSaveIntervalDialog extends AbstractHandler {
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
|
* @see
|
||||||
|
* org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
|
||||||
|
* .ExecutionEvent)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
int interval = AutoSaveJob.getInterval();
|
int interval = AutoSaveJob.getInterval();
|
||||||
boolean autoSaveEnabled = interval > 0;
|
boolean autoSaveEnabled = interval > 0;
|
||||||
if (!autoSaveEnabled) {
|
if (!autoSaveEnabled) {
|
||||||
interval = AutoSaveJob.MAX_INTERVAL;
|
interval = AutoSaveJob.MAX_INTERVAL;
|
||||||
}
|
|
||||||
|
|
||||||
AutoSaveIntervalDialog dialog = new AutoSaveIntervalDialog(shell,
|
|
||||||
interval, autoSaveEnabled);
|
|
||||||
dialog.setBlockOnOpen(true);
|
|
||||||
dialog.open();
|
|
||||||
|
|
||||||
if (dialog.getReturnCode() == Window.OK) {
|
|
||||||
// update
|
|
||||||
if (dialog.isAutoSaveEnabled()) {
|
|
||||||
interval = dialog.getCurrentInterval();
|
|
||||||
AutoSaveJob.setInterval(interval);
|
|
||||||
DataManager.enableAutoSave();
|
|
||||||
} else {
|
|
||||||
AutoSaveJob.setInterval(0);
|
|
||||||
DataManager.disableAutoSave();
|
|
||||||
}
|
}
|
||||||
} // else do nothing...
|
dialog = new AutoSaveIntervalDialog(shell, interval,
|
||||||
|
autoSaveEnabled);
|
||||||
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof Integer) {
|
||||||
|
int returnCode = (Integer) returnValue;
|
||||||
|
if (returnCode == Window.OK) {
|
||||||
|
// update
|
||||||
|
if (dialog.isAutoSaveEnabled()) {
|
||||||
|
int interval = dialog.getCurrentInterval();
|
||||||
|
AutoSaveJob.setInterval(interval);
|
||||||
|
DataManager.enableAutoSave();
|
||||||
|
} else {
|
||||||
|
AutoSaveJob.setInterval(0);
|
||||||
|
DataManager.disableAutoSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,14 @@ import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.BreakLockDialog;
|
import com.raytheon.viz.gfe.dialogs.BreakLockDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description ShowBreakLock.java Jun 17, 2008
|
* Action class to bring up the break locck dialog.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 17, 2008 Eric Babin Initial Creation
|
* Jun 17, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 27, 2012 1287 rferrel Changes for non-blocking BreakLockDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.BreakLockDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowBreakLock extends AbstractHandler {
|
public class ShowBreakLock extends AbstractHandler {
|
||||||
|
private BreakLockDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -59,12 +61,16 @@ public class ShowBreakLock extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
BreakLockDialog dialog = new BreakLockDialog(shell, dm);
|
dialog = new BreakLockDialog(shell, dm);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.viz.gfe.dialogs.CopyGridsDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 27, 2008 Eric Babin Initial Creation
|
* Feb 27, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 23, 2012 1287 rferrel Changes for non-blocking CopyGridsDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -47,9 +48,16 @@ import com.raytheon.viz.gfe.dialogs.CopyGridsDialog;
|
||||||
|
|
||||||
public class ShowCopyGridsDialog extends AbstractHandler {
|
public class ShowCopyGridsDialog extends AbstractHandler {
|
||||||
|
|
||||||
private static IUFStatusHandler statusHandler = UFStatus
|
private IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ShowCopyGridsDialog.class);
|
.getHandler(ShowCopyGridsDialog.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The active dialog. This assumes the dialog is modal. If the dialog is not
|
||||||
|
* modal then the current logic will bring the active dialog back to the top
|
||||||
|
* no matter which option is selected.
|
||||||
|
*/
|
||||||
|
private CopyGridsDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -64,27 +72,32 @@ public class ShowCopyGridsDialog extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
boolean isSelected;
|
boolean isSelected;
|
||||||
String selectedOrAll = event.getParameter("selectedOrAll");
|
String selectedOrAll = event.getParameter("selectedOrAll");
|
||||||
if ("selected".equalsIgnoreCase(selectedOrAll)) {
|
if ("selected".equalsIgnoreCase(selectedOrAll)) {
|
||||||
isSelected = true;
|
isSelected = true;
|
||||||
} else if ("all".equalsIgnoreCase(selectedOrAll)) {
|
} else if ("all".equalsIgnoreCase(selectedOrAll)) {
|
||||||
isSelected = false;
|
isSelected = false;
|
||||||
|
} else {
|
||||||
|
statusHandler
|
||||||
|
.error("Invalid parmeter \""
|
||||||
|
+ selectedOrAll
|
||||||
|
+ "\" in ShowCopyGridsDialog. Value must be \"selected\" or \"all\".");
|
||||||
|
dialog = null;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog = new CopyGridsDialog(shell, dm, isSelected);
|
||||||
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.open();
|
||||||
} else {
|
} else {
|
||||||
statusHandler
|
dialog.bringToTop();
|
||||||
.error("Invalid parmeter \""
|
|
||||||
+ selectedOrAll
|
|
||||||
+ "\" in ShowCopyGridsDialog. Value must be \"selected\" or \"all\".");
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyGridsDialog dialog = new CopyGridsDialog(shell, dm, isSelected);
|
|
||||||
dialog.setBlockOnOpen(true);
|
|
||||||
dialog.open();
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 27, 2008 Eric Babin Initial Creation
|
* Feb 27, 2008 Eric Babin Initial Creation
|
||||||
* 04/18/08 #857 bphillip Implemented interaction with server
|
* 04/18/08 #857 bphillip Implemented interaction with server
|
||||||
|
* Oct 24, 2012 #1287 rferrel Changes for non-blocking CreateFromScratchDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowCreateFromScratchDialog extends AbstractHandler {
|
public class ShowCreateFromScratchDialog extends AbstractHandler {
|
||||||
|
private CreateFromScratchDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -54,12 +56,16 @@ public class ShowCreateFromScratchDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
CreateFromScratchDialog dialog = new CreateFromScratchDialog(shell);
|
dialog = new CreateFromScratchDialog(shell);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineRefSetDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 11, 2008 Eric Babin Initial Creation
|
* Mar 11, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 24, 2012 1287 rferrel Changes for non-blocking DefineRefSetDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -63,11 +64,13 @@ public class ShowDefineRefSetDialog extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dialog == null || dialog.getShell() == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new DefineRefSetDialog(shell, dm);
|
dialog = new DefineRefSetDialog(shell, dm);
|
||||||
dialog.setBlockOnOpen(false);
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
dialog.open();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 15, 2008 Eric Babin Initial Creation
|
* Feb 15, 2008 Eric Babin Initial Creation
|
||||||
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
||||||
|
* Oct 24, 2012 1287 rferrel Changes for non-blocking DefineSamplesViaLatLongDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowDefineSamplesLatLongAction extends AbstractHandler {
|
public class ShowDefineSamplesLatLongAction extends AbstractHandler {
|
||||||
|
private DefineSamplesViaLatLongDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -54,13 +56,16 @@ public class ShowDefineSamplesLatLongAction extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
DefineSamplesViaLatLongDialog dialog = new DefineSamplesViaLatLongDialog(
|
dialog = new DefineSamplesViaLatLongDialog(shell);
|
||||||
shell);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.open();
|
||||||
dialog.open();
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.actions;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
import org.eclipse.core.commands.ExecutionEvent;
|
||||||
|
@ -35,10 +36,9 @@ import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.viz.gfe.Activator;
|
|
||||||
import com.raytheon.viz.gfe.constants.StatusConstants;
|
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action for launching delete samples dialog.
|
* Action for launching delete samples dialog.
|
||||||
|
@ -49,6 +49,7 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 7, 2008 Eric Babin Initial Creation
|
* Mar 7, 2008 Eric Babin Initial Creation
|
||||||
* 22JUL2008 #1275. Eric Babin Remove inadvertent dispose on parent shell.
|
* 22JUL2008 #1275. Eric Babin Remove inadvertent dispose on parent shell.
|
||||||
|
* Oct 24, 2012 #1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -57,7 +58,10 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowDeleteSampleSetDialog extends AbstractHandler {
|
public class ShowDeleteSampleSetDialog extends AbstractHandler {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(ShowDeleteSampleSetDialog.class);
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(ShowDeleteSampleSetDialog.class);
|
||||||
|
|
||||||
|
private SampleSetDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -68,44 +72,65 @@ public class ShowDeleteSampleSetDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
ArrayList<SampleId> sampleIdList = DataManager.getCurrentInstance()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getSampleSetManager().getInventoryAsList();
|
ArrayList<SampleId> sampleIdList = DataManager.getCurrentInstance()
|
||||||
|
.getSampleSetManager().getInventoryAsList();
|
||||||
|
|
||||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(SampleId o1, SampleId o2) {
|
public int compare(SampleId o1, SampleId o2) {
|
||||||
return o1.getName().compareTo(o2.getName());
|
return o1.getName().compareTo(o2.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
|
|
||||||
SampleSetDialog dialog = new SampleSetDialog(shell, sampleIdList,
|
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||||
SampleSetDialog.DELETE);
|
SampleSetDialog.DELETE);
|
||||||
|
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
if (dialog.getReturnCode() != Window.CANCEL
|
|
||||||
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof Integer) {
|
||||||
|
int returnCode = (Integer) returnValue;
|
||||||
|
doDialogClose(returnCode);
|
||||||
|
}
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doDialogClose(int returnCode) {
|
||||||
|
if (returnCode != Window.CANCEL
|
||||||
&& dialog.getSelectedSampleIdIndexes() != null) {
|
&& dialog.getSelectedSampleIdIndexes() != null) {
|
||||||
|
List<SampleId> sampleIdList = dialog.getSamples();
|
||||||
SampleId id = sampleIdList
|
SampleId id = sampleIdList
|
||||||
.get(dialog.getSelectedSampleIdIndexes()[0]);
|
.get(dialog.getSelectedSampleIdIndexes()[0]);
|
||||||
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
if (MessageDialog.openConfirm(shell, "Delete sample set",
|
if (MessageDialog.openConfirm(shell, "Delete sample set",
|
||||||
"Delete selected sample set?")) {
|
"Delete selected sample set?")) {
|
||||||
if (DataManager.getCurrentInstance().getSampleSetManager()
|
if (DataManager.getCurrentInstance().getSampleSetManager()
|
||||||
.deleteSampleSet(id)) {
|
.deleteSampleSet(id)) {
|
||||||
statusHandler.handle(Priority.EVENTA, id.getName()
|
statusHandler.handle(Priority.EVENTA, id.getName()
|
||||||
+ ", Sample set deleted successfully");
|
+ ", Sample set deleted successfully");
|
||||||
} else {
|
} else {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error deleting sample set, " + id.getName());
|
"Error deleting sample set, " + id.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ import com.raytheon.viz.gfe.dialogs.SaveDeleteSelectTRDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 23, 2008 Eric Babin Initial Creation
|
* Jan 23, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 25, 2012 1287 rferrel Changes for non-blocking ShowDeleteSelectionTimeRangeDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,7 +47,7 @@ import com.raytheon.viz.gfe.dialogs.SaveDeleteSelectTRDialog;
|
||||||
|
|
||||||
public class ShowDeleteSelectionTimeRangeDialog extends AbstractHandler {
|
public class ShowDeleteSelectionTimeRangeDialog extends AbstractHandler {
|
||||||
|
|
||||||
protected static final String DEFAULT_MSG = "You have selected delete on a default period. Only the user's entry of this item will be deleted. That is, the item will be reset to the Base default value. Continue?";
|
private SaveDeleteSelectTRDialog dialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -68,42 +69,17 @@ public class ShowDeleteSelectionTimeRangeDialog extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
|
||||||
|
|
||||||
SaveDeleteSelectTRDialog dialog = new SaveDeleteSelectTRDialog(shell,
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
dataManager, "Delete");
|
.getShell();
|
||||||
dialog.setBlockOnOpen(true);
|
|
||||||
dialog.open();
|
dialog = new SaveDeleteSelectTRDialog(shell, dataManager, "Delete");
|
||||||
// String delName = null;
|
dialog.setBlockOnOpen(false);
|
||||||
// if (dialog.getReturnCode() == Window.OK) {
|
dialog.open();
|
||||||
// delName = dialog.getItemToDelete();
|
} else {
|
||||||
// if (selectTRmgr.getRange(delName).getLevel() !=
|
dialog.bringToTop();
|
||||||
// LocalizationLevel.USER) {
|
}
|
||||||
// // Confirm
|
|
||||||
// if (!MessageDialog.openConfirm(shell,
|
|
||||||
// "Default Time Period", DEFAULT_MSG)) {
|
|
||||||
// returnCode = Window.CANCEL;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (returnCode == Window.OK) {
|
|
||||||
// selectTRmgr.remove(delName);
|
|
||||||
// TimeScaleDisplayedPeriodsPreference
|
|
||||||
// .removeTimeScaleDisplayedPeriod(delName);
|
|
||||||
// try {
|
|
||||||
// selectTRmgr.save(LocalizationLevel.USER);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// throw new ExecutionException(
|
|
||||||
// "Error saving SelectTimeRanges", e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// UFStatus.handle(Priority.PROBLEM, Activator.PLUGIN_ID,
|
|
||||||
// StatusConstants.CATEGORY_GFE, null,
|
|
||||||
// "Error loading time ranges");
|
|
||||||
// }
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.EditActionsDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 19, 2007 njensen Initial creation
|
* Feb 19, 2007 njensen Initial creation
|
||||||
* Aug 05, 2010 6112 mpduff One, and only one, dialog open
|
* Aug 05, 2010 6112 mpduff One, and only one, dialog open
|
||||||
|
* Oct 25, 2012 1287 rferrel Changes for non-blocking EditActionsDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -61,11 +62,13 @@ public class ShowEditActionsDialog extends AbstractHandler {
|
||||||
|
|
||||||
// If the dialog doesn't exist, create one, otherwise call its open
|
// If the dialog doesn't exist, create one, otherwise call its open
|
||||||
// method
|
// method
|
||||||
if (dialog == null || dialog.getShell() == null) {
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
dialog = new EditActionsDialog(shell);
|
dialog = new EditActionsDialog(shell);
|
||||||
dialog.setBlockOnOpen(false);
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
dialog.open();
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.core.parm.Parm.InterpState;
|
import com.raytheon.viz.gfe.core.parm.Parm.InterpState;
|
||||||
import com.raytheon.viz.gfe.core.parm.ParmState.InterpMode;
|
import com.raytheon.viz.gfe.core.parm.ParmState.InterpMode;
|
||||||
import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to show Grid Interpolation Dialog and initiate interpolation
|
* Handler to show Grid Interpolation Dialog and initiate interpolation
|
||||||
|
@ -40,6 +41,7 @@ import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||||
* ------------ ---------- -------------- --------------------------
|
* ------------ ---------- -------------- --------------------------
|
||||||
* Feb 27, 2008 Eric Babin Initial Creation
|
* Feb 27, 2008 Eric Babin Initial Creation
|
||||||
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
||||||
|
* Oct 25, 2012 #1287 rferrel Changes for non-blocking GridsInterpolateDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -48,6 +50,7 @@ import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowGridsInterpolationDialog extends AbstractHandler {
|
public class ShowGridsInterpolationDialog extends AbstractHandler {
|
||||||
|
private GridsInterpolateDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -58,20 +61,38 @@ public class ShowGridsInterpolationDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
GridsInterpolateDialog dialog = new GridsInterpolateDialog(shell);
|
dialog = new GridsInterpolateDialog(shell);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
@Override
|
||||||
InterpMode interpMode = dialog.getInterpMode();
|
public void dialogClosed(Object returnValue) {
|
||||||
int interval = dialog.getInterval() * 3600;
|
if (returnValue instanceof Integer) {
|
||||||
int duration = dialog.getDuration() * 3600;
|
int returnCode = (Integer) returnValue;
|
||||||
|
if (returnCode == IDialogConstants.OK_ID) {
|
||||||
|
InterpMode interpMode = dialog.getInterpMode();
|
||||||
|
int interval = dialog.getInterval() * 3600;
|
||||||
|
int duration = dialog.getDuration() * 3600;
|
||||||
|
|
||||||
DataManager.getCurrentInstance().getParmOp().interpolateSelected(
|
DataManager
|
||||||
interpMode, InterpState.ASYNC, interval, duration);
|
.getCurrentInstance()
|
||||||
} // else do nothing...
|
.getParmOp()
|
||||||
|
.interpolateSelected(interpMode,
|
||||||
|
InterpState.ASYNC, interval,
|
||||||
|
duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,14 @@ import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.HiddenWeatherElementDialog;
|
import com.raytheon.viz.gfe.dialogs.HiddenWeatherElementDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description ShowHiddenWeatherElementDialog.java Feb 27, 2008
|
* Action class to dispaly the Hidden Weather Dialog.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 27, 2008 Eric Babin Initial Creation
|
* Feb 27, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 25, 2012 1287 rferrel Changes for non-blocking HiddenWeatherElementDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -45,6 +46,7 @@ import com.raytheon.viz.gfe.dialogs.HiddenWeatherElementDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowHiddenWeatherElementDialog extends AbstractHandler {
|
public class ShowHiddenWeatherElementDialog extends AbstractHandler {
|
||||||
|
private HiddenWeatherElementDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -61,18 +63,24 @@ public class ShowHiddenWeatherElementDialog extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
|
||||||
|
|
||||||
if (dataManager.getParmManager().getUndisplayedParms().length > 0) {
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
HiddenWeatherElementDialog dialog = new HiddenWeatherElementDialog(
|
.getShell();
|
||||||
shell, dataManager);
|
|
||||||
dialog.setBlockOnOpen(true);
|
|
||||||
dialog.open();
|
|
||||||
|
|
||||||
|
if (dataManager.getParmManager().getUndisplayedParms().length > 0) {
|
||||||
|
dialog = new HiddenWeatherElementDialog(shell, dataManager);
|
||||||
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.open();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dialog = null;
|
||||||
|
MessageDialog.openInformation(null,
|
||||||
|
"No Hidden Weather Elements",
|
||||||
|
"No Hidden Weather Elements found.");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
MessageDialog.openInformation(null, "No Hidden Weather Elements",
|
dialog.bringToTop();
|
||||||
"No Hidden Weather Elements found.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.actions;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
import org.eclipse.core.commands.ExecutionEvent;
|
||||||
|
@ -31,10 +32,14 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||||
|
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.viz.gfe.GFEException;
|
import com.raytheon.viz.gfe.GFEException;
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||||
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to launch sampele set dialog.
|
* Action to launch sampele set dialog.
|
||||||
|
@ -45,6 +50,7 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 7, 2008 Eric Babin Initial Creation
|
* Mar 7, 2008 Eric Babin Initial Creation
|
||||||
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
||||||
|
* Oct 24, 2012 1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -53,14 +59,12 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowLoadSampleSetDialog extends AbstractHandler {
|
public class ShowLoadSampleSetDialog extends AbstractHandler {
|
||||||
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(ShowLoadSampleSetDialog.class);
|
||||||
|
|
||||||
// SampleRenderable sample;
|
private SampleSetDialog dialog;
|
||||||
|
|
||||||
// public ShowLoadSampleSetDialog() {
|
private DataManager dm;
|
||||||
//
|
|
||||||
// super();
|
|
||||||
// this.sample = new SampleRenderable();
|
|
||||||
// }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -71,96 +75,81 @@ public class ShowLoadSampleSetDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
DataManager dm = DataManager.getCurrentInstance();
|
dm = DataManager.getCurrentInstance();
|
||||||
if (dm == null) {
|
if (dm == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
|
||||||
.getShell();
|
|
||||||
|
|
||||||
ArrayList<SampleId> sampleIdList = dm.getSampleSetManager()
|
|
||||||
.getInventoryAsList();
|
|
||||||
|
|
||||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compare(SampleId o1, SampleId o2) {
|
|
||||||
return o1.getName().compareTo(o2.getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
SampleSetDialog dialog = new SampleSetDialog(shell, sampleIdList,
|
ArrayList<SampleId> sampleIdList = dm.getSampleSetManager()
|
||||||
SampleSetDialog.LOAD);
|
.getInventoryAsList();
|
||||||
|
|
||||||
dialog.setBlockOnOpen(true);
|
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||||
dialog.open();
|
|
||||||
if (dialog.getReturnCode() != Window.CANCEL
|
@Override
|
||||||
&& dialog.getSelectedSampleIdIndexes() != null) {
|
public int compare(SampleId o1, SampleId o2) {
|
||||||
if (dialog.getReturnCode() == SampleSetDialog.OK) {
|
return o1.getName().compareTo(o2.getName());
|
||||||
if (dialog.getType() == SampleSetDialog.LOAD) {
|
|
||||||
for (int i = 0; i < dialog.getSelectedSampleIdIndexes().length; i++) {
|
|
||||||
SampleId id = sampleIdList.get(dialog
|
|
||||||
.getSelectedSampleIdIndexes()[i]);
|
|
||||||
try {
|
|
||||||
dm.getSampleSetManager().loadSampleSet(id,
|
|
||||||
ISampleSetManager.SampleSetLoadMode.ADD);
|
|
||||||
} catch (GFEException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (dialog.getType() == SampleSetDialog.SAVE) {
|
|
||||||
dm.getSampleSetManager().saveActiveSampleSet(
|
|
||||||
new SampleId(dialog.getSampleName()));
|
|
||||||
}
|
|
||||||
if (dialog.getType() == SampleSetDialog.DELETE) {
|
|
||||||
for (int i = 0; i < dialog.getSelectedSampleIdIndexes().length; i++) {
|
|
||||||
SampleId id = sampleIdList.get(dialog
|
|
||||||
.getSelectedSampleIdIndexes()[i]);
|
|
||||||
dm.getSampleSetManager().deleteSampleSet(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (dialog.getReturnCode() == SampleSetDialog.REMOVE) {
|
|
||||||
for (int i = 0; i < dialog.getSelectedSampleIdIndexes().length; i++) {
|
|
||||||
SampleId id = sampleIdList.get(dialog
|
|
||||||
.getSelectedSampleIdIndexes()[i]);
|
|
||||||
try {
|
|
||||||
dm.getSampleSetManager().loadSampleSet(id,
|
|
||||||
ISampleSetManager.SampleSetLoadMode.REMOVE);
|
|
||||||
} catch (GFEException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (dialog.getReturnCode() == SampleSetDialog.REPLACE) {
|
});
|
||||||
for (int i = 0; i < dialog.getSelectedSampleIdIndexes().length; i++) {
|
|
||||||
SampleId id = sampleIdList.get(dialog
|
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||||
.getSelectedSampleIdIndexes()[i]);
|
SampleSetDialog.LOAD);
|
||||||
try {
|
|
||||||
dm.getSampleSetManager().loadSampleSet(id,
|
dialog.setBlockOnOpen(false);
|
||||||
ISampleSetManager.SampleSetLoadMode.REPLACE);
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
} catch (GFEException e) {
|
|
||||||
e.printStackTrace();
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof Integer) {
|
||||||
|
int returnCode = (Integer) returnValue;
|
||||||
|
doDialogClosed(returnCode);
|
||||||
}
|
}
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
// refresh();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
private void doDialogClosed(int returnCode) {
|
||||||
* (non-Javadoc)
|
if (returnCode != Window.CANCEL
|
||||||
*
|
&& dialog.getSelectedSampleIdIndexes() != null) {
|
||||||
* @see com.raytheon.viz.ui.tools.AbstractTool#refresh()
|
List<SampleId> sampleIdList = dialog.getSamples();
|
||||||
*/
|
ISampleSetManager.SampleSetLoadMode mode = null;
|
||||||
// @Override
|
switch (returnCode) {
|
||||||
// protected void refresh() {
|
case SampleSetDialog.OK:
|
||||||
// IEditorPart part = VizApp.getCurrentEditor();
|
mode = ISampleSetManager.SampleSetLoadMode.ADD;
|
||||||
// if (part instanceof AbstractEditor) {
|
break;
|
||||||
// ((AbstractEditor) part).refresh();
|
case SampleSetDialog.REMOVE:
|
||||||
// }
|
mode = ISampleSetManager.SampleSetLoadMode.REMOVE;
|
||||||
// }
|
break;
|
||||||
|
case SampleSetDialog.REPLACE:
|
||||||
|
mode = ISampleSetManager.SampleSetLoadMode.REPLACE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Load unknow return code: " + returnCode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int index : dialog.getSelectedSampleIdIndexes()) {
|
||||||
|
SampleId id = sampleIdList.get(index);
|
||||||
|
try {
|
||||||
|
dm.getSampleSetManager().loadSampleSet(id, mode);
|
||||||
|
} catch (GFEException e) {
|
||||||
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
"Load failed for mode: " + mode.toString()
|
||||||
|
+ ", sample id: " + id.toString(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.viz.gfe.dialogs.ProcessMonitorDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 7, 2008 Eric Babin Initial Creation
|
* Mar 7, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 25, 2012 1287 rferrel Change for non-blocking ProcessMonitorDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -43,6 +44,7 @@ import com.raytheon.viz.gfe.dialogs.ProcessMonitorDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowProcessMonitorDialog extends AbstractHandler {
|
public class ShowProcessMonitorDialog extends AbstractHandler {
|
||||||
|
private ProcessMonitorDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -53,13 +55,16 @@ public class ShowProcessMonitorDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
ProcessMonitorDialog dialog = new ProcessMonitorDialog(shell);
|
dialog = new ProcessMonitorDialog(shell);
|
||||||
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.setBlockOnOpen(false);
|
dialog.open();
|
||||||
dialog.open();
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 6, 2008 Eric Babin Initial Creation
|
* Mar 6, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 25, 2012 12878 rferrel Changes for non-blocking ProductScriptsDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowProductScriptsDialog extends AbstractHandler {
|
public class ShowProductScriptsDialog extends AbstractHandler {
|
||||||
|
private ProductScriptsDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -59,12 +61,16 @@ public class ShowProductScriptsDialog extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
ProductScriptsDialog dialog = new ProductScriptsDialog(shell, dm);
|
dialog = new ProductScriptsDialog(shell, dm);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 6, 2008 Eric Babin Initial Creation
|
* Mar 6, 2008 Eric Babin Initial Creation
|
||||||
|
* Oct 25, 2012 1287 rferrel Changes for non-blocking PublishDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowPublishDialog extends AbstractHandler {
|
public class ShowPublishDialog extends AbstractHandler {
|
||||||
|
private PublishDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -54,14 +56,21 @@ public class ShowPublishDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
|
||||||
.getShell();
|
|
||||||
|
|
||||||
DataManager dm = DataManager.getCurrentInstance();
|
DataManager dm = DataManager.getCurrentInstance();
|
||||||
if (dm != null) {
|
|
||||||
|
if (dm == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
|
.getShell();
|
||||||
|
|
||||||
PublishDialog dialog = new PublishDialog(shell, dm);
|
PublishDialog dialog = new PublishDialog(shell, dm);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -80,8 +89,8 @@ public class ShowPublishDialog extends AbstractHandler {
|
||||||
|
|
||||||
DataManager dm = DataManager.getCurrentInstance();
|
DataManager dm = DataManager.getCurrentInstance();
|
||||||
if (dm != null) {
|
if (dm != null) {
|
||||||
return !dm.getParmManager().getMutableDatabase().equals(
|
return !dm.getParmManager().getMutableDatabase()
|
||||||
dm.getParmManager().getProductDB());
|
.equals(dm.getParmManager().getProductDB());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue