12.9.1-5 baseline

Former-commit-id: 4fec0b9354 [formerly 77cbd6c1e5] [formerly a1d931fd44] [formerly a1d931fd44 [formerly 61f269f54c]] [formerly 4fec0b9354 [formerly 77cbd6c1e5] [formerly a1d931fd44] [formerly a1d931fd44 [formerly 61f269f54c]] [formerly f2fac39428 [formerly a1d931fd44 [formerly 61f269f54c] [formerly f2fac39428 [formerly d85b989f77196d20eb2d2a21cf4daa13d50474ae]]]]]
Former-commit-id: f2fac39428
Former-commit-id: c68ab3311a [formerly d9faed979f] [formerly 7fb0b17bd5] [formerly 5b54a131b7dd8cd501953ba8fd918503d0851b4c [formerly 54140b7733222bbc423315196e9781453b12f896] [formerly 7fb0b17bd5 [formerly 72824561cb]]]
Former-commit-id: a2129aca55a7ff6fdaf13fb64bacec56ad158149 [formerly 84e9e52a92ae5e740b0daf680a98316f7435f7f7] [formerly 2d928d328e [formerly 9b5c2094ed]]
Former-commit-id: b40318710922ff74b3d17e2773847774993ac0db [formerly 2d928d328e]
Former-commit-id: 98059f9ef1
This commit is contained in:
Steve Harris 2012-08-21 15:27:03 -05:00
parent 96f39ba3b5
commit a2164a88d8
1587 changed files with 216915 additions and 139458 deletions

View file

@ -3,12 +3,12 @@ edex_endpoint_arg=@EDEX_HOME@/edex/data/sbn/radar
# The following line controls the location of log files. See
# data/config/res/log4j.properties for more logging options.
log_dir=$rs_home_dir/rcm/data/logs
log_dir=$rs_home_dir/data/logs
# Uncomment and change the following line to choose a Java VM. The
# default is the "java" program that is in the PATH.
#java=/path/to/jre/bin/java
java=${INSTALL_PATH}/bin/java
java=/awips2/java/bin/java
# necessary for fxaAnnounce to be called if rpg goes down
awips2_fxa=/awips2/fxa

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<bundle>
<displayList>
<displays xsi:type="mapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties>
<capabilities>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1" />
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b" />
<capability xsi:type="labelableCapability" labelField="name" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
</properties>
<resourceData xsi:type="dbMapResourceData">
<table>mapdata.location</table>
<constraint>cwa = '${site}'</constraint>
<mapName>Locations</mapName>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -22,6 +22,8 @@
from gfeConfig import *
import gfeConfig
HideConfigFile = 1
# Defines the T as the displayable weather element
Png_parms = ['T_SFC:_Fcst -1', 'Td_SFC:_Fcst -1', 'Wind_SFC:_Fcst -1']
Png_image = 'T'

View file

@ -43,7 +43,6 @@ VariableList = [("Check or Force:" , "Check Only", "radio",
import SmartScript
import TimeRange
import AbsTime
from com.raytheon.uf.common.time import TimeRange as javaTR
from numpy import *
MODEL = "Fcst"
@ -63,11 +62,11 @@ class Procedure (SmartScript.SmartScript):
# @return: time ranges at which WEName has data.
# @rtype: Python list of Python TimeRange objects
def getWEInventory(self, WEName):
# yesterday = time.time() - (2 * 24 * 3600) # two days ago
# later = time.time() + 10 * 24 * 3600 # 10 days from now
allTimes = javaTR.allTimes()
yesterday = self._gmtime() - (2 * 24 * 3600) # two days ago
later = self._gmtime() + 10 * 24 * 3600 # 10 days from now
allTimes = TimeRange.TimeRange(yesterday, later)
parm = self.getParm(MODEL, WEName, LEVEL);
inv = parm.getGridInventory(allTimes)
inv = parm.getGridInventory(allTimes.toJavaObj())
trList = []
for gd in inv:
tr = TimeRange.TimeRange(gd.getGridTime())

View file

@ -49,7 +49,6 @@ import SmartScript
import time
import TimeRange
import AbsTime
from com.raytheon.uf.common.time import TimeRange as javaTR
from numpy import *
MODEL = "Fcst"
@ -61,11 +60,11 @@ class Procedure (SmartScript.SmartScript):
def getWEInventory(self, WEName):
#yesterday = time.time() - (2 * 24 * 3600) # two days ago
#later = time.time() + 10 * 24 * 3600 # 10 days from now
allTimes = javaTR.allTimes()
parm = self.getParm(MODEL, WEName, LEVEL);
inv = parm.getGridInventory(allTimes)
yesterday = self._gmtime() - (2 * 24 * 3600) # two days ago
later = self._gmtime() + 10 * 24 * 3600 # 10 days from now
allTimes = TimeRange.TimeRange(yesterday, later)
parm = self.getParm(MODEL, WEName, LEVEL);
inv = parm.getGridInventory(allTimes.toJavaObj())
trList = []
for gd in inv:
@ -81,12 +80,12 @@ class Procedure (SmartScript.SmartScript):
return []
lt = parm.getLockTable()
jlok = lt.lockedByOther()
lbo = []
for i in xrange(jlok.size()):
tr = jlok.get(i)
tr = TimeRange.TimeRange(tr)
lbo.append( tr )
return lbo
lbo = []
for i in xrange(jlok.size()):
tr = jlok.get(i)
tr = TimeRange.TimeRange(tr)
lbo.append( tr )
return lbo
def overlappingTRs(self, timeRange, trList):
newTRList = []
@ -116,7 +115,7 @@ class Procedure (SmartScript.SmartScript):
endWindChill = 4 ## Last month to report wind chill
# Get local edit area simply by using the baseline edit area
eaList = self.editAreaList()
eaList = self.editAreaList()
siteID = self.getSiteID()
if siteID in eaList: # make sure the edit area is there

View file

@ -42,8 +42,6 @@ import time
import AbsTime
import TimeRange
from com.raytheon.uf.common.time import TimeRange as javaTR
MODEL = "Fcst"
LEVEL = "SFC"
@ -148,17 +146,16 @@ class Procedure (SmartScript.SmartScript):
# @return: time ranges at which WEName has data.
# @rtype: Python list of Python TimeRange objects
def _getWEInventory(self, dbName, WEName, timeRange=None):
# yesterday = time.time() - (2 * 24 * 3600) # two days ago
# later = time.time() + 10 * 24 * 3600 # 10 days from now
# set up a timeRange if it is None
if timeRange is None:
timeRange = javaTR.allTimes()
timeRange = TimeRange.allTimes()
parm = self.getParm(dbName, WEName, LEVEL)
if parm is None:
print "PFC: dbName =", dbName
print "PFC: WEName =", WEName
print "PFC: parm is None"
return []
inv = parm.getGridInventory(timeRange)
inv = parm.getGridInventory(timeRange.toJavaObj())
if inv is None: self.statusBarMsg("inv is None","S")
elif len(inv)==0: print self.statusBarMsg("PFC: len(inv)==0","S")
trList = []

View file

@ -42,7 +42,6 @@ VariableList = [("ProductID:", "", "alphaNumeric"),
import TimeRange
import AbsTime
from com.raytheon.uf.common.time import TimeRange as javaTR
import SmartScript
@ -608,15 +607,6 @@ class Procedure (SmartScript.SmartScript):
return textList
# Retrieves a text product from the text database
def getTextProductFromDB(self, productID):
from com.raytheon.viz.gfe.product import TextDBUtil
opMode = self.gfeOperatingMode()=="OPERATIONAL"
fullText = TextDBUtil.retrieveProduct(productID, opMode)
textList = fullText.splitlines(True)
return textList
# Reads decodes depression information using the specified product.
def decodeDepressionInfo(self, textProduct):
@ -650,11 +640,11 @@ class Procedure (SmartScript.SmartScript):
return fcstList
def getWEInventory(self, modelName, WEName, level):
#yesterday = time.time() - (300 * 24 * 3600) # 300 days ago
#later = time.time() + 100 * 24 * 3600 # 100days from now
allTimes = javaTR.allTimes()
yesterday = self._gmtime() - (2 * 24 * 3600) # two days ago
later = self._gmtime() + 10 * 24 * 3600 # 10 days from now
allTimes = TimeRange.TimeRange(yesterday, later)
parm = self.getParm(modelName, WEName, level);
inv = parm.getGridInventory(allTimes)
inv = parm.getGridInventory(allTimes.toJavaObj())
trList = []
for gd in inv:
tr = TimeRange.TimeRange(gd.getGridTime())

View file

@ -42,11 +42,9 @@ import SmartScript
import time
import ProcessVariableList
from com.raytheon.viz.gfe.core import DataManager
class Procedure (SmartScript.SmartScript):
def __init__(self, dbss):
self._dbss = DataManager.getCurrentInstance()
self._dbss = dbss
SmartScript.SmartScript.__init__(self, self._dbss)
def execute(self, editArea, timeRange, varDict):

View file

@ -44,14 +44,6 @@ import UFStatusHandler
import JUtil
from java.io import File
from java.lang import System
from com.raytheon.uf.common.serialization import SerializationUtil
from com.raytheon.uf.common.localization import LocalizationFile
from com.raytheon.uf.common.localization import PathManagerFactory
from com.raytheon.uf.common.localization import LocalizationContext
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel
from com.raytheon.uf.common.site.xml import CwaXML
from com.raytheon.uf.common.site.xml import AdjacentWfoXML
PLUGIN_NAME = 'com.raytheon.viz.gfe'
CATEGORY = 'GFE'

View file

@ -42,9 +42,6 @@ import time
import AbsTime
import TimeRange
from com.raytheon.uf.common.time import TimeRange as javaTR
from com.raytheon.uf.common.time import SimulatedTime as simulatedTime
MODEL = "Fcst"
LEVEL = "SFC"
@ -64,14 +61,13 @@ class Procedure (SmartScript.SmartScript):
# @return: time ranges at which WEName has data.
# @rtype: Python list of Python TimeRange objects
def _getWEInventory(self, dbName, WEName, timeRange=None):
# yesterday = time.time() - (2 * 24 * 3600) # two days ago
# later = time.time() + 10 * 24 * 3600 # 10 days from now
# set up a timeRange if it is None
if timeRange is None:
timeRange = javaTR.allTimes()
timeRange = TimeRange.allTimes()
parm = self.getParm(dbName, WEName, LEVEL)
if parm is None:
return []
inv = parm.getGridInventory(timeRange)
inv = parm.getGridInventory(timeRange.toJavaObj())
if inv is None: self.statusBarMsg("inv is None","S")
elif len(inv)==0: print self.statusBarMsg("PFC: len(inv)==0","S")
trList = []
@ -226,7 +222,7 @@ class Procedure (SmartScript.SmartScript):
# Figure out what year it is
currentTime = AbsTime.AbsTime(simulatedTime.getSystemTime().getTime()).unixTime()
currentTime = self._gmtime().unixTime()
jan01Tuple = (time.gmtime(currentTime)[0],1,1,0,0,0,0,0,0) # 01 Jan this year
jan01Secs = time.mktime(jan01Tuple) # 01 Jan in seconds

View file

@ -56,7 +56,6 @@ VariableList = [("Product to\ndecode:", [], "check",
import TimeRange
import AbsTime
from com.raytheon.uf.common.time import TimeRange as javaTR
import SmartScript
@ -615,15 +614,6 @@ class Procedure (SmartScript.SmartScript):
f.close()
return textList
# Retrieves a text product from the text database
def getTextProductFromDB(self, productID):
from com.raytheon.viz.gfe.product import TextDBUtil
opMode = self.gfeOperatingMode()=="OPERATIONAL"
fullText = TextDBUtil.retrieveProduct(productID, opMode)
textList = fullText.splitlines(True)
return textList
def printFcst(self, f, baseTime):
print "=============================================================="
print "Time:", time.asctime(time.gmtime(f['validTime'])),
@ -639,11 +629,11 @@ class Procedure (SmartScript.SmartScript):
print r, "kts:", f['radii'][r]
def getWEInventory(self, modelName, WEName, level):
#yesterday = time.time() - (300 * 24 * 3600) # 300 days ago
#later = time.time() + 100 * 24 * 3600 # 100days from now
allTimes = javaTR.allTimes()
yesterday = self._gmtime() - (2 * 24 * 3600) # two days ago
later = self._gmtime() + 10 * 24 * 3600 # 10 days from now
allTimes = TimeRange.TimeRange(yesterday, later)
parm = self.getParm(modelName, WEName, level);
inv = parm.getGridInventory(allTimes)
inv = parm.getGridInventory(allTimes.toJavaObj())
trList = []
for gd in inv:
tr = TimeRange.TimeRange(gd.getGridTime())

View file

@ -48,9 +48,6 @@ from numpy import *
import ProcessVariableList
import SmartScript
from com.raytheon.uf.common.dataplugin.gfe.db.objects import GFERecord_GridType as GridType
toolName = 'LimitValues'
class Tool (SmartScript.SmartScript):
@ -59,7 +56,6 @@ class Tool (SmartScript.SmartScript):
def preProcessGrid(self,editArea,variableElement,
variableElement_GridInfo,WEname):
wxType = variableElement_GridInfo.getGridType()
#
# Need a mask of the current edit area, so the
# dialog can figure out the current max/min in
@ -81,10 +77,10 @@ class Tool (SmartScript.SmartScript):
# setup valgrid with the grid that will be
# limited (i.e. for vectors the speed)
#
if wxType.equals(GridType.SCALAR):
valgrid=variableElement
if wxType.equals(GridType.VECTOR):
if type(variableElement) is list:
(valgrid,dir)=variableElement
else:
valgrid=variableElement
#
# When checking for mins, need all areas outside the edit
# area set to the max value for this element - so that the
@ -148,18 +144,17 @@ class Tool (SmartScript.SmartScript):
# Main routine that reads in the variableElement and limits it to
# the values set up via the dialog in the preProcessGrid routine
#
def execute(self, variableElement, variableElement_GridInfo, varDict):
def execute(self, variableElement, varDict):
"limit gridvalues between user-set limits"
#
# set val to the grid we will limit
# (if it is a vector - get the speed)
#
wxType = variableElement_GridInfo.getGridType()
if wxType.equals(GridType.SCALAR):
val=variableElement
if wxType.equals(GridType.VECTOR):
if type(variableElement) is list:
val=variableElement[0]
dir=variableElement[1]
else:
val=variableElement
#
# limit the values, max first, then min
#
@ -170,9 +165,9 @@ class Tool (SmartScript.SmartScript):
# put the trimmed values back
#
if wxType.equals(GridType.SCALAR):
variableElement=valC
if wxType.equals(GridType.VECTOR):
if type(variableElement) is list:
variableElement=(valC,dir)
else:
variableElement=valC
return variableElement

View file

@ -2380,4 +2380,13 @@ class SmartScript(BaseTool.BaseTool):
import JUtil
return JUtil.javaStringListToPylist(self.__dataMgr.knownOfficeTypes())
# Retrieves a text product from the text database
def getTextProductFromDB(self, productID):
from com.raytheon.viz.gfe.product import TextDBUtil
opMode = self.gfeOperatingMode()=="OPERATIONAL"
fullText = TextDBUtil.retrieveProduct(productID, opMode)
textList = fullText.splitlines(True)
return textList

View file

@ -69,6 +69,7 @@ class GFEPainter(VizPainter.VizPainter):
imageHeight = Integer(int(imageHeight))
geom = GfeImageUtil.getLocationGeometry(gloc, envelope, imageWidth, imageHeight, expandLeft / 100.0, expandRight / 100.0, expandTop / 100.0, expandBottom / 100.0)
display = GFEMapRenderableDisplay(MapDescriptor(geom))
display.setDataManager(self.dataMgr)
desc = display.getDescriptor()
self.dataMgr.getSpatialDisplayManager().setDescriptor(desc)
VizPainter.VizPainter.__init__(self, display)

View file

@ -54,7 +54,7 @@ class VizPainter():
self.target = GLTargetProxy.constructOffScreenTarget(imageWidth, imageHeight)
self.target.init()
self.display.setup(self.target)
def __del__(self):
resources = self.getDescriptor().getResourceList()
@ -101,7 +101,7 @@ class VizPainter():
# requires multiple passes to paint everything
paint = True
while paint:
self.target.beginFrame(self.display, True)
self.target.beginFrame(self.display.getView(), True)
if backgroundColor is not None:
self.target.setBackgroundColor(backgroundColor)
self.display.paint(self.target, props)

View file

@ -78,6 +78,12 @@ if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
fi
# Special instructions for the 64-bit jvm.
ARCH_ARGS=""
if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then
ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so"
fi
#run a loop for alertviz
while [ $exitVal -ne 0 ]
do
@ -96,9 +102,9 @@ do
else
#finally check if we can write to the file
if [ -w ${LOGFILE} ]; then
${dir}/alertviz $* > ${LOGFILE} 2>&1
${dir}/alertviz ${ARCH_ARGS} $* > ${LOGFILE} 2>&1
else
${dir}/alertviz $*
${dir}/alertviz ${ARCH_ARGS} $*
fi
fi
exitVal=$?

View file

@ -133,10 +133,16 @@ if [ ${redirect} == "TRUE" ]; then
fi
fi
lookupINI $@
if ( [ ${redirect} == "TRUE" ] || [ -w ${LOGFILE} ] ); then
exec ${dir}/cave ${SWITCHES} ${CAVE_INI_ARG} $@ > ${LOGFILE} 2>&1
else
${dir}/cave ${SWITCHES} ${CAVE_INI_ARG} $@
# Special instructions for the 64-bit jvm.
ARCH_ARGS=""
if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then
ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so"
fi
lookupINI $@
if ( [ ${redirect} == "TRUE" ] || [ -w ${LOGFILE} ] ); then
exec ${dir}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} $@ > ${LOGFILE} 2>&1
else
${dir}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} $@
fi

View file

@ -53,7 +53,23 @@ public abstract class AbstractAdvisoryDataAdapter implements
PluginDataObject record);
public abstract float getLineWidth();
public abstract LineStyle getLineStyle();
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
return true;
}
}

