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>
|
||||
<max-memory>
|
||||
<value>2048M</value>
|
||||
<value>3072M</value>
|
||||
</max-memory>
|
||||
|
||||
<max-perm>
|
||||
|
|
|
@ -76,7 +76,10 @@
|
|||
# Status: TEST
|
||||
# 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 Avn, AvnLib, AvnParser, TafDecoder
|
||||
|
||||
|
@ -104,7 +107,8 @@ def updateTafs(bbb, fcsts):
|
|||
|
||||
AvnLib.adjustTimes(bbb, taf)
|
||||
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)
|
||||
lines = AvnLib.makeTafFromPeriods(ident, bbb, taf['group'],
|
||||
tafDuration=tafDuration,
|
||||
|
|
|
@ -1411,9 +1411,12 @@ class FWS_Overrides:
|
|||
|
||||
for element, defaultFlag in self._weInfoHiddenList():
|
||||
if defaultFlag:
|
||||
self._periodElementDict["Today"].append(element)
|
||||
self._periodElementDict["Tonight"].append(element)
|
||||
self._periodElementDict["Tomorrow"].append(element)
|
||||
if len(self._periodElementDict["Today"]) != 0:
|
||||
self._periodElementDict["Today"].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["Tonight"].append(element)
|
||||
self._periodAllElementDict["Tomorrow"].append(element)
|
||||
|
|
|
@ -292,8 +292,9 @@ public class DbMapResource extends
|
|||
}
|
||||
QueryResult mappedResult = DbMapQueryFactory.getMapQuery(
|
||||
resourceData.getTable(),
|
||||
resourceData.getGeomField()).queryWithinEnvelope(
|
||||
req.envelope, fields, constraints);
|
||||
getGeomField(levels[levels.length - 1]))
|
||||
.queryWithinEnvelope(req.envelope, fields,
|
||||
constraints);
|
||||
Map<Integer, Geometry> gidMap = new HashMap<Integer, Geometry>(
|
||||
mappedResult.getResultCount() * 2);
|
||||
List<Integer> toRequest = new ArrayList<Integer>(
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
<property name="socketTimeout" value="330000"/>
|
||||
<property name="connectionTimeout" value="10000"/>
|
||||
<property name="maxConnectionsPerHost" value="10"/>
|
||||
<property name="compressRequests" value="false"/>
|
||||
<property name="gzipResponseHandling" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="baosPool" class="com.raytheon.uf.common.util.ByteArrayOutputStreamPool" factory-method="getInstance">
|
||||
|
|
|
@ -19,22 +19,11 @@
|
|||
**/
|
||||
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.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.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -64,52 +53,7 @@ public class DataCubeAlertMessageParser extends AbstractAlertMessageParser {
|
|||
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);
|
||||
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;
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Interface for methods needed for handling alter bundles.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -31,6 +31,7 @@ import java.util.Map;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 4, 2010 mschenke Initial creation
|
||||
* Aug 8, 2012 875 rferrel Add separators for menu support.
|
||||
* Oct 3, 2012 1248 rferrel Added bundle change listeners.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,4 +86,34 @@ public interface IAlterBundleContributor {
|
|||
*/
|
||||
public void alterBundle(Bundle bundleToAlter, String alterKey,
|
||||
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;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
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.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.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
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 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 */
|
||||
@XmlJavaTypeAdapter(value = RequestableMetadataMarshaller.class)
|
||||
protected HashMap<String, RequestConstraint> metadataMap;
|
||||
|
@ -246,21 +275,52 @@ public abstract class AbstractRequestableResourceData extends
|
|||
Validate.isTrue(updateData instanceof Object[],
|
||||
"Update expected Object[]");
|
||||
|
||||
if (updateData instanceof PluginDataObject[]) {
|
||||
for (PluginDataObject pdo : (PluginDataObject[]) updateData) {
|
||||
DataTime time = pdo.getDataTime();
|
||||
if (binOffset != null) {
|
||||
time = binOffset.getNormalizedTime(time);
|
||||
this.fireChangeListeners(ChangeType.DATA_UPDATE, updateData);
|
||||
}
|
||||
|
||||
public void update(AlertMessage... messages) {
|
||||
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) {
|
||||
if (!cachedAvailableTimes.contains(time)) {
|
||||
cachedAvailableTimes.add(time);
|
||||
Object timeObj = null;
|
||||
// do not try to maintain the time cache if the alert does not
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
this.fireChangeListeners(ChangeType.DATA_UPDATE, updateData);
|
||||
if (!consistentCache) {
|
||||
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
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 13, 2007 chammack Initial Creation.
|
||||
* Oct 16, 2012 1229 rferrel Change to use ProcedureDlg.displayDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,10 +58,8 @@ public class AddAWIPSProcedure extends AbstractHandler {
|
|||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
Procedure procedure = new Procedure();
|
||||
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(null, procedure,
|
||||
ProcedureDlg.displayDialog(null, procedure,
|
||||
HandlerUtil.getActiveShell(event));
|
||||
dlg.open();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,13 @@ import org.eclipse.core.commands.ExecutionException;
|
|||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
|
||||
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.Mode;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* DeleteAWIPSProcedure
|
||||
|
@ -41,6 +46,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg.Mode;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 13, 2007 chammack Initial Creation.
|
||||
* Jul 8, 2008 #1183 chammack Migrate to new localization
|
||||
* Oct 16, 2012 #1229 rferrel Changes for non-blocking ProcedureListDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,6 +54,10 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureListDlg.Mode;
|
|||
* @version 1
|
||||
*/
|
||||
public class DeleteAWIPSProcedure extends AbstractHandler {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DeleteAWIPSProcedure.class);
|
||||
|
||||
private ProcedureListDlg listDlg;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -58,18 +68,30 @@ public class DeleteAWIPSProcedure extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
ProcedureListDlg listDlg = new ProcedureListDlg("Delete Procedure",
|
||||
HandlerUtil.getActiveShell(event), Mode.DELETE);
|
||||
listDlg.open();
|
||||
if (listDlg == null || listDlg.getShell() == null
|
||||
|| listDlg.isDisposed()) {
|
||||
listDlg = new ProcedureListDlg("Delete Procedure",
|
||||
HandlerUtil.getActiveShell(event), Mode.DELETE);
|
||||
listDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
LocalizationFile selectedFile = listDlg.getSelectedFile();
|
||||
if (selectedFile != null && selectedFile.exists()) {
|
||||
try {
|
||||
selectedFile.delete();
|
||||
} catch (Exception e) {
|
||||
throw new ExecutionException("Error deleting procedure: "
|
||||
+ selectedFile.getName(), e);
|
||||
}
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
LocalizationFile selectedFile = (LocalizationFile) returnValue;
|
||||
try {
|
||||
selectedFile.delete();
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
statusHandler.handle(
|
||||
Priority.PROBLEM,
|
||||
"Error deleting procedure: "
|
||||
+ selectedFile.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
listDlg.open();
|
||||
} else {
|
||||
listDlg.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.tools.AbstractTool;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 bgonzale Initial creation
|
||||
* Oct 15, 2012 1229 rferrel Changes for non-blocking DisplayPropertiesDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,13 +58,12 @@ public class DisplayPropertiesAction extends AbstractTool {
|
|||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
super.execute(arg0);
|
||||
|
||||
if (dialog == null) {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new DisplayPropertiesDialog(VizWorkbenchManager
|
||||
.getInstance().getCurrentWindow().getShell());
|
||||
dialog.open();
|
||||
dialog = null;
|
||||
} else {
|
||||
dialog.open();
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -24,8 +24,6 @@ import java.io.File;
|
|||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
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 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.d2d.ui.dialogs.procedures.OpenProcedureListDlg;
|
||||
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.actions.LoadSerializedXml;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* OpenAWIPSProcedure
|
||||
|
@ -47,6 +45,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 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>
|
||||
*
|
||||
|
@ -55,8 +55,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
|||
*/
|
||||
public class OpenAWIPSProcedure extends AbstractHandler {
|
||||
|
||||
private OpenProcedureListDlg dialog;
|
||||
|
||||
private OpenProcedureListDlg dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -66,25 +66,28 @@ public class OpenAWIPSProcedure extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
if(dialog != null){
|
||||
dialog.open();
|
||||
return null;
|
||||
}
|
||||
|
||||
dialog = new OpenProcedureListDlg(
|
||||
HandlerUtil.getActiveShell(event));
|
||||
dialog.open();
|
||||
|
||||
LocalizationFile selectedFile = dialog.getSelectedFile();
|
||||
dialog = null;
|
||||
if (selectedFile != null) {
|
||||
File f = selectedFile.getFile();
|
||||
Procedure p = (Procedure) LoadSerializedXml.deserialize(f);
|
||||
ProcedureDlg dlg = ProcedureDlg.getOrCreateDialog(
|
||||
LocalizationUtil.extractName(selectedFile.getName()), p,
|
||||
VizWorkbenchManager.getInstance().getCurrentWindow()
|
||||
.getShell());
|
||||
dlg.open();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new OpenProcedureListDlg(HandlerUtil.getActiveShell(event));
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
LocalizationFile selectedFile = (LocalizationFile) returnValue;
|
||||
File f = selectedFile.getFile();
|
||||
Procedure p = (Procedure) LoadSerializedXml
|
||||
.deserialize(f);
|
||||
ProcedureDlg.displayDialog(LocalizationUtil
|
||||
.extractName(selectedFile.getName()), p,
|
||||
VizWorkbenchManager.getInstance()
|
||||
.getCurrentWindow().getShell());
|
||||
}
|
||||
dialog = null;
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.HistoryListDlg;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 13, 2007 chammack Initial Creation.
|
||||
* Oct 16, 2012 1229 rferrel Changes for non-blocking HistoryListDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,6 +47,8 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.HistoryListDlg;
|
|||
*/
|
||||
public class ShowHistoryList extends AbstractHandler {
|
||||
|
||||
private HistoryListDlg dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -55,9 +58,12 @@ public class ShowHistoryList extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
HistoryListDlg dlg = new HistoryListDlg(
|
||||
HandlerUtil.getActiveShell(event));
|
||||
dlg.open();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new HistoryListDlg(HandlerUtil.getActiveShell(event));
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.PrintDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2011 bkowal Initial creation
|
||||
* Oct 15, 2012 1229 rferrel Changes to work with non-blocking PrintDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.PrintDialog;
|
|||
*/
|
||||
|
||||
public class ShowPrintDialog extends AbstractHandler {
|
||||
PrintDialog printDialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -54,9 +56,13 @@ public class ShowPrintDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
PrintDialog printDialog = new PrintDialog(
|
||||
HandlerUtil.getActiveShell(event));
|
||||
printDialog.open();
|
||||
if (printDialog == null || printDialog.getShell() == null
|
||||
|| printDialog.isDisposed()) {
|
||||
printDialog = new PrintDialog(HandlerUtil.getActiveShell(event));
|
||||
printDialog.open();
|
||||
} else {
|
||||
printDialog.bringToTop();
|
||||
}
|
||||
|
||||
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.capabilities.AbstractCapability;
|
||||
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.MapScale;
|
||||
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.MagnificationPopulator;
|
||||
import com.raytheon.uf.viz.d2d.ui.actions.DensityHandler;
|
||||
|
@ -78,6 +76,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 bgonzale Initial creation
|
||||
* Oct 16, 2012 1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -86,7 +85,8 @@ import com.raytheon.viz.ui.dialogs.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;
|
||||
|
||||
|
@ -171,7 +171,8 @@ public class DisplayPropertiesDialog extends CaveSWTDialog {
|
|||
* @param editor
|
||||
*/
|
||||
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");
|
||||
|
||||
this.sHandler = new ScaleHandler();
|
||||
|
|
|
@ -52,7 +52,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.ColorData;
|
|||
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>
|
||||
*
|
||||
|
@ -60,6 +60,8 @@ import com.raytheon.viz.ui.dialogs.colordialog.IColorBarAction;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 13, 2010 mschenke Initial creation
|
||||
* Oct 16, 2012 1229 rferrel Updated to use bringToTop to
|
||||
* activate existing dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -92,18 +94,36 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
|
|||
|
||||
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,
|
||||
AbstractVizResource<?, ?> resource, ResourceProperties rscProps,
|
||||
D2DMapRenderableDisplay[] displays) {
|
||||
ImageBlinkDialog dlg = dialogMap.get(resource);
|
||||
if (dlg == null) {
|
||||
if (dlg == null || dlg.getShell() == null || dlg.isDisposed()) {
|
||||
dlg = new ImageBlinkDialog(new Shell(Display.getCurrent()), rates,
|
||||
currRate, resource, rscProps, displays);
|
||||
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(
|
||||
AbstractVizResource<?, ?> resource) {
|
||||
dialogMap.remove(resource);
|
||||
|
@ -146,10 +166,8 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
|
|||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
removeDialog(resource);
|
||||
resource
|
||||
.unregisterListener((IDisposeListener) ImageBlinkDialog.this);
|
||||
resource
|
||||
.unregisterListener((IPaintListener) ImageBlinkDialog.this);
|
||||
resource.unregisterListener((IDisposeListener) ImageBlinkDialog.this);
|
||||
resource.unregisterListener((IPaintListener) ImageBlinkDialog.this);
|
||||
}
|
||||
});
|
||||
Composite mainComp = new Composite(shell, SWT.NONE);
|
||||
|
@ -186,9 +204,8 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
|
|||
|
||||
cbo.add(BlinkToggleAction.NO_BLINK);
|
||||
|
||||
cbo
|
||||
.setText(rate == BlinkToggleAction.NO_BLINK_VALUE ? BlinkToggleAction.NO_BLINK
|
||||
: "" + rate);
|
||||
cbo.setText(rate == BlinkToggleAction.NO_BLINK_VALUE ? BlinkToggleAction.NO_BLINK
|
||||
: "" + rate);
|
||||
|
||||
cbo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
|
|
@ -98,6 +98,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* AWIPS2 DR Work
|
||||
* 08/15/2012 1053 jkorman Added capability to save/restore user
|
||||
* print settings.
|
||||
* 10/12/2012 1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -107,10 +108,11 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
|
||||
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 final String SETTINGS_FILENAME = "printSettings";
|
||||
|
||||
private static final String SETTINGS_FILENAME = "printSettings";
|
||||
|
||||
private ArrayList<PrinterData> printerDataStore = null;
|
||||
|
||||
private PrinterData printToFileData = null;
|
||||
|
@ -130,13 +132,12 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
private Button colorRadioButton = null;
|
||||
|
||||
private Button grayscaleRadioButton = null;
|
||||
|
||||
|
||||
/* Orientation */
|
||||
private Button landscapeRadioButton = null;
|
||||
|
||||
private Button portraitRadioButton = null;
|
||||
|
||||
|
||||
/* Remaining Settings */
|
||||
private Spinner scaleSpinner = null;
|
||||
|
||||
|
@ -189,7 +190,7 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
public PrintDialog(Shell shell) {
|
||||
super(shell, SWT.DIALOG_TRIM);
|
||||
super(shell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
this.setText("Print");
|
||||
}
|
||||
|
||||
|
@ -315,7 +316,7 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
button.setText("Color");
|
||||
button.setSelection(true);
|
||||
colorRadioButton = button;
|
||||
|
||||
|
||||
button = new Button(group, SWT.RADIO);
|
||||
button.setText("Grayscale");
|
||||
this.grayscaleRadioButton = button;
|
||||
|
@ -329,7 +330,7 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
button.setText("Portrait");
|
||||
button.setSelection(true);
|
||||
portraitRadioButton = button;
|
||||
|
||||
|
||||
button = new Button(group, SWT.RADIO);
|
||||
button.setText("Landscape");
|
||||
this.landscapeRadioButton = button;
|
||||
|
@ -502,20 +503,20 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
private void selectDestinationFile(String fileName) {
|
||||
|
||||
|
||||
FileDialog fileDialog = new FileDialog(this.shell, SWT.SAVE);
|
||||
|
||||
if(fileName != null) {
|
||||
|
||||
if (fileName != null) {
|
||||
int n = fileName.lastIndexOf(File.separator);
|
||||
String path = null;
|
||||
if(n > 0) {
|
||||
path = fileName.substring(0,n);
|
||||
fileName = fileName.substring(n+1);
|
||||
if (n > 0) {
|
||||
path = fileName.substring(0, n);
|
||||
fileName = fileName.substring(n + 1);
|
||||
}
|
||||
fileDialog.setFileName(fileName);
|
||||
fileDialog.setFilterPath(path);
|
||||
}
|
||||
|
||||
|
||||
fileDialog.open();
|
||||
|
||||
String filterPath = fileDialog.getFilterPath();
|
||||
|
@ -710,8 +711,8 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
if (printerSettings.invert) {
|
||||
// Only invert gray pixels, not colored pixels, awt doesn't not have a
|
||||
// good filter for this.
|
||||
// Only invert gray pixels, not colored pixels, awt doesn't not have
|
||||
// a good filter for this.
|
||||
for (int x = 0; x < bi.getWidth(); x += 1) {
|
||||
for (int y = 0; y < bi.getHeight(); y += 1) {
|
||||
Color color = new Color(bi.getRGB(x, y));
|
||||
|
@ -721,7 +722,7 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
255 - color.getGreen(), 255 - color.getBlue());
|
||||
bi.setRGB(x, y, color.getRGB());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -887,15 +888,16 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
|
||||
settings.setInvertBlackWhite(invertCheckbox.getSelection());
|
||||
settings.setPrintGrayScale(grayscaleRadioButton.getSelection());
|
||||
settings.setOrientation(PRINT_ORIENTATION.getPrintOrientation(landscapeRadioButton.getSelection()));
|
||||
settings.setOrientation(PRINT_ORIENTATION
|
||||
.getPrintOrientation(landscapeRadioButton.getSelection()));
|
||||
|
||||
settings.setCopies(copiesSpinner.getSelection());
|
||||
settings.setScale(scaleSpinner.getSelection());
|
||||
|
||||
|
||||
settings.setDensity(densityCombo.getSelectionIndex());
|
||||
settings.setMag(magnificationCombo.getSelectionIndex());
|
||||
|
||||
if(printerRadioButton.getSelection()) {
|
||||
|
||||
if (printerRadioButton.getSelection()) {
|
||||
int idx = selectedPrinterCombo.getSelectionIndex();
|
||||
settings.setPrinterUsed(selectedPrinterCombo.getItem(idx));
|
||||
settings.setUsePrinterFile(false);
|
||||
|
@ -905,9 +907,10 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
LocalizationContext ctx = initUserLocalization();
|
||||
|
||||
|
||||
// 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;
|
||||
try {
|
||||
strm = f.openOutputStream();
|
||||
|
@ -917,11 +920,12 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
} catch (Exception e) {
|
||||
statusHandler.error("Could not save user print settings", e);
|
||||
} finally {
|
||||
if(f != null) {
|
||||
if (f != null) {
|
||||
try {
|
||||
strm.close();
|
||||
} catch(IOException ioe) {
|
||||
statusHandler.error("Could not close user print settings", ioe);
|
||||
} catch (IOException ioe) {
|
||||
statusHandler.error("Could not close user print settings",
|
||||
ioe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -933,71 +937,79 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
private void readFromConfig() {
|
||||
|
||||
LocalizationContext ctx = initUserLocalization();
|
||||
|
||||
|
||||
// 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(f.exists()) {
|
||||
if (f.exists()) {
|
||||
UserPrintSettings settings = null;
|
||||
try {
|
||||
|
||||
settings = (UserPrintSettings) JAXB.unmarshal(f.openInputStream(),UserPrintSettings.class);
|
||||
|
||||
settings = (UserPrintSettings) JAXB.unmarshal(
|
||||
f.openInputStream(), UserPrintSettings.class);
|
||||
|
||||
} 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());
|
||||
grayscaleRadioButton.setSelection(settings.isPrintGrayScale());
|
||||
colorRadioButton.setSelection(!grayscaleRadioButton.getSelection());
|
||||
colorRadioButton.setSelection(!grayscaleRadioButton
|
||||
.getSelection());
|
||||
|
||||
landscapeRadioButton.setSelection(settings.getOrientation()
|
||||
.isPrintLandscape());
|
||||
portraitRadioButton.setSelection(!landscapeRadioButton
|
||||
.getSelection());
|
||||
|
||||
landscapeRadioButton.setSelection(settings.getOrientation().isPrintLandscape());
|
||||
portraitRadioButton.setSelection(!landscapeRadioButton.getSelection());
|
||||
|
||||
Integer n = settings.getCopies();
|
||||
if(n != null) {
|
||||
if(n >= copiesSpinner.getMinimum() && n <= copiesSpinner.getMaximum()) {
|
||||
if (n != null) {
|
||||
if (n >= copiesSpinner.getMinimum()
|
||||
&& n <= copiesSpinner.getMaximum()) {
|
||||
copiesSpinner.setSelection(n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
n = settings.getScale();
|
||||
if(n != null) {
|
||||
if(n >= scaleSpinner.getMinimum() && n <= scaleSpinner.getMaximum()) {
|
||||
if (n != null) {
|
||||
if (n >= scaleSpinner.getMinimum()
|
||||
&& n <= scaleSpinner.getMaximum()) {
|
||||
scaleSpinner.setSelection(settings.getScale());
|
||||
}
|
||||
}
|
||||
n = settings.getDensity();
|
||||
if(n != null) {
|
||||
if((n >= 0) && (n < densityCombo.getItemCount())) {
|
||||
if (n != null) {
|
||||
if ((n >= 0) && (n < densityCombo.getItemCount())) {
|
||||
densityCombo.select(n);
|
||||
}
|
||||
}
|
||||
n = settings.getMag();
|
||||
if(n != null) {
|
||||
if((n >= 0) && (n < magnificationCombo.getItemCount())) {
|
||||
if (n != null) {
|
||||
if ((n >= 0) && (n < magnificationCombo.getItemCount())) {
|
||||
magnificationCombo.select(n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String s = settings.getPrinterFile();
|
||||
if(s != null) {
|
||||
if (s != null) {
|
||||
destinationFileText.setText(s);
|
||||
destinationFileText.setToolTipText(s);
|
||||
destinationFileText.setEnabled(true);
|
||||
browseButton.setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
s = settings.getPrinterUsed();
|
||||
if(s != null) {
|
||||
if (s != null) {
|
||||
int idx = -1;
|
||||
for(int i = 0;i < selectedPrinterCombo.getItemCount(); i++) {
|
||||
if(s.equals(selectedPrinterCombo.getItem(i))) {
|
||||
for (int i = 0; i < selectedPrinterCombo.getItemCount(); i++) {
|
||||
if (s.equals(selectedPrinterCombo.getItem(i))) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(idx > -1) {
|
||||
if (idx > -1) {
|
||||
selectedPrinterCombo.select(idx);
|
||||
}
|
||||
}
|
||||
|
@ -1006,9 +1018,7 @@ public class PrintDialog extends CaveSWTDialog {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.UFStatus;
|
||||
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.Bundle;
|
||||
import com.raytheon.uf.viz.core.procedures.IAlterBundleChangeListener;
|
||||
import com.raytheon.uf.viz.core.procedures.IAlterBundleContributor;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.widgets.MenuButton;
|
||||
|
||||
/**
|
||||
* Dialog for selecting an alternate bundle.
|
||||
* Dialog for altering a bundle.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -63,6 +66,8 @@ import com.raytheon.viz.ui.widgets.MenuButton;
|
|||
* trying to perform a load.
|
||||
* Jul 31, 2012 #875 rferrel Use MenuButton to organize entries
|
||||
* in menus.
|
||||
* Oct 03, 2012 #1248 rferrel Bundle change listeners added.
|
||||
* Oct 16, 2012 #1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -70,16 +75,16 @@ import com.raytheon.viz.ui.widgets.MenuButton;
|
|||
* @version 1.0
|
||||
*/
|
||||
public class AlterBundleDlg extends CaveSWTDialog {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.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 {
|
||||
|
||||
|
@ -101,11 +106,17 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
|
||||
private Bundle bundle;
|
||||
|
||||
private Map<IAlterBundleContributor, IAlterBundleChangeListener> contribListenerMap;
|
||||
|
||||
private Map<String, MenuButton> menuButtonMap;
|
||||
|
||||
protected AlterBundleDlg(Bundle bundle, Shell parentShell) {
|
||||
super(parentShell);
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("Alter Bundle on Loading");
|
||||
|
||||
this.bundle = bundle;
|
||||
this.contribListenerMap = new HashMap<IAlterBundleContributor, IAlterBundleChangeListener>();
|
||||
this.menuButtonMap = new HashMap<String, MenuButton>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,6 +147,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
Map<String, String[]> alterables = contrib.getAlterables();
|
||||
final List<AlterBundleEntry> contribEntries = new ArrayList<AlterBundleEntry>(
|
||||
alterables.size());
|
||||
contrib.listenerSetup();
|
||||
// Create Enable button
|
||||
final Button enabledBtn = new Button(comp, SWT.CHECK);
|
||||
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;
|
||||
for (Entry<String, String[]> entry : alterables.entrySet()) {
|
||||
if (i != 0) {
|
||||
new Label(comp, SWT.NONE);
|
||||
}
|
||||
Label label = new Label(comp, SWT.CENTER);
|
||||
label.setText(entry.getKey() + " = ");
|
||||
String key = entry.getKey();
|
||||
label.setText(key + " = ");
|
||||
|
||||
final AlterBundleEntry abe = new AlterBundleEntry();
|
||||
abe.contributor = contrib;
|
||||
|
@ -191,9 +214,11 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
menuButton.setLayoutData(gd);
|
||||
menuButton.addSelectionListener(listener);
|
||||
Menu menu = new Menu(menuButton);
|
||||
MenuItem topMi = createMenu(menu, entry);
|
||||
MenuItem topMi = createMenu(menu, entry.getValue());
|
||||
menuButton.setMenu(menu);
|
||||
menuButton.setSelectedItem(topMi);
|
||||
menuButton.setData(contrib);
|
||||
menuButtonMap.put(key, menuButton);
|
||||
|
||||
++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>();
|
||||
|
||||
menuMap.put(Top_MENU_KEY, topMenu);
|
||||
|
@ -210,7 +235,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
MenuItem mi = null;
|
||||
MenuItem topMi = null;
|
||||
|
||||
for (String value : entry.getValue()) {
|
||||
for (String value : values) {
|
||||
if (value.startsWith(MENU_SEP)) {
|
||||
value = value.substring(MENU_SEP_LEN);
|
||||
}
|
||||
|
@ -331,8 +356,36 @@ public class AlterBundleDlg extends CaveSWTDialog {
|
|||
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() {
|
||||
bundle = null;
|
||||
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.SaveBundle;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
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 {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(HistoryListDlg.class);
|
||||
|
||||
private List dataList;
|
||||
|
@ -72,8 +91,10 @@ public class HistoryListDlg extends CaveSWTDialog {
|
|||
|
||||
private Button closeBtn;
|
||||
|
||||
private AlterBundleDlg alterDlg;
|
||||
|
||||
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");
|
||||
|
||||
try {
|
||||
|
@ -273,7 +294,7 @@ public class HistoryListDlg extends CaveSWTDialog {
|
|||
closeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
shell.dispose();
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -284,14 +305,24 @@ public class HistoryListDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
try {
|
||||
Bundle b = HistoryList.getInstance().getBundle(
|
||||
dataList.getSelectionIndex(), false);
|
||||
AlterBundleDlg dlg = new AlterBundleDlg(b, getParent());
|
||||
b = (Bundle) dlg.open();
|
||||
if (mustCreate(alterDlg)) {
|
||||
Bundle b = HistoryList.getInstance().getBundle(
|
||||
dataList.getSelectionIndex(), false);
|
||||
alterDlg = new AlterBundleDlg(b, getShell());
|
||||
alterDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
if (b != null) {
|
||||
// Load was issued in alterBundleDlg
|
||||
loadAlterBundle(b);
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof Bundle) {
|
||||
// Load was issued in alterBundleDlg
|
||||
Bundle b = (Bundle) returnValue;
|
||||
loadAlterBundle(b);
|
||||
}
|
||||
}
|
||||
});
|
||||
alterDlg.open();
|
||||
} else {
|
||||
alterDlg.bringToTop();
|
||||
}
|
||||
} catch (VizException e) {
|
||||
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.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
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.actions.SaveBundle;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
|
||||
/**
|
||||
|
@ -89,20 +90,24 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Dialog for loading or modifying procedures.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ProcedureDlg extends CaveSWTDialog {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ProcedureDlg.class);
|
||||
|
||||
public static final String ORIGINAL = "Original Location";
|
||||
|
@ -111,7 +116,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
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;
|
||||
|
||||
|
@ -131,9 +136,9 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
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;
|
||||
|
||||
|
@ -167,6 +172,10 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
|
||||
private final java.util.List<BundlePair> bundles;
|
||||
|
||||
private AlterBundleDlg alterDlg;
|
||||
|
||||
private ProcedureListDlg saveAsDlg;
|
||||
|
||||
private ProcedureDlg(String fileName, Procedure p, Shell parent) {
|
||||
// Win32
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
|
||||
|
@ -223,7 +232,7 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
protected void disposed() {
|
||||
font.dispose();
|
||||
synchronized (openDialogs) {
|
||||
openDialogs.remove(this);
|
||||
openDialogs.remove(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -877,19 +886,34 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
BundlePair bp = new BundlePair();
|
||||
bp.name = bundles.get(dataList.getSelectionIndex()).name;
|
||||
bp.xml = bundles.get(dataList.getSelectionIndex()).xml;
|
||||
Bundle b = Bundle.unmarshalBundle(bp.xml, null);
|
||||
if (mustCreate(alterDlg)) {
|
||||
final BundlePair bp = new BundlePair();
|
||||
bp.name = bundles.get(dataList.getSelectionIndex()).name;
|
||||
bp.xml = bundles.get(dataList.getSelectionIndex()).xml;
|
||||
Bundle b = Bundle.unmarshalBundle(bp.xml, null);
|
||||
|
||||
AlterBundleDlg dlg = new AlterBundleDlg(b, getParent());
|
||||
b = (Bundle) dlg.open();
|
||||
alterDlg = new AlterBundleDlg(b, getShell());
|
||||
alterDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
if (b != null) {
|
||||
// Load was issued in alterBundleDlg
|
||||
bp.xml = b.toXML();
|
||||
saveProcedure();
|
||||
load(b);
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof Bundle) {
|
||||
Bundle b = (Bundle) returnValue;
|
||||
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) {
|
||||
final String err = "Error altering bundle";
|
||||
|
@ -898,18 +922,38 @@ public class ProcedureDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
private void showSaveAsDlg() {
|
||||
ProcedureListDlg dlg = new ProcedureListDlg("Save Procedure As...",
|
||||
shell, ProcedureListDlg.Mode.SAVE);
|
||||
dlg.open();
|
||||
if (mustCreate(saveAsDlg)) {
|
||||
saveAsDlg = new ProcedureListDlg("Save Procedure As...", shell,
|
||||
ProcedureListDlg.Mode.SAVE);
|
||||
|
||||
String fn = dlg.getSelectedFileName();
|
||||
if (fn == null) {
|
||||
return;
|
||||
saveAsDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@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
|
||||
*/
|
||||
public static ProcedureDlg getDialog(String fileName) {
|
||||
synchronized (openDialogs) {
|
||||
if (fileName != null) {
|
||||
for (ProcedureDlg dialog : openDialogs) {
|
||||
if (fileName.equals(dialog.fileName)) {
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
synchronized (ProcedureDlg.openDialogs) {
|
||||
ProcedureDlg dialog = openDialogs.get(fileName);
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 p
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
public static ProcedureDlg getOrCreateDialog(String fileName, Procedure p,
|
||||
Shell parent) {
|
||||
public static void displayDialog(String fileName, Procedure p, Shell parent) {
|
||||
synchronized (openDialogs) {
|
||||
ProcedureDlg dialog = getDialog(fileName);
|
||||
if (dialog == null) {
|
||||
if (dialog == null || dialog.getShell() == null
|
||||
|| dialog.isDisposed()) {
|
||||
dialog = new ProcedureDlg(fileName, p, parent);
|
||||
openDialogs.add(dialog);
|
||||
openDialogs.put(fileName, dialog);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,19 +56,21 @@ 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>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* ??? Initial creation
|
||||
* 07/31/2012 DR 15036 D. Friedman Ensure current user's procedures
|
||||
* are visible.
|
||||
* 10/16/2012 1229 rferrel Made dialog non-blocking.
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -80,8 +82,6 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
|
||||
private Text procedureTF;
|
||||
|
||||
private LocalizationFile selectedFile;
|
||||
|
||||
private TreeViewer treeViewer;
|
||||
|
||||
private Button okBtn;
|
||||
|
@ -103,7 +103,7 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
private final 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);
|
||||
|
||||
this.mode = mode;
|
||||
|
@ -343,7 +343,8 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
public void run() {
|
||||
TreeItem[] items = treeViewer.getTree().getItems();
|
||||
if (items != null && items.length > 0)
|
||||
treeViewer.getTree().showItem(items[items.length - 1]);
|
||||
treeViewer.getTree().showItem(
|
||||
items[items.length - 1]);
|
||||
treeViewer.reveal(find);
|
||||
}
|
||||
});
|
||||
|
@ -401,7 +402,7 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
cancelBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
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
|
||||
*/
|
||||
|
@ -492,21 +486,22 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
+ " already exists. Overwrite anyways?");
|
||||
if (result == true) {
|
||||
fileName = procedureTF.getText();
|
||||
shell.dispose();
|
||||
close();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fileName = procedureTF.getText();
|
||||
shell.dispose();
|
||||
close();
|
||||
}
|
||||
} else if (mode == Mode.OPEN) {
|
||||
fileName = procedureTF.getText();
|
||||
if (tmp instanceof ProcedureTree) {
|
||||
// it must be a procedure tree, that is what the content
|
||||
// provider uses internally
|
||||
selectedFile = ((ProcedureTree) tmp).getFile();
|
||||
LocalizationFile selectedFile = ((ProcedureTree) tmp).getFile();
|
||||
setReturnValue(selectedFile);
|
||||
}
|
||||
shell.dispose();
|
||||
close();
|
||||
} else if (mode == Mode.DELETE) {
|
||||
|
||||
TreeItem[] selection = treeViewer.getTree().getSelection();
|
||||
|
@ -520,9 +515,11 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
if (tmp instanceof ProcedureTree) {
|
||||
// it must be a procedure tree, that is what the content
|
||||
// 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.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 {
|
||||
private CreateProjectionDialog dlg;
|
||||
|
||||
/*
|
||||
* (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
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
@ -42,9 +62,13 @@ public class CreateProjectionHandler extends AbstractTool implements IHandler {
|
|||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
CreateProjectionDialog dlg = new CreateProjectionDialog(shell);
|
||||
|
||||
dlg.open();
|
||||
if (dlg == null || dlg.getShell() == null || dlg.isDisposed()) {
|
||||
dlg = new CreateProjectionDialog(shell);
|
||||
dlg.setBlockOnOpen(false);
|
||||
dlg.open();
|
||||
} else {
|
||||
dlg.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.Display;
|
|||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
import com.raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
||||
|
||||
/**
|
||||
|
@ -38,6 +39,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.BackgroundColorDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 1, 2009 mschenke Initial creation
|
||||
* Oct 16, 2012 1229 rferrel Changes for non-blocking BackgroundColorDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,12 +69,18 @@ public class SetBackgroundColorAction extends AbstractRightClickAction {
|
|||
@Override
|
||||
public void run() {
|
||||
BackgroundColorDialog dialog = dialogMap.get(container);
|
||||
if (dialog == null) {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new BackgroundColorDialog(Display.getCurrent()
|
||||
.getActiveShell(), container, mode);
|
||||
dialogMap.put(container, dialog);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
dialogMap.remove(container);
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
dialogMap.remove(container);
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTWizardDlg;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 14, 2010 mschenke Initial creation
|
||||
* Oct 22, 2012 1229 rferrel Changes for non-blocking CaveSWTWizardDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTWizardDlg;
|
|||
*/
|
||||
|
||||
public class NewDerivedParameterAction extends Action {
|
||||
private CaveSWTWizardDlg dialog;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -55,9 +57,13 @@ public class NewDerivedParameterAction extends Action {
|
|||
@Override
|
||||
public void run() {
|
||||
DerivedParamWizard wizard = new DerivedParamWizard();
|
||||
CaveSWTWizardDlg dialog = new CaveSWTWizardDlg(VizWorkbenchManager
|
||||
.getInstance().getCurrentWindow().getShell(), wizard);
|
||||
dialog.open();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new CaveSWTWizardDlg(VizWorkbenchManager.getInstance()
|
||||
.getCurrentWindow().getShell(), wizard);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -99,11 +99,8 @@ public class KmlColormappedImageExtension extends
|
|||
|
||||
private static class Generator extends KmlGroundOverlayGenerator {
|
||||
|
||||
private final DrawableImage[] images;
|
||||
|
||||
public Generator(float alpha, DrawableImage[] images) {
|
||||
super(alpha);
|
||||
this.images = images;
|
||||
super(alpha, images);
|
||||
}
|
||||
|
||||
@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.data.DataSource;
|
||||
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.prep.Colormapper;
|
||||
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
||||
|
@ -74,7 +76,21 @@ public abstract class KmlGroundOverlayGenerator extends KmlFeatureGenerator {
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.kml.export.graphics.ext;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
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.NearestNeighborInterpolation;
|
||||
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.DataSource;
|
||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
||||
|
@ -121,11 +119,8 @@ public class KmlMosaicImageExtension extends
|
|||
|
||||
private final ColorMapParameters parameters;
|
||||
|
||||
private final DrawableImage[] images;
|
||||
|
||||
public Generator(float alpha, KmlMosaicImage image) {
|
||||
super(alpha);
|
||||
this.images = image.getImagesToMosaic();
|
||||
super(alpha, image.getImagesToMosaic());
|
||||
this.parameters = image.getColorMapParameters();
|
||||
this.mosaicComparator = image.getMosaicComparator();
|
||||
}
|
||||
|
|
|
@ -77,11 +77,8 @@ public class KmlRasterImageExtension extends
|
|||
|
||||
private static class Generator extends KmlGroundOverlayGenerator {
|
||||
|
||||
private final DrawableImage[] images;
|
||||
|
||||
public Generator(float alpha, DrawableImage[] images) {
|
||||
super(alpha);
|
||||
this.images = images;
|
||||
super(alpha, images);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 2009-12-02 vkorolev Initial creation.
|
||||
* 2010-01-21 4268 vkorolev Fixed Trend Plot
|
||||
* 2012-10-15 1229 vkorolev Changes for non-blocking TrendPlotDlg
|
||||
* </pre>
|
||||
*
|
||||
* @author vkorolev
|
||||
|
@ -65,9 +66,12 @@ public class TrendPlotDlg extends CaveSWTDialog {
|
|||
|
||||
public Date curdate;
|
||||
|
||||
public String var;
|
||||
|
||||
public TrendPlotDlg(Shell parent, String selectedZone, String station,
|
||||
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 + "#"
|
||||
+ dataName);
|
||||
|
||||
|
@ -89,13 +93,13 @@ public class TrendPlotDlg extends CaveSWTDialog {
|
|||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
setReturnValue(false);
|
||||
setReturnValue(product);
|
||||
// Initialize all layouts
|
||||
Iterator<String> prodVar = product.iterator();
|
||||
while (prodVar.hasNext()) {
|
||||
String varname = prodVar.next();
|
||||
new TrendPlotCanvas(shell, selectedZone, station, varname,
|
||||
dataName, obData);
|
||||
String var = prodVar.next();
|
||||
new TrendPlotCanvas(shell, selectedZone, station, var, dataName,
|
||||
obData);
|
||||
}
|
||||
addCloseBtn();
|
||||
}
|
||||
|
|
|
@ -168,6 +168,7 @@ public class PointsToolLayer extends AbstractMovableToolLayer<Point> implements
|
|||
for (IFont font : fonts.values()) {
|
||||
font.dispose();
|
||||
}
|
||||
fonts.clear();
|
||||
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.Usage;
|
||||
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.data.IPointNode;
|
||||
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
|
||||
* needed methods abstract.
|
||||
* Jul 31, 2012 #875 rferrel Points now group in menu items.
|
||||
* Oct 04, 2012 #1248 rferrel Added Point change listener.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1176,7 +1179,7 @@ public abstract class BaseRadarProductUI {
|
|||
});
|
||||
geomCombo = c;
|
||||
} else {
|
||||
MenuButton mb = new MenuButton(r2);
|
||||
final MenuButton mb = new MenuButton(r2);
|
||||
mb.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
MenuItem item = (MenuItem) e.data;
|
||||
|
@ -1186,9 +1189,43 @@ public abstract class BaseRadarProductUI {
|
|||
mb.setMinimumSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
|
||||
Menu menu = new Menu(mb);
|
||||
createMenuItems(menu, null);
|
||||
MenuItem firstItem = createMenuItems(menu, null);
|
||||
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;
|
||||
mb.addDisposeListener(new DisposeListener() {
|
||||
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
PointsDataManager.getInstance()
|
||||
.removePointsChangedListener(pointChangeListener);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
azRanLabel = new Label(r2, SWT.LEFT);
|
||||
|
@ -1220,10 +1257,11 @@ public abstract class BaseRadarProductUI {
|
|||
setupRow(r, r2, b);
|
||||
}
|
||||
|
||||
private void createMenuItems(Menu menu, IPointNode root) {
|
||||
private MenuItem createMenuItems(Menu menu, IPointNode root) {
|
||||
MenuItem item = null;
|
||||
for (IPointNode node : PointsDataManager.getInstance().getChildren(
|
||||
root)) {
|
||||
MenuItem firstItem = null;
|
||||
for (IPointNode node : PointsDataManager.getInstance()
|
||||
.getChildren(root)) {
|
||||
if (node.isGroup()) {
|
||||
if (PointsDataManager.getInstance().getChildren(node).size() == 0) {
|
||||
continue;
|
||||
|
@ -1231,13 +1269,20 @@ public abstract class BaseRadarProductUI {
|
|||
Menu childMenu = new Menu(menu);
|
||||
item = new MenuItem(menu, SWT.CASCADE);
|
||||
item.setMenu(childMenu);
|
||||
createMenuItems(childMenu, node);
|
||||
MenuItem it = createMenuItems(childMenu, node);
|
||||
if (firstItem == null) {
|
||||
firstItem = it;
|
||||
}
|
||||
} else {
|
||||
item = new MenuItem(menu, SWT.PUSH);
|
||||
if (firstItem == null) {
|
||||
firstItem = item;
|
||||
}
|
||||
}
|
||||
item.setText(node.getName());
|
||||
item.setData(node);
|
||||
}
|
||||
return firstItem;
|
||||
}
|
||||
|
||||
protected void onLoadBaselines() {
|
||||
|
@ -2003,7 +2048,14 @@ public abstract class BaseRadarProductUI {
|
|||
}
|
||||
} else {
|
||||
MenuButton mb = (MenuButton) geomCombo;
|
||||
|
||||
// Check to see if desired point still exists.
|
||||
MenuItem item = mb.getSelectedItem();
|
||||
mb.setSelectedItem(desiredGeom);
|
||||
if (mb.getSelectedItem() == null) {
|
||||
mb.setSelectedItem(item);
|
||||
onGeomSelected(item.getText());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
|||
|
||||
@Override
|
||||
protected void setupServers() throws VizException {
|
||||
HttpClient.getInstance().enableGzipResponseHandling();
|
||||
HttpClient.getInstance().setGzipResponseHandling(true);
|
||||
if (promptUI) {
|
||||
ThinClientConnectivityDialog dlg = new ThinClientConnectivityDialog(
|
||||
checkAlertviz);
|
||||
|
@ -100,10 +100,10 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
|||
.getString(ThinClientPreferenceConstants.P_SERVICES_PROXY));
|
||||
VizApp.setPypiesServer(store
|
||||
.getString(ThinClientPreferenceConstants.P_PYPIES_PROXY));
|
||||
if (store
|
||||
.getBoolean(ThinClientPreferenceConstants.P_ENABLE_REQUEST_COMPRESSION)) {
|
||||
HttpClient.getInstance().enableRequestCompression();
|
||||
}
|
||||
boolean compressRequests = store
|
||||
.getBoolean(ThinClientPreferenceConstants.P_ENABLE_REQUEST_COMPRESSION);
|
||||
HttpClient.getInstance().setCompressRequests(compressRequests);
|
||||
|
||||
} else {
|
||||
GetServersRequest req = new GetServersRequest();
|
||||
GetServersResponse resp = (GetServersResponse) ThriftClient
|
||||
|
|
|
@ -19,28 +19,21 @@
|
|||
**/
|
||||
package com.raytheon.viz.alerts.jobs;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
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.comm.Loader;
|
||||
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.AbstractResourceData;
|
||||
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 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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void alertArrived(Collection<AlertMessage> alertMessages) {
|
||||
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;
|
||||
|
||||
for (AlertMessage message : alertMessages) {
|
||||
|
@ -130,34 +97,25 @@ public class AutoUpdater implements IAlertObserver {
|
|||
continue;
|
||||
|
||||
AbstractRequestableResourceData reqResourceData = (AbstractRequestableResourceData) resourceData;
|
||||
AbstractAlertMessageParser parserToUse = null;
|
||||
if ((parserToUse = reqResourceData.getAlertParser()) == null) {
|
||||
parserToUse = defaultParser;
|
||||
|
||||
if (md.getTimeMatcher() != null) {
|
||||
md.getTimeMatcher().redoTimeMatching(r1);
|
||||
}
|
||||
Object objectToSend = parserToUse.parseAlertMessage(
|
||||
message, reqResourceData);
|
||||
displayList.add(md);
|
||||
|
||||
if (objectToSend != null) {
|
||||
if (md.getTimeMatcher() != null) {
|
||||
md.getTimeMatcher().redoTimeMatching(r1);
|
||||
}
|
||||
displayList.add(md);
|
||||
List<AlertMessage> list = pdoSendMap
|
||||
.get(reqResourceData);
|
||||
if (list == null) {
|
||||
list = new ArrayList<AlertMessage>();
|
||||
pdoSendMap.put(reqResourceData, list);
|
||||
}
|
||||
list.add(message);
|
||||
|
||||
List<Object> list = pdoSendMap.get(reqResourceData);
|
||||
if (list == null) {
|
||||
list = new ArrayList<Object>();
|
||||
pdoSendMap.put(reqResourceData, list);
|
||||
}
|
||||
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();
|
||||
}
|
||||
if (list.size() > 100) {
|
||||
// update with objects
|
||||
reqResourceData.update(list
|
||||
.toArray(new AlertMessage[list.size()]));
|
||||
list.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -174,13 +132,11 @@ public class AutoUpdater implements IAlertObserver {
|
|||
}
|
||||
|
||||
for (AbstractRequestableResourceData arrd : pdoSendMap.keySet()) {
|
||||
List<Object> pdos = pdoSendMap.get(arrd);
|
||||
List<AlertMessage> pdos = pdoSendMap.get(arrd);
|
||||
if (pdos == null || pdos.size() < 1) {
|
||||
continue;
|
||||
}
|
||||
Class<?> componentType = pdos.get(0).getClass();
|
||||
arrd.update(pdos.toArray((Object[]) Array.newInstance(
|
||||
componentType, pdos.size())));
|
||||
arrd.update(pdos.toArray(new AlertMessage[pdos.size()]));
|
||||
}
|
||||
|
||||
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.Priority;
|
||||
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Action for Aviation Plug-in
|
||||
|
@ -79,11 +80,16 @@ public class AviationAction extends AbstractHandler {
|
|||
.getShell();
|
||||
if (aviationDlg == null || aviationDlg.getShell().isDisposed()) {
|
||||
aviationDlg = new AviationDialog(shell);
|
||||
aviationDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
aviationDlg = null;
|
||||
}
|
||||
});
|
||||
aviationDlg.open();
|
||||
aviationDlg = null;
|
||||
} else {
|
||||
aviationDlg.setVisible(true);
|
||||
aviationDlg.setFocus();
|
||||
aviationDlg.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -22,7 +22,7 @@ package com.raytheon.viz.aviation;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
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
|
||||
|
@ -35,6 +35,9 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 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>
|
||||
*
|
||||
|
@ -42,7 +45,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class AviationComponent extends AbstractCAVEComponent {
|
||||
public class AviationComponent extends AbstractCAVEDialogComponent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -56,6 +59,7 @@ public class AviationComponent extends AbstractCAVEComponent {
|
|||
AviationDialog aviationDlg = new AviationDialog(new Shell(
|
||||
Display.getCurrent()));
|
||||
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.TafSiteConfigFactory;
|
||||
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.
|
||||
|
@ -92,6 +93,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* for both stand alone and from Cave.
|
||||
* 8/31/2011 10837 rferrel Added checks to see if the avnImage
|
||||
* file exists.
|
||||
* 10/02/2012 1229 rferrel Made dialog non-blocking.
|
||||
* 10/09/2012 1229 rferrel Changes for non-blocking TafMonitorDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -161,7 +164,7 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
public static boolean USERTRANSMIT = true;
|
||||
|
||||
/**
|
||||
* List control containing forcaster names.
|
||||
* List control containing forecaster names.
|
||||
*/
|
||||
private List forecasterList;
|
||||
|
||||
|
@ -171,14 +174,13 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
private final AtomicInteger dlgCount = new AtomicInteger(0);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* Create a non-blocking dialog.
|
||||
*
|
||||
* @param parent
|
||||
* Parent Shell.
|
||||
*/
|
||||
public AviationDialog(Shell parent) {
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||
| CAVE.INDEPENDENT_SHELL);
|
||||
| CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS Menu");
|
||||
|
||||
ForecastModel.getInstance().setBackupRestartUtility(this);
|
||||
|
@ -339,7 +341,7 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
loadTafSiteConfig();
|
||||
displayTafMonitorDialog();
|
||||
} else {
|
||||
tafMonitorDlg.showDialog();
|
||||
tafMonitorDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -355,8 +357,8 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
shell.setVisible(false);
|
||||
if (climateMenuDlg == null
|
||||
|| climateMenuDlg.getShell().isDisposed()) {
|
||||
if (climateMenuDlg == null || climateMenuDlg.getShell() == null
|
||||
|| climateMenuDlg.isDisposed()) {
|
||||
// Create an array of message types
|
||||
StatusMessageType[] msgTypes = new StatusMessageType[4];
|
||||
msgTypes[0] = StatusMessageType.Metar;
|
||||
|
@ -367,13 +369,19 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
// Create the climate menu dialog.
|
||||
dlgCount.incrementAndGet();
|
||||
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 = null;
|
||||
if (dlgCount.decrementAndGet() == 0) {
|
||||
shell.dispose();
|
||||
}
|
||||
} else {
|
||||
climateMenuDlg.showDialog();
|
||||
climateMenuDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -562,7 +570,12 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
*/
|
||||
@Override
|
||||
public void restartTafMonitor() {
|
||||
// This prevents tafMonitorDlg from closing this shell when closing the
|
||||
// TaMonitorDlg prior to the restart.
|
||||
dlgCount.incrementAndGet();
|
||||
if (tafMonitorDlg.closeDisplay() == false) {
|
||||
// adjust the count.
|
||||
dlgCount.decrementAndGet();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -595,7 +608,12 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
}
|
||||
|
||||
if (!emptyStationList) {
|
||||
// This prevents tafMonitorDlg from closing this shell when closing
|
||||
// the TaMonitorDlg prior to the restart.
|
||||
dlgCount.incrementAndGet();
|
||||
if (tafMonitorDlg.closeDisplay() == false) {
|
||||
// adjust the count.
|
||||
dlgCount.decrementAndGet();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -629,25 +647,28 @@ public class AviationDialog extends CaveSWTDialog implements IBackupRestart {
|
|||
}
|
||||
for (String product : productDisplayList) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error no stations configured for " + product);
|
||||
"Error no stations configured for " + product);
|
||||
}
|
||||
} else {
|
||||
tafMonitorDlg = new TafMonitorDlg(shell, stationList,
|
||||
productDisplayList);
|
||||
tafMonitorDlg.open();
|
||||
tafMonitorDlg = null;
|
||||
if (tafMonitorDlg == null || tafMonitorDlg.getShell() == null
|
||||
|| tafMonitorDlg.isDisposed()) {
|
||||
tafMonitorDlg = new TafMonitorDlg(shell, stationList,
|
||||
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
|
||||
* config files in execute.
|
||||
* Oct 19, 2010 7347 rferrel Replace reference to TAF_SITE_CONFIG
|
||||
* Oct 08, 2012 1229 rferrel Changes to work with non-blocking AvnConfigDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -73,12 +74,12 @@ public class AvnconfigAction extends AbstractHandler {
|
|||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (avnfspSetupDlg == null || avnfspSetupDlg.isDisposed()) {
|
||||
if (avnfspSetupDlg == null || avnfspSetupDlg.getShell() == null
|
||||
|| avnfspSetupDlg.isDisposed()) {
|
||||
avnfspSetupDlg = new AvnconfigDlg(shell);
|
||||
avnfspSetupDlg.open();
|
||||
avnfspSetupDlg = null;
|
||||
} else {
|
||||
avnfspSetupDlg.setFocus();
|
||||
avnfspSetupDlg.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -22,7 +22,7 @@ package com.raytheon.viz.aviation;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
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.
|
||||
|
@ -34,14 +34,15 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
*
|
||||
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||
* AvnconfigDlg.
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class AvnconfigComponent extends AbstractCAVEComponent {
|
||||
public class AvnconfigComponent extends AbstractCAVEDialogComponent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -55,6 +56,7 @@ public class AvnconfigComponent extends AbstractCAVEComponent {
|
|||
AvnconfigDlg avnfspSetupDlg = new AvnconfigDlg(new Shell(
|
||||
Display.getCurrent()));
|
||||
avnfspSetupDlg.open();
|
||||
blockUntilClosed(avnfspSetupDlg);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -26,8 +26,6 @@ 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.Dialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
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.TafSiteInfoEditorDlg;
|
||||
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
|
||||
|
@ -54,6 +53,14 @@ import com.raytheon.viz.avnconfig.TextEditorSetupDlg;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 22 MAY 2008 1119 lvenable Initial creation
|
||||
* 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>
|
||||
*
|
||||
|
@ -61,17 +68,7 @@ import com.raytheon.viz.avnconfig.TextEditorSetupDlg;
|
|||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class AvnconfigDlg extends Dialog {
|
||||
|
||||
/**
|
||||
* Dialog shell.
|
||||
*/
|
||||
private Shell shell;
|
||||
|
||||
/**
|
||||
* The display control.
|
||||
*/
|
||||
private Display display;
|
||||
public class AvnconfigDlg extends CaveSWTDialog {
|
||||
|
||||
/**
|
||||
* Composite containing message status controls.
|
||||
|
@ -104,6 +101,8 @@ public class AvnconfigDlg extends Dialog {
|
|||
*/
|
||||
private ClimateDataMenuDlg climateDataDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -111,20 +110,13 @@ public class AvnconfigDlg extends Dialog {
|
|||
* Parent shell.
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
/**
|
||||
* Open method used set up components and display the dialog.
|
||||
*
|
||||
* @return Null.
|
||||
*/
|
||||
public Object open() {
|
||||
Shell parent = getParent();
|
||||
display = parent.getDisplay();
|
||||
shell = new Shell(parent, SWT.DIALOG_TRIM);
|
||||
shell.setText("AvnFPS Setup");
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
// Create the main layout for the shell.
|
||||
GridLayout mainLayout = new GridLayout(1, false);
|
||||
mainLayout.marginHeight = 3;
|
||||
|
@ -132,25 +124,6 @@ public class AvnconfigDlg extends Dialog {
|
|||
mainLayout.verticalSpacing = 5;
|
||||
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.
|
||||
// ---------------------------------------------
|
||||
|
@ -244,11 +217,16 @@ public class AvnconfigDlg extends Dialog {
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS Setup Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS Setup Help";
|
||||
|
||||
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 = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -293,13 +271,11 @@ public class AvnconfigDlg extends Dialog {
|
|||
textEditorBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (editorDlg == null || editorDlg.getParent().isDisposed()) {
|
||||
if (mustCreate(editorDlg)) {
|
||||
editorDlg = new TextEditorSetupDlg(shell);
|
||||
editorDlg.open();
|
||||
editorDlg = null;
|
||||
} else {
|
||||
editorDlg.getParent().forceActive();
|
||||
editorDlg.getParent().forceFocus();
|
||||
editorDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -311,14 +287,11 @@ public class AvnconfigDlg extends Dialog {
|
|||
monitorRulesBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (monCriteriaDlg == null
|
||||
|| monCriteriaDlg.getParent().isDisposed()) {
|
||||
if (mustCreate(monCriteriaDlg)) {
|
||||
monCriteriaDlg = new MonitoringCriteriaDlg(shell);
|
||||
monCriteriaDlg.open();
|
||||
monCriteriaDlg = null;
|
||||
} else {
|
||||
monCriteriaDlg.getParent().forceActive();
|
||||
monCriteriaDlg.getParent().forceFocus();
|
||||
monCriteriaDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -330,13 +303,11 @@ public class AvnconfigDlg extends Dialog {
|
|||
tafSiteInfoBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (siteInfoDlg == null || siteInfoDlg.getParent().isDisposed()) {
|
||||
if (mustCreate(siteInfoDlg)) {
|
||||
siteInfoDlg = new TafSiteInfoEditorDlg(shell);
|
||||
siteInfoDlg.open();
|
||||
siteInfoDlg = null;
|
||||
} else {
|
||||
siteInfoDlg.getParent().forceActive();
|
||||
siteInfoDlg.getParent().forceFocus();
|
||||
siteInfoDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -348,13 +319,11 @@ public class AvnconfigDlg extends Dialog {
|
|||
tafProductsBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (productsDlg == null || productsDlg.getParent().isDisposed()) {
|
||||
if (mustCreate(productsDlg)) {
|
||||
productsDlg = new TafProductConfigDlg(shell);
|
||||
productsDlg.open();
|
||||
productsDlg = null;
|
||||
} else {
|
||||
productsDlg.getParent().forceActive();
|
||||
productsDlg.getParent().forceFocus();
|
||||
productsDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -366,10 +335,11 @@ public class AvnconfigDlg extends Dialog {
|
|||
climateBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (climateDataDlg == null) {
|
||||
if (mustCreate(climateDataDlg)) {
|
||||
climateDataDlg = new ClimateDataMenuDlg(shell);
|
||||
climateDataDlg.open();
|
||||
climateDataDlg = null;
|
||||
} else {
|
||||
climateDataDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -381,12 +351,4 @@ public class AvnconfigDlg extends Dialog {
|
|||
private void createBottomMessageControls() {
|
||||
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.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
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.
|
||||
|
@ -39,6 +39,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||
* CigVisDistributionDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +48,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class CigVisDistComponent extends AbstractCAVEComponent {
|
||||
public class CigVisDistComponent extends AbstractCAVEDialogComponent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -63,6 +65,7 @@ public class CigVisDistComponent extends AbstractCAVEComponent {
|
|||
new Shell(Display.getCurrent()), siteList,
|
||||
StatusMessageType.Metar, null);
|
||||
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.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
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.
|
||||
|
@ -39,14 +39,15 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
*
|
||||
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||
* CigVisTrendDlg.
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class CigVisTrendComponent extends AbstractCAVEComponent {
|
||||
public class CigVisTrendComponent extends AbstractCAVEDialogComponent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -62,6 +63,7 @@ public class CigVisTrendComponent extends AbstractCAVEComponent {
|
|||
CigVisTrendDlg cigVisTrendDialog = new CigVisTrendDlg(new Shell(
|
||||
Display.getCurrent()), siteList, StatusMessageType.Metar, null);
|
||||
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.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
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.
|
||||
|
@ -39,6 +39,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||
* MetarDisplayDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +48,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class MetarComponent extends AbstractCAVEComponent {
|
||||
public class MetarComponent extends AbstractCAVEDialogComponent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -62,6 +64,7 @@ public class MetarComponent extends AbstractCAVEComponent {
|
|||
MetarDisplayDialog metarDialog = new MetarDisplayDialog(new Shell(
|
||||
Display.getCurrent()), siteList, StatusMessageType.Metar, null);
|
||||
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.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
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.
|
||||
|
@ -39,6 +39,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* Oct 17, 2012 1229 rferrel Changes for non-blocking
|
||||
* WindRosePlotDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +48,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class WindRoseComponent extends AbstractCAVEComponent {
|
||||
public class WindRoseComponent extends AbstractCAVEDialogComponent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -63,6 +65,7 @@ public class WindRoseComponent extends AbstractCAVEComponent {
|
|||
Display.getCurrent()), siteList, StatusMessageType.WindRose,
|
||||
null);
|
||||
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.TafSiteConfigFactory;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* May 24, 2011 #9075 rferrel Changed getObsHistoryFromInv() to scan
|
||||
* 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>
|
||||
*
|
||||
|
@ -98,10 +108,11 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* @version 1.0
|
||||
*/
|
||||
public class ClimateDataMenuDlg extends CaveSWTDialog {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ClimateDataMenuDlg.class);
|
||||
|
||||
private static final Pattern SP_PAT = Pattern.compile("\\s+");
|
||||
private final Pattern SP_PAT = Pattern.compile("\\s+");
|
||||
|
||||
/**
|
||||
* Text font.
|
||||
|
@ -222,6 +233,8 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
|
||||
private int waitCnt = 0;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -229,7 +242,8 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
* Parent shell.
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -247,6 +261,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
darkBlueBgColor.dispose();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||
* .eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
// Initialize all of the data, controls, and layouts
|
||||
|
@ -381,11 +402,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
metarsMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (metarDlg == null) {
|
||||
if (metarDlg == null || metarDlg.getShell() == null
|
||||
|| metarDlg.isDisposed()) {
|
||||
metarDlg = new MetarDisplayDialog(shell, siteList,
|
||||
StatusMessageType.Metar, null);
|
||||
metarDlg.open();
|
||||
metarDlg = null;
|
||||
} else {
|
||||
metarDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -396,11 +419,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
windRoseMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (windRose == null || windRose.isDisposed()) {
|
||||
if (windRose == null || windRose.getShell() == null
|
||||
|| windRose.isDisposed()) {
|
||||
windRose = new WindRosePlotDlg(shell, siteList,
|
||||
StatusMessageType.WindRose, null);
|
||||
windRose.open();
|
||||
windRose = null;
|
||||
} else {
|
||||
windRose.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -411,11 +436,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
cigVisDistMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (cigVisDist == null) {
|
||||
if (cigVisDist == null || cigVisDist.getShell() == null
|
||||
|| cigVisDist.isDisposed()) {
|
||||
cigVisDist = new CigVisDistributionDlg(shell, siteList,
|
||||
StatusMessageType.CigVis, null);
|
||||
cigVisDist.open();
|
||||
cigVisDist = null;
|
||||
} else {
|
||||
cigVisDist.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -426,11 +453,13 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
cigVisTrendMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (cigVisTrend == null) {
|
||||
if (cigVisTrend == null || cigVisTrend.getShell() == null
|
||||
|| cigVisTrend.isDisposed()) {
|
||||
cigVisTrend = new CigVisTrendDlg(shell, siteList,
|
||||
StatusMessageType.CigVisTrend, null);
|
||||
cigVisTrend.open();
|
||||
cigVisTrend = null;
|
||||
} else {
|
||||
cigVisTrend.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -475,11 +504,15 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "CLimate Data Update Dialog Help";
|
||||
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";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "CLimate Data Update Dialog Help";
|
||||
|
||||
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 = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -842,10 +875,12 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
return;
|
||||
}
|
||||
|
||||
if (climateHistoryDlg == null) {
|
||||
if (climateHistoryDlg == null || climateHistoryDlg.getShell() == null
|
||||
|| climateHistoryDlg.isDisposed()) {
|
||||
climateHistoryDlg = new ClimateHistoryDlg(shell, data);
|
||||
climateHistoryDlg.open();
|
||||
climateHistoryDlg = null;
|
||||
} else {
|
||||
climateHistoryDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -853,10 +888,12 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
* Display the NCDC inventory/history dialog.
|
||||
*/
|
||||
private void displayNCDCInventoryHistoryDialog() {
|
||||
if (invHistoryDlg == null) {
|
||||
if (invHistoryDlg == null || invHistoryDlg.getShell() == null
|
||||
|| invHistoryDlg.isDisposed()) {
|
||||
invHistoryDlg = new NCDCInvHistDlg(shell);
|
||||
invHistoryDlg.open();
|
||||
invHistoryDlg = null;
|
||||
} else {
|
||||
invHistoryDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -864,12 +901,20 @@ public class ClimateDataMenuDlg extends CaveSWTDialog {
|
|||
* Display the generate scripts dialog.
|
||||
*/
|
||||
private void displayGenerateScriptDialog() {
|
||||
if (generateScriptsDlg == null) {
|
||||
if (generateScriptsDlg == null || generateScriptsDlg.getShell() == null
|
||||
|| generateScriptsDlg.isDisposed()) {
|
||||
ClimateDataManager.getInstance().assessStationsMap(this);
|
||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
||||
Boolean bool = (Boolean) generateScriptsDlg.open("data");
|
||||
generateScriptsDlg = null;
|
||||
genScriptsBtn.setEnabled(bool);
|
||||
generateScriptsDlg = new GenScriptsDlg(shell, "data");
|
||||
generateScriptsDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@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));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getMessage());
|
||||
statusHandler.handle(Priority.PROBLEM, e.getMessage());
|
||||
} catch (ConfigurationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.toString());
|
||||
statusHandler.handle(Priority.PROBLEM, e.toString());
|
||||
} 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
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 16, 2009 #3438 lvenable Initial creation
|
||||
* Oct 06, 2012 #1229 rferrel Made non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -87,7 +88,8 @@ public class ClimateHistoryDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public ClimateHistoryDlg(Shell parentShell,
|
||||
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");
|
||||
|
||||
this.climateHistData = climateHistData;
|
||||
|
|
|
@ -70,6 +70,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* to the correct directory.
|
||||
* May 10, 2011 #8844 rferrel Display error message when unable
|
||||
* to save a script.
|
||||
* Oct 08, 2012 #1229 rferrel Made non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -132,23 +133,16 @@ public class GenScriptsDlg extends CaveSWTDialog {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param style
|
||||
* @param parentShell
|
||||
* Parent shell.
|
||||
*/
|
||||
public GenScriptsDlg(Shell parentShell) {
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
public GenScriptsDlg(Shell parentShell, String style) {
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||
| CAVE.DO_NOT_BLOCK);
|
||||
setText("Generate Scripts");
|
||||
initFtpArgs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the dialog.
|
||||
*
|
||||
* @return null.
|
||||
*/
|
||||
public Object open(String style) {
|
||||
this.style = style;
|
||||
return open();
|
||||
initFtpArgs();
|
||||
}
|
||||
|
||||
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.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* This class displays the NCDC Inventory/History dialog.
|
||||
|
@ -53,6 +54,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 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>
|
||||
*
|
||||
|
@ -133,7 +136,8 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
|||
* Parent shell.
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -225,10 +229,22 @@ public class NCDCInvHistDlg extends CaveSWTDialog {
|
|||
invScriptBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (generateScriptsDlg == null) {
|
||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
||||
generateScriptsDlg.open("inv");
|
||||
generateScriptsDlg = null;
|
||||
if (generateScriptsDlg == null
|
||||
|| generateScriptsDlg.getShell() == null
|
||||
|| generateScriptsDlg.isDisposed()) {
|
||||
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() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (generateScriptsDlg == null) {
|
||||
generateScriptsDlg = new GenScriptsDlg(shell);
|
||||
generateScriptsDlg.open("his");
|
||||
generateScriptsDlg = null;
|
||||
if (generateScriptsDlg == null
|
||||
|| generateScriptsDlg.getShell() == null
|
||||
|| generateScriptsDlg.isDisposed()) {
|
||||
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
|
||||
* 4/4/2011 8896 rferrel Made timeout configurable
|
||||
* 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>
|
||||
*
|
||||
|
@ -95,7 +97,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
*/
|
||||
public class CigVisDistributionDlg extends CaveSWTDialog implements
|
||||
PyProcessListener {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(CigVisDistributionDlg.class);
|
||||
|
||||
/**
|
||||
|
@ -205,6 +207,8 @@ public class CigVisDistributionDlg extends CaveSWTDialog implements
|
|||
*/
|
||||
private SaveImageDlg siDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -220,7 +224,7 @@ public class CigVisDistributionDlg extends CaveSWTDialog implements
|
|||
public CigVisDistributionDlg(Shell parent, java.util.List<String> icaos,
|
||||
StatusMessageType msgType, RGB statusCompRGB) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS - Ceiling/Visibility Distribution");
|
||||
|
||||
this.icaos = icaos;
|
||||
|
@ -383,11 +387,15 @@ public class CigVisDistributionDlg extends CaveSWTDialog implements
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
||||
|
||||
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 = 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.
|
||||
* 3/31/2011 8774 rferrel killProcess when doing a disposed
|
||||
* 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>
|
||||
*
|
||||
|
@ -204,6 +206,8 @@ public class CigVisTrendDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private SaveImageDlg siDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -218,7 +222,8 @@ public class CigVisTrendDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public CigVisTrendDlg(Shell parent, java.util.List<String> icaos,
|
||||
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");
|
||||
|
||||
this.icaos = icaos;
|
||||
|
@ -357,11 +362,14 @@ public class CigVisTrendDlg extends CaveSWTDialog {
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS - Ceiling and Visibility Display Help";
|
||||
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.";
|
||||
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -66,6 +66,11 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* in initializeComponents
|
||||
* 10/12/2010 6009 rferrel Code clean up from making TafSiteConfig
|
||||
* 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>
|
||||
*
|
||||
|
@ -102,6 +107,8 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
|
||||
private CigVisTrendDlg cigVisTrend;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -114,7 +121,8 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public ClimateMenuDlg(Shell parent, StatusMessageType[] statusMsgTypes,
|
||||
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");
|
||||
|
||||
this.statusMsgTypes = statusMsgTypes;
|
||||
|
@ -229,11 +237,15 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
usageMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS Climate Menu - Usage";
|
||||
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";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS Climate Menu - Usage";
|
||||
|
||||
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 = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -258,11 +270,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
metarsBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (metarDlg == null) {
|
||||
if (metarDlg == null || metarDlg.getShell() == null
|
||||
|| metarDlg.isDisposed()) {
|
||||
metarDlg = new MetarDisplayDialog(shell, stationList,
|
||||
statusMsgTypes[0], statusCompRGB);
|
||||
metarDlg.open();
|
||||
metarDlg = null;
|
||||
} else {
|
||||
metarDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -277,11 +291,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
windRoseBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (windRose == null || windRose.isDisposed()) {
|
||||
if (windRose == null || windRose.getShell() == null
|
||||
|| windRose.isDisposed()) {
|
||||
windRose = new WindRosePlotDlg(shell, stationList,
|
||||
statusMsgTypes[1], statusCompRGB);
|
||||
windRose.open();
|
||||
windRose = null;
|
||||
} else {
|
||||
windRose.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -296,11 +312,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
distBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (cigVisDist == null) {
|
||||
if (cigVisDist == null || cigVisDist.getShell() == null
|
||||
|| cigVisDist.isDisposed()) {
|
||||
cigVisDist = new CigVisDistributionDlg(shell, stationList,
|
||||
statusMsgTypes[2], statusCompRGB);
|
||||
cigVisDist.open();
|
||||
cigVisDist = null;
|
||||
} else {
|
||||
cigVisDist.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -315,11 +333,13 @@ public class ClimateMenuDlg extends CaveSWTDialog {
|
|||
trendBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (cigVisTrend == null) {
|
||||
if (cigVisTrend == null || cigVisTrend.getShell() == null
|
||||
|| cigVisTrend.isDisposed()) {
|
||||
cigVisTrend = new CigVisTrendDlg(shell, stationList,
|
||||
statusMsgTypes[3], statusCompRGB);
|
||||
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/8/2011 8838 rferrel Properly set up "Show Display"
|
||||
* 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>
|
||||
*
|
||||
|
@ -98,7 +100,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
*/
|
||||
public class MetarDisplayDialog extends CaveSWTDialog implements
|
||||
PyProcessListener {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(MetarDisplayDialog.class);
|
||||
|
||||
/**
|
||||
|
@ -165,6 +167,8 @@ public class MetarDisplayDialog extends CaveSWTDialog implements
|
|||
|
||||
private PythonProcess pythonScript = null;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -179,7 +183,8 @@ public class MetarDisplayDialog extends CaveSWTDialog implements
|
|||
*/
|
||||
public MetarDisplayDialog(Shell parent, java.util.List<String> icaos,
|
||||
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");
|
||||
|
||||
this.icaos = icaos;
|
||||
|
@ -484,11 +489,16 @@ public class MetarDisplayDialog extends CaveSWTDialog implements
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "METAR Display Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "METAR Display Help";
|
||||
|
||||
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 = 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.MessageStatusComp;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* as WeatherPlotDataManager.
|
||||
* 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>
|
||||
*
|
||||
|
@ -173,16 +177,6 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
|||
*/
|
||||
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.
|
||||
*/
|
||||
|
@ -223,6 +217,10 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
|||
*/
|
||||
private List<String> icaos;
|
||||
|
||||
private TimeSelectorDialog timeDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -234,7 +232,8 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
|||
public WeatherPlotDialog(Shell parent, StatusMessageType msgType,
|
||||
List<String> stationList) {
|
||||
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");
|
||||
|
||||
this.msgType = msgType;
|
||||
|
@ -419,10 +418,25 @@ public class WeatherPlotDialog extends CaveSWTDialog {
|
|||
timesBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
TimeSelectorDialog timeDlg = new TimeSelectorDialog(shell,
|
||||
wxPlotCfg);
|
||||
if ((Boolean) timeDlg.open()) {
|
||||
displayData();
|
||||
if (timeDlg == null || timeDlg.getShell() == null
|
||||
|| timeDlg.isDisposed()) {
|
||||
timeDlg = new TimeSelectorDialog(shell, wxPlotCfg);
|
||||
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() {
|
||||
@Override
|
||||
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. ";
|
||||
String description = "Help";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
text);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "Help";
|
||||
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. ";
|
||||
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 FEB 2008 938 lvenable Initial creation
|
||||
* 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes.
|
||||
* 04 OCT 2012 1229 rferrel Made non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -162,7 +163,8 @@ public class WindRoseConfigDlg extends CaveSWTDialog {
|
|||
* Parent shell.
|
||||
*/
|
||||
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");
|
||||
|
||||
this.windRoseConfigData = windRoseConfigData;
|
||||
|
|
|
@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
|||
import org.eclipse.swt.widgets.MessageBox;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Spinner;
|
||||
|
||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||
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
|
||||
* 23JUL2012 15169 zhao Use Combo for 'Month' and 'Number of Months'
|
||||
* & 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>
|
||||
*
|
||||
|
@ -183,6 +187,10 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private RGB statusCompRGB;
|
||||
|
||||
private WindRoseConfigDlg configDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -197,7 +205,8 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public WindRosePlotDlg(Shell parent, java.util.List<String> icaos,
|
||||
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");
|
||||
|
||||
this.icaos = icaos;
|
||||
|
@ -321,9 +330,13 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
configureMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
WindRoseConfigDlg configDlg = new WindRoseConfigDlg(shell,
|
||||
windRoseConfigData);
|
||||
configDlg.open();
|
||||
if (configDlg == null || configDlg.getShell() == null
|
||||
|| configDlg.isDisposed()) {
|
||||
configDlg = new WindRoseConfigDlg(shell, windRoseConfigData);
|
||||
configDlg.open();
|
||||
} else {
|
||||
configDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -367,11 +380,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS - Wind Rose Display Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS - Wind Rose Display Help";
|
||||
|
||||
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 = 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);
|
||||
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||
monthCbo.setLayoutData(gd);
|
||||
for ( int i = 1; i <= 12; i++ ) {
|
||||
monthCbo.add(""+i, i-1);
|
||||
for (int i = 1; i <= 12; i++) {
|
||||
monthCbo.add("" + i, i - 1);
|
||||
}
|
||||
monthCbo.select(cal.get(Calendar.MONTH));
|
||||
monthCbo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
//System.out.println(" *************** monthsCbo.getText() = " + monthCbo.getText() );
|
||||
if (autoRedrawChk.getSelection()) {
|
||||
redrawWindRose();
|
||||
redrawWindRose();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -451,16 +467,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
gd = new GridData(66, SWT.DEFAULT);
|
||||
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||
numMonthsCbo.setLayoutData(gd);
|
||||
for ( int i = 1; i <= 12; i++ ) {
|
||||
numMonthsCbo.add(""+i, i-1);
|
||||
for (int i = 1; i <= 12; i++) {
|
||||
numMonthsCbo.add("" + i, i - 1);
|
||||
}
|
||||
numMonthsCbo.select(0);
|
||||
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
//System.out.println(" *************** numMonthsCbo.getText() = " + numMonthsCbo.getText() );
|
||||
if (autoRedrawChk.getSelection()) {
|
||||
redrawWindRose();
|
||||
redrawWindRose();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -585,11 +600,9 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
generateWindRoseHeader();
|
||||
|
||||
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
||||
windRoseHeader,
|
||||
monthCbo.getText(),
|
||||
numMonthsCbo.getText(),
|
||||
hourSpnr.getText(),
|
||||
numHoursSpnr.getText(), flightCatCbo.getSelectionIndex(),
|
||||
windRoseHeader, monthCbo.getText(), numMonthsCbo.getText(),
|
||||
hourSpnr.getText(), numHoursSpnr.getText(),
|
||||
flightCatCbo.getSelectionIndex(),
|
||||
siteList.getItem(siteList.getSelectionIndex()), this);
|
||||
}
|
||||
}
|
||||
|
@ -647,18 +660,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
|||
|
||||
header.append(MONTHS[monthCbo.getSelectionIndex()]);
|
||||
|
||||
if ( numMonthsCbo.getSelectionIndex() == 0 ) {
|
||||
if (numMonthsCbo.getSelectionIndex() == 0) {
|
||||
header.append(" ");
|
||||
} else {
|
||||
header.append("-");
|
||||
|
||||
int endMonth = 0;
|
||||
|
||||
if ( ( numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() ) > 11 ) {
|
||||
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() - 12;
|
||||
if ((numMonthsCbo.getSelectionIndex() + monthCbo
|
||||
.getSelectionIndex()) > 11) {
|
||||
endMonth = numMonthsCbo.getSelectionIndex()
|
||||
+ monthCbo.getSelectionIndex() - 12;
|
||||
header.append(MONTHS[endMonth]);
|
||||
} else {
|
||||
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex();
|
||||
endMonth = numMonthsCbo.getSelectionIndex()
|
||||
+ monthCbo.getSelectionIndex();
|
||||
header.append(MONTHS[endMonth]);
|
||||
}
|
||||
header.append(" ");
|
||||
|
|
|
@ -71,6 +71,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 7/26/2010 6693 rferrel Apply now checks for Delay.
|
||||
* 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/04/2012 1229 rferrel Made non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -141,7 +142,8 @@ public class LoaderDialog extends CaveSWTDialog {
|
|||
* Parent Shell.
|
||||
*/
|
||||
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");
|
||||
|
||||
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
|
||||
* the desired check list; removed the use
|
||||
* of sites to be like OB9.2.X.
|
||||
* 10/09/2012 1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -89,7 +90,8 @@ public class QcDialog extends CaveSWTDialog {
|
|||
* - parent composite
|
||||
*/
|
||||
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");
|
||||
|
||||
this.items = items;
|
||||
|
@ -217,7 +219,7 @@ public class QcDialog extends CaveSWTDialog {
|
|||
qcItems.put("impact", "0");
|
||||
}
|
||||
setReturnValue(qcItems);
|
||||
shell.dispose();
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -229,7 +231,7 @@ public class QcDialog extends CaveSWTDialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
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.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Dialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
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.texteditor.TextDisplayModel;
|
||||
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.
|
||||
|
@ -214,6 +215,14 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
|||
* 11/29/2011 11612 rferrel Added getViewerTabList.
|
||||
* 20JUL2012 14570 gzhang/zhao Highlight correct time groups in TAF Viewer
|
||||
* 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>
|
||||
*
|
||||
|
@ -221,12 +230,12 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
|||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
||||
public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
|
||||
IEditActions {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.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
|
||||
|
@ -249,11 +258,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
return PATH_MANAGER.getFile(baseCommonCtx, "python").getPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dialog shell.
|
||||
*/
|
||||
private Shell shell;
|
||||
|
||||
/**
|
||||
* The display control.
|
||||
*/
|
||||
|
@ -449,6 +453,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
*/
|
||||
private boolean pythonModifiedTAF = false;
|
||||
|
||||
private FindReplaceDlg findDlg;
|
||||
|
||||
/**
|
||||
* TAF editor enumeration
|
||||
*/
|
||||
|
@ -515,21 +521,30 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
|
||||
private PythonScript parsePythonScript;
|
||||
|
||||
private LoaderDialog loadDlg;
|
||||
|
||||
private QcDialog qcDlg;
|
||||
|
||||
private SendDialog sendDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
private HelpUsageDlg keyBindingUsageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent
|
||||
* Parent Shell.
|
||||
* @param disposeOnExit
|
||||
* Flag to indicate whether to dispose dialog on exit.
|
||||
*/
|
||||
public TafViewerEditorDlg(Shell parent, boolean disposeOnExit,
|
||||
List<String> stationList) {
|
||||
super(parent, 0);
|
||||
public TafViewerEditorDlg(Shell parent, List<String> stationList,
|
||||
int caveStyle) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS, caveStyle
|
||||
| CAVE.DO_NOT_BLOCK);
|
||||
|
||||
this.stationList = stationList;
|
||||
|
||||
init();
|
||||
setText("AvnFPS TAF Editor");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -542,34 +557,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
|
||||
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() {
|
||||
@Override
|
||||
public void shellClosed(ShellEvent event) {
|
||||
|
@ -586,7 +573,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
// }
|
||||
|
||||
// Block the disposal of this dialog.
|
||||
shell.setVisible(false);
|
||||
hideDialog();
|
||||
event.doit = false;
|
||||
}
|
||||
});
|
||||
|
@ -630,8 +617,6 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
// Initialize all of the controls and layouts
|
||||
initializeComponents();
|
||||
|
||||
shell.pack();
|
||||
|
||||
/*
|
||||
* NOTE:
|
||||
*
|
||||
|
@ -662,6 +647,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
*/
|
||||
@Override
|
||||
public void updateSettings(TafSettings setting, String stationName) {
|
||||
checkDlg();
|
||||
|
||||
String previousStationName = this.stationName;
|
||||
this.stationName = stationName;
|
||||
|
||||
|
@ -780,6 +767,9 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
|
||||
@Override
|
||||
public void clearAll() {
|
||||
if (shell == null) {
|
||||
return;
|
||||
}
|
||||
// Clear all tab items within all editor tabs on the tab folder.
|
||||
tabFolder.setSelection(editorTab);
|
||||
|
||||
|
@ -880,8 +870,31 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
*/
|
||||
@Override
|
||||
public void showDialog() {
|
||||
|
||||
checkDlg();
|
||||
|
||||
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();
|
||||
|
@ -893,12 +906,34 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
@Override
|
||||
public void hideDialog() {
|
||||
|
||||
// if (disposeOnExit == true) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
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 = 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() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
// shell.dispose();
|
||||
hideDialog();
|
||||
}
|
||||
});
|
||||
|
@ -1250,9 +1293,13 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
findMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
FindReplaceDlg findDlg = new FindReplaceDlg(shell,
|
||||
editorTafTabComp.getTextEditorControl());
|
||||
findDlg.open();
|
||||
if (mustCreate(findDlg)) {
|
||||
findDlg = new FindReplaceDlg(shell, editorTafTabComp
|
||||
.getTextEditorControl());
|
||||
findDlg.open();
|
||||
} else {
|
||||
findDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1304,53 +1351,57 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
keyBindingMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String text = "Ctrl-u Undo changes.\n"
|
||||
+ "Ctrl-r Redo changes.\n"
|
||||
+ "Insert Toggles insert/overwrite mode.\n"
|
||||
+ "Any-Key Insert normal printing characters.\n"
|
||||
+ "Button1 Sets the insert point, clear the selection, set focus.\n"
|
||||
+ "Ctrl-Button1 Set the insert point without affecting the selection.\n"
|
||||
+ "Button1-Motion Sweep out a selection from the insert point.\n"
|
||||
+ "Double-Button1 Select the word under the mouse.\n"
|
||||
+ "Triple-Button1 Select the line under the mouse.\n"
|
||||
+ "Shift-Button1 Adjust the end of selection closest to the mouse.\n"
|
||||
+ "Shift-Button1-Motion Continue to adjust the selection.\n"
|
||||
+ "Button2 Paste the selection, or set the scrolling anchor.\n"
|
||||
+ "Button2-Motion Scroll the window.\n"
|
||||
+ "Left or Ctrl-b Move the cursor left one character. Clear selection.\n"
|
||||
+ "Shift-Left Move the cursor and extend the selection.\n"
|
||||
+ "Ctrl-Left Move the cursor by words. Clear the selection.\n"
|
||||
+ "Ctrl-Shift-Left Move the cursor by words. Extend the selection.\n"
|
||||
+ "Right or Ctrl-f Right bindings are analogous to Left bindings.\n"
|
||||
+ "Alt-b or Alt Same as Ctrl-Left, Ctrl-Right.\n"
|
||||
+ "Up or Ctrl-p Move the cursor up one line. Clear the selection.\n"
|
||||
+ "Ctrl-Up Move the cursor by paragraph which are group of lines separated by a blank line.\n"
|
||||
+ "Ctrl-Shift-Up Move the cursor by paragraph. Extend selection.\n"
|
||||
+ "Down or Ctrl-n All Down bindings are analogous to Up bindings.\n"
|
||||
+ "PgUp, PgDn Move the cursor by one screen. Clear the selection.\n"
|
||||
+ "Shift-PgUp, Move the cursor by one screen. Extend the selection.\n"
|
||||
+ "Shift-PgDn\n"
|
||||
+ "Home or Ctrl-a Move the cursor to line start. Clear the selection.\n"
|
||||
+ "Shift-Home Move the cursor to line start. Extend the selection.\n"
|
||||
+ "End or Ctrl-e Move the cursor to line end. Clear the selection.\n"
|
||||
+ "Shift-End Move the cursor to line end. Extend the selection.\n"
|
||||
+ "Ctrl-Home Move the cursor to the beginning of text. Clear the selection.\n"
|
||||
+ "Ctrl-End Move the cursor to the beginning of text. Extend the selection.\n"
|
||||
+ "Ctrl-/ Select everything in the text widget.\n"
|
||||
+ "Ctrl-\\ Clear the selection.\n"
|
||||
+ "Delete Delete the selection, if any. Otherwise delete the character 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-d Delete character to the right of the cursor.\n"
|
||||
+ "Alt-d Delete word to the right 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"
|
||||
+ " character.\n"
|
||||
+ "Ctrl-o Insert a newline but do not advance the cursor.\n"
|
||||
+ "Alt-Delete Delete the word to the left of the cursor.\n"
|
||||
+ "Ctrl-t Transpose the characters on either side of the cursor.";
|
||||
String description = "Key Bindings";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
text);
|
||||
usageDlg.open();
|
||||
if (mustCreate(keyBindingUsageDlg)) {
|
||||
String description = "Key Bindings";
|
||||
String helpText = "Ctrl-u Undo changes.\n"
|
||||
+ "Ctrl-r Redo changes.\n"
|
||||
+ "Insert Toggles insert/overwrite mode.\n"
|
||||
+ "Any-Key Insert normal printing characters.\n"
|
||||
+ "Button1 Sets the insert point, clear the selection, set focus.\n"
|
||||
+ "Ctrl-Button1 Set the insert point without affecting the selection.\n"
|
||||
+ "Button1-Motion Sweep out a selection from the insert point.\n"
|
||||
+ "Double-Button1 Select the word under the mouse.\n"
|
||||
+ "Triple-Button1 Select the line under the mouse.\n"
|
||||
+ "Shift-Button1 Adjust the end of selection closest to the mouse.\n"
|
||||
+ "Shift-Button1-Motion Continue to adjust the selection.\n"
|
||||
+ "Button2 Paste the selection, or set the scrolling anchor.\n"
|
||||
+ "Button2-Motion Scroll the window.\n"
|
||||
+ "Left or Ctrl-b Move the cursor left one character. Clear selection.\n"
|
||||
+ "Shift-Left Move the cursor and extend the selection.\n"
|
||||
+ "Ctrl-Left Move the cursor by words. Clear the selection.\n"
|
||||
+ "Ctrl-Shift-Left Move the cursor by words. Extend the selection.\n"
|
||||
+ "Right or Ctrl-f Right bindings are analogous to Left bindings.\n"
|
||||
+ "Alt-b or Alt Same as Ctrl-Left, Ctrl-Right.\n"
|
||||
+ "Up or Ctrl-p Move the cursor up one line. Clear the selection.\n"
|
||||
+ "Ctrl-Up Move the cursor by paragraph which are group of lines separated by a blank line.\n"
|
||||
+ "Ctrl-Shift-Up Move the cursor by paragraph. Extend selection.\n"
|
||||
+ "Down or Ctrl-n All Down bindings are analogous to Up bindings.\n"
|
||||
+ "PgUp, PgDn Move the cursor by one screen. Clear the selection.\n"
|
||||
+ "Shift-PgUp, Move the cursor by one screen. Extend the selection.\n"
|
||||
+ "Shift-PgDn\n"
|
||||
+ "Home or Ctrl-a Move the cursor to line start. Clear the selection.\n"
|
||||
+ "Shift-Home Move the cursor to line start. Extend the selection.\n"
|
||||
+ "End or Ctrl-e Move the cursor to line end. Clear the selection.\n"
|
||||
+ "Shift-End Move the cursor to line end. Extend the selection.\n"
|
||||
+ "Ctrl-Home Move the cursor to the beginning of text. Clear the selection.\n"
|
||||
+ "Ctrl-End Move the cursor to the beginning of text. Extend the selection.\n"
|
||||
+ "Ctrl-/ Select everything in the text widget.\n"
|
||||
+ "Ctrl-\\ Clear the selection.\n"
|
||||
+ "Delete Delete the selection, if any. Otherwise delete the character 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-d Delete character to the right of the cursor.\n"
|
||||
+ "Alt-d Delete word to the right 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"
|
||||
+ " character.\n"
|
||||
+ "Ctrl-o Insert a newline but do not advance the cursor.\n"
|
||||
+ "Alt-Delete Delete the word to the left of the cursor.\n"
|
||||
+ "Ctrl-t Transpose the characters on either side of the cursor.";
|
||||
keyBindingUsageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
keyBindingUsageDlg.open();
|
||||
} else {
|
||||
keyBindingUsageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1360,101 +1411,104 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String text = "This is a text editor specialized for composing and checking TAFs.\n"
|
||||
+ "\n"
|
||||
+ "The dialog consists of two areas. The top part is for viewing and\n"
|
||||
+ "editing TAFs, the bottom part displays guidance data.\n"
|
||||
+ "\n"
|
||||
+ "The text editor consists of 4 independent pages. Each one displays WMO\n"
|
||||
+ "header. The 'Rtn', ..., 'Cor' toggles change forecast type. Use\n"
|
||||
+ "'Clear' button to clear the text window. The 'Tools' combo box\n"
|
||||
+ "displays list of site-specific utilities to modify the forecast.\n"
|
||||
+ "\n"
|
||||
+ "Menus:\n"
|
||||
+ " Most of the items are relevant when the 'Editor' tab is selected. \n"
|
||||
+ " File:\n"
|
||||
+ " Print - call print dialog\n"
|
||||
+ " Clear Errors - clears error tags set by the formatting \n"
|
||||
+ " (quality check) action. Can be used to force \n"
|
||||
+ " transmission of forecasts that did not pass\n"
|
||||
+ " the Syntax check. It also reverses colors in\n"
|
||||
+ " the editor window to normal after forecast is\n"
|
||||
+ " sent\n"
|
||||
+ " Update Times - updates issue and valid times\n"
|
||||
+ " Save As - allows to save edited forecast to a file. \n"
|
||||
+ " Restore From - use to restore forecast from a backup file\n"
|
||||
+ " Store in DB - use to store forecast in AWIPS text database\n"
|
||||
+ " Close - closes the editor window\n"
|
||||
+ "\n"
|
||||
+ " Options: \n"
|
||||
+ " Auto Save - toggles auto-save feature\n"
|
||||
+ " Auto Print - toggles automatic printout of sent forecasts\n"
|
||||
+ " Update Times on Format - if selected, the issue and valid times in \n"
|
||||
+ " the forecast are updated before quality control\n"
|
||||
+ " checks\n"
|
||||
+ " Send in Collective - Toggles collective versus split bulletin\n"
|
||||
+ " transmission. Intended for OCONUS sites only.\n"
|
||||
+ "\n"
|
||||
+ " Edit:\n"
|
||||
+ " Provides the usual editing functions (i.e. Cut, Copy, Paste, \n"
|
||||
+ " and Find/Replace)\n"
|
||||
+ "\n"
|
||||
+ "TAF editor area:\n"
|
||||
+ "\n"
|
||||
+ "Buttons:\n"
|
||||
+ " Load: invokes forecast selection dialog. Bulletin (or product) \n"
|
||||
+ " is selected from 'Bulletins' menu. To load bulletin from \n"
|
||||
+ " previously saved file, set the 'From file' toggle.\n"
|
||||
+ " Otherwise the forecasts will be loaded depending on \n"
|
||||
+ " the 'Load Order' selecton:\n"
|
||||
+ " Latest: first an attempt is made to access the most \n"
|
||||
+ " recent previous forecast. If one cannot be found,\n"
|
||||
+ " a template file is loaded.\n"
|
||||
+ " Merge: loads previous forecast, then appends template.\n"
|
||||
+ " The intent is to allow phrases such as\n"
|
||||
+ " AMD NOT SKED AFT D1HHZ.\n"
|
||||
+ " Template: loads forecasts from template file.\n"
|
||||
+ " 'Forecast Type' selection is used to initialize WMO\n"
|
||||
+ " header (DDHHMM and BBB) fields. These fields will be \n"
|
||||
+ " updated when forecast is sent. \n"
|
||||
+ "\n"
|
||||
+ " Syntax: Performs syntax check and assures proper indentation \n"
|
||||
+ " and maximum line length. If Syntax Check fails the forecast, \n"
|
||||
+ " the problem areas will be highlighted. The color \n"
|
||||
+ " corresponds to the severity of the problem. Red means \n"
|
||||
+ " the forecast could not be parsed sucessfully. Orange \n"
|
||||
+ " means error according to NWSI 10-813. Green is a warning.\n"
|
||||
+ "\n"
|
||||
+ " QC: Performs selected quality control checks\n"
|
||||
+ "\n"
|
||||
+ " Send: Splits the bulletin into separate files, one per site, \n"
|
||||
+ " which are written to directory 'xmit/pending'. \n"
|
||||
+ " The transmission program running on the data server is \n"
|
||||
+ " responsible for actual transmission.\n"
|
||||
+ " The program will check whether a regular forecast is \n"
|
||||
+ " sent within the transmission time window. If not, an \n"
|
||||
+ " error dialog is displayed.\n"
|
||||
+ "\n"
|
||||
+ " Save: Stores bulletin as a work TAF in a file\n"
|
||||
+ "\n"
|
||||
+ " Restore: Restores bulletin from the work file\n"
|
||||
+ "\n"
|
||||
+ "Toggles:\n"
|
||||
+ " Insert - toggles insert/overwrite mode\n"
|
||||
+ " Wrap - if selected, the line is folded when its length\n"
|
||||
+ " exceedes window width. Has no effect on \n"
|
||||
+ " the final format.\n"
|
||||
+ "\n"
|
||||
+ "Viewer area:\n"
|
||||
+ " Use 'Site ID' combo box to view site data from the list of \n"
|
||||
+ " currently monitored sites. \n"
|
||||
+ " Select page in the notebook for a specific data source. The list \n"
|
||||
+ " of data sources is configurable. A set of display options is \n"
|
||||
+ " available, depending on the data source.";
|
||||
String description = "Usage";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
text);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "Usage";
|
||||
String helpText = "This is a text editor specialized for composing and checking TAFs.\n"
|
||||
+ "\n"
|
||||
+ "The dialog consists of two areas. The top part is for viewing and\n"
|
||||
+ "editing TAFs, the bottom part displays guidance data.\n"
|
||||
+ "\n"
|
||||
+ "The text editor consists of 4 independent pages. Each one displays WMO\n"
|
||||
+ "header. The 'Rtn', ..., 'Cor' toggles change forecast type. Use\n"
|
||||
+ "'Clear' button to clear the text window. The 'Tools' combo box\n"
|
||||
+ "displays list of site-specific utilities to modify the forecast.\n"
|
||||
+ "\n"
|
||||
+ "Menus:\n"
|
||||
+ " Most of the items are relevant when the 'Editor' tab is selected. \n"
|
||||
+ " File:\n"
|
||||
+ " Print - call print dialog\n"
|
||||
+ " Clear Errors - clears error tags set by the formatting \n"
|
||||
+ " (quality check) action. Can be used to force \n"
|
||||
+ " transmission of forecasts that did not pass\n"
|
||||
+ " the Syntax check. It also reverses colors in\n"
|
||||
+ " the editor window to normal after forecast is\n"
|
||||
+ " sent\n"
|
||||
+ " Update Times - updates issue and valid times\n"
|
||||
+ " Save As - allows to save edited forecast to a file. \n"
|
||||
+ " Restore From - use to restore forecast from a backup file\n"
|
||||
+ " Store in DB - use to store forecast in AWIPS text database\n"
|
||||
+ " Close - closes the editor window\n"
|
||||
+ "\n"
|
||||
+ " Options: \n"
|
||||
+ " Auto Save - toggles auto-save feature\n"
|
||||
+ " Auto Print - toggles automatic printout of sent forecasts\n"
|
||||
+ " Update Times on Format - if selected, the issue and valid times in \n"
|
||||
+ " the forecast are updated before quality control\n"
|
||||
+ " checks\n"
|
||||
+ " Send in Collective - Toggles collective versus split bulletin\n"
|
||||
+ " transmission. Intended for OCONUS sites only.\n"
|
||||
+ "\n"
|
||||
+ " Edit:\n"
|
||||
+ " Provides the usual editing functions (i.e. Cut, Copy, Paste, \n"
|
||||
+ " and Find/Replace)\n"
|
||||
+ "\n"
|
||||
+ "TAF editor area:\n"
|
||||
+ "\n"
|
||||
+ "Buttons:\n"
|
||||
+ " Load: invokes forecast selection dialog. Bulletin (or product) \n"
|
||||
+ " is selected from 'Bulletins' menu. To load bulletin from \n"
|
||||
+ " previously saved file, set the 'From file' toggle.\n"
|
||||
+ " Otherwise the forecasts will be loaded depending on \n"
|
||||
+ " the 'Load Order' selecton:\n"
|
||||
+ " Latest: first an attempt is made to access the most \n"
|
||||
+ " recent previous forecast. If one cannot be found,\n"
|
||||
+ " a template file is loaded.\n"
|
||||
+ " Merge: loads previous forecast, then appends template.\n"
|
||||
+ " The intent is to allow phrases such as\n"
|
||||
+ " AMD NOT SKED AFT D1HHZ.\n"
|
||||
+ " Template: loads forecasts from template file.\n"
|
||||
+ " 'Forecast Type' selection is used to initialize WMO\n"
|
||||
+ " header (DDHHMM and BBB) fields. These fields will be \n"
|
||||
+ " updated when forecast is sent. \n"
|
||||
+ "\n"
|
||||
+ " Syntax: Performs syntax check and assures proper indentation \n"
|
||||
+ " and maximum line length. If Syntax Check fails the forecast, \n"
|
||||
+ " the problem areas will be highlighted. The color \n"
|
||||
+ " corresponds to the severity of the problem. Red means \n"
|
||||
+ " the forecast could not be parsed sucessfully. Orange \n"
|
||||
+ " means error according to NWSI 10-813. Green is a warning.\n"
|
||||
+ "\n"
|
||||
+ " QC: Performs selected quality control checks\n"
|
||||
+ "\n"
|
||||
+ " Send: Splits the bulletin into separate files, one per site, \n"
|
||||
+ " which are written to directory 'xmit/pending'. \n"
|
||||
+ " The transmission program running on the data server is \n"
|
||||
+ " responsible for actual transmission.\n"
|
||||
+ " The program will check whether a regular forecast is \n"
|
||||
+ " sent within the transmission time window. If not, an \n"
|
||||
+ " error dialog is displayed.\n"
|
||||
+ "\n"
|
||||
+ " Save: Stores bulletin as a work TAF in a file\n"
|
||||
+ "\n"
|
||||
+ " Restore: Restores bulletin from the work file\n"
|
||||
+ "\n"
|
||||
+ "Toggles:\n"
|
||||
+ " Insert - toggles insert/overwrite mode\n"
|
||||
+ " Wrap - if selected, the line is folded when its length\n"
|
||||
+ " exceedes window width. Has no effect on \n"
|
||||
+ " the final format.\n"
|
||||
+ "\n"
|
||||
+ "Viewer area:\n"
|
||||
+ " Use 'Site ID' combo box to view site data from the list of \n"
|
||||
+ " currently monitored sites. \n"
|
||||
+ " Select page in the notebook for a specific data source. The list \n"
|
||||
+ " of data sources is configurable. A set of display options is \n"
|
||||
+ " available, depending on the data source.";
|
||||
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1654,9 +1708,12 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
loadBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
LoaderDialog loadDlg = new LoaderDialog(shell,
|
||||
TafViewerEditorDlg.this);
|
||||
loadDlg.open();
|
||||
if (mustCreate(loadDlg)) {
|
||||
loadDlg = new LoaderDialog(shell, TafViewerEditorDlg.this);
|
||||
loadDlg.open();
|
||||
} else {
|
||||
loadDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1752,14 +1809,26 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
printForecast(editorTafTabComp.getTextEditorControl()
|
||||
.getText());
|
||||
}
|
||||
SendDialog sendDlg = new SendDialog(shell,
|
||||
editorTafTabComp, msgStatComp, sendCollectMI
|
||||
.getSelection());
|
||||
sendDlg.open();
|
||||
// sendDlg sets the "taf sent" field only
|
||||
if (editorTafTabComp.isTafSent()) {
|
||||
editorTafTabComp.updateTafSent(true);
|
||||
|
||||
if (mustCreate(sendDlg)) {
|
||||
sendDlg = new SendDialog(shell, editorTafTabComp,
|
||||
msgStatComp, sendCollectMI.getSelection());
|
||||
sendDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@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 {
|
||||
putMessageToForecaster("Cannot send forecast: Press Syntax before transmission");
|
||||
}
|
||||
|
@ -2491,6 +2560,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
*/
|
||||
@Override
|
||||
public void populateViewerStation(String theStation) {
|
||||
checkDlg();
|
||||
siteIdCbo.select(siteIdCbo.indexOf(theStation));
|
||||
}
|
||||
|
||||
|
@ -2684,7 +2754,8 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
private boolean checkSyntaxInEditor(boolean doLogMessage) {
|
||||
// Get the content of the Taf Editor.
|
||||
// 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.
|
||||
boolean errorInTaf = false;
|
||||
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) {
|
||||
QcDialog qcDlg = new QcDialog(shell, savedQcItems);
|
||||
Object o = qcDlg.open();
|
||||
if (o == null) {
|
||||
return;
|
||||
}
|
||||
HashMap<String, String> qcItems = (HashMap<String, String>) o;
|
||||
qcMap = new HashMap<String, HashMap<String, String>>();
|
||||
for (String site : sitesInTaf) {
|
||||
qcMap.put(site, qcItems);
|
||||
if (mustCreate(qcDlg)) {
|
||||
qcDlg = new QcDialog(shell, savedQcItems);
|
||||
qcDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
String tafText = editorTafTabComp
|
||||
.getTextEditorControl().getText();
|
||||
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 {
|
||||
String tafText = editorTafTabComp.getTextEditorControl().getText();
|
||||
List<String> sitesInTaf = getSitesInTaf(tafText);
|
||||
HashMap<String, HashMap<String, String>> qcMap = null;
|
||||
qcMap = new HashMap<String, HashMap<String, String>>();
|
||||
|
||||
for (String site : sitesInTaf) {
|
||||
qcMap.put(site, null);
|
||||
}
|
||||
}
|
||||
try {
|
||||
setWaitCursor(true);
|
||||
qcCheck(qcMap);
|
||||
} finally {
|
||||
setWaitCursor(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3301,6 +3379,7 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
@SuppressWarnings("unchecked")
|
||||
private void qcCheck(HashMap<String, HashMap<String, String>> qcMap) {
|
||||
try {
|
||||
setWaitCursor(true);
|
||||
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
|
||||
ArrayList<Object> tafs = new ArrayList<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.");
|
||||
} catch (IOException e) {
|
||||
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("\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());
|
||||
hightlightTAF();
|
||||
|
@ -3675,10 +3756,10 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
}
|
||||
|
||||
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
||||
String taf = tafViewerStTxt.getText();
|
||||
String taf = tafViewerStTxt.getText();
|
||||
int offset = taf.indexOf("TAF");
|
||||
if ( showHeadersChk.getSelection() ) {
|
||||
offset = taf.indexOf("TAF", offset + 3);
|
||||
if (showHeadersChk.getSelection()) {
|
||||
offset = taf.indexOf("TAF", offset + 3);
|
||||
}
|
||||
try {
|
||||
int end = taf.indexOf("TAF", offset + 3);
|
||||
|
@ -3686,90 +3767,109 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
taf = taf.substring(offset, end);
|
||||
} else {
|
||||
taf = taf.substring(offset);
|
||||
}
|
||||
}
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
// Assume no TAF in the viewer
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String,String> alertTimeMap=TafMonitorDlg.getCurrentAlertTimeMap(stationName);// DR 14570
|
||||
|
||||
Map<String, String> alertTimeMap = TafMonitorDlg
|
||||
.getCurrentAlertTimeMap(stationName);// DR 14570
|
||||
|
||||
// 20120712 for TEMPO
|
||||
String TEMPO_TXT = "TEMPO";
|
||||
|
||||
if(taf.contains(TEMPO_TXT)){
|
||||
if (taf.contains(TEMPO_TXT)) {
|
||||
|
||||
Map<String,String[]> tempoMap = TafMonitorDlg.getCurrentTempoMap(stationName);//20120711
|
||||
if(tempoMap != null){
|
||||
int tempoStart = taf.indexOf(TEMPO_TXT);
|
||||
int tempoEnd = taf.indexOf(TafUtil.LINE_BREAK, tempoStart);//end of the TEMPO line
|
||||
Map<String, String[]> tempoMap = TafMonitorDlg
|
||||
.getCurrentTempoMap(stationName);// 20120711
|
||||
if (tempoMap != null) {
|
||||
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()) {
|
||||
//System.out.println("2___alertKey: "+ alertKey);
|
||||
for (String value : tempoMap.get(alertKey)) {
|
||||
//System.out.println("3___value: "+ value);
|
||||
str.setLength(1);
|
||||
str.append(value);
|
||||
int len = str.length();
|
||||
str.append(" ");
|
||||
for (String alertKey : tempoMap.keySet()) {
|
||||
// System.out.println("2___alertKey: "+ alertKey);
|
||||
for (String value : tempoMap.get(alertKey)) {
|
||||
// System.out.println("3___value: "+ value);
|
||||
str.setLength(1);
|
||||
str.append(value);
|
||||
int len = str.length();
|
||||
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) {
|
||||
str.setLength(len);
|
||||
str.append("\n");
|
||||
startIndex = taf.indexOf(str.toString());
|
||||
}
|
||||
if (startIndex >= 0 /*within tempo line*/&& startIndex<tempoEnd) {
|
||||
StyleRange sr = new StyleRange(offset + startIndex + 1,
|
||||
len - 1, null, configMgr.getViwerAlertColor());
|
||||
if (startIndex < 0) {
|
||||
str.setLength(len);
|
||||
str.append("\n");
|
||||
startIndex = taf.indexOf(str.toString());
|
||||
}
|
||||
if (startIndex >= 0 /* within tempo line */
|
||||
&& startIndex < tempoEnd) {
|
||||
StyleRange sr = new StyleRange(offset + startIndex
|
||||
+ 1, len - 1, null,
|
||||
configMgr.getViwerAlertColor());
|
||||
|
||||
tafViewerStTxt.setStyleRange(sr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tafViewerStTxt.setStyleRange(sr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}// END 20120712 for TEMPO
|
||||
|
||||
|
||||
StringBuilder str = new StringBuilder(" ");
|
||||
for (String alertKey : alertMap.keySet()) {
|
||||
for (String value : alertMap.get(alertKey)) {
|
||||
str.setLength(1);
|
||||
str.append(value);
|
||||
int len = str.length();
|
||||
str.append(" ");
|
||||
String time = alertTimeMap.get(alertKey);// 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 endIndex = taf.indexOf(TafUtil.LINE_BREAK, idx);// DR 14570: a line ends with a 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());
|
||||
}
|
||||
}
|
||||
for (String value : alertMap.get(alertKey)) {
|
||||
str.setLength(1);
|
||||
str.append(value);
|
||||
int len = str.length();
|
||||
str.append(" ");
|
||||
String time = alertTimeMap.get(alertKey);// 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 endIndex = taf.indexOf(TafUtil.LINE_BREAK, idx);// DR 14570:
|
||||
// a line
|
||||
// ends with
|
||||
// a
|
||||
// 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) {
|
||||
StyleRange sr = new StyleRange(offset + startIndex + 1,
|
||||
len - 1, null, configMgr.getViwerAlertColor());
|
||||
if (startIndex >= 0 /* within the same line */
|
||||
&& startIndex < endIndex) {
|
||||
StyleRange sr = new StyleRange(offset + startIndex + 1,
|
||||
len - 1, null, configMgr.getViwerAlertColor());
|
||||
|
||||
tafViewerStTxt.setStyleRange(sr);
|
||||
} else {
|
||||
// Should not get here. The first TAF in the viewer and the
|
||||
// values in the alertMap should both be from the latest
|
||||
// TAF. This indicates a program bug.
|
||||
System.out.println("highlightTAF unable to find: \""
|
||||
+ str.toString() + "\" in the first TAF");
|
||||
}
|
||||
tafViewerStTxt.setStyleRange(sr);
|
||||
} else {
|
||||
// Should not get here. The first TAF in the viewer and the
|
||||
// values in the alertMap should both be from the latest
|
||||
// TAF. This indicates a program bug.
|
||||
System.out.println("highlightTAF unable to find: \""
|
||||
+ str.toString() + "\" in the first TAF");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4166,6 +4266,18 @@ public class TafViewerEditorDlg extends Dialog implements ITafSettable,
|
|||
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
|
||||
* 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.
|
||||
* 12/08/2011 11745 rferrel Updated header time to transmission time.
|
||||
* 08AUG2012 15613 zhao Determine proper BBB for transmission
|
||||
* 09OCT2012 1229 rferrel Make dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -146,7 +147,7 @@ public class SendDialog extends CaveSWTDialog {
|
|||
public SendDialog(Shell parent, EditorTafTabComp tabComp,
|
||||
IStatusSettable msgStatComp, boolean sendCollective) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS Send");
|
||||
|
||||
this.tabComp = tabComp;
|
||||
|
@ -365,7 +366,7 @@ public class SendDialog extends CaveSWTDialog {
|
|||
String siteWmoId = tabComp.getWmoId();
|
||||
// WMO Site
|
||||
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> updatedTafs = new ArrayList<String>();
|
||||
|
@ -407,11 +408,10 @@ public class SendDialog extends CaveSWTDialog {
|
|||
* If "AAX" or "CCX" or "RRX", determine BBB for transmission
|
||||
*/
|
||||
String xmitBbb = bbb;
|
||||
if ( bbb.equals("AAX") || bbb.equals("CCX") || bbb.equals("RRX") ) {
|
||||
String type = bbb.substring(0, 2);
|
||||
xmitBbb = getXmitBbb( type, siteId);
|
||||
if (bbb.equals("AAX") || bbb.equals("CCX") || bbb.equals("RRX")) {
|
||||
String type = bbb.substring(0, 2);
|
||||
xmitBbb = getXmitBbb(type, siteId);
|
||||
}
|
||||
|
||||
|
||||
// Update Header Time to transmission time.
|
||||
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
|
||||
|
@ -467,40 +467,41 @@ public class SendDialog extends CaveSWTDialog {
|
|||
shell.dispose();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private String getXmitBbb(String type, String siteId) {
|
||||
|
||||
try {
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.GET_LIST);
|
||||
request.setState(TafQueueRecord.TafQueueState.SENT);
|
||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient.sendRequest(request);
|
||||
java.util.List<String> payload = response.getPayload();
|
||||
String [] records = (String []) payload.toArray(new String[0]);
|
||||
int numRecords = records.length;
|
||||
for ( int i = numRecords-1; i >=0; i-- ) {
|
||||
if ( records[i].contains(siteId) ) {
|
||||
String [] texts = records[i].split("-");
|
||||
String bbb = texts[texts.length-2];
|
||||
if ( bbb.equals(" ") ) {
|
||||
return type+"A";
|
||||
}
|
||||
if ( bbb.subSequence(0, 2).equals(type) ) {
|
||||
char[] newX = new char[] { bbb.charAt(2) };
|
||||
if ( newX[0] == 'X' ) {
|
||||
newX[0] = 'A';
|
||||
} else {
|
||||
newX[0]++;
|
||||
}
|
||||
return type + new String( newX );
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return type + "A";
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
private String getXmitBbb(String type, String siteId) {
|
||||
|
||||
try {
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.GET_LIST);
|
||||
request.setState(TafQueueRecord.TafQueueState.SENT);
|
||||
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
|
||||
.sendRequest(request);
|
||||
java.util.List<String> payload = response.getPayload();
|
||||
String[] records = (String[]) payload.toArray(new String[0]);
|
||||
int numRecords = records.length;
|
||||
for (int i = numRecords - 1; i >= 0; i--) {
|
||||
if (records[i].contains(siteId)) {
|
||||
String[] texts = records[i].split("-");
|
||||
String bbb = texts[texts.length - 2];
|
||||
if (bbb.equals(" ")) {
|
||||
return type + "A";
|
||||
}
|
||||
if (bbb.subSequence(0, 2).equals(type)) {
|
||||
char[] newX = new char[] { bbb.charAt(2) };
|
||||
if (newX[0] == 'X') {
|
||||
newX[0] = 'A';
|
||||
} else {
|
||||
newX[0]++;
|
||||
}
|
||||
return type + new String(newX);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return type + "A";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
|||
import com.raytheon.viz.avnconfig.IStatusSettable;
|
||||
import com.raytheon.viz.avnconfig.MessageStatusComp;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* TafMonitorDlg (Terminal Aerodome Forecast Monitor Dialog) class.
|
||||
|
@ -128,8 +129,16 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 10/27/2010 7383 rferrel Save changed blink state in configMgr.
|
||||
* 3/14/2011 8588 rferrel Allow monitoring multiple products.
|
||||
* 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>
|
||||
*
|
||||
* @author grichard
|
||||
|
@ -187,6 +196,16 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private ResourceEditorDlg resDlg;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BackupDialog backupDialog;
|
||||
|
||||
/**
|
||||
* Alert configuration dialog.
|
||||
*/
|
||||
private AlertDialog alertDialog;
|
||||
|
||||
/**
|
||||
* Resource configuration manager.
|
||||
*/
|
||||
|
@ -235,6 +254,12 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
|
||||
private List<String> productDisplayList;
|
||||
|
||||
private ClimateMenuDlg climateMenuDlg;
|
||||
|
||||
private TransmissionQueueDlg tqDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -247,7 +272,7 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
List<String> productDispalyList) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT
|
||||
| CAVE.INDEPENDENT_SHELL);
|
||||
| CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS Monitor");
|
||||
|
||||
this.stationList = stationList;
|
||||
|
@ -373,7 +398,23 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
|
||||
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();
|
||||
createButtonsComposite();
|
||||
|
@ -480,13 +521,11 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
setupMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (resDlg == null) {
|
||||
if (mustCreate(resDlg)) {
|
||||
resDlg = new ResourceEditorDlg(shell);
|
||||
resDlg.open();
|
||||
|
||||
resDlg = null;
|
||||
} else {
|
||||
resDlg.showDialog();
|
||||
resDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -499,8 +538,14 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
alertMenuItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
AlertDialog alertDialog = new AlertDialog(shell);
|
||||
alertDialog.open();
|
||||
// Do we need to create a new dialog?
|
||||
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() {
|
||||
@Override
|
||||
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.";
|
||||
String description = "Usage";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
text);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String descrription = "Usage";
|
||||
|
||||
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 = new HelpUsageDlg(shell, descrription, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -617,9 +666,13 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
msgTypes[2] = StatusMessageType.TafMonCigVis;
|
||||
msgTypes[3] = StatusMessageType.TafMonCigVisTrend;
|
||||
|
||||
ClimateMenuDlg climateMenuDlg = new ClimateMenuDlg(shell,
|
||||
msgTypes, configMgr.getDefaultBackgroundRGB());
|
||||
climateMenuDlg.open();
|
||||
if (mustCreate(climateMenuDlg)) {
|
||||
climateMenuDlg = new ClimateMenuDlg(shell, msgTypes,
|
||||
configMgr.getDefaultBackgroundRGB());
|
||||
climateMenuDlg.open();
|
||||
} else {
|
||||
climateMenuDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -632,11 +685,19 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
|
||||
if (avnPlotDlg == null) {
|
||||
if (mustCreate(avnPlotDlg)) {
|
||||
avnPlotDlg = new WeatherPlotDialog(shell,
|
||||
StatusMessageType.WeatherPlot, stationList);
|
||||
avnPlotDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
avnPlotDlg = null;
|
||||
}
|
||||
});
|
||||
avnPlotDlg.open();
|
||||
avnPlotDlg = null;
|
||||
} else {
|
||||
avnPlotDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -649,9 +710,13 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
backupBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
BackupDialog backup = new BackupDialog(shell,
|
||||
productDisplayList);
|
||||
backup.open();
|
||||
if (mustCreate(backupDialog)) {
|
||||
backupDialog = new BackupDialog(shell, productDisplayList);
|
||||
backupDialog.open();
|
||||
} else {
|
||||
// No, so use the existing dialog.
|
||||
backupDialog.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -664,8 +729,12 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
queueBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
TransmissionQueueDlg tqd = new TransmissionQueueDlg(shell);
|
||||
tqd.open();
|
||||
if (mustCreate(tqDlg)) {
|
||||
tqDlg = new TransmissionQueueDlg(shell);
|
||||
tqDlg.open();
|
||||
} else {
|
||||
tqDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -823,7 +892,8 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
tveDlg.disposeDialog();
|
||||
shell.dispose();
|
||||
// shell.dispose();
|
||||
close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -918,10 +988,10 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
public final List<ViewerTab> getViewerTabList() {
|
||||
return tveDlg.getViewerTabList();
|
||||
}
|
||||
|
||||
//------------------------- DR 14570:
|
||||
|
||||
public static Map<String,String> getCurrentAlertTimeMap(String siteID){
|
||||
|
||||
// ------------------------- DR 14570:
|
||||
|
||||
public static Map<String, String> getCurrentAlertTimeMap(String siteID) {
|
||||
Map<String, String> alertTimeMap = null;
|
||||
if (currentDlg != null) {
|
||||
if (currentDlg.getDisplay().isDisposed()) {
|
||||
|
@ -936,8 +1006,9 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
}
|
||||
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;
|
||||
if (currentDlg != null) {
|
||||
if (currentDlg.getDisplay().isDisposed()) {
|
||||
|
@ -945,7 +1016,7 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
|||
} else {
|
||||
for (TafSiteComp siteRow : currentDlg.getTafSiteComps()) {
|
||||
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.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 {
|
||||
|
||||
private ScrolledComposite scrolledComp;
|
||||
|
@ -52,7 +69,8 @@ public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
|||
private ResourceEditorHelpDlg helpDlg;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -144,13 +162,11 @@ public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
|||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (helpDlg == null) {
|
||||
if (mustCreate(helpDlg)) {
|
||||
helpDlg = new ResourceEditorHelpDlg(shell);
|
||||
helpDlg.open();
|
||||
|
||||
helpDlg = null;
|
||||
} else {
|
||||
helpDlg.showDialog();
|
||||
helpDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -198,8 +214,4 @@ public class ResourceEditorDlg extends CaveSWTDialog implements IResize {
|
|||
scrolledComp.setMinSize(resourceComp.computeSize(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.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 {
|
||||
/**
|
||||
* Main composite for the controls.
|
||||
|
@ -48,9 +67,14 @@ public class ResourceEditorHelpDlg extends CaveSWTDialog {
|
|||
|
||||
private Cursor textCursor;
|
||||
|
||||
/**
|
||||
* Construct the ResourceEditor help dialog.
|
||||
* @param parentShell The shell containing this dialog.
|
||||
*/
|
||||
public ResourceEditorHelpDlg(Shell parentShell) {
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 1/24/2008 817 grichard Initial creation.
|
||||
* 20121010 1229 jkorman Added DO_NOT_BLOCK so dialog does not block on open.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -72,7 +73,7 @@ public class AlertDialog extends CaveSWTDialog {
|
|||
* Parent Shell.
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* in initializeComponents.
|
||||
* 10/06/2010 6009 rferrel Use product to get initial selected item.
|
||||
* 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>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -88,7 +88,7 @@ public class BackupDialog extends CaveSWTDialog {
|
|||
*/
|
||||
public BackupDialog(Shell parent, java.util.List<String> productDisplayList) {
|
||||
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");
|
||||
this.productDisplayList = productDisplayList;
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 FEB 2008 938 lvenable Initial creation.
|
||||
* 3/27/2008 1033 grichard Added ETA-MOS label.
|
||||
* 10/10/2012 1229 rferrel Make dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -95,7 +96,8 @@ public class TimeSelectorDialog extends CaveSWTDialog {
|
|||
*/
|
||||
public TimeSelectorDialog(Shell parent, WxPlotCfg wxPlotCfg) {
|
||||
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");
|
||||
this.wxPlotCfg = wxPlotCfg;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,8 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 FEB 2008 938 lvenable Initial creation
|
||||
* 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>
|
||||
*
|
||||
|
@ -68,26 +70,6 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
|
|||
*
|
||||
*/
|
||||
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.
|
||||
|
@ -149,6 +131,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private IStatusSettable msgStatComp;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -157,7 +141,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public TransmissionQueueDlg(Shell parent) {
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -298,10 +283,35 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
|
|||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "Help";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "Help";
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
// Allow multiple instances of this dialog.
|
||||
TransmissionViewerDlg tvd = new TransmissionViewerDlg(shell,
|
||||
tafText, tafInfo);
|
||||
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.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 {
|
||||
|
||||
/**
|
||||
|
@ -55,7 +72,8 @@ public class TransmissionViewerDlg extends CaveSWTDialog {
|
|||
public TransmissionViewerDlg(Shell parentShell, String tafText,
|
||||
String tafInfo) {
|
||||
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);
|
||||
|
||||
this.tafText = tafText;
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 FEB 2008 938 lvenable Initial creation.
|
||||
* 6/19/2008 937 grichard Implemented 'replace all'.
|
||||
* 10/11/2012 1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -119,7 +120,8 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
* Text editor containing the text to be searched.
|
||||
*/
|
||||
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");
|
||||
|
||||
this.textEditor = textEditor;
|
||||
|
|
|
@ -42,6 +42,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28 FEB 2008 938 lvenable Initial creation.
|
||||
* 15 OCT 2012 1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -83,7 +84,7 @@ public class HelpUsageDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public HelpUsageDlg(Shell parent, String helpDesc, String helpText) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
|
||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS Help");
|
||||
|
||||
this.helpDesc = helpDesc;
|
||||
|
|
|
@ -67,6 +67,9 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
|||
* 2/6/2008 817 lvenable Initial creation.
|
||||
* 4/7/2008 934 grichard Added IStatusSettable implementation.
|
||||
* 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>
|
||||
*
|
||||
|
@ -341,17 +344,19 @@ public class MessageStatusComp extends Composite implements IStatusSettable {
|
|||
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());
|
||||
sb.append(" ").append(msg);
|
||||
StringBuilder sb = new StringBuilder(calculateIssueTime());
|
||||
sb.append(" ").append(msg);
|
||||
|
||||
AvnMessageMgr msgMgr = AvnMessageMgr.getInstance();
|
||||
msgMgr.addMessage(msgType, sb.toString());
|
||||
AvnMessageMgr msgMgr = AvnMessageMgr.getInstance();
|
||||
msgMgr.addMessage(msgType, sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -419,12 +424,12 @@ public class MessageStatusComp extends Composite implements IStatusSettable {
|
|||
* Create the message viewer dialog.
|
||||
*/
|
||||
private void createMessageViewerDialog() {
|
||||
if (msgViewerDlg == null || msgViewerDlg.getShell().isDisposed()) {
|
||||
if (msgViewerDlg == null || msgViewerDlg.getShell() == null
|
||||
|| msgViewerDlg.isDisposed()) {
|
||||
msgViewerDlg = new MessageViewerDlg(this, msgType);
|
||||
msgViewerDlg.open();
|
||||
msgViewerDlg = null;
|
||||
} else {
|
||||
msgViewerDlg.showDialog();
|
||||
msgViewerDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 28 FEB 2008 938 lvenable Initial creation.
|
||||
* 4/8/2008 934 grichard Added IStatusViewable interface.
|
||||
* 9/12/2008 1444 grichard Accommodate separate message logs.
|
||||
* 10/12/2012 1229 rferrel Make dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -81,7 +82,7 @@ public class MessageViewerDlg extends CaveSWTDialog {
|
|||
*/
|
||||
public MessageViewerDlg(Composite parent, StatusMessageType msgType) {
|
||||
super(parent.getShell(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS,
|
||||
CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
|
||||
setText("Message Log");
|
||||
|
||||
this.msgType = msgType;
|
||||
|
@ -178,16 +179,4 @@ public class MessageViewerDlg extends CaveSWTDialog {
|
|||
}
|
||||
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.widgets.Button;
|
||||
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.Shell;
|
||||
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.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
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
|
||||
|
@ -59,6 +58,9 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.DataSource;
|
|||
* 16 Mar 2011 8599 rferrel Create msgStatusComp then load tabs.
|
||||
* 27 Sep 2011 10958 rferrel Display more details when handling
|
||||
* 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>
|
||||
*
|
||||
|
@ -66,16 +68,7 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.DataSource;
|
|||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class MonitoringCriteriaDlg extends Dialog {
|
||||
/**
|
||||
* Dialog shell.
|
||||
*/
|
||||
private Shell shell;
|
||||
|
||||
/**
|
||||
* The display control.
|
||||
*/
|
||||
private Display display;
|
||||
public class MonitoringCriteriaDlg extends CaveSWTDialog {
|
||||
|
||||
/**
|
||||
* Composite containing message status controls.
|
||||
|
@ -108,6 +101,8 @@ public class MonitoringCriteriaDlg extends Dialog {
|
|||
*/
|
||||
private DefaultRuleData defaultRuleData;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -115,20 +110,12 @@ public class MonitoringCriteriaDlg extends Dialog {
|
|||
* Parent shell.
|
||||
*/
|
||||
public MonitoringCriteriaDlg(Shell parent) {
|
||||
super(parent, 0);
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS Monitoring Criteria");
|
||||
}
|
||||
|
||||
/**
|
||||
* Open method used to display the dialog.
|
||||
*
|
||||
* @return Null.
|
||||
*/
|
||||
public Object open() {
|
||||
Shell parent = getParent();
|
||||
display = parent.getDisplay();
|
||||
shell = new Shell(parent, SWT.DIALOG_TRIM);
|
||||
shell.setText("AvnFPS Monitoring Criteria");
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
// Create the main layout for the shell.
|
||||
GridLayout mainLayout = new GridLayout(1, false);
|
||||
mainLayout.marginHeight = 3;
|
||||
|
@ -138,17 +125,6 @@ public class MonitoringCriteriaDlg extends Dialog {
|
|||
|
||||
// Initialize all of the controls and layouts
|
||||
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() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS - Monitoring Criteria Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS - Monitoring Criteria Help";
|
||||
|
||||
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 = 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.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Dialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
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.requests.ThriftClient;
|
||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
/**
|
||||
* TAF product configuration dialog.
|
||||
|
@ -66,6 +66,9 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
|||
* 22 MAY 2008 1119 lvenable Initial creation
|
||||
* 9 Jul 2010 5078 rferrel Added catches for File Not Found.
|
||||
* 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>
|
||||
*
|
||||
|
@ -73,20 +76,10 @@ import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
|||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class TafProductConfigDlg extends Dialog {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
public class TafProductConfigDlg extends CaveSWTDialog {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(TafProductConfigDlg.class);
|
||||
|
||||
/**
|
||||
* Dialog shell.
|
||||
*/
|
||||
private Shell shell;
|
||||
|
||||
/**
|
||||
* The display control.
|
||||
*/
|
||||
private Display display;
|
||||
|
||||
/**
|
||||
* Composite containing message status controls.
|
||||
*/
|
||||
|
@ -132,26 +125,20 @@ public class TafProductConfigDlg extends Dialog {
|
|||
*/
|
||||
private Map<String, java.util.List<String>> productsMap;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
public TafProductConfigDlg(Shell parent) {
|
||||
super(parent, 0);
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS TAF Product Configuration");
|
||||
}
|
||||
|
||||
/**
|
||||
* Open method used to display the dialog.
|
||||
*
|
||||
* @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");
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
// Create the main layout for the shell.
|
||||
GridLayout mainLayout = new GridLayout(1, false);
|
||||
mainLayout.marginHeight = 3;
|
||||
|
@ -161,25 +148,18 @@ public class TafProductConfigDlg extends Dialog {
|
|||
|
||||
// Initialize all of the controls and layouts
|
||||
initializeComponents();
|
||||
}
|
||||
|
||||
shell.pack();
|
||||
|
||||
shell.open();
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch()) {
|
||||
display.sleep();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposed() {
|
||||
listFont.dispose();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the components on the display.
|
||||
*/
|
||||
private void initializeComponents() {
|
||||
Display display = getParent().getDisplay();
|
||||
listFont = new Font(display, "Monospace", 10, SWT.NORMAL);
|
||||
|
||||
createBottomMessageControls();
|
||||
|
@ -562,11 +542,16 @@ public class TafProductConfigDlg extends Dialog {
|
|||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "TAF Product Configuration Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "TAF Product Configuration Help";
|
||||
|
||||
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 = 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.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.configuration.ConfigurationException;
|
||||
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.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Dialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
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.requests.ThriftClient;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -78,6 +80,10 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* Make and Edit buttons to work.
|
||||
* 10 Dec 2010 7662 rferrel Create and use getObStation.
|
||||
* 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>
|
||||
*
|
||||
|
@ -85,24 +91,14 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class TafSiteInfoEditorDlg extends Dialog {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(TafSiteInfoEditorDlg.class);
|
||||
|
||||
/**
|
||||
* A site's template hours.
|
||||
*/
|
||||
private final static String[] START_HOURS = { "00", "06", "12", "18" };
|
||||
|
||||
/**
|
||||
* Dialog shell.
|
||||
*/
|
||||
private Shell shell;
|
||||
|
||||
/**
|
||||
* The display control.
|
||||
*/
|
||||
private Display display;
|
||||
private final String[] START_HOURS = { "00", "06", "12", "18" };
|
||||
|
||||
/**
|
||||
* Composite containing message status controls.
|
||||
|
@ -241,6 +237,13 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
|||
*/
|
||||
private Color correctColor;
|
||||
|
||||
/**
|
||||
* Possible to have a different dialog for each issue time.
|
||||
*/
|
||||
private Map<String, TextEditorSetupDlg> editorDlgMap;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -248,19 +251,13 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
|||
* Parent shell.
|
||||
*/
|
||||
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>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open method used to display the dialog.
|
||||
*
|
||||
* @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");
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
|
||||
// Create the main layout for the shell.
|
||||
GridLayout mainLayout = new GridLayout(1, false);
|
||||
|
@ -271,25 +268,25 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
|||
|
||||
// Initialize all of the controls and layouts
|
||||
initializeComponents();
|
||||
}
|
||||
|
||||
shell.pack();
|
||||
|
||||
shell.open();
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch()) {
|
||||
display.sleep();
|
||||
}
|
||||
@Override
|
||||
protected void disposed() {
|
||||
if (incorrectColor != null) {
|
||||
incorrectColor.dispose();
|
||||
}
|
||||
|
||||
incorrectColor.dispose();
|
||||
|
||||
return null;
|
||||
if (correctColor != null) {
|
||||
correctColor.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the components on the display.
|
||||
*/
|
||||
private void initializeComponents() {
|
||||
Display display = getParent().getDisplay();
|
||||
|
||||
incorrectColor = new Color(display, new RGB(255, 215, 220));
|
||||
|
||||
createTopControls();
|
||||
|
@ -486,11 +483,16 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
|||
helpBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "AvnFPS - Site Info Editor Help";
|
||||
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.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "AvnFPS - Site Info Editor Help";
|
||||
|
||||
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 = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -877,15 +879,30 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
|||
public void widgetSelected(SelectionEvent event) {
|
||||
if (isSiteIdValid()) {
|
||||
try {
|
||||
String issueTime = issueCbo.getText().substring(0, 2);
|
||||
ITafSiteConfig config = TafSiteConfigFactory
|
||||
.getInstance();
|
||||
String siteId = siteIdTF.getText();
|
||||
LocalizationFile lFile = config.getTemplateFile(siteId,
|
||||
issueTime);
|
||||
TextEditorSetupDlg editorDlg = new TextEditorSetupDlg(
|
||||
shell, lFile);
|
||||
editorDlg.open();
|
||||
final String issueTime = issueCbo.getText().substring(
|
||||
0, 2);
|
||||
TextEditorSetupDlg editorDlg = editorDlgMap
|
||||
.get(issueTime);
|
||||
if (mustCreate(editorDlg)) {
|
||||
ITafSiteConfig config = TafSiteConfigFactory
|
||||
.getInstance();
|
||||
String siteId = siteIdTF.getText();
|
||||
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) {
|
||||
msgStatusComp.setMessageText(e.getMessage(), new RGB(
|
||||
255, 0, 0));
|
||||
|
@ -1109,6 +1126,7 @@ public class TafSiteInfoEditorDlg extends Dialog {
|
|||
* @return boolean - True if all the data is valid.
|
||||
*/
|
||||
private boolean validateData() {
|
||||
Display display = getParent().getDisplay();
|
||||
boolean isValid = true;
|
||||
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.exception.LocalizationOpFailedException;
|
||||
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.ICloseCallback;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* LocalizedFile and added preOpen() to
|
||||
* 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>
|
||||
*
|
||||
|
@ -141,6 +144,12 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
|
||||
private String template;
|
||||
|
||||
private FindReplaceDlg findDlg;
|
||||
|
||||
private OpenDlg openDlg;
|
||||
|
||||
private HelpUsageDlg usageDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -160,7 +169,8 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
* When not null a localized file to load into the editor.
|
||||
*/
|
||||
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");
|
||||
|
||||
this.template = null;
|
||||
|
@ -323,8 +333,12 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
// Use the AvnFPS Find/Replace dialog
|
||||
FindReplaceDlg findDlg = new FindReplaceDlg(shell, editorStTxt);
|
||||
findDlg.open();
|
||||
if (mustCreate(findDlg)) {
|
||||
findDlg = new FindReplaceDlg(shell, editorStTxt);
|
||||
findDlg.open();
|
||||
} else {
|
||||
findDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -383,33 +397,36 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
usageMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
String description = "Text Editor Help";
|
||||
String helpText = "This is a generic text editor. Edit any text file via the file\n";
|
||||
helpText += "selection dialog that is invoked by pressing the 'Open' button.\n";
|
||||
helpText += "\n";
|
||||
helpText += "Menu items:\n";
|
||||
helpText += " File:\n";
|
||||
helpText += " Print invokes print dialog\n";
|
||||
helpText += " Edit:\n";
|
||||
helpText += " provides the usual editing functions (i.e. Cut, Copy, Paste,\n";
|
||||
helpText += " and Find/Replace). The menu can be also invoked by pressing\n";
|
||||
helpText += " right mouse button within the text window area.\n";
|
||||
helpText += "\n";
|
||||
helpText += "Buttons:\n";
|
||||
helpText += " Clear: clears text window.\n";
|
||||
helpText += " Open: invokes file selection dialog\n";
|
||||
helpText += " Save: saves content of the text window\n";
|
||||
helpText += " Save as: invokes file selection dialog\n";
|
||||
helpText += "\n";
|
||||
helpText += "Toggles:\n";
|
||||
helpText += " Insert: toggles insert/overwrite mode\n";
|
||||
helpText += " Wrap: toggles word wrap\n";
|
||||
helpText += "\n";
|
||||
helpText += "The currently loaded (if any) file name is displayed in a label above the\n";
|
||||
helpText += "text window.";
|
||||
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg.open();
|
||||
if (mustCreate(usageDlg)) {
|
||||
String description = "Text Editor Help";
|
||||
String helpText = "This is a generic text editor. Edit any text file via the file\n"
|
||||
+ "selection dialog that is invoked by pressing the 'Open' button.\n"
|
||||
+ "\n"
|
||||
+ "Menu items:\n"
|
||||
+ " File:\n"
|
||||
+ " Print invokes print dialog\n"
|
||||
+ " Edit:\n"
|
||||
+ " provides the usual editing functions (i.e. Cut, Copy, Paste,\n"
|
||||
+ " and Find/Replace). The menu can be also invoked by pressing\n"
|
||||
+ " right mouse button within the text window area.\n"
|
||||
+ "\n"
|
||||
+ "Buttons:\n"
|
||||
+ " Clear: clears text window.\n"
|
||||
+ " Open: invokes file selection dialog\n"
|
||||
+ " Save: saves content of the text window\n"
|
||||
+ " Save as: invokes file selection dialog\n"
|
||||
+ "\n"
|
||||
+ "Toggles:\n"
|
||||
+ " Insert: toggles insert/overwrite mode\n"
|
||||
+ " Wrap: toggles word wrap\n"
|
||||
+ "\n"
|
||||
+ "The currently loaded (if any) file name is displayed in a label above the\n"
|
||||
+ "text window.";
|
||||
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -509,7 +526,6 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
Button saveAsBtn = new Button(buttonComp, SWT.PUSH);
|
||||
saveAsBtn.setText("Save As");
|
||||
saveAsBtn.setToolTipText("Save file with new name");
|
||||
// saveAsBtn.setEnabled(false);
|
||||
saveAsBtn.setLayoutData(gd);
|
||||
saveAsBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -799,8 +815,6 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
path = path.substring(1, path.lastIndexOf('/'));
|
||||
|
||||
dlg.setFilterPath(path);
|
||||
// dlg.setFilterNames(FILTER_NAMES);
|
||||
// dlg.setFilterExtensions(FILTER_EXTS);
|
||||
String fn = dlg.open();
|
||||
if (fn != null) {
|
||||
try {
|
||||
|
@ -839,9 +853,23 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
* Show the 'Open' file dialog.
|
||||
*/
|
||||
private void openFile() {
|
||||
OpenSaveDlg dlg = new OpenSaveDlg(shell, DialogType.OPEN);
|
||||
dlg.open();
|
||||
openFile(dlg.getSelectedFile());
|
||||
if (mustCreate(openDlg)) {
|
||||
openDlg = new OpenDlg(shell);
|
||||
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.IDescriptor;
|
||||
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.IAlterBundleContributor;
|
||||
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.ResourceList;
|
||||
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.PointsDataManager;
|
||||
import com.raytheon.uf.viz.points.data.IPointNode;
|
||||
|
@ -46,8 +49,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
import com.vividsolutions.jts.geom.LineString;
|
||||
|
||||
/**
|
||||
* This class generates the alternate bundle's contributions for points and
|
||||
* lines.
|
||||
* This class generates the alter bundle's contributions for points and lines.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -57,6 +59,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Aug 08, 2012 #875 rferrel Generate menu entries for points.
|
||||
* Oct 03, 2012 #1248 rferrel Added listener for when points change.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -65,7 +68,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
||||
public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
||||
|
||||
private static final String POINTS_PREFIX = "Point-";
|
||||
|
||||
|
@ -75,6 +78,8 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
|
||||
private static final String LINES_KEY = "line";
|
||||
|
||||
private IPointChangedListener pointChangedListener;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -85,37 +90,8 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
@Override
|
||||
public Map<String, String[]> getAlterables() {
|
||||
Map<String, String[]> alterables = new HashMap<String, String[]>();
|
||||
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
||||
PointsDataManager pdm = PointsDataManager.getInstance();
|
||||
Collection<String> blNames = tdm.getBaselineNames();
|
||||
String[] lines = new String[blNames.size()];
|
||||
int i = 0;
|
||||
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);
|
||||
String[] linesValues = createLineArray();
|
||||
String[] pointsValues = createPointArray();
|
||||
|
||||
alterables.put(LINES_KEY, linesValues);
|
||||
alterables.put(POINTS_KEY, pointsValues);
|
||||
|
@ -149,6 +125,39 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
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)
|
||||
*
|
||||
|
@ -183,6 +192,9 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list
|
||||
*/
|
||||
private void replaceWithCurrentPoints(ResourceList list) {
|
||||
for (ResourcePair rp : list) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
|
@ -196,6 +208,9 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param b
|
||||
*/
|
||||
private void replaceWithCurrentLines(Bundle b) {
|
||||
for (AbstractRenderableDisplay display : b.getDisplays()) {
|
||||
IDescriptor desc = display.getDescriptor();
|
||||
|
@ -219,6 +234,10 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list
|
||||
* @param selectedString
|
||||
*/
|
||||
private void alterResourceList(ResourceList list, String selectedString) {
|
||||
for (ResourcePair rp : list) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
|
@ -256,6 +275,10 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param container
|
||||
* @param selectedString
|
||||
*/
|
||||
private void alterContainer(IBaseLinesContainer container,
|
||||
String selectedString) {
|
||||
LineString line = ToolsDataManager.getInstance().getBaseline(
|
||||
|
@ -264,4 +287,65 @@ public class ToolsAlterBundleContributor implements IAlterBundleContributor {
|
|||
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
|
||||
* interpolates it to a larger size. The raster is then split once it is already
|
||||
* loaded in memory.
|
||||
* loaded in memory.git pull
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -116,23 +116,28 @@ public class MemoryBasedTileSet extends AbstractTileSet {
|
|||
*/
|
||||
@Override
|
||||
protected void preloadDataObject(int level) throws StorageException {
|
||||
IDataRecord rec = getDataRecord();
|
||||
synchronized (isLoaded) {
|
||||
if (isLoaded[level]) {
|
||||
return;
|
||||
}
|
||||
IDataRecord rec = getDataRecord();
|
||||
|
||||
if (loadedData == null) {
|
||||
loadedData = new Object[levels];
|
||||
dims = new int[levels][];
|
||||
if (loadedData == null) {
|
||||
loadedData = new Object[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 {
|
||||
|
|
|
@ -34,9 +34,14 @@
|
|||
</equals>
|
||||
</iterate>
|
||||
</with>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
<or>
|
||||
<with variable="activePart">
|
||||
<instanceof value="com.raytheon.viz.gfe.GridManagerView"/>
|
||||
</with>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</or>
|
||||
</and>
|
||||
</definition>
|
||||
</extension>
|
||||
|
@ -356,12 +361,6 @@
|
|||
optional="false">
|
||||
</commandParameter>
|
||||
</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
|
||||
categoryId="com.raytheon.viz.gfe.GFECategory"
|
||||
description="Site Activation"
|
||||
|
@ -993,15 +992,6 @@
|
|||
</reference>
|
||||
</activeWhen>
|
||||
</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
|
||||
class="com.raytheon.viz.gfe.actions.ShowSiteActivationDlg"
|
||||
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;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Display Activate Site dialog standalone and blocked.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 15, 2011 bphillip Initial creation
|
||||
* Oct 26, 2012 1287 rferrel Force blocking of SiteActivationDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -55,6 +56,7 @@ public class ActivateSiteComponent extends AbstractCAVEComponent {
|
|||
protected void startInternal(String componentName) throws Exception {
|
||||
SiteActivationDlg dlg = new SiteActivationDlg(new Shell(
|
||||
Display.getCurrent()));
|
||||
dlg.setBlockOnOpen(true);
|
||||
dlg.open();
|
||||
}
|
||||
|
||||
|
|
|
@ -22,12 +22,11 @@ package com.raytheon.viz.gfe;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
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.ui.personalities.awips.AbstractCAVEComponent;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Bring up the Service Backup Dialog in stand alone mode as a blocking dialog.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -36,6 +35,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 12, 2011 bphillip Initial creation
|
||||
* Oct 26, 2012 1287 rferrel Change to force blocking of ServiceBackupDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,6 +56,7 @@ public class ServiceBackupComponent extends AbstractCAVEComponent {
|
|||
protected void startInternal(String componentName) throws Exception {
|
||||
ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(new Shell(
|
||||
Display.getCurrent()));
|
||||
svcBuDlg.setBlockOnOpen(true);
|
||||
svcBuDlg.open();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
|
|||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Action to bring up the Dispaly attributes dialog.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 13, 2009 mschenke Initial creation
|
||||
* Oct 22, 2012 1287 rferrel Changes for non-blocking DisplayAttributesDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,6 +47,8 @@ public class DisplayAttributesAction extends AbstractRightClickAction {
|
|||
|
||||
private GFEResource rsc;
|
||||
|
||||
private DisplayAttributesDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -53,14 +56,18 @@ public class DisplayAttributesAction extends AbstractRightClickAction {
|
|||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
rsc = ((GFEResource) this.getSelectedRsc());
|
||||
rsc = ((GFEResource) this.getSelectedRsc());
|
||||
|
||||
DisplayAttributesDialog dad = new DisplayAttributesDialog(shell, rsc);
|
||||
dad.setBlockOnOpen(true);
|
||||
dad.open();
|
||||
dialog = new DisplayAttributesDialog(shell, rsc);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 11, 2008 Eric Babin Initial Creation
|
||||
* Oct 23, 2012 1287 rferrel Changes for non-blocking FormatterLauncherDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,28 +57,31 @@ public class FormatterlauncherAction extends AbstractHandler {
|
|||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
if (dialog == null) {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
dialog = new FormatterLauncherDialog(shell);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
dialog.dispose();
|
||||
dialog = null;
|
||||
} else if (dialog.getShell() == null) {
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.getShell().setVisible(true);
|
||||
dialog.getShell().setActive();
|
||||
dialog.bringToTop();
|
||||
if (dialog.buttonBar != null) {
|
||||
dialog.buttonBar.moveAbove(null);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FormatterLauncherDialog getFormatterLauncher() {
|
||||
return dialog;
|
||||
|
||||
public static void closeFormatters() {
|
||||
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.dialogs.AutoSaveIntervalDialog;
|
||||
import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Action for launching auto save dialog
|
||||
|
@ -40,6 +41,7 @@ import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 23, 2008 Eric Babin Initial Creation
|
||||
* Jul 8, 2008 randerso reworked
|
||||
* Oct 23, 2012 1287 rferrel Changes for non-blocking AutoSaveIntervalDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -47,6 +49,7 @@ import com.raytheon.viz.gfe.jobs.AutoSaveJob;
|
|||
* @version 1.0
|
||||
*/
|
||||
public class ShowAutoSaveIntervalDialog extends AbstractHandler {
|
||||
private AutoSaveIntervalDialog dialog;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -58,36 +61,50 @@ public class ShowAutoSaveIntervalDialog extends AbstractHandler {
|
|||
/*
|
||||
* (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
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
int interval = AutoSaveJob.getInterval();
|
||||
boolean autoSaveEnabled = interval > 0;
|
||||
if (!autoSaveEnabled) {
|
||||
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();
|
||||
int interval = AutoSaveJob.getInterval();
|
||||
boolean autoSaveEnabled = interval > 0;
|
||||
if (!autoSaveEnabled) {
|
||||
interval = AutoSaveJob.MAX_INTERVAL;
|
||||
}
|
||||
} // 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,14 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
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>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 17, 2008 Eric Babin Initial Creation
|
||||
* Oct 27, 2012 1287 rferrel Changes for non-blocking BreakLockDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.BreakLockDialog;
|
|||
*/
|
||||
|
||||
public class ShowBreakLock extends AbstractHandler {
|
||||
private BreakLockDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -59,12 +61,16 @@ public class ShowBreakLock extends AbstractHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
BreakLockDialog dialog = new BreakLockDialog(shell, dm);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
dialog = new BreakLockDialog(shell, dm);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.viz.gfe.dialogs.CopyGridsDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 27, 2008 Eric Babin Initial Creation
|
||||
* Oct 23, 2012 1287 rferrel Changes for non-blocking CopyGridsDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -47,9 +48,16 @@ import com.raytheon.viz.gfe.dialogs.CopyGridsDialog;
|
|||
|
||||
public class ShowCopyGridsDialog extends AbstractHandler {
|
||||
|
||||
private static IUFStatusHandler statusHandler = UFStatus
|
||||
private IUFStatusHandler statusHandler = UFStatus
|
||||
.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)
|
||||
*
|
||||
|
@ -64,27 +72,32 @@ public class ShowCopyGridsDialog extends AbstractHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
boolean isSelected;
|
||||
String selectedOrAll = event.getParameter("selectedOrAll");
|
||||
if ("selected".equalsIgnoreCase(selectedOrAll)) {
|
||||
isSelected = true;
|
||||
} else if ("all".equalsIgnoreCase(selectedOrAll)) {
|
||||
isSelected = false;
|
||||
boolean isSelected;
|
||||
String selectedOrAll = event.getParameter("selectedOrAll");
|
||||
if ("selected".equalsIgnoreCase(selectedOrAll)) {
|
||||
isSelected = true;
|
||||
} else if ("all".equalsIgnoreCase(selectedOrAll)) {
|
||||
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 {
|
||||
statusHandler
|
||||
.error("Invalid parmeter \""
|
||||
+ selectedOrAll
|
||||
+ "\" in ShowCopyGridsDialog. Value must be \"selected\" or \"all\".");
|
||||
return null;
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
CopyGridsDialog dialog = new CopyGridsDialog(shell, dm, isSelected);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 27, 2008 Eric Babin Initial Creation
|
||||
* 04/18/08 #857 bphillip Implemented interaction with server
|
||||
* Oct 24, 2012 #1287 rferrel Changes for non-blocking CreateFromScratchDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.CreateFromScratchDialog;
|
|||
*/
|
||||
|
||||
public class ShowCreateFromScratchDialog extends AbstractHandler {
|
||||
private CreateFromScratchDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -54,12 +56,16 @@ public class ShowCreateFromScratchDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
CreateFromScratchDialog dialog = new CreateFromScratchDialog(shell);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
dialog = new CreateFromScratchDialog(shell);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineRefSetDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 11, 2008 Eric Babin Initial Creation
|
||||
* Oct 24, 2012 1287 rferrel Changes for non-blocking DefineRefSetDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,11 +64,13 @@ public class ShowDefineRefSetDialog extends AbstractHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (dialog == null || dialog.getShell() == null) {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new DefineRefSetDialog(shell, dm);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
dialog.open();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2008 Eric Babin Initial Creation
|
||||
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
||||
* Oct 24, 2012 1287 rferrel Changes for non-blocking DefineSamplesViaLatLongDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.DefineSamplesViaLatLongDialog;
|
|||
*/
|
||||
|
||||
public class ShowDefineSamplesLatLongAction extends AbstractHandler {
|
||||
private DefineSamplesViaLatLongDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -54,13 +56,16 @@ public class ShowDefineSamplesLatLongAction extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
DefineSamplesViaLatLongDialog dialog = new DefineSamplesViaLatLongDialog(
|
||||
shell);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
dialog = new DefineSamplesViaLatLongDialog(shell);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.actions;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
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.UFStatus;
|
||||
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.dialogs.SampleSetDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Action for launching delete samples dialog.
|
||||
|
@ -49,6 +49,7 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* 22JUL2008 #1275. Eric Babin Remove inadvertent dispose on parent shell.
|
||||
* Oct 24, 2012 #1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,7 +58,10 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
|||
*/
|
||||
|
||||
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)
|
||||
|
@ -68,44 +72,65 @@ public class ShowDeleteSampleSetDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
ArrayList<SampleId> sampleIdList = DataManager.getCurrentInstance()
|
||||
.getSampleSetManager().getInventoryAsList();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
ArrayList<SampleId> sampleIdList = DataManager.getCurrentInstance()
|
||||
.getSampleSetManager().getInventoryAsList();
|
||||
|
||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||
|
||||
@Override
|
||||
public int compare(SampleId o1, SampleId o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
@Override
|
||||
public int compare(SampleId o1, SampleId o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
SampleSetDialog dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.DELETE);
|
||||
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.DELETE);
|
||||
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
if (dialog.getReturnCode() != Window.CANCEL
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@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) {
|
||||
List<SampleId> sampleIdList = dialog.getSamples();
|
||||
SampleId id = sampleIdList
|
||||
.get(dialog.getSelectedSampleIdIndexes()[0]);
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
if (MessageDialog.openConfirm(shell, "Delete sample set",
|
||||
"Delete selected sample set?")) {
|
||||
if (DataManager.getCurrentInstance().getSampleSetManager()
|
||||
.deleteSampleSet(id)) {
|
||||
statusHandler.handle(Priority.EVENTA, id.getName()
|
||||
+ ", Sample set deleted successfully");
|
||||
+ ", Sample set deleted successfully");
|
||||
} else {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error deleting sample set, " + id.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import com.raytheon.viz.gfe.dialogs.SaveDeleteSelectTRDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 23, 2008 Eric Babin Initial Creation
|
||||
* Oct 25, 2012 1287 rferrel Changes for non-blocking ShowDeleteSelectionTimeRangeDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +47,7 @@ import com.raytheon.viz.gfe.dialogs.SaveDeleteSelectTRDialog;
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
|
||||
SaveDeleteSelectTRDialog dialog = new SaveDeleteSelectTRDialog(shell,
|
||||
dataManager, "Delete");
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
// String delName = null;
|
||||
// if (dialog.getReturnCode() == Window.OK) {
|
||||
// delName = dialog.getItemToDelete();
|
||||
// if (selectTRmgr.getRange(delName).getLevel() !=
|
||||
// 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");
|
||||
// }
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
dialog = new SaveDeleteSelectTRDialog(shell, dataManager, "Delete");
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.EditActionsDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 19, 2007 njensen Initial creation
|
||||
* Aug 05, 2010 6112 mpduff One, and only one, dialog open
|
||||
* Oct 25, 2012 1287 rferrel Changes for non-blocking EditActionsDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,11 +62,13 @@ public class ShowEditActionsDialog extends AbstractHandler {
|
|||
|
||||
// If the dialog doesn't exist, create one, otherwise call its open
|
||||
// method
|
||||
if (dialog == null || dialog.getShell() == null) {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dialog = new EditActionsDialog(shell);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
dialog.open();
|
||||
|
||||
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.ParmState.InterpMode;
|
||||
import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
||||
* Oct 25, 2012 #1287 rferrel Changes for non-blocking GridsInterpolateDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,6 +50,7 @@ import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
|||
*/
|
||||
|
||||
public class ShowGridsInterpolationDialog extends AbstractHandler {
|
||||
private GridsInterpolateDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -58,20 +61,38 @@ public class ShowGridsInterpolationDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
GridsInterpolateDialog dialog = new GridsInterpolateDialog(shell);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog = new GridsInterpolateDialog(shell);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
||||
InterpMode interpMode = dialog.getInterpMode();
|
||||
int interval = dialog.getInterval() * 3600;
|
||||
int duration = dialog.getDuration() * 3600;
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof Integer) {
|
||||
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(
|
||||
interpMode, InterpState.ASYNC, interval, duration);
|
||||
} // else do nothing...
|
||||
DataManager
|
||||
.getCurrentInstance()
|
||||
.getParmOp()
|
||||
.interpolateSelected(interpMode,
|
||||
InterpState.ASYNC, interval,
|
||||
duration);
|
||||
}
|
||||
}
|
||||
dialog = null;
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -30,13 +30,14 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
import com.raytheon.viz.gfe.dialogs.HiddenWeatherElementDialog;
|
||||
|
||||
/**
|
||||
* TODO Add Description ShowHiddenWeatherElementDialog.java Feb 27, 2008
|
||||
* Action class to dispaly the Hidden Weather Dialog.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 27, 2008 Eric Babin Initial Creation
|
||||
* Oct 25, 2012 1287 rferrel Changes for non-blocking HiddenWeatherElementDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,6 +46,7 @@ import com.raytheon.viz.gfe.dialogs.HiddenWeatherElementDialog;
|
|||
*/
|
||||
|
||||
public class ShowHiddenWeatherElementDialog extends AbstractHandler {
|
||||
private HiddenWeatherElementDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -61,18 +63,24 @@ public class ShowHiddenWeatherElementDialog extends AbstractHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
|
||||
if (dataManager.getParmManager().getUndisplayedParms().length > 0) {
|
||||
HiddenWeatherElementDialog dialog = new HiddenWeatherElementDialog(
|
||||
shell, dataManager);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
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 {
|
||||
MessageDialog.openInformation(null, "No Hidden Weather Elements",
|
||||
"No Hidden Weather Elements found.");
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.actions;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
|
@ -31,10 +32,14 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
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.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Action to launch sampele set dialog.
|
||||
|
@ -45,6 +50,7 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
||||
* Oct 24, 2012 1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -53,14 +59,12 @@ import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
|||
*/
|
||||
|
||||
public class ShowLoadSampleSetDialog extends AbstractHandler {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ShowLoadSampleSetDialog.class);
|
||||
|
||||
// SampleRenderable sample;
|
||||
private SampleSetDialog dialog;
|
||||
|
||||
// public ShowLoadSampleSetDialog() {
|
||||
//
|
||||
// super();
|
||||
// this.sample = new SampleRenderable();
|
||||
// }
|
||||
private DataManager dm;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -71,96 +75,81 @@ public class ShowLoadSampleSetDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
||||
DataManager dm = DataManager.getCurrentInstance();
|
||||
if (dm == 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());
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dm = DataManager.getCurrentInstance();
|
||||
if (dm == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
});
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
SampleSetDialog dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.LOAD);
|
||||
ArrayList<SampleId> sampleIdList = dm.getSampleSetManager()
|
||||
.getInventoryAsList();
|
||||
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
if (dialog.getReturnCode() != Window.CANCEL
|
||||
&& dialog.getSelectedSampleIdIndexes() != null) {
|
||||
if (dialog.getReturnCode() == SampleSetDialog.OK) {
|
||||
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();
|
||||
}
|
||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||
|
||||
@Override
|
||||
public int compare(SampleId o1, SampleId o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
|
||||
} else if (dialog.getReturnCode() == SampleSetDialog.REPLACE) {
|
||||
for (int i = 0; i < dialog.getSelectedSampleIdIndexes().length; i++) {
|
||||
SampleId id = sampleIdList.get(dialog
|
||||
.getSelectedSampleIdIndexes()[i]);
|
||||
try {
|
||||
dm.getSampleSetManager().loadSampleSet(id,
|
||||
ISampleSetManager.SampleSetLoadMode.REPLACE);
|
||||
} catch (GFEException e) {
|
||||
e.printStackTrace();
|
||||
});
|
||||
|
||||
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.LOAD);
|
||||
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.tools.AbstractTool#refresh()
|
||||
*/
|
||||
// @Override
|
||||
// protected void refresh() {
|
||||
// IEditorPart part = VizApp.getCurrentEditor();
|
||||
// if (part instanceof AbstractEditor) {
|
||||
// ((AbstractEditor) part).refresh();
|
||||
// }
|
||||
// }
|
||||
private void doDialogClosed(int returnCode) {
|
||||
if (returnCode != Window.CANCEL
|
||||
&& dialog.getSelectedSampleIdIndexes() != null) {
|
||||
List<SampleId> sampleIdList = dialog.getSamples();
|
||||
ISampleSetManager.SampleSetLoadMode mode = null;
|
||||
switch (returnCode) {
|
||||
case SampleSetDialog.OK:
|
||||
mode = ISampleSetManager.SampleSetLoadMode.ADD;
|
||||
break;
|
||||
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
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Oct 25, 2012 1287 rferrel Change for non-blocking ProcessMonitorDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -43,6 +44,7 @@ import com.raytheon.viz.gfe.dialogs.ProcessMonitorDialog;
|
|||
*/
|
||||
|
||||
public class ShowProcessMonitorDialog extends AbstractHandler {
|
||||
private ProcessMonitorDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -53,13 +55,16 @@ public class ShowProcessMonitorDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
ProcessMonitorDialog dialog = new ProcessMonitorDialog(shell);
|
||||
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
dialog = new ProcessMonitorDialog(shell);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 6, 2008 Eric Babin Initial Creation
|
||||
* Oct 25, 2012 12878 rferrel Changes for non-blocking ProductScriptsDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog;
|
|||
*/
|
||||
|
||||
public class ShowProductScriptsDialog extends AbstractHandler {
|
||||
private ProductScriptsDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -59,12 +61,16 @@ public class ShowProductScriptsDialog extends AbstractHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
ProductScriptsDialog dialog = new ProductScriptsDialog(shell, dm);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.open();
|
||||
dialog = new ProductScriptsDialog(shell, dm);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 6, 2008 Eric Babin Initial Creation
|
||||
* Oct 25, 2012 1287 rferrel Changes for non-blocking PublishDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
|
|||
*/
|
||||
|
||||
public class ShowPublishDialog extends AbstractHandler {
|
||||
private PublishDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -54,14 +56,21 @@ public class ShowPublishDialog extends AbstractHandler {
|
|||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
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);
|
||||
dialog.setBlockOnOpen(true);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -80,8 +89,8 @@ public class ShowPublishDialog extends AbstractHandler {
|
|||
|
||||
DataManager dm = DataManager.getCurrentInstance();
|
||||
if (dm != null) {
|
||||
return !dm.getParmManager().getMutableDatabase().equals(
|
||||
dm.getParmManager().getProductDB());
|
||||
return !dm.getParmManager().getMutableDatabase()
|
||||
.equals(dm.getParmManager().getProductDB());
|
||||
}
|
||||
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