View file

@ -173,4 +173,30 @@ public class AirmetDataAdapter extends AbstractAdvisoryDataAdapter {
return LINE_STYLE;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((hazardType == null) ? 0 : hazardType.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AirmetDataAdapter other = (AirmetDataAdapter) obj;
if (hazardType == null) {
if (other.hazardType != null)
return false;
} else if (!hazardType.equals(other.hazardType))
return false;
return true;
}
}

View file

@ -238,4 +238,26 @@ public class ConvSigmetCastDataAdapter extends AbstractAdvisoryDataAdapter {
return forecast;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (forecast ? 1231 : 1237);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ConvSigmetCastDataAdapter other = (ConvSigmetCastDataAdapter) obj;
if (forecast != other.forecast)
return false;
return true;
}
}

View file

@ -37,13 +37,13 @@ import com.vividsolutions.jts.geom.Coordinate;
@XmlAccessorType(XmlAccessType.NONE)
public class ConvSigmetOutlookDataAdapter extends AbstractAdvisoryDataAdapter {
private static final String LABEL_FORMAT = "%s Outlook";
private static final String CLASS_TYPE = "OUTLOOK";
private static final float LINE_WIDTH = 1.0f;
private static final LineStyle LINE_STYLE = LineStyle.SOLID;
@Override
@ -84,12 +84,12 @@ public class ConvSigmetOutlookDataAdapter extends AbstractAdvisoryDataAdapter {
}
Coordinate[] coords = new Coordinate[locations.size()];
for (ConvSigmetLocation loc : locations) {
coords[loc.getIndex() - 1] = new Coordinate(loc.getLongitude(), loc
.getLatitude());
coords[loc.getIndex() - 1] = new Coordinate(loc.getLongitude(),
loc.getLatitude());
}
String label = String.format(LABEL_FORMAT, section.getSequenceID());
AdvisoryRecord aRecord = new AdvisoryRecord(coords, label, section
.getSegment());
AdvisoryRecord aRecord = new AdvisoryRecord(coords, label,
section.getSegment());
return aRecord;
}
@ -98,7 +98,7 @@ public class ConvSigmetOutlookDataAdapter extends AbstractAdvisoryDataAdapter {
public float getLineWidth() {
return LINE_WIDTH;
}
@Override
public LineStyle getLineStyle() {
return LINE_STYLE;

View file

@ -95,13 +95,13 @@ public class IntlSigmetDataAdapter extends AbstractAdvisoryDataAdapter {
if (sigmetRecord.getDistance() != -9999 && coords.length <= 2) {
if (coords.length == 1) {
AdvisoryRecord aRecord = new AdvisoryRecord(coords[0],
sigmetRecord.getDistance(), label, sigmetRecord
.getBullMessage());
sigmetRecord.getDistance(), label,
sigmetRecord.getBullMessage());
result.add(aRecord);
} else {
AdvisoryRecord aRecord = new AdvisoryRecord(coords,
sigmetRecord.getDistance(), label, sigmetRecord
.getBullMessage());
sigmetRecord.getDistance(), label,
sigmetRecord.getBullMessage());
result.add(aRecord);
}
} else {
@ -137,4 +137,30 @@ public class IntlSigmetDataAdapter extends AbstractAdvisoryDataAdapter {
return LINE_STYLE;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((hazardType == null) ? 0 : hazardType.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
IntlSigmetDataAdapter other = (IntlSigmetDataAdapter) obj;
if (hazardType == null) {
if (other.hazardType != null)
return false;
} else if (!hazardType.equals(other.hazardType))
return false;
return true;
}
}

View file

@ -56,9 +56,9 @@ import com.vividsolutions.jts.geom.Coordinate;
public class NonConvSigmetDataAdapter extends AbstractAdvisoryDataAdapter {
private static final String INSPECT_FORMAT = "Valid UNTIL %02d%02d%02d\n%s";
private static final float LINE_WIDTH = 1.5f;
private static final LineStyle LINE_STYLE = LineStyle.SOLID;
@XmlAttribute
@ -146,4 +146,30 @@ public class NonConvSigmetDataAdapter extends AbstractAdvisoryDataAdapter {
return LINE_STYLE;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((hazardType == null) ? 0 : hazardType.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
NonConvSigmetDataAdapter other = (NonConvSigmetDataAdapter) obj;
if (hazardType == null) {
if (other.hazardType != null)
return false;
} else if (!hazardType.equals(other.hazardType))
return false;
return true;
}
}

View file

@ -49,8 +49,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class AdvisoryResourceData extends
AbstractRequestableResourceData {
public class AdvisoryResourceData extends AbstractRequestableResourceData {
@XmlElement
private AbstractAdvisoryDataAdapter dataAdapter;
@ -60,52 +59,15 @@ public class AdvisoryResourceData extends
@XmlAttribute
private String colorString;
@XmlAttribute
private boolean enableNonstandardInspect = false;
@Override
public boolean equals(Object obj) {
if (!super.equals(obj)) {
return false;
}
if (obj instanceof AdvisoryResourceData == false) {
return false;
}
AdvisoryResourceData other = (AdvisoryResourceData) obj;
if (other.dataAdapter != dataAdapter
&& (other.dataAdapter == null || !other.dataAdapter
.equals(dataAdapter))) {
return false;
}
if (other.name != name
&& (other.name == null || !other.name.equals(name))) {
return false;
}
if (other.colorString != colorString
&& (other.colorString == null || !other.colorString
.equalsIgnoreCase(colorString))) {
return false;
}
if (other.enableNonstandardInspect != this.enableNonstandardInspect) {
return false;
}
return true;
}
@Override
protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects)
throws VizException {
AdvisoryResource nr = new AdvisoryResource(this,
loadProperties);
AdvisoryResource nr = new AdvisoryResource(this, loadProperties);
if (colorString != null) {
nr.getCapability(ColorableCapability.class).setColorAsString(
colorString);
@ -116,7 +78,6 @@ public class AdvisoryResourceData extends
return nr;
}
public AbstractAdvisoryDataAdapter getDataAdapter() {
return dataAdapter;
}
@ -149,4 +110,46 @@ public class AdvisoryResourceData extends
return colorString;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((colorString == null) ? 0 : colorString.hashCode());
result = prime * result
+ ((dataAdapter == null) ? 0 : dataAdapter.hashCode());
result = prime * result + (enableNonstandardInspect ? 1231 : 1237);
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
AdvisoryResourceData other = (AdvisoryResourceData) obj;
if (colorString == null) {
if (other.colorString != null)
return false;
} else if (!colorString.equals(other.colorString))
return false;
if (dataAdapter == null) {
if (other.dataAdapter != null)
return false;
} else if (!dataAdapter.equals(other.dataAdapter))
return false;
if (enableNonstandardInspect != other.enableNonstandardInspect)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
}

View file

@ -63,6 +63,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 3, 2010 bsteffen Initial creation
* Aug 14,2012 #1055 dgilling Fix getData regression from
* fxatext schema changes.
*
* </pre>
*
@ -98,7 +100,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
ffgDescription.parameters[6] = new ParameterDescription("stationId",
Type.STRING);
ffgDescription.parameters[7] = new ParameterDescription("id", Type.INT);
ffgDescription.parameters[8] = new ParameterDescription("dataURI", Type.STRING);
ffgDescription.parameters[8] = new ParameterDescription("dataURI",
Type.STRING);
rtpDescription.parameters = new ParameterDescription[7];
rtpDescription.parameters[0] = new ParameterDescription("time",
@ -112,7 +115,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
rtpDescription.parameters[4] = new ParameterDescription("stationId",
Type.STRING);
rtpDescription.parameters[5] = new ParameterDescription("id", Type.INT);
rtpDescription.parameters[6] = new ParameterDescription("dataURI", Type.STRING);
rtpDescription.parameters[6] = new ParameterDescription("dataURI",
Type.STRING);
}
@ -175,7 +179,7 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
private PointDataContainer getData(String nnnid) throws VizException {
List<Object[]> queryResult = DirectDbQuery.executeQuery(
"select createtime, product from stdtextproducts where nnnid = '"
"select refTime, product from stdtextproducts where nnnid = '"
+ nnnid + "'", "fxa", DirectDbQuery.QueryLanguage.SQL);
List<Long> times = new ArrayList<Long>(queryResult.size());
List<String> products = new ArrayList<String>(queryResult.size());
@ -241,7 +245,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
pdv.setFloat("3hr", Float.valueOf(parts[1]));
pdv.setFloat("6hr", Float.valueOf(parts[2]));
pdv.setString("stationId", station);
pdv.setString("dataURI", "/textPoints/" + station + "/" + time);
pdv.setString("dataURI", "/textPoints/" + station + "/"
+ time);
// TODO this id is not really guaranteed to be unique
pdv.setInt("id", ((int) time) + station.hashCode());
}
@ -319,7 +324,8 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
pdv.setFloat("latitude", (float) coord.latlon.y);
pdv.setFloat("precip", precip);
pdv.setString("stationId", station);
pdv.setString("dataURI", "/textPoints/" + station + "/" + time);
pdv.setString("dataURI", "/textPoints/" + station + "/"
+ time);
// TODO this id is not really guaranteed to be unique
pdv.setInt("id", ((int) time) + station.hashCode());
}

View file

@ -28,12 +28,11 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import org.eclipse.swt.graphics.Rectangle;
import org.opengis.coverage.grid.GridEnvelope;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.viz.core.GraphicsFactory;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
@ -248,16 +247,7 @@ public class MapRenderableDisplay extends AbstractRenderableDisplay implements
}
public IExtent getMapExtent() {
GridEnvelope range = descriptor.getGridGeometry().getGridRange();
try {
return GraphicsFactory.getGraphicsAdapter(getDisplayType())
.constructExtent(range);
} catch (VizException e1) {
throw new RuntimeException(
"MapRenderableDisplay failed to construct its map extent.",
e1);
}
return new PixelExtent(descriptor.getGridGeometry().getGridRange());
}
public boolean handleClick(int x, int y, int button, IGraphicsTarget target)

View file

@ -20,6 +20,10 @@
package com.raytheon.uf.viz.core.maps.display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import com.raytheon.viz.ui.editor.VizMultiPaneEditor;
/**
@ -45,9 +49,18 @@ public class VizMapEditor extends VizMultiPaneEditor {
public static final String EDITOR_ID = "com.raytheon.viz.ui.glmap.GLMapEditor";
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.editor.AbstractEditor#init(org.eclipse.ui.IEditorSite
* , org.eclipse.ui.IEditorInput)
*/
@Override
protected String getEditorName() {
return "Map";
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
super.init(site, input);
setTabTitle("Map");
}
}

View file

@ -26,6 +26,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.PaintStatus;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
@ -164,7 +165,10 @@ public class MapResourceGroup extends
paintProps.setAlpha(resource.getCapability(
ImagingCapability.class).getAlpha());
}
resource.paint(target, newProps);
PaintStatus paintStatus = resource.paint(target, newProps);
if (paintStatus != PaintStatus.PAINTED) {
updatePaintStatus(paintStatus);
}
}
}
}

View file

@ -32,6 +32,7 @@ import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.drawables.ext.ICanvasRenderingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.legend.ILegendDecorator;
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
@ -101,15 +102,8 @@ public abstract class AbstractLegendResource<T extends AbstractResourceData>
LegendEntry[] legendData = getLegendData(descriptor);
List<DrawableString> legendStrings = new ArrayList<DrawableString>();
// Disable the clipping pane
target.clearClippingPlane();
// Get the ratio for pixel to gl pixel conversion
double ratio = paintProps.getView().getExtent().getWidth()
/ paintProps.getCanvasBounds().width;
double yStart = paintProps.getView().getExtent().getMaxY()
- (BOTTOM_OFFSET_IN_PIXELS * ratio);
double yStart = paintProps.getCanvasBounds().height
- (BOTTOM_OFFSET_IN_PIXELS);
for (LegendEntry le : legendData) {
String allText = "";
for (LegendData ld : le.legendParts) {
@ -119,8 +113,8 @@ public abstract class AbstractLegendResource<T extends AbstractResourceData>
Rectangle2D allTextBounds = target
.getStringBounds(le.font, allText);
double xStart = paintProps.getView().getExtent().getMaxX()
- ((RIGHT_OFFSET_IN_PIXELS + allTextBounds.getWidth()) * ratio);
double xStart = paintProps.getCanvasBounds().width
- ((RIGHT_OFFSET_IN_PIXELS + allTextBounds.getWidth()));
double maxHeight = 0.0;
for (LegendData ld : le.legendParts) {
@ -132,18 +126,17 @@ public abstract class AbstractLegendResource<T extends AbstractResourceData>
legendStrings.add(string);
Rectangle2D textBounds = target.getStringsBounds(string);
xStart += (textBounds.getWidth() * ratio);
xStart += textBounds.getWidth();
if (textBounds.getHeight() > maxHeight) {
maxHeight = textBounds.getHeight();
}
}
yStart -= (maxHeight * ratio);
yStart -= maxHeight;
}
target.drawStrings(legendStrings);
target.setupClippingPlane(paintProps.getClippingPane());
target.getExtension(ICanvasRenderingExtension.class).drawStrings(
paintProps, legendStrings.toArray(new DrawableString[0]));
}
/*

View file

@ -51,6 +51,7 @@ Export-Package: com.raytheon.uf.viz.core,
com.raytheon.uf.viz.core.font,
com.raytheon.uf.viz.core.geom,
com.raytheon.uf.viz.core.globals,
com.raytheon.uf.viz.core.icon,
com.raytheon.uf.viz.core.interp,
com.raytheon.uf.viz.core.jobs,
com.raytheon.uf.viz.core.legend,

View file

@ -17,6 +17,7 @@ com.raytheon.uf.viz.core.rsc.capabilities.LabelableCapability
com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability
com.raytheon.uf.viz.core.rsc.capabilities.DisplayTypeCapability
com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability
com.raytheon.uf.viz.core.rsc.capabilities.MultiChannelCapability
com.raytheon.uf.viz.core.rsc.capabilities.PointCapability
com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability
com.raytheon.uf.viz.core.rsc.GenericResourceData

View file

@ -112,5 +112,8 @@
<graphicsExtension
class="com.raytheon.uf.viz.core.drawables.ext.colormap.GeneralColormappedImageExtension">
</graphicsExtension>
<graphicsExtension
class="com.raytheon.uf.viz.core.drawables.ext.GeneralCanvasRenderingExtension">
</graphicsExtension>
</extension>
</plugin>

View file

@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.opengis.coverage.grid.GridEnvelope;
import com.raytheon.uf.viz.core.GraphicsFactory.GraphicsType;
import com.raytheon.uf.viz.core.exception.VizException;
import com.vividsolutions.jts.geom.Coordinate;
@ -45,30 +44,12 @@ import com.vividsolutions.jts.geom.Coordinate;
*/
public abstract class AbstractGraphicsFactoryAdapter {
private GraphicsType type;
public void setType(GraphicsType type) {
this.type = type;
}
/**
* Checks to see if the internal graphics type is of type "type"
*
* @param type
* @return
*/
protected boolean isType(GraphicsType type) {
return this.type == type;
}
/**
* Construct the view
*
* @return the view
* @throws VizException
* if construction fails
*/
public abstract IView constructView() throws VizException;
public abstract IView constructView();
/**
* Create a graphics target

View file

@ -0,0 +1,528 @@
/**
* 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;
import java.awt.geom.Rectangle2D;
import java.awt.image.RenderedImage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.eclipse.swt.graphics.RGB;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.raytheon.uf.common.colormap.IColorMap;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColormappedDataPreparer;
import com.raytheon.uf.viz.core.data.IDataPreparer;
import com.raytheon.uf.viz.core.data.IImageDataPreparer;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.data.resp.NumericImageData;
import com.raytheon.uf.viz.core.drawables.ColorMapLoader;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.ImagingSupport;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtensionManager;
import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* A base target that handles many of the generic things a target needs to do,
* such as calling alternative forms of overloaded functions.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 25, 2012 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public abstract class AbstractGraphicsTarget implements IGraphicsTarget {
/** Does a refresh need to be performed? */
protected boolean needsRefresh = true;
protected GraphicsExtensionManager extensionManager;
protected RGB backgroundColor = new RGB(0, 0, 0);
public AbstractGraphicsTarget() {
extensionManager = new GraphicsExtensionManager(this);
}
@Override
public boolean drawRasters(PaintProperties paintProps,
DrawableImage... images) throws VizException {
return ImagingSupport.drawRasters(this, paintProps, images);
}
@Override
@Deprecated
public IImage initializeRaster(IDataPreparer preparer,
ColorMapParameters optionalParams) {
IImage rval = null;
if (optionalParams == null) {
// Assume IImageDataPreparer
final IImageDataPreparer imagePreparer = (IImageDataPreparer) preparer;
rval = initializeRaster(new IRenderedImageCallback() {
@Override
public RenderedImage getImage() throws VizException {
return imagePreparer.prepareData().getImage();
}
});
} else if (preparer instanceof IColormappedDataPreparer) {
try {
IColormappedImageExtension cmapExt = getExtension(IColormappedImageExtension.class);
final IColormappedDataPreparer cmapPreparer = (IColormappedDataPreparer) preparer;
rval = cmapExt.initializeRaster(
new IColorMapDataRetrievalCallback() {
@Override
public ColorMapData getColorMapData()
throws VizException {
NumericImageData oldData = cmapPreparer
.prepareData();
return new ColorMapData(
oldData.getData(),
new int[] {
oldData.getDatasetBounds().width,
oldData.getDatasetBounds().height });
}
}, optionalParams);
} catch (VizException e) {
throw new IllegalStateException(e);
}
}
return rval;
}
@Override
public boolean drawRaster(IImage image, PixelCoverage extent,
PaintProperties paintProps) throws VizException {
return this.drawRaster(image, extent, paintProps,
RasterMode.SYNCHRONOUS);
}
@Override
public boolean drawRaster(IImage image, PixelCoverage extent,
PaintProperties paintProps, RasterMode mode) throws VizException {
DrawableImage di = new DrawableImage(image, extent);
di.setMode(mode);
return drawRasters(paintProps, di);
}
@Override
public void drawStrings(DrawableString... parameters) throws VizException {
drawStrings(Arrays.asList(parameters));
}
@Override
public Rectangle2D getStringsBounds(DrawableString parameters) {
// TODO: Handle box already set? and OUTLINE style
String[] text = parameters.getText();
double maxWidth = 0;
double totalHeight = 0;
Rectangle2D bounds = null;
for (String string : text) {
Rectangle2D txtBounds = getStringsBounds(parameters, string);
if (txtBounds.getWidth() > maxWidth) {
maxWidth = txtBounds.getWidth();
}
totalHeight += txtBounds.getHeight();
if (bounds == null) {
bounds = txtBounds;
}
}
if (bounds != null) {
if (parameters.textStyle == TextStyle.BLANKED
|| parameters.textStyle == TextStyle.BOXED) {
maxWidth += 1.0f;
}
bounds.setRect(0, 0, maxWidth, totalHeight);
}
return bounds;
}
@Override
public void drawShadedShape(IShadedShape shape, float alpha)
throws VizException {
drawShadedShape(shape, alpha, 1.0f);
}
@Override
public void drawShadedShape(IShadedShape shape, float alpha,
float brightness) throws VizException {
drawShadedShapes(alpha, brightness, shape);
}
@Override
public void drawWireframeShape(IWireframeShape shape, RGB color,
float lineWidth) throws VizException {
drawWireframeShape(shape, color, lineWidth, LineStyle.SOLID);
}
@Override
public void drawWireframeShape(IWireframeShape shape, RGB color,
float lineWidth, LineStyle lineStyle) throws VizException {
drawWireframeShape(shape, color, lineWidth, lineStyle, 1.0f);
}
@Override
public void drawWireframeShape(IWireframeShape shape, RGB color,
float lineWidth, LineStyle lineStyle, IFont font)
throws VizException {
drawWireframeShape(shape, color, lineWidth, lineStyle, font, 1.0f);
}
@Override
@Deprecated
public void drawArc(double x1, double y1, double z1, double radius,
RGB color, float width, int startAzimuth, int endAzimuth,
LineStyle lineStyle, boolean includeSides) throws VizException {
DrawableCircle dc = new DrawableCircle();
dc.setCoordinates(x1, y1, z1);
dc.basics.color = color;
dc.lineStyle = lineStyle;
dc.startAzimuth = startAzimuth;
dc.endAzimuth = endAzimuth;
if (startAzimuth > endAzimuth) {
dc.numberOfPoints = (endAzimuth + 360) - startAzimuth;
} else {
dc.numberOfPoints = endAzimuth - startAzimuth;
}
dc.includeSides = includeSides;
dc.lineWidth = width;
dc.radius = radius;
drawCircle(dc);
}
@Override
public double[] getPointOnCircle(double x1, double y1, double z1,
double radius, double angle) throws VizException {
double pointOnCircle[] = new double[3];
pointOnCircle[0] = x1 + radius * Math.cos(Math.toRadians(angle));
pointOnCircle[1] = y1 + radius * Math.sin(Math.toRadians(angle));
// on plane z1
pointOnCircle[2] = z1;
return pointOnCircle;
}
@Override
public IWireframeShape createWireframeShape(boolean mutable,
IDescriptor descriptor) {
return createWireframeShape(mutable, descriptor, 0.0f);
}
@Override
public IWireframeShape createWireframeShape(boolean mutable,
IDescriptor descriptor, float simplificationLevel) {
return createWireframeShape(mutable, descriptor, simplificationLevel,
false, null);
}
@Override
public IWireframeShape createWireframeShape(boolean mutable,
GeneralGridGeometry geom, float simplificationLevel) {
return createWireframeShape(mutable, geom, simplificationLevel, false,
null);
}
@Override
public IWireframeShape createWireframeShape(boolean mutable,
IDescriptor descriptor, float simplificationLevel,
boolean spatialChopFlag, IExtent extent) {
return createWireframeShape(mutable, descriptor.getGridGeometry(),
simplificationLevel, spatialChopFlag, extent);
}
@Override
public IWireframeShape createWireframeShape(boolean mutableFlag,
GeneralGridGeometry geom) {
return createWireframeShape(mutableFlag, geom, 0.0f);
}
@Override
public IShadedShape createShadedShape(boolean mutable,
IDescriptor descriptor, boolean tesselate) {
return createShadedShape(mutable, descriptor.getGridGeometry(),
tesselate);
}
@Override
public void setNeedsRefresh(boolean needsRefresh) {
this.needsRefresh = needsRefresh;
}
@Override
public boolean isNeedsRefresh() {
return needsRefresh;
}
@Override
public void setBackgroundColor(RGB backgroundColor) {
this.backgroundColor = backgroundColor;
}
@Override
@Deprecated
public void setUseBuiltinColorbar(boolean isColorbarDisplayed) {
// Most targets do not support a BuiltinColorbar and this functionality
// is deprecated, so the default behavior is to completely ignore this.
}
@Override
@Deprecated
public String getViewType() {
return VizConstants.VIEW_2D;
}
@Override
public void drawPoint(double x, double y, double z, RGB color,
PointStyle pointStyle) throws VizException {
drawPoint(x, y, z, color, pointStyle, 1.0f);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.IGraphicsTarget#drawPoints(java.util.Collection,
* org.eclipse.swt.graphics.RGB,
* com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle, float)
*/
@Override
public void drawPoints(Collection<double[]> locations, RGB color,
PointStyle pointStyle, float magnification) throws VizException {
List<DrawableString> dstrings = new ArrayList<DrawableString>();
for (double[] location : locations) {
String text = null;
switch (pointStyle) {
case SQUARE:
text = "";
break;
case CIRCLE:
text = "";
break;
case CROSS:
text = "+";
break;
case DASH:
text = "-";
break;
case DISC:
text = "";
break;
case POINT:
text = "";
break;
case BOX:
text = "";
break;
case STAR:
text = "*";
break;
case X:
text = "x";
break;
case NONE:
default:
return;
}
DrawableString dstring = new DrawableString(text, color);
dstring.setCoordinates(location[0], location[1]);
dstring.magnification = magnification;
dstrings.add(dstring);
}
drawStrings(dstrings);
}
@Override
public void drawPoint(double x, double y, double z, RGB color,
PointStyle pointStyle, float magnification) throws VizException {
drawPoints(Arrays.asList(new double[] { x, y, z }), color, pointStyle,
magnification);
}
@Override
public void drawString(IFont font, String text, double x, double y,
double z, TextStyle textStyle, RGB color,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment, Double rotation)
throws VizException {
drawString(font, text, x, y, z, textStyle, color, horizontalAlignment,
verticalAlignment, rotation, 1.0f, 1.0f);
}
@Override
public void drawString(IFont font, String text, double x, double y,
double z, TextStyle textStyle, RGB color,
HorizontalAlignment horizontalAlignment, Double rotation)
throws VizException {
drawString(font, text, x, y, z, textStyle, color, horizontalAlignment,
VerticalAlignment.BOTTOM, rotation);
}
@Override
public void drawStrings(IFont font, String[] text, double x, double y,
double z, TextStyle textStyle, RGB[] colors,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment) throws VizException {
DrawableString params = new DrawableString(text, colors);
params.font = font;
params.setCoordinates(x, y, z);
params.textStyle = textStyle;
params.horizontalAlignment = horizontalAlignment;
params.verticallAlignment = verticalAlignment;
drawStrings(params);
}
@Override
public void drawString(IFont font, String string, double xPos, double yPos,
double zPos, TextStyle textStyle, RGB color,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment, Double rotation, float alpha,
double magnification) throws VizException {
DrawableString params = new DrawableString(string, color);
params.font = font;
params.setCoordinates(xPos, yPos, zPos);
params.textStyle = textStyle;
params.horizontalAlignment = horizontalAlignment;
params.verticallAlignment = verticalAlignment;
params.rotation = rotation != null ? rotation : 0.0;
params.basics.alpha = alpha;
params.magnification = magnification;
drawStrings(params);
}
@Override
public Rectangle2D getStringBounds(IFont font, String text) {
if (font == null) {
font = getDefaultFont();
}
DrawableString params = new DrawableString(text, null);
params.font = font;
return getStringsBounds(params, text);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.IGraphicsTarget#getStringBounds(com.raytheon
* .uf.viz.core.drawables.IFont, java.lang.String[],
* com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle)
*/
@Override
public Rectangle2D getStringBounds(IFont font, String[] text,
TextStyle style) {
DrawableString params = new DrawableString(text, (RGB[]) null);
params.font = font;
params.textStyle = style;
return getStringsBounds(params);
}
@Override
public void drawCircle(double x1, double y1, double z1, double radius,
RGB color, float width) throws VizException {
DrawableCircle circle = new DrawableCircle();
circle.setCoordinates(x1, y1, z1);
circle.lineWidth = width;
circle.basics.color = color;
circle.radius = new Double(radius);
drawCircle(circle);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.IGraphicsTarget#drawFilledCircle(double,
* double, double, double, org.eclipse.swt.graphics.RGB)
*/
@Override
public void drawFilledCircle(double x, double y, double z, double radius,
RGB color) throws VizException {
DrawableCircle circle = new DrawableCircle();
circle.setCoordinates(x, y, z);
circle.basics.color = color;
circle.radius = new Double(radius);
circle.filled = true;
drawCircle(circle);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.IGraphicsTarget#buildColorMap(java.lang.String)
*/
@Override
public IColorMap buildColorMap(String name) throws VizException {
return ColorMapLoader.loadColorMap(name);
}
@Override
public void drawLine(double x1, double y1, double z1, double x2, double y2,
double z2, RGB color, float width, LineStyle lineStyle)
throws VizException {
DrawableLine line = new DrawableLine();
line.addPoint(x1, y1, z1);
line.addPoint(x2, y2, z2);
line.width = width;
line.lineStyle = lineStyle;
line.basics.color = color;
drawLine(line);
}
@Override
public void drawLine(double x1, double y1, double z1, double x2, double y2,
double z2, RGB color, float width) throws VizException {
drawLine(x1, y1, z1, x2, y2, z2, color, width, LineStyle.SOLID);
}
@Override
public <T extends IGraphicsExtensionInterface> T getExtension(
Class<T> extensionClass) throws VizException {
return extensionManager.getExtension(extensionClass);
}
}

View file

@ -0,0 +1,213 @@
/**
* 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;
import javax.vecmath.Vector3d;
import org.eclipse.swt.graphics.Rectangle;
import com.raytheon.uf.viz.core.geom.Plane;
import com.raytheon.uf.viz.core.geom.Ray;
/**
*
* Provides basic view functionality that may be useful to any view object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 25, 2012 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public abstract class AbstractView implements IView {
private static final Plane mapPlane = new Plane(0.0, 0.0, 1.0, 0.0, false);
protected IExtent extent;
public AbstractView(IExtent pe) {
this.extent = pe;
}
@Override
public void scaleAndBias(double factor, double screenX, double screenY,
IGraphicsTarget target) {
double[] grid = screenToGrid(screenX, screenY, 0, target);
this.extent.scaleAndBias(factor, grid[0], grid[1]);
}
@Override
public double getZoom() {
return extent.getScale();
}
@Override
public double recalcZoomLevel(int[] dimensions) {
int worldWidth = dimensions[0];
int worldHeight = dimensions[1];
return Math.min((extent.getMaxX() - extent.getMinX()) / worldWidth,
(extent.getMaxY() - extent.getMinY()) / worldHeight);
}
@Override
public void zoom(double zoomLevel) {
this.extent.scale(zoomLevel);
}
@Override
public boolean isVisible(double[] pixel) {
return extent.contains(pixel);
}
@Override
public boolean isVisible(IExtent pe) {
return extent.intersects(pe);
}
@Override
public IExtent getExtent() {
return extent;
}
@Override
public void setExtent(IExtent e) {
this.extent = e;
}
@Override
public double[] getDisplayCoords(double[] screenCoordinate,
IGraphicsTarget target) {
Ray r = computeRay(screenCoordinate, target);
if (r == null) {
return null;
}
Vector3d i = mapPlane.intersection(r);
if (i == null) {
return null;
}
return new double[] { i.x, i.y, i.z };
}
/**
* Create a Ray starting a the near plane with direction towards the far
*
* @param mouse
* mouse x,y
* @return Ray
*/
public Ray computeRay(double[] mouse, IGraphicsTarget target) {
Vector3d far = new Vector3d(screenToGrid(mouse[0], mouse[1], 1, target));
Vector3d near = new Vector3d(
screenToGrid(mouse[0], mouse[1], 0, target));
if (near == null || far == null) {
return null;
}
far.sub(near);
far.normalize();
return new Ray(near, far);
}
@Override
public IExtent createExtent(PixelCoverage pc) {
return new PixelExtent(pc.getMinX(), pc.getMaxX(), pc.getMinY(),
pc.getMaxY());
}
@Override
public void shiftExtent(double[] startScreen, double[] endScreen,
IGraphicsTarget target) {
double[] start = screenToGrid(startScreen[0], startScreen[1], 0, target);
double[] end = screenToGrid(endScreen[0], endScreen[1], 0, target);
this.extent.shift(end[0] - start[0], end[1] - start[1]);
}
@Override
public void scaleToClientArea(Rectangle clientArea, int[] dims) {
double screenRatio;
if ((clientArea.width == 0) || (clientArea.height == 0)) {
screenRatio = 1.0;
} else {
screenRatio = (double) clientArea.width
/ (double) clientArea.height;
}
int f_worldWidth = dims[0];
int f_worldHeight = dims[1];
double worldRatio = (double) f_worldWidth / (double) f_worldHeight;
// set pixel extent to show entire map
if (screenRatio > worldRatio) {
this.extent = new PixelExtent(0, f_worldHeight * screenRatio, 0,
f_worldHeight);
} else {
this.extent = new PixelExtent(0, f_worldWidth, 0, f_worldWidth
/ screenRatio);
}
this.extent.shift((f_worldWidth - extent.getWidth()) / 2,
(f_worldHeight - extent.getHeight()) / 2);
}
@Override
public double[] screenToGrid(double x, double y, double depth,
IGraphicsTarget target) {
double correctedX = (x * (extent.getMaxX() - extent.getMinX()) / getCanvasBounds(target).width)
+ extent.getMinX();
double correctedY = (y * (extent.getMaxY() - extent.getMinY()) / getCanvasBounds(target).height)
+ extent.getMinY();
// z bounds are 0 to 1
double correctedZ = (depth * (extent.getMax().z - extent.getMin().z))
+ extent.getMin().z;
return new double[] { correctedX, correctedY, correctedZ };
}
@Override
public double[] gridToScreen(double[] grid, IGraphicsTarget target) {
double x = ((grid[0] - extent.getMinX()) * getCanvasBounds(target).width)
/ (extent.getMaxX() - extent.getMinX());
double y = ((grid[1] - extent.getMinY()) * getCanvasBounds(target).height)
/ (extent.getMaxY() - extent.getMinY());
// z bounds are 0 to 1
double z = (grid[2] - extent.getMin().z)
/ (extent.getMax().z - extent.getMin().z);
return new double[] { x, y, z };
}
public abstract Rectangle getCanvasBounds(IGraphicsTarget target);
public abstract void setupView(IGraphicsTarget target);
public abstract AbstractView clone();
}

View file

@ -59,15 +59,17 @@ public class ContextManager {
private static Map<String, String[]> contexts = null;
private static Map<Class<?>, String[]> contextCache = new HashMap<Class<?>, String[]>();
private static final String EXTENSION_POINT = "com.raytheon.uf.viz.core.classContext";
private static Map<IServiceLocator, ContextManager> instanceMap = new HashMap<IServiceLocator, ContextManager>();
private static synchronized String[] getContextsForClass(String name) {
private static synchronized String[] getContextsForClass(Class<?> clazz) {
if (contexts == null) {
loadContexts();
}
String[] cons = contexts.get(name);
String[] cons = contexts.get(clazz.getName());
if (cons == null) {
cons = new String[] {};
}
@ -106,23 +108,37 @@ public class ContextManager {
}
private static String[] getAllContextsForClass(Class<?> clazz) {
Set<String> contexts = new HashSet<String>();
String[] ids = getContextsForClass(clazz.getName());
for (String id : ids) {
contexts.add(id);
if (clazz == null || clazz == Object.class) {
// Base case, no contexts
return new String[0];
}
Class<?> superClass = clazz.getSuperclass();
while (superClass.equals(Object.class) == false) {
ids = getContextsForClass(superClass.getName());
String[] ids = contextCache.get(clazz);
if (ids == null) {
Set<String> contexts = new HashSet<String>();
ids = getContextsForClass(clazz);
for (String id : ids) {
contexts.add(id);
}
superClass = superClass.getSuperclass();
}
return contexts.toArray(new String[contexts.size()]);
for (Class<?> interfaze : clazz.getInterfaces()) {
// Get contexts for each interface
ids = getAllContextsForClass(interfaze);
for (String id : ids) {
contexts.add(id);
}
}
ids = getAllContextsForClass(clazz.getSuperclass());
for (String id : ids) {
contexts.add(id);
}
ids = contexts.toArray(new String[contexts.size()]);
contextCache.put(clazz, ids);
}
return ids;
}
public static synchronized ContextManager getInstance(

View file

@ -19,8 +19,10 @@
**/
package com.raytheon.uf.viz.core;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
/**
* Class that stores information about how to draw a circle
* Class that stores information about how to draw a circle or arc of a circle
*
* <pre>
*
@ -40,20 +42,39 @@ public class DrawableCircle extends AbstractDrawableObject {
/**
* fixed world size, when zooming the circle size will appear to grow/shrink
* on the screen
* on the screen. Mutually exclusive with {@link #screenRadius}
*/
public Double radius = null;
/**
* fixed screen size ( in pixels ), when zooming the proper radius will be
* calculated so the circle size stays the same on the screen
* calculated so the circle size stays the same on the screen. Mutually
* exclusive with {@link #radius}
*/
public Double screenRadius = null;
/** The width of the circle's line (non-filled) */
public float lineWidth = 1.0f;
/** The line style of the circle's line (non-filled) */
public LineStyle lineStyle = LineStyle.SOLID;
/** Whether the circle is filled or not */
public boolean filled = false;
/** The number of points to use for the circle */
public int numberOfPoints = 360;
/** Start azimuth of the circle in degrees (0.0) */
public float startAzimuth = 0.0f;
/** End azimuth of the circle in degrees (360.0) */
public float endAzimuth = 360.0f;
/**
* If the start/end azimuth are < 360 def apart, this will specify if the
* sides of the arc should be drawn
*/
public boolean includeSides = true;
}

View file

@ -68,12 +68,6 @@ public class DrawableString extends AbstractDrawableObject {
/** amount of rotation in degrees from right */
public double rotation = 0.0;
/**
* determines if the text rotation should be from start of text or x,y,z
* passed in
*/
public boolean rotateOnStartOfText = false;
/** The colors to use for the strings */
private RGB[] colors;

View file

@ -33,9 +33,7 @@ import org.eclipse.core.runtime.Platform;
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.drawables.IDescriptor;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.status.StatusConstants;
/**
*
@ -54,26 +52,9 @@ import com.raytheon.uf.viz.core.status.StatusConstants;
* @version 1.0
*/
public class GraphicsFactory {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(GraphicsFactory.class);
public static enum GraphicsType {
TWO_D("2D"), THREE_D("3D");
public String id;
private GraphicsType(String type) {
this.id = type;
}
public static GraphicsType getType(String id) {
for (GraphicsType type : GraphicsType.values()) {
if (type.id.equals(id)) {
return type;
}
}
return null;
}
}
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(GraphicsFactory.class);
private static final String DEFAULT = "default";
@ -93,36 +74,20 @@ public class GraphicsFactory {
IConfigurationElement[] config = ext.getConfigurationElements();
for (IConfigurationElement ele : config) {
String id = ele.getAttribute("id");
String type = ele.getAttribute("type");
String[] types = type == null ? new String[] {
GraphicsType.TWO_D.id, GraphicsType.THREE_D.id }
: new String[] { type };
for (String tp : types) {
GraphicsType gt = GraphicsType.getType(tp);
if (gt != null) {
AbstractGraphicsFactoryAdapter adapter;
try {
adapter = (AbstractGraphicsFactoryAdapter) ele
.createExecutableExtension("factoryClass");
adapter.setType(gt);
adapters.put(id + ":" + tp, adapter);
} catch (CoreException e) {
statusHandler.handle(
Priority.PROBLEM,
"Could not instantiate graphics adapter: "
+ ele.getAttribute("factoryClass"));
try {
AbstractGraphicsFactoryAdapter adapter = (AbstractGraphicsFactoryAdapter) ele
.createExecutableExtension("factoryClass");
adapters.put(id, adapter);
} catch (CoreException e) {
statusHandler.handle(Priority.PROBLEM,
"Could not instantiate graphics adapter: "
+ ele.getAttribute("factoryClass"));
}
} else {
statusHandler.handle(Priority.PROBLEM,
"Graphics type, " + type
+ " is not a valid type");
}
}
}
}
if (adapters.containsKey(DEFAULT + ":" + GraphicsType.TWO_D.id) == false) {
if (adapters.containsKey(DEFAULT) == false) {
statusHandler.handle(Priority.PROBLEM,
"No default graphics factory adapter found");
}
@ -136,22 +101,8 @@ public class GraphicsFactory {
* @return
* @throws VizException
*/
public static AbstractGraphicsFactoryAdapter getGraphicsAdapter()
throws VizException {
return getGraphicsAdapter(DEFAULT, GraphicsType.TWO_D.id);
}
/**
* Get the default graphics adapter given the graphics type. A null type
* will default to 2D
*
* @return
* @throws VizException
*/
public static AbstractGraphicsFactoryAdapter getGraphicsAdapter(String type)
throws VizException {
return getGraphicsAdapter(DEFAULT, type != null ? type
: GraphicsType.TWO_D.id);
public static AbstractGraphicsFactoryAdapter getGraphicsAdapter() {
return getGraphicsAdapter(DEFAULT);
}
/**
@ -161,27 +112,13 @@ public class GraphicsFactory {
* @return
* @throws VizException
*/
public static AbstractGraphicsFactoryAdapter getGraphicsAdapter(String id,
String type) throws VizException {
AbstractGraphicsFactoryAdapter adapter = adapters.get(id + ":" + type);
public static AbstractGraphicsFactoryAdapter getGraphicsAdapter(String id) {
AbstractGraphicsFactoryAdapter adapter = adapters.get(id);
if (adapter == null) {
throw new VizException("Could not find graphics adapter with id: "
+ id + " and type: " + type);
throw new RuntimeException(
"Could not find graphics adapter with id: " + id);
}
return adapter;
}
/**
* Get the graphics type string for the descriptor (2D or 3D)
*
* @param descriptor
* @return
*/
public static String getType(IDescriptor descriptor) {
String type = GraphicsType.TWO_D.id;
if (descriptor.getGridGeometry().getDimension() == 3) {
type = GraphicsType.THREE_D.id;
}
return type;
}
}

View file

@ -35,15 +35,12 @@ import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.geom.PixelCoordinate;
import com.vividsolutions.jts.geom.LinearRing;
/**
*
@ -432,22 +429,6 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract void drawShadedRect(IExtent pe, RGB color, double alpha,
byte[] pattern) throws VizException;
/**
* Draw a shaded polygon, not high performance, for singularly used and
* rapidly changing shapes
*
* @param poly
* the polygon to be drawn in world coordinates
* @param color
* the color to fill with
* @param alpha
* the alpha blending factor
* @param pattern
* the fill pattern or null for solid fill
*/
public abstract void drawShadedPolygon(LinearRing poly, RGB color,
double alpha, byte[] pattern) throws VizException;
/**
* Draws a cicle with parameters about the circle
*
@ -465,25 +446,10 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract void drawLine(DrawableLine... lines) throws VizException;
/**
* DEPRECATED: Use {@link #drawCircle(DrawableCircle...)}
*
* @param x1
* x location of arc start.
* @param y1
* y location of arc start.
* @param z1
* z location of arc start
* @param radius
* radius (if was a complete circle.
* @param color
* color of arc
* @param width
* width of arc
* @param startAzimuth
* angle at where to draw the arc.
* @param endAzimuth
* angle at where to end arc.
* @throws VizException
*/
@Deprecated
public void drawArc(double x1, double y1, double z1, double radius,
RGB color, float width, int startAzimuth, int arcWidth,
LineStyle lineStyle, boolean includeSides) throws VizException;
@ -529,6 +495,20 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract IWireframeShape createWireframeShape(boolean mutable,
IDescriptor descriptor, float simplificationLevel);
/**
* Create a wireframe shape object
*
* @param mutable
* whether the shape changes after creation
* @param descriptor
* the geometry for the shape
* @param simplificationLevel
* the simplification level
* @return a wireframe shape object
*/
public abstract IWireframeShape createWireframeShape(boolean mutable,
GeneralGridGeometry geom, float simplificationLevel);
/**
* Create a wireframe shape object with options
*
@ -556,19 +536,28 @@ public interface IGraphicsTarget extends IImagingExtension {
GeneralGridGeometry geom, float simplificationLevel,
boolean spatialChopFlag, IExtent extent);
/**
* DEPRECATED: Use
* {@link #createShadedShape(boolean, GeneralGridGeometry, boolean)} instead
*
*/
@Deprecated
public abstract IShadedShape createShadedShape(boolean mutable,
IDescriptor descriptor, boolean tesselate);
/**
* Create a shaded shape object
*
* @param mutable
* whether the shape changes after creation
* @param descriptor
* the map descriptor
* @param targetGeometry
* the geometry the shape is made for
* @param tesselate
* whether a shape requires tesselation to be convex
* @return a shaded shape object
*/
public abstract IShadedShape createShadedShape(boolean mutable,
IDescriptor descriptor, boolean tesselate);
GeneralGridGeometry targetGeometry, boolean tesselate);
/**
* Initialization
@ -580,13 +569,12 @@ public interface IGraphicsTarget extends IImagingExtension {
* Start a frame with a given extent. Must call endFrame after drawing is
* complete.
*
* @param display
* the display area that the frame covers
* @param view
* viewable area of the frame
* @param isClearBackground
* whether background should be cleared prior to drawing
*/
public abstract void beginFrame(IRenderableDisplay display,
boolean isClearBackground);
public abstract void beginFrame(IView view, boolean isClearBackground);
/**
* End a frame
@ -686,28 +674,11 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract IFont getDefaultFont();
/**
* Draw a cylinder.
*
* @param coord
* @param color
* @param alpha
* @param height
* @param baseRadius
* @param topRadius
* @param sideCount
* @param sliceCount
* @param rotation
* @param lean
*/
public void drawCylinder(PixelCoordinate coord, RGB color, float alpha,
double height, double baseRadius, double topRadius, int sideCount,
int sliceCount, double rotation, double lean);
/**
* Gets the view type, e.g. 2D
* DEPRECATED: Should not be used for anything
*
* @return
*/
@Deprecated
public String getViewType();
/**
@ -760,28 +731,6 @@ public interface IGraphicsTarget extends IImagingExtension {
*/
public IView getView();
/**
* Notify the Graphics Target that there are updated extents that need to be
* set.
*
* @param updatedExtent
*/
public void updateExtent(IExtent updatedExtent);
/**
* Use getExtension(IOffscreenRenderingExtension.class).renderOffscreen(
* offscreenImage) instead;
*/
@Deprecated
public void renderOffscreen(IImage offscreenImage) throws VizException;
/**
* Use getExtension(IOffscreenRenderingExtension.class).renderOnscreen()
* instead;
*/
@Deprecated
public void renderOnscreen() throws VizException;
/**
* Use drawStrings(DrawableString parameters)
*/
@ -849,72 +798,6 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract Rectangle2D getStringBounds(IFont font, String[] text,
TextStyle style);
/**
* Draw a ramp of colors using a colormap over a specified region
*
* @param colorMap
* the colormap to apply
* @param pixelExtent
* the pixelextent
* @param blendAlpha
* the alpha to multiply the alpha values by
*/
@Deprecated
public abstract void drawColorRamp(IColorMap colorMap, IExtent pixelExtent,
float blendAlpha) throws VizException;
/**
* Draw a ramp of colors using a colormap over a specified region
*
* @param colorMap
* the colormap to apply
* @param pixelExtent
* the pixelextent
* @param blendAlpha
* the alpha to multiply the alpha values by
* @param brightness
* the brightness to multiply the color values by
* @param contrast
* the contrast to apply to the colorbar
*/
@Deprecated
public abstract void drawColorRamp(IColorMap colorMap, IExtent pixelExtent,
float blendAlpha, float brightness, float contrast)
throws VizException;
/**
* Draw a ramp of colors using a colormap over a specified region
*
* @param colorMapParams
* the colormap to apply
* @param pixelExtent
* the pixelextent
* @param blendAlpha
* the alpha to multiply the alpha values by
*/
@Deprecated
public abstract void drawColorRamp(ColorMapParameters colorMapParams,
IExtent pixelExtent, float blendAlpha) throws VizException;
/**
* Draw a ramp of colors using a colormap over a specified region
*
* @param colorMap
* the colormap to apply
* @param pixelExtent
* the pixelextent
* @param blendAlpha
* the alpha to multiply the alpha values by
* @param brightness
* the brightness to multiply the color values by
* @param contrast
* the contrast to apply to the colorbar
*/
@Deprecated
public abstract void drawColorRamp(ColorMapParameters colorMapParams,
IExtent pixelExtent, float blendAlpha, float brightness,
float contrast) throws VizException;
/**
* DEPRECATED: call drawCircle(DrawableCircle...)
*

View file

@ -54,10 +54,24 @@ public interface IMesh {
public boolean intersects(IExtent extent);
/**
* Reprojects the mesh into the new target geometry
* use clone instead, this method will be removed in future version.
*
* @param targetGeometry
* @return
* @throws VizException
*/
public void reproject(GeneralGridGeometry targetGeometry)
@Deprecated
public IMesh reproject(GeneralGridGeometry targetGeometry)
throws VizException;
/**
* Create a mesh identical to this mesh but for a different target geometry.
* If this mesh is no longer in use than dispose should be called after
* cloning.
*
* @param targetGeometry
* @return
* @throws VizException
*/
public IMesh clone(GeneralGridGeometry targetGeometry) throws VizException;
}

View file

@ -166,6 +166,6 @@ public interface IView {
public abstract void scaleToClientArea(Rectangle clientArea,
int[] dimensions);
public Object clone();
public IView clone();
}

View file

@ -343,9 +343,11 @@ public class PixelExtent implements IExtent {
*/
@Override
public PixelExtent clone() {
PixelExtent pe = new PixelExtent(getMinX(), getMaxX(), getMinY(),
getMaxY());
double[] myCenter = getCenter();
PixelExtent pe = new PixelExtent(aMinX, aMaxX, aMinY, aMaxY);
double[] curCenter = pe.getCenter();
pe.shift(myCenter[0] - curCenter[0], myCenter[1] - curCenter[1]);
pe.scaleAndBias(getScale(), myCenter[0], myCenter[1]);
return pe;
}

View file

@ -233,6 +233,7 @@ public class CatalogQuery {
req.setPluginName(pluginName);
req.setBinOffset(binOffset);
req.setQueryTerms(constraintMap);
return req;
}
@ -251,6 +252,7 @@ public class CatalogQuery {
* @return the available times that meet the constraints
* @throws VizException
*/
@SuppressWarnings("unchecked")
public static DataTime[] performTimeQuery(
Map<String, RequestConstraint> constraintMap, boolean max,
BinOffset binOffset) throws VizException {

View file

@ -87,6 +87,7 @@ public class DefaultDataCubeAdapter implements IDataCubeAdapter {
throws VizException {
TimeQueryRequestSet set = new TimeQueryRequestSet();
set.setRequests(requests.toArray(new TimeQueryRequest[0]));
@SuppressWarnings("unchecked")
List<List<DataTime>> result = (List<List<DataTime>>) ThriftClient
.sendRequest(set);

View file

@ -754,16 +754,17 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
return gridGeometry;
}
/**
* Set the grid geometry
/*
* (non-Javadoc)
*
* @param gridGeometry
* the gridGeometry to set
* @throws VizException
* @see
* com.raytheon.uf.viz.core.drawables.IDescriptor#setGridGeometry(org.geotools
* .coverage.grid.GeneralGridGeometry)
*/
public void setGridGeometry(GeneralGridGeometry gridGeometry)
@Override
public void setGridGeometry(GeneralGridGeometry geometry)
throws VizException {
this.gridGeometry = gridGeometry;
this.gridGeometry = geometry;
init();
}

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
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.AbstractGraphicsFactoryAdapter;
import com.raytheon.uf.viz.core.GraphicsFactory;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
@ -120,10 +121,13 @@ public abstract class AbstractRenderableDisplay implements IRenderableDisplay {
private Map<String, Object> globals = new HashMap<String, Object>();
private AbstractGraphicsFactoryAdapter graphicsAdapter;
public AbstractRenderableDisplay() {
super();
this.listener = new RenderableDisplayListener();
backgroundColor = getStartingBackgroundColor();
setGraphicsAdapter(GraphicsFactory.getGraphicsAdapter());
}
public AbstractRenderableDisplay(IExtent extent, IDescriptor descriptor) {
@ -233,35 +237,17 @@ public abstract class AbstractRenderableDisplay implements IRenderableDisplay {
@Override
public void setDescriptor(IDescriptor desc) {
boolean shouldRecreateView = true;
if (this.descriptor != null) {
this.descriptor.getResourceList().removePostAddListener(
this.listener);
this.descriptor.getResourceList().removePostRemoveListener(
this.listener);
// if the descriptor types are different then the view needs to be
// recreated
shouldRecreateView = !GraphicsFactory.getType(this.descriptor)
.equals(GraphicsFactory.getType(desc));
}
this.descriptor = (AbstractDescriptor) desc;
this.descriptor.getResourceList().addPostAddListener(this.listener);
this.descriptor.getResourceList().addPostRemoveListener(this.listener);
if (shouldRecreateView) {
try {
this.view = GraphicsFactory.getGraphicsAdapter(
GraphicsFactory.getType(this.descriptor))
.constructView();
} catch (VizException e) {
statusHandler.handle(Priority.CRITICAL,
e.getLocalizedMessage(), e);
e.printStackTrace();
}
}
customizeResourceList(this.descriptor.getResourceList());
}
@ -279,17 +265,6 @@ public abstract class AbstractRenderableDisplay implements IRenderableDisplay {
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IRenderableDisplay#getDisplayType()
*/
@Override
public String getDisplayType() {
return GraphicsFactory.getType(descriptor);
}
@Override
public int[] getDimensions() {
return new int[] { getWorldWidth(), getWorldHeight(), 0 };
@ -595,4 +570,31 @@ public abstract class AbstractRenderableDisplay implements IRenderableDisplay {
listener.refresh();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IRenderableDisplay#getGraphicsAdapter
* ()
*/
@Override
public AbstractGraphicsFactoryAdapter getGraphicsAdapter() {
return graphicsAdapter;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IRenderableDisplay#setGraphicsAdapter
* (com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter)
*/
@Override
public void setGraphicsAdapter(AbstractGraphicsFactoryAdapter adapter) {
if (this.graphicsAdapter != adapter) {
this.graphicsAdapter = adapter;
this.view = adapter.constructView();
}
}
}

View file

@ -26,6 +26,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
@ -320,6 +321,15 @@ public interface IDescriptor extends IResourceGroup {
*/
public abstract GeneralGridGeometry getGridGeometry();
/**
* Set the geometry for the descriptor
*
* @param geometry
* @throws VizException
*/
public abstract void setGridGeometry(GeneralGridGeometry geometry)
throws VizException;
/**
* DEPRECATED, use getFrameCoordinator().changeFrame(...) with
* IFrameCoordinator.FrameChangeOperation/FrameChangeMode

View file

@ -24,6 +24,7 @@ import java.util.Map;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.IExtent;
@ -127,13 +128,6 @@ public interface IRenderableDisplay extends IRenderable {
*/
public void setDescriptor(IDescriptor desc);
/**
* Get the type of the display.
*
* @return
*/
public abstract String getDisplayType();
/**
* Get the internal view representation from this display. Note, this is
* really only for use in initializing a PaintProperties object and for
@ -336,4 +330,18 @@ public interface IRenderableDisplay extends IRenderable {
* Notify the display to refresh
*/
public void refresh();
/**
* Get the graphics adapter for the display
*
* @return
*/
public AbstractGraphicsFactoryAdapter getGraphicsAdapter();
/**
* Set the graphics adapter for the display
*
* @param adapter
*/
public void setGraphicsAdapter(AbstractGraphicsFactoryAdapter adapter);
}

View file

@ -37,5 +37,31 @@ package com.raytheon.uf.viz.core.drawables;
*/
public enum PaintStatus {
PAINTED, REPAINT, ERROR;
/**
* indicates that a resource or renderable has successfully painted all
* available data.
*/
PAINTED,
/**
* indicates that a resource is currently in the act of painting
*/
PAINTING,
/**
* indicates that less than all the data has painted and more data will be
* arriving asynchronously, when that data arrives the PaintStatus will
* become REPAINT.
*/
INCOMPLETE,
/**
* indicates a resource has new data that needs to be painted
*/
REPAINT,
/**
* an uncaught error occured during the last paint event.
*/
ERROR;
}

View file

@ -241,12 +241,11 @@ public class ResourcePair implements ISerializableObject {
this.loadProperties = new LoadProperties();
}
setResource(this.resourceData
.construct(this.loadProperties, descriptor));
if (this.resource == null) {
AbstractVizResource rsc = this.resourceData.construct(
this.loadProperties, descriptor);
if (rsc == null) {
success = false;
} else {
AbstractVizResource rsc = this.resource;
rsc.setDescriptor(descriptor);
if (this.resourceData instanceof IResourceGroup) {
ResourceList rscList = ((IResourceGroup) this.resourceData)
@ -258,6 +257,7 @@ public class ResourcePair implements ISerializableObject {
}
}
}
setResource(rsc);
if (fireListeners) {
descriptor.getResourceList().firePreAddListeners(this);

View file

@ -0,0 +1,152 @@
/**
* 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.drawables.ext;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.viz.core.DrawableColorMap;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* A general implementation of the canvas rendering extension which converts
* canvas relative coordinates into display coordinates.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 26, 2012 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class GeneralCanvasRenderingExtension extends
GraphicsExtension<IGraphicsTarget> implements ICanvasRenderingExtension {
@Override
public void drawStrings(PaintProperties paintProps,
DrawableString... parameters) throws VizException {
IExtent extent = paintProps.getView().getExtent();
double xRatio = extent.getWidth() / paintProps.getCanvasBounds().width;
double yRatio = extent.getHeight()
/ paintProps.getCanvasBounds().height;
List<DrawableString> mapStrings = new ArrayList<DrawableString>(
parameters.length);
for (DrawableString screenString : parameters) {
DrawableString mapString = new DrawableString(
screenString.getText(), screenString.getColors());
mapString.boxColor = screenString.boxColor;
mapString.font = screenString.font;
mapString.horizontalAlignment = screenString.horizontalAlignment;
mapString.magnification = screenString.magnification;
mapString.rotation = screenString.rotation;
mapString.shadowColor = screenString.shadowColor;
mapString.textStyle = screenString.textStyle;
mapString.verticallAlignment = screenString.verticallAlignment;
mapString.basics.alpha = screenString.basics.alpha;
mapString.basics.xOrColors = screenString.basics.xOrColors;
mapString.basics.color = screenString.basics.color;
mapString.basics.x = extent.getMinX() + screenString.basics.x
* xRatio;
mapString.basics.y = extent.getMinY() + screenString.basics.y
* yRatio;
mapString.basics.z = screenString.basics.z;
mapStrings.add(mapString);
}
target.clearClippingPlane();
target.drawStrings(mapStrings);
target.setupClippingPlane(paintProps.getClippingPane());
}
@Override
public void drawLines(PaintProperties paintProps,
DrawableLine... parameters) throws VizException {
IExtent extent = paintProps.getView().getExtent();
double xRatio = extent.getWidth() / paintProps.getCanvasBounds().width;
double yRatio = extent.getHeight()
/ paintProps.getCanvasBounds().height;
List<DrawableLine> mapLines = new ArrayList<DrawableLine>(
parameters.length);
for (DrawableLine screenLine : parameters) {
DrawableLine mapLine = new DrawableLine();
mapLine.lineStyle = screenLine.lineStyle;
mapLine.width = screenLine.width;
mapLine.basics.alpha = screenLine.basics.alpha;
mapLine.basics.color = screenLine.basics.color;
mapLine.basics.xOrColors = screenLine.basics.xOrColors;
for (double[] point : screenLine.points) {
double x = extent.getMinX() + point[0] * xRatio;
double y = extent.getMinY() + point[1] * yRatio;
mapLine.addPoint(x, y);
}
mapLines.add(mapLine);
}
target.clearClippingPlane();
target.drawLine(mapLines.toArray(new DrawableLine[0]));
target.setupClippingPlane(paintProps.getClippingPane());
}
@Override
public void drawColorRamp(PaintProperties paintProps,
DrawableColorMap colorMap) throws VizException {
IExtent extent = paintProps.getView().getExtent();
double xRatio = extent.getWidth() / paintProps.getCanvasBounds().width;
double yRatio = extent.getHeight()
/ paintProps.getCanvasBounds().height;
DrawableColorMap newColorMap = new DrawableColorMap(
colorMap.getColorMapParams());
newColorMap.alpha = colorMap.alpha;
newColorMap.brightness = colorMap.brightness;
newColorMap.contrast = colorMap.contrast;
newColorMap.interpolate = colorMap.interpolate;
double x1 = colorMap.extent.getMinX();
double y1 = colorMap.extent.getMinY();
double x2 = colorMap.extent.getMaxX();
double y2 = colorMap.extent.getMaxY();
x1 = extent.getMinX() + x1 * xRatio;
y1 = extent.getMinY() + y1 * yRatio;
x2 = extent.getMinX() + x2 * xRatio;
y2 = extent.getMinY() + y2 * yRatio;
newColorMap.extent = new PixelExtent(x1, x2, y1, y2);
target.clearClippingPlane();
target.drawColorRamp(newColorMap);
target.setupClippingPlane(paintProps.getClippingPane());
}
@Override
public int getCompatibilityValue(IGraphicsTarget target) {
return Compatibilty.GENERIC;
}
}

View file

@ -44,7 +44,7 @@ public class GraphicsExtensionManager {
Priority.PROBLEM,
"Error getting extension "
+ config.getAttribute(CLASS_ATTR)
+ ": " + t.getLocalizedMessage());
+ ": " + t.getLocalizedMessage(), t);
}
}
@ -78,8 +78,8 @@ public class GraphicsExtensionManager {
for (Class<?> eClass : extensions) {
if (extensionClass.isAssignableFrom(eClass)) {
try {
GraphicsExtension<?> graphicsExt = GraphicsExtension.class.cast(eClass
.newInstance());
GraphicsExtension<?> graphicsExt = GraphicsExtension.class
.cast(eClass.newInstance());
int val = graphicsExt.setTarget(target);
if (val > bestVal) {
bestVal = val;

View file

@ -0,0 +1,80 @@
/**
* 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.drawables.ext;
import com.raytheon.uf.viz.core.DrawableColorMap;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* Contains methods for drawing on a target using canvas relative postions.
* Useful for extra descriptions or information that are not drawn on a point of
* the map but rather are on a specific portion of the display.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 26, 2012 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public interface ICanvasRenderingExtension extends IGraphicsExtensionInterface {
/**
* Draw the DrawableString object to the screen, the location of the
* draqwable strings should be in canvas pixels which start at 0,0 in the
* upper left.
*
* @param parameters
* @throws VizException
*/
public abstract void drawStrings(PaintProperties paintProps,
DrawableString... parameters) throws VizException;
/**
* Draw the DrawableLine object to the screen. The points in the line should
* be in canvas pixels which start at 0,0 in the upper left.
*
* @param parameters
* @throws VizException
*/
public abstract void drawLines(PaintProperties paintProps,
DrawableLine... parameters) throws VizException;
/**
* Draw the drawable colormap to the screen, the extent of the colormap
* should be in canvas pixels.
*
* @param colorMap
* the colorMap to draw
*/
public abstract void drawColorRamp(PaintProperties paintProps,
DrawableColorMap colorMap) throws VizException;
}

View file

@ -17,17 +17,18 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.radar.rsc.mosaic.ext;
package com.raytheon.uf.viz.core.drawables.ext;
import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* Radar mosaic image extension, creates IMosaicImages
* Mosaic image extension, creates IMosaicImages. Mosaicing should be used when
* multiple overlapping images are being drawn to the screen. The mosaic
* extension will combine these images into a single mosaic image.
*
* <pre>
*
@ -43,7 +44,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
* @version 1.0
*/
public interface IRadarMosaicImageExtension extends IImagingExtension {
public interface IMosaicImageExtension extends IImagingExtension {
public static interface IMosaicImage extends IColormappedImage {

View file

@ -17,12 +17,26 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2008.08.29 at 09:59:50 AM CDT
//
package com.raytheon.uf.viz.core.drawables.ext;
@javax.xml.bind.annotation.XmlSchema(namespace = "http://earth.google.com/kml/2.1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package com.google.earth.kml._2;
/**
* A mosaicing extension that combines images by using the largest value for
* overlapped areas of multiple iamges.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 10, 2012 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public interface IMosaicMaxValImageExtension extends IMosaicImageExtension {
}

View file

@ -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.drawables.ext;
/**
* A mosaicing extension that combines images by using the values from the last
* drawn image when images overalap.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 10, 2012 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public interface IMosaicOrderedImageExtension extends IMosaicImageExtension {
}

View file

@ -1,82 +0,0 @@
package com.raytheon.uf.viz.core.drawables.ext;
import java.nio.Buffer;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException;
public interface IOffscreenRenderingExtension extends
IGraphicsExtensionInterface {
/**
* All drawing between a call to renderOffscreen and the next call to
* renderOnscreen will be drawn to offscreenImage rather than to the screen.
* Will use the current screen's world as the coverage area for the
* offscreen image
*
* @param offscreenImage
* image to render to
* @throws VizException
*/
public void renderOffscreen(IImage offscreenImage) throws VizException;
/**
* All drawing between a call to renderOffscreen and the next call to
* renderOnscreen will be drawn to offscreenImage rather than to the screen.
* Will use the extent passed in as the world coverage area for the
* offscreen image
*
* @param offscreenImage
* @param offscreenExtent
* @throws VizException
*/
public void renderOffscreen(IImage offscreenImage, IExtent offscreenExtent)
throws VizException;
/**
* Reset rendering to the screen. This only needs to be called if
* renderOffscreen has been called.
*
* @throws VizException
*/
public void renderOnscreen() throws VizException;
/**
* Construct an offscreen image with the specified dimensions. This image
* will be an RGB based image
*
* @param dimensions
* @return
* @throws VizException
*/
public IImage constructOffscreenImage(int[] dimensions) throws VizException;
/**
* Construct an offscreen image for given Buffer type and size
*
* @param dataType
* @param dataBounds
* @return
* @throws VizException
*/
public IColormappedImage constructOffscreenImage(
Class<? extends Buffer> dataType, int[] dimensions)
throws VizException;
/**
* Construct an offscreen image for given Buffer type and size, applying
* ColorMapParameters to offscreen image where possible
*
* @param dataType
* @param dataBounds
* @param parameters
* @return
* @throws VizException
*/
public IColormappedImage constructOffscreenImage(
Class<? extends Buffer> dataType, int[] dimensions,
ColorMapParameters parameters) throws VizException;
}

View file

@ -19,10 +19,9 @@
**/
package com.raytheon.uf.viz.core.drawables.ext;
import java.awt.image.RenderedImage;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.exception.VizException;
@ -60,6 +59,7 @@ public interface ISingleColorImageExtension extends IImagingExtension {
* @return
* @throws VizException
*/
public ISingleColorImage constructImage(RenderedImage image, RGB color);
public ISingleColorImage constructImage(IRenderedImageCallback callback,
RGB color);
}

View file

@ -23,9 +23,10 @@ import java.util.Collection;
import java.util.Map;
import org.eclipse.swt.graphics.RGB;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IShape;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException;
import com.vividsolutions.jts.geom.Geometry;
@ -57,7 +58,7 @@ import com.vividsolutions.jts.geom.LineString;
public interface IColormapShadedShapeExtension extends
IGraphicsExtensionInterface {
public interface IColormapShadedShape {
public interface IColormapShadedShape extends IShape {
/**
* get the colormap keys
@ -97,8 +98,6 @@ public interface IColormapShadedShapeExtension extends
*/
public void addGeometry(Geometry geometry, Object colorKey);
public void dispose();
}
/**
@ -114,7 +113,7 @@ public interface IColormapShadedShapeExtension extends
* @return a shaded shape object
*/
public IColormapShadedShape createColormapShadedShape(
IDescriptor descriptor, boolean tesselate);
GeneralGridGeometry targetGeometry, boolean tesselate);
/**
* Create a shaded shape object

View file

@ -0,0 +1,104 @@
/**
* 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.drawables.ext.colormap;
import java.util.Map;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* {@link IImagingExtension} used to create and draw multi-channel R,G,B images
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 5, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public interface IMultiChannelImageExtension extends IImagingExtension {
public static enum Channel {
RED, GREEN, BLUE;
}
public static class ChannelData {
public String name;
public ColorMapParameters parameters;
public boolean invert;
public ChannelData(String name, ColorMapParameters params,
boolean invert) {
this.name = name;
this.parameters = params;
}
}
public static interface IMultiChannelImage extends IImage {
public Map<Channel, IImageChannel> getImageMapping();
public void setImageMapping(Map<Channel, IImageChannel> mapping);
}
public static interface IImageChannel extends IColormappedImage {
public void setInverted(boolean inverted);
}
/**
* Construct a true color image, this
*
* @param channelMap
* @return
* @throws VizException
*/
public IMultiChannelImage constructImage(
Map<Channel, IImageChannel> imageMapping) throws VizException;
/**
* Construct a IImageChannel for a IMultiChannelImage
*
* @param callback
* @param inverted
* @return
* @throws VizException
*/
public IImageChannel constructImage(
IColorMapDataRetrievalCallback callback, ChannelData channelData)
throws VizException;
}

View file

@ -0,0 +1,86 @@
/**
* 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.icon;
import java.io.File;
import java.net.URL;
import org.eclipse.core.internal.registry.osgi.OSGIUtils;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.Bundle;
/**
* Utilities for using icons in Viz
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 njensen Initial creation
*
* </pre>
*
* @author njensen
* @version 1.0
*/
@SuppressWarnings("restriction")
public class IconUtil {
/**
* Creates an ImageDescriptor for an icon
*
* @param bundleName
* the name of the bundle to find the icon in
* @param name
* the name of the icon
* @return the ImageDescriptor corresponding to the icon
*/
public static ImageDescriptor getImageDescriptor(String bundleName,
String name) {
return getImageDescriptor(OSGIUtils.getDefault().getBundle(bundleName),
name);
}
/**
* Creates an ImageDescriptor for an icon
*
* @param bundle
* the bundle to find the icon in
* @param name
* the name of the icon
* @return the ImageDescriptor corresponding to the icon
*/
public static ImageDescriptor getImageDescriptor(Bundle bundle, String name) {
String path = null;
if (!name.startsWith("icons")) {
path = "icons" + File.separator + name;
} else {
path = name;
}
URL url = FileLocator.find(bundle, new Path(path), null);
return ImageDescriptor.createFromURL(url);
}
}

View file

@ -160,6 +160,36 @@ public class JobPool {
return workQueue.remove(runnable);
}
/**
* A JobPool is considered active if any of the jobs it contains are running
* or waiting to be run. When all scheduled work is run
*
* @return
*/
public boolean isActive() {
if (!workQueue.isEmpty()) {
return true;
}
for (Job job : jobList) {
int state = job.getState();
if (state == Job.RUNNING || state == Job.WAITING) {
return true;
}
}
return false;
}
/**
* get the number of tasks(Runnables) that are waiting to be run. This does
* not include tasks that are currently running so even if there are no
* waiting tasks the pool may still be active.
*
* @return
*/
public int getWorkRemaining() {
return workQueue.size();
}
protected class PooledJob extends Job {
public PooledJob(String name) {

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.thinclient;
package com.raytheon.uf.viz.core.jobs;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@ -46,7 +46,7 @@ import com.raytheon.uf.common.comm.NetworkStatistics.NetworkTraffic;
public class StatsJob extends Job {
private NetworkStatistics stats = NetworkStatistics.getInstance();
private NetworkStatistics stats;
private long lastSent = 0, lastReceived = 0, lastRequestCount = 0;
@ -57,9 +57,10 @@ public class StatsJob extends Job {
/**
* @param name
*/
public StatsJob() {
super("Network Statistics Job");
public StatsJob(String name, NetworkStatistics stats) {
super(name);
setSystem(true);
this.stats = stats;
}
/*
@ -81,15 +82,18 @@ public class StatsJob extends Job {
- lastRequestCount;
System.out.println("Last minute sent " + requestCountInLastMinute
+ " http requests for a total of "
+ (sentInLastMinute / 1000) + " kB sent and "
+ (receivedInLastMinute / 1000) + " kB received");
+ " messages for a total of "
+ NetworkStatistics.toString(sentInLastMinute)
+ " sent and "
+ NetworkStatistics.toString(receivedInLastMinute)
+ " received");
lastSent = total.getBytesSent();
lastReceived = total.getBytesReceived();
lastRequestCount = total.getRequestCount();
System.out.println("Total sent " + total.getRequestCount()
+ " http requests for a total of " + (lastSent / 1000)
+ " kB sent and " + (lastReceived / 1000) + " kB received");
+ " messages for a total of "
+ NetworkStatistics.toString(lastSent) + " sent and "
+ NetworkStatistics.toString(lastReceived) + " received");
NetworkTraffic[] mapped = stats.getMappedTrafficStats();
for (NetworkTraffic nt : mapped) {
System.out.println(nt);

View file

@ -276,8 +276,22 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
public LocalizationContext[] getLocalSearchHierarchy(LocalizationType type) {
synchronized (this.contexts) {
LocalizationContext[] ctx = this.contexts.get(type);
LocalizationLevel[] levels = getAvailableLevels();
if (ctx != null) {
// Check for new available levels
Set<LocalizationLevel> levelSet = new HashSet<LocalizationLevel>(
Arrays.asList(levels));
for (LocalizationContext context : ctx) {
if (levelSet.contains(context.getLocalizationLevel()) == false) {
// New level detected, regenerate search hierarchy
ctx = null;
break;
}
}
}
if (ctx == null) {
LocalizationLevel[] levels = getAvailableLevels();
Arrays.sort(levels, LocalizationLevel.REVERSE_COMPARATOR);
ctx = new LocalizationContext[levels.length];

View file

@ -20,7 +20,6 @@
package com.raytheon.uf.viz.core.map;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.TransformException;
@ -141,16 +140,6 @@ public interface IMapDescriptor extends IDescriptor {
Coordinate ur) throws FactoryException, TransformException,
VizException;
/**
* Set the grid geometry
*
* @param gridGeometry
* the gridGeometry to set
* @throws VizException
*/
public abstract void setGridGeometry(GeneralGridGeometry gridGeometry)
throws VizException;
/**
* Get the current map width
*

View file

@ -125,7 +125,8 @@ public class ThriftClient {
private static INotAuthHandler defaultHandler = UserController
.getNotAuthHandler();
private static NetworkStatistics stats = NetworkStatistics.getInstance();
private static NetworkStatistics stats = HttpClient.getInstance()
.getStats();
/**
* Construct a thrift web service object that sends method calls to the http

View file

@ -337,6 +337,7 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
for (IInitListener listener : initListeners) {
listener.inited(this);
}
issueRefresh();
}
/**
@ -351,10 +352,12 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
*
*/
public final void dispose() {
status = ResourceStatus.DISPOSED;
disposeInternal();
for (IDisposeListener listener : disposeListeners) {
listener.disposed(this);
if (status == ResourceStatus.INITIALIZED) {
status = ResourceStatus.DISPOSED;
disposeInternal();
for (IDisposeListener listener : disposeListeners) {
listener.disposed(this);
}
}
}
@ -439,7 +442,7 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
initJob = new InitJob(target);
initJob.schedule();
}
issueRefresh();
updatePaintStatus(PaintStatus.INCOMPLETE);
break;
}
case LOADING: {
@ -451,19 +454,21 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
initJob = null;
throw e;
}
issueRefresh();
updatePaintStatus(PaintStatus.INCOMPLETE);
break;
}
case INITIALIZED: {
// We have initialized successfully, now time to paint
try {
paintStatus = PaintStatus.PAINTED;
updatePaintStatus(PaintStatus.PAINTING);
paintInternal(target, paintProps);
} catch (VizException e) {
paintStatus = PaintStatus.ERROR;
updatePaintStatus(PaintStatus.ERROR);
throw e;
}
if (paintStatus == PaintStatus.PAINTING) {
updatePaintStatus(PaintStatus.PAINTED);
}
for (IPaintListener listener : paintListeners) {
listener.painted(this);
}
@ -710,6 +715,10 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
}
}
public PaintStatus getPaintStatus() {
return paintStatus;
}
/**
* Recycle a resource to be used again, will call dispose on the resource if
* it is in the INITIALIZED state, otherwise sets status to NEW which will
@ -721,6 +730,7 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
}
status = ResourceStatus.NEW;
initJob = null;
dataTimes.clear();
}
public ResourceOrder getResourceOrder() {

View file

@ -374,6 +374,10 @@ public class ResourceList extends CopyOnWriteArrayList<ResourcePair> implements
// eat exception
}
}
synchronized (resourcesToInstantiate) {
resourcesToInstantiate.clear();
}
}
/*

View file

@ -0,0 +1,313 @@
/**
* 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.rsc.capabilities;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.ext.colormap.IMultiChannelImageExtension.Channel;
import com.raytheon.uf.viz.core.drawables.ext.colormap.IMultiChannelImageExtension.ChannelData;
/**
* Capability for multi channel imagery
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 20, 2011 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class MultiChannelCapability extends AbstractCapability {
@XmlAccessorType(XmlAccessType.NONE)
public static class ChannelSerializable {
@XmlAttribute
private String name;
@XmlAttribute
private Channel channel;
@XmlAttribute
private boolean invert;
@XmlElement
private float dataMin;
@XmlElement
private float dataMax;
@XmlElement
private float cmapMin;
@XmlElement
private float cmapMax;
public ChannelSerializable() {
}
public ChannelSerializable(Channel channel, ChannelData channelData) {
this.channel = channel;
this.name = channelData.name;
this.invert = channelData.invert;
ColorMapParameters params = channelData.parameters;
this.dataMin = params.getDataMin();
this.dataMax = params.getDataMax();
this.cmapMin = params.getColorMapMin();
this.cmapMax = params.getColorMapMax();
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the channel
*/
public Channel getChannel() {
return channel;
}
/**
* @param channel
* the channel to set
*/
public void setChannel(Channel channel) {
this.channel = channel;
}
/**
* @return the dataMin
*/
public float getDataMin() {
return dataMin;
}
/**
* @param dataMin
* the dataMin to set
*/
public void setDataMin(float dataMin) {
this.dataMin = dataMin;
}
/**
* @return the dataMax
*/
public float getDataMax() {
return dataMax;
}
/**
* @param dataMax
* the dataMax to set
*/
public void setDataMax(float dataMax) {
this.dataMax = dataMax;
}
/**
* @return the cmapMin
*/
public float getCmapMin() {
return cmapMin;
}
/**
* @param cmapMin
* the cmapMin to set
*/
public void setCmapMin(float cmapMin) {
this.cmapMin = cmapMin;
}
/**
* @return the cmapMax
*/
public float getCmapMax() {
return cmapMax;
}
/**
* @param cmapMax
* the cmapMax to set
*/
public void setCmapMax(float cmapMax) {
this.cmapMax = cmapMax;
}
/**
* @return the invert
*/
public boolean isInvert() {
return invert;
}
/**
* @param invert
* the invert to set
*/
public void setInvert(boolean invert) {
this.invert = invert;
}
}
public static class Marshaller extends
XmlAdapter<ChannelSerializable[], HashMap<Channel, ChannelData>> {
/*
* (non-Javadoc)
*
* @see
* javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang
* .Object)
*/
@Override
public HashMap<Channel, ChannelData> unmarshal(ChannelSerializable[] v)
throws Exception {
HashMap<Channel, ChannelData> channelMap = new HashMap<Channel, ChannelData>();
for (ChannelSerializable cs : v) {
ColorMapParameters params = new ColorMapParameters();
params.setDataMin(cs.dataMin);
params.setDataMax(cs.dataMax);
params.setColorMapMin(cs.cmapMin);
params.setColorMapMax(cs.cmapMax);
channelMap.put(cs.channel, new ChannelData(cs.name, params,
cs.invert));
}
return channelMap;
}
/*
* (non-Javadoc)
*
* @see
* javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object
* )
*/
@Override
public ChannelSerializable[] marshal(HashMap<Channel, ChannelData> v)
throws Exception {
ChannelSerializable[] serializable = new ChannelSerializable[v
.size()];
int i = 0;
for (Entry<Channel, ChannelData> entry : v.entrySet()) {
ChannelSerializable cs = new ChannelSerializable(
entry.getKey(), entry.getValue());
serializable[i++] = cs;
}
return serializable;
}
}
@XmlJavaTypeAdapter(value = Marshaller.class)
private HashMap<Channel, ChannelData> channelMap = new HashMap<Channel, ChannelData>();
private String[] names;
/**
* @return the names
*/
public String[] getNames() {
return names;
}
/**
* @param names
* the names to set
*/
public void setNames(String[] names) {
this.names = names;
}
/**
* @return the channelMap
*/
public Map<Channel, ChannelData> getChannelMap() {
return channelMap;
}
/**
* @param channelMap
* the channelMap to set
*/
public void setChannelMap(HashMap<Channel, ChannelData> channelMap) {
if (channelMap == null) {
channelMap = new HashMap<Channel, ChannelData>();
}
this.channelMap = channelMap;
capabilityChanged();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability#
* capabilityChanged()
*/
@Override
public void capabilityChanged() {
super.capabilityChanged();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability#clone()
*/
@Override
public AbstractCapability clone() {
MultiChannelCapability cap = new MultiChannelCapability();
cap.channelMap = new HashMap<Channel, ChannelData>(channelMap);
return cap;
}
}

View file

@ -103,7 +103,7 @@
install-size="0"
version="0.0.0"
fragment="true"/>
<plugin
id="meteolib.jni.win32"
os="win32"
@ -197,12 +197,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.lang"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.logging"
download-size="0"
@ -215,12 +209,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.log4j"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.mina"
download-size="0"
@ -233,12 +221,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.tomcat.nativ"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.tools.bzip2"
download-size="0"
@ -286,7 +268,7 @@
install-size="0"
version="0.0.0"
fragment="true"/>
<plugin
id="org.jep.win32"
os="win32"
@ -296,12 +278,6 @@
version="0.0.0"
fragment="true"/>
<plugin
id="org.jivesoftware.smack"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.junit"
download-size="0"
@ -361,6 +337,20 @@
id="org.apache.commons.cli"
download-size="0"
install-size="0"
version="0.0.0"/>
version="0.0.0"/>
<plugin
id="org.apache.log4j"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.lang"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -42,5 +42,10 @@
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="com.raytheon.uf.viz.points"
download-size="0"
install-size="0"
version="0.0.0"/>
</feature>

View file

@ -27,8 +27,8 @@ import java.util.Map;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.DrawableColorMap;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.PixelExtent;
@ -38,6 +38,7 @@ import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.drawables.ext.ICanvasRenderingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.preferences.ColorFactory;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
@ -71,8 +72,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
public class D2DColorBarResource extends
AbstractVizResource<GenericResourceData, IDescriptor> {
private static IFont colorBarFont;
private static RGB COLOR = ColorFactory.getInstance().getColor(
D2DColorBarResource.class.getName() + "Color");
@ -80,6 +79,8 @@ public class D2DColorBarResource extends
LEFT, RIGHT
}
private IFont colorBarFont;
private Map<List<LabelEntry>, List<LabelEntry>> modifiedMap;
public D2DColorBarResource(GenericResourceData resourceData,
@ -95,18 +96,14 @@ public class D2DColorBarResource extends
@Override
protected void disposeInternal() {
colorBarFont.dispose();
}
@Override
protected void initInternal(IGraphicsTarget target) throws VizException {
synchronized (resourceData) {
if (colorBarFont == null) {
colorBarFont = target.initializeFont(D2DColorBarResource.class
.getName() + "Font");
colorBarFont.setScaleFont(false);
}
}
colorBarFont = target.initializeFont(D2DColorBarResource.class
.getName() + "Font");
colorBarFont.setScaleFont(false);
}
@Override
@ -172,25 +169,25 @@ public class D2DColorBarResource extends
private void paintLeftColorBar(IGraphicsTarget target,
PaintProperties paintProps, AbstractVizResource<?, ?> rsc,
ColorMapParameters colorMapParameters) throws VizException {
IExtent viewExtent = paintProps.getView().getExtent();
double ratio = (viewExtent.getWidth() / paintProps.getCanvasBounds().width);
ImagingCapability cap = rsc.hasCapability(ImagingCapability.class) ? rsc
.getCapability(ImagingCapability.class) : null;
float alpha = cap != null ? cap.getAlpha() : paintProps.getAlpha();
float brightness = cap != null ? cap.getBrightness() : 1.0f;
float contrast = cap != null ? cap.getContrast() : 1.0f;
double x1 = viewExtent.getMinX() + (3 * ratio);
double drawnWidth = ((viewExtent.getMaxX() - x1) * (((paintProps
.getCanvasBounds().width / 2.0) - 7.0) / paintProps
.getCanvasBounds().width));
double x1 = 3;
double drawnWidth = (paintProps.getCanvasBounds().width / 2.0) - 7.0;
double x2 = x1 + drawnWidth;
double y1 = viewExtent.getMinY();
double y1 = 0;
int pixels = paintProps.getCanvasBounds().width < 500 ? 18 : 25;
double y2 = y1 + (pixels * ratio);
double y2 = y1 + (pixels);
PixelExtent pixelExtent = new PixelExtent(x1, x2, y1, y2);
target.drawColorRamp(colorMapParameters, pixelExtent, (float) alpha,
brightness, contrast);
DrawableColorMap cmap = new DrawableColorMap(colorMapParameters);
cmap.extent = new PixelExtent(x1, x2, y1, y2);
cmap.alpha = alpha;
cmap.brightness = brightness;
cmap.contrast = contrast;
target.getExtension(ICanvasRenderingExtension.class).drawColorRamp(
paintProps, cmap);
if (rsc.hasCapability(BlendedCapability.class)) {
alpha *= 2.0;
@ -208,26 +205,27 @@ public class D2DColorBarResource extends
private void paintRightColorBar(IGraphicsTarget target,
PaintProperties paintProps, AbstractVizResource<?, ?> rsc,
ColorMapParameters colorMapParameters) throws VizException {
IExtent viewExtent = paintProps.getView().getExtent();
double ratio = (viewExtent.getWidth() / paintProps.getCanvasBounds().width);
ImagingCapability cap = rsc.hasCapability(ImagingCapability.class) ? rsc
.getCapability(ImagingCapability.class) : null;
float alpha = cap != null ? cap.getAlpha() : paintProps.getAlpha();
float brightness = cap != null ? cap.getBrightness() : 1.0f;
float contrast = cap != null ? cap.getContrast() : 1.0f;
double x1 = viewExtent.getMinX();
double drawnWidth = ((viewExtent.getMaxX() - x1) * (((paintProps
.getCanvasBounds().width / 2.0) - 7.0) / paintProps
.getCanvasBounds().width));
double x2 = viewExtent.getMaxX() - (3 * ratio);
double x1 = 0;
double drawnWidth = ((paintProps.getCanvasBounds().width / 2.0) - 7.0);
double x2 = paintProps.getCanvasBounds().width - 3;
x1 = x2 - drawnWidth;
double y1 = viewExtent.getMinY();
double y1 = 0;
int pixels = paintProps.getCanvasBounds().width < 500 ? 18 : 25;
double y2 = y1 + (pixels * ratio);
double y2 = y1 + pixels;
DrawableColorMap cmap = new DrawableColorMap(colorMapParameters);
cmap.extent = new PixelExtent(x1, x2, y1, y2);
cmap.alpha = alpha;
cmap.brightness = brightness;
cmap.contrast = contrast;
target.getExtension(ICanvasRenderingExtension.class).drawColorRamp(
paintProps, cmap);
PixelExtent pixelExtent = new PixelExtent(x1, x2, y1, y2);
target.drawColorRamp(colorMapParameters, pixelExtent, (float) alpha,
brightness, contrast);
alpha *= 2.0;
double yPos = y1 + ((y2 - y1) * .4);
double zPos = 0; // draw the colorbar on the plane z = 0
@ -466,11 +464,8 @@ public class D2DColorBarResource extends
}
}
double ratio = paintProps.getView().getExtent().getWidth()
/ paintProps.getCanvasBounds().width;
double lastXPos = Double.NEGATIVE_INFINITY;
double padding = 3 * ratio;
double padding = 3;
if (paintProps.getCanvasBounds().width < 500) {
colorBarFont.setMagnification(0.9f);
}
@ -512,13 +507,14 @@ public class D2DColorBarResource extends
drawable.basics.alpha = paintProps.getAlpha();
Rectangle2D rect = target.getStringsBounds(drawable);
double widthDiv2 = (rect.getWidth() / 2) * ratio;
double widthDiv2 = (rect.getWidth() / 2);
if (xPos - widthDiv2 > lastXPos) {
drawables.add(drawable);
lastXPos = xPos + widthDiv2 + padding;
}
}
target.drawStrings(drawables);
target.getExtension(ICanvasRenderingExtension.class).drawStrings(
paintProps, drawables.toArray(new DrawableString[0]));
}
}
}

View file

@ -31,11 +31,11 @@ import javax.xml.bind.annotation.XmlRootElement;
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.IGraphicsTarget;
import com.raytheon.uf.viz.core.VizConstants;
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
@ -222,7 +223,6 @@ public class D2DMapRenderableDisplay extends MapRenderableDisplay implements
props.setScale(scale);
PaintProperties myProps = new PaintProperties(paintProps);
myProps.setPerspectiveProps(props);
target.setUseBuiltinColorbar(false);
if (scaleOnNextPaint) {
scaleToClientArea(paintProps.getCanvasBounds());
@ -270,27 +270,17 @@ public class D2DMapRenderableDisplay extends MapRenderableDisplay implements
public void clear(IDisplayPane parentPane) {
super.clear(parentPane);
descriptor.getResourceList().clear();
String scale = getScale();
int frameCount = descriptor.getNumberOfFrames();
double magnification = getMagnification();
double density = getDensity();
try {
File scaleFile = MapScales.getInstance().getScaleByName(scale)
.getFile();
LoadSerializedXml.loadTo(parentPane, scaleFile, null);
parentPane.getRenderableDisplay().setBackgroundColor(
backgroundColor);
parentPane.getDescriptor().setNumberOfFrames(frameCount);
((ID2DRenderableDisplay) parentPane.getRenderableDisplay())
.setMagnification(magnification);
((ID2DRenderableDisplay) parentPane.getRenderableDisplay())
.setDensity(density);
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, "Error clearing display", e);
File scaleFile = MapScales.getInstance().getScaleByName(getScale())
.getFile();
Bundle bundle = (Bundle) LoadSerializedXml.deserialize(scaleFile);
for (AbstractRenderableDisplay ard : bundle.getDisplays()) {
descriptor.getResourceList().addAll(
ard.getDescriptor().getResourceList());
ard.getDescriptor().getResourceList().clear();
break;
}
descriptor.getResourceList().instantiateResources(descriptor, true);
scaleToClientArea(getBounds());
}
@Override

View file

@ -27,6 +27,11 @@
id="com.raytheon.uf.viz.d2d.ui"
name="D2DContext">
</context>
<context
description="D2D Perspective Context"
id="com.raytheon.uf.viz.d2d.ui.perspective"
name="D2DPerspectiveContext">
</context>
</extension>
<extension
point="org.eclipse.ui.actionSets">
@ -2103,6 +2108,12 @@
point="com.raytheon.uf.viz.core.classContext">
<classContext
class="com.raytheon.uf.viz.d2d.ui.perspectives.D2DPerspectiveManager">
<contextId
id="com.raytheon.uf.viz.d2d.ui.perspective">
</contextId>
</classContext>
<classContext
class="com.raytheon.uf.viz.d2d.ui.perspectives.D2DContextActivator">
<contextId
id="com.raytheon.uf.viz.d2d.ui">
</contextId>

View file

@ -34,13 +34,10 @@ import org.eclipse.swt.layout.FormData;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.VizConstants;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.ResourceList;
@ -102,13 +99,6 @@ public abstract class AbstractNonMapDisplay extends AbstractXyRenderableDisplay
adjustedExtent = aPixelExtent;
}
@Override
public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException {
super.paint(target, paintProps);
target.setUseBuiltinColorbar(true);
}
@Override
public void setDescriptor(IDescriptor desc) {
super.setDescriptor(desc);

View file

@ -50,13 +50,16 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 4, 2010 mschenke Initial creation
* Jul 11, 2012 #875 rferrel Return Value now only set
* to bundle on Load. Prevents
* the window's 'x' close from
* trying to perform a load.
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class AlterBundleDlg extends CaveSWTDialog {
private static class AlterBundleEntry {
@ -95,11 +98,6 @@ public class AlterBundleDlg extends CaveSWTDialog {
return mainLayout;
}
@Override
protected void disposed() {
setReturnValue(bundle);
}
@Override
protected void initializeComponents(Shell shell) {
Composite mainComposite = new Composite(shell, SWT.NONE);
@ -231,7 +229,7 @@ public class AlterBundleDlg extends CaveSWTDialog {
entry.alterValue);
}
}
setReturnValue(bundle);
shell.close();
}

View file

@ -153,9 +153,6 @@ public class RotatePanelsHandler extends AbstractTool {
if (panes != null && index < panes.length && panes.length != 1) {
boolean from4To1 = mEditor.displayedPaneCount() > 1;
for (IDisplayPane displayPane : panes) {
mEditor.hidePane(displayPane);
}
boolean hasProducts = false;
if (panes[index] != null) {
List<D2DLegendResource> rscs = panes[index].getDescriptor()
@ -206,6 +203,11 @@ public class RotatePanelsHandler extends AbstractTool {
: panes[index];
}
for (IDisplayPane displayPane : panes) {
if (displayPane != paneToShow) {
mEditor.hidePane(displayPane);
}
}
mEditor.showPane(paneToShow);
mEditor.setSelectedPane(IMultiPaneEditor.VISIBLE_PANE, paneToShow);

View file

@ -0,0 +1,77 @@
/**
* 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.d2d.ui.perspectives;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
import com.raytheon.viz.ui.perspectives.AbstractWorkbenchPartContextActivator;
/**
* Activates context for D2D UI for IDisplayPaneContainers with
* ID2DRenderableDisplays
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 5, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class D2DContextActivator extends AbstractWorkbenchPartContextActivator {
D2DContextActivator(IWorkbenchPage page) {
super(page);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.perspectives.AbstractPerspectiveContextManager#
* isPerspectivePart(org.eclipse.ui.IWorkbenchPartReference)
*/
@Override
protected boolean isPerspectivePart(IWorkbenchPartReference partRef) {
if (partRef != null) {
IWorkbenchPart part = partRef.getPart(false);
if (part instanceof IDisplayPaneContainer) {
for (IDisplayPane pane : ((IDisplayPaneContainer) part)
.getDisplayPanes()) {
if (pane.getRenderableDisplay() instanceof ID2DRenderableDisplay) {
return true;
}
}
}
}
return false;
}
}

View file

@ -77,7 +77,6 @@ import com.raytheon.viz.ui.cmenu.LoopingAction;
import com.raytheon.viz.ui.cmenu.StepFrameMenuAction;
import com.raytheon.viz.ui.cmenu.UnloadAllGraphicsAction;
import com.raytheon.viz.ui.cmenu.ZoomMenuAction;
import com.raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
import com.raytheon.viz.ui.perspectives.AbstractCAVEPerspectiveManager;
@ -121,6 +120,7 @@ public class D2DPerspectiveManager extends AbstractCAVEPerspectiveManager {
@Override
public void open() {
contextActivator = new D2DContextActivator(page);
Procedure procedure = new Procedure();
List<Bundle> bundles = new ArrayList<Bundle>();
for (MapScale scale : MapScales.getInstance().getScales()) {
@ -449,4 +449,5 @@ public class D2DPerspectiveManager extends AbstractCAVEPerspectiveManager {
D2DLegendResource rsc) {
return new ChangeLegendModeAction(mode, rsc);
}
}

View file

@ -245,8 +245,14 @@ public class RemoteDataStore implements IDataStore {
}
@Override
public void repack(String dirName, Compression compression)
throws StorageException {
public void repack(Compression compression) throws StorageException {
throw new StorageException("Operation not supported", null);
}
@Override
public void copy(String outputDir, Compression compression,
String timestampCheck, int minMillisSinceLastChange,
int maxMillisSinceLastChange) throws StorageException {
throw new StorageException("Operation not supported", null);
}

View file

@ -39,18 +39,19 @@ import os, types, sys, imp, inspect
class DerivParamImporter:
def __init__(self, userDir, siteDir, baseDir):
self.baseDir = baseDir
self.siteDir = siteDir
self.userDir = userDir
def __init__(self, *args):
# Initialize directories to search for files
self.searchDirs = args;
def __buildPath(self, dir, name):
return dir + os.sep + name + '.py'
def __isDerivParam(self, name):
return os.path.exists(self.__buildPath(self.baseDir, name)) or \
os.path.exists(self.__buildPath(self.siteDir, name)) or \
os.path.exists(self.__buildPath(self.userDir, name))
def __isDerivParam(self, name):
# Check each directory to search instead of base/site/user specifically
for searchDir in self.searchDirs:
if os.path.exists(self.__buildPath(searchDir, name)):
return True
return False
def find_module(self, fullname, path=None):
if path is None:
@ -62,9 +63,11 @@ class DerivParamImporter:
if sys.modules.has_key(fullname):
return sys.modules[fullname]
combined = imp.new_module(fullname)
self.__addToModule(combined, fullname, self.baseDir, "base")
self.__addToModule(combined, fullname, self.siteDir, "site")
self.__addToModule(combined, fullname, self.userDir, "user")
i = 0
for searchDir in self.searchDirs:
# Add module for each search directory, giving unique name
self.__addToModule(combined, fullname, searchDir, "localization" + str(i))
i = i + 1
sys.modules[fullname] = combined
return combined

View file

@ -23,6 +23,7 @@ import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -30,9 +31,9 @@ import jep.JepException;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -76,8 +77,6 @@ public class DerivParamPythonFunctionAdapter implements
private static final String TEMPLATE_FILE = DerivedParameterGenerator.DERIV_PARAM_DIR
+ File.separator + PYTHON + File.separator + "functionTemplate.txt";
private File baseDir = null;
private MasterDerivScript masterScript;
private List<IDataRecord> results;
@ -136,49 +135,45 @@ public class DerivParamPythonFunctionAdapter implements
@Override
public void init() {
IPathManager pm = PathManagerFactory.getPathManager();
if (baseDir == null) {
LocalizationContext context = pm.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE);
context.setContextName(Activator.getDefault().getBundle()
.getSymbolicName());
baseDir = pm.getFile(context,
DerivedParameterGenerator.FUNCTIONS_DIR);
if (baseDir == null) {
statusHandler.handle(Priority.PROBLEM,
"Could not find base directory for "
+ DerivedParameterGenerator.FUNCTIONS_DIR);
File script = pm.getStaticFile(INTERFACE_SCRIPT);
// Get list of all files for search hierarch of CAVE_STATIC
LocalizationFile[] derivParamFiles = pm.listFiles(
pm.getLocalSearchHierarchy(LocalizationType.CAVE_STATIC),
DerivedParameterGenerator.DERIV_PARAM_DIR, null, false, false);
List<String> functionDirs = new ArrayList<String>(
derivParamFiles.length);
functionDirs.add(script.getParent());
Arrays.sort(derivParamFiles);
for (LocalizationFile file : derivParamFiles) {
if (file.isDirectory()
&& DerivedParameterGenerator.FUNCTIONS
.equals(LocalizationUtil.extractName(file.getName()))) {
// If it is a derived parameters functions directory, add to search list
functionDirs.add(file.getFile().getAbsolutePath());
}
}
File script = pm.getStaticFile(INTERFACE_SCRIPT);
File siteDir = pm.getFile(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.SITE),
DerivedParameterGenerator.FUNCTIONS_DIR);
File userDir = pm.getFile(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.USER),
DerivedParameterGenerator.FUNCTIONS_DIR);
if (baseDir.exists() == false) {
baseDir.mkdirs();
}
if (siteDir.exists() == false) {
siteDir.mkdirs();
}
if (userDir.exists() == false) {
userDir.mkdirs();
}
String PATH = PyUtil.buildJepIncludePath(script.getParent(),
userDir.getAbsolutePath(), siteDir.getAbsolutePath(),
baseDir.getAbsolutePath());
// Create path from function dir list
String PATH = PyUtil.buildJepIncludePath(functionDirs
.toArray(new String[functionDirs.size()]));
List<String> preEvals = new ArrayList<String>(2);
preEvals.add("import DerivParamImporter");
StringBuilder cmd = new StringBuilder(200);
cmd.append("sys.meta_path.append(DerivParamImporter.DerivParamImporter(");
cmd.append("'").append(userDir.getPath()).append("', ");
cmd.append("'").append(siteDir.getPath()).append("', ");
cmd.append("'").append(siteDir.getPath()).append("'))");
// Pass in directories to search based on function directories
int size = functionDirs.size() - 1;
for (int i = size; i > 0; --i) {
if (i < size) {
cmd.append(", ");
}
cmd.append("'").append(functionDirs.get(i)).append("'");
}
cmd.append("))");
preEvals.add(cmd.toString());
try {

View file

@ -217,13 +217,12 @@ public class MasterDerivScript extends PythonInterpreter {
IDataRecord[] valList = (IDataRecord[]) argValue;
if (valList.length == 1) {
// treat as an unwrapped array
FloatDataRecord val = (FloatDataRecord) valList[0];
evaluateArgument(argName, val);
evaluateArgument(argName, valList[0]);
} else {
// create a list of arrays
jep.eval(argName + " = []");
for (int argIdx = 0; argIdx < valList.length; argIdx++) {
FloatDataRecord val = (FloatDataRecord) valList[argIdx];
IDataRecord val = (IDataRecord) valList[argIdx];
jep.eval(argName + ".append(None)");
// setNumeric won't work with indexed objects
evaluateArgument("__tmp", val);

View file

@ -176,7 +176,6 @@ public abstract class AbstractDataCubeAdapter implements IDataCubeAdapter {
TimeQueryRequest myQ = req.getTimeQuery(originalRequest,
latestOnly, cache, latestOnlyCache);
if (myQ != null) {
// no need to merge timeQueries
queries.put(req, myQ);
}
} else {

View file

@ -118,12 +118,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.lang"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.logging"
download-size="0"
@ -228,12 +222,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.log4j"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.jep"
download-size="0"
@ -344,12 +332,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.tomcat.nativ"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="com.raytheon.uf.common.util"
download-size="0"
@ -525,4 +507,18 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.log4j"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.lang"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -40,6 +40,7 @@ import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig;

View file

@ -69,7 +69,8 @@ public class FFMPShapeContainer {
if (shape == null) {
shape = target.getExtension(IColormapShadedShapeExtension.class)
.createColormapShadedShape(descriptor, true);
.createColormapShadedShape(descriptor.getGridGeometry(),
true);
ConcurrentHashMap<String, IColormapShadedShape> cwaShapes = shadedShapes
.get(cwa);

View file

@ -11,6 +11,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import com.raytheon.uf.common.util.FileUtil;
/**
* Utility to populate EDEX with Data for DAT tools
*
@ -281,7 +283,8 @@ public class ScanTestDataPopulator {
*/
private void copyFile(File file) {
File outfile = new File(MANUAL_INGEST_DIR + "/" + file.getName());
File outfile = new File(FileUtil.join(MANUAL_INGEST_DIR,
file.getName()));
InputStream in = null;
try {
in = new FileInputStream(file);

View file

@ -46,6 +46,7 @@ import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObTrendDataSet;
import com.raytheon.uf.viz.monitor.util.ObUtil;
/**
* The Trend Canvas
@ -75,7 +76,7 @@ public class TrendPlotCanvas {
private Canvas canvas;
Calendar curdate;
private Calendar curdate;
private SortedMap<Date, Float> trendData;
@ -200,7 +201,8 @@ public class TrendPlotCanvas {
if (!Float.isNaN(thresholds[1])) {
yellowThreshold = thresholds[1];
}
curdate = Calendar.getInstance();
curdate = ObUtil.getTimeNow(); // Calendar.getInstance();
if (trendDataSet.getYAxisMinMaxIncrement() != null) {
float[] minMaxIncr = trendDataSet.getYAxisMinMaxIncrement();
if (!Float.isNaN(minMaxIncr[0])) {

View file

@ -68,6 +68,7 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
import com.raytheon.uf.viz.monitor.trendplot.TrendPlotDlg;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.uf.viz.monitor.util.ObUtil;
/**
* Abstrct Zone table dialog that is the foundation for all Zone dialogs.
@ -760,7 +761,7 @@ public abstract class ZoneTableDlg extends Dialog implements IMonitorListener,
HodographDlg hodographDlg = new HodographDlg(shell,
varName.name(), station, "METAR");
hodographDlg.setCurrentTime(Calendar.getInstance());
hodographDlg.setCurrentTime(ObUtil.getTimeNow()); //Calendar.getInstance());
if (thresholds[0] == Float.NaN || thresholds[1] == Float.NaN
|| thresholds[2] == Float.NaN
|| thresholds[3] == Float.NaN) {

View file

@ -82,6 +82,19 @@ public final class ObUtil {
dropTime.add(Calendar.HOUR, -(ObConst.THREAT_INTERVAL_HOURS));
return dropTime.getTime();
}
/**
* Method that gets the current time.
*
* @return current time.
*/
public static Calendar getTimeNow() {
Date now = SimulatedTime.getSystemTime().getTime();
Calendar nowTime = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
nowTime.setTime(now);
return nowTime;
}
/**
* Checks for the existence of a localization-created flag file which

View file

@ -32,8 +32,6 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.ncwf.Activator;
/**
* The ResourceData for Ncwf resources
@ -52,11 +50,12 @@ import com.raytheon.uf.viz.ncwf.Activator;
*/
@XmlAccessorType(XmlAccessType.NONE)
public class NcwfPolygonResourceData extends AbstractRequestableResourceData {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(NcwfPolygonResourceData.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(NcwfPolygonResourceData.class);
@XmlAttribute
private String name;
@Override
public boolean equals(Object obj) {
if (!super.equals(obj)) {
@ -65,13 +64,13 @@ public class NcwfPolygonResourceData extends AbstractRequestableResourceData {
if (obj instanceof NcwfPolygonResourceData == false) {
return false;
}
NcwfPolygonResourceData other = (NcwfPolygonResourceData) obj;
if (other.name.equals(name)) {
if (!other.name.equals(name)) {
return false;
}
return true;
}
@ -100,7 +99,5 @@ public class NcwfPolygonResourceData extends AbstractRequestableResourceData {
public void setName(String name) {
this.name = name;
}
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.jivesoftware.smack</name>
<name>com.raytheon.uf.viz.points</name>
<comment></comment>
<projects>
</projects>

View file

@ -1,5 +1,6 @@
#Thu Mar 26 10:04:40 CDT 2009
#Tue Jul 10 10:45:07 CDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

View file

@ -0,0 +1,19 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Points
Bundle-SymbolicName: com.raytheon.uf.viz.points
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.points.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
javax.measure;bundle-version="1.0.0",
org.geotools;bundle-version="2.6.4",
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.common.time;bundle-version="1.12.1174",
com.raytheon.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.common.awipstools;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.points

View file

@ -1,24 +1,4 @@
/**
* 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.drawing;
package com.raytheon.uf.viz.points;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -29,30 +9,28 @@ import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.viz.drawing";
public static final String PLUGIN_ID = "com.raytheon.uf.viz.points"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
@ -62,7 +40,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
*
*
* @return the shared instance
*/
public static Activator getDefault() {

View file

@ -0,0 +1,44 @@
package com.raytheon.uf.viz.points;
/*****************************************************************************************
* COPYRIGHT (c), 2007, RAYTHEON COMPANY
* ALL RIGHTS RESERVED, An Unpublished Work
*
* RAYTHEON PROPRIETARY
* If the end user is not the U.S. Government or any agency thereof, use
* or disclosure of data contained in this source code file is subject to
* the proprietary restrictions set forth in the Master Rights File.
*
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
* If the end user is the U.S. Government or any agency thereof, this source
* code is provided to the U.S. Government with Government Purpose Rights.
* Use or disclosure of data contained in this source code file is subject to
* the "Government Purpose Rights" restriction in the Master Rights File.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* Use or disclosure of data contained in this source code file is subject to
* the export restrictions set forth in the Master Rights File.
******************************************************************************************/
/**
* Interface for listening for tool changes. Register with PointsDataManager
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
*
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public interface IPointChangedListener {
public void pointChanged();
}

Some files were not shown because too many files have changed in this diff Show more