awips2/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/ShapeTable.py
Steve Harris 8beb6fc0b8 12.11.1-6 baseline
Former-commit-id: 30c786a885 [formerly fba4a443a0] [formerly 5c1f3cdc46 [formerly 18939af3b7cf54a36970d65d528003f4fe489eb7]]
Former-commit-id: 5c1f3cdc46
Former-commit-id: 08fc9f6b14
2012-10-18 15:53:01 -05:00

74 lines
No EOL
2.3 KiB
Python

##
# 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.
##
import JUtil
import DefaultEditAreaNaming
from com.raytheon.edex.plugin.gfe.reference import DbShapeSource
#
# Python wrapper class for PostGIS table with interface like A1 ShapeFile.py
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 09/04/12 #9441 randerso Initial Creation.
#
#
#
class ShapeTable(JUtil.JavaWrapperClass):
def __init__(self, identifier):
self.identifier = identifier
self.name = None
self.editAreaName = None
self.groupName = None
self.javaObj = DbShapeSource(identifier)
pass
def filename(self, filen):
raise NotImplementedError, "This method is obsolete. See comments in Maps.py"
def filter(self, fn):
if callable(fn):
self._func = fn
self.javaObj.setFiltered(True)
else:
raise TypeError(self.__class__+".filter() requires a function")
def doFilter(self, atts):
return self._func(atts)
def getEAName(self, atts):
if self.editAreaName is not None:
return DefaultEditAreaNaming.getEditAreaName(atts, self.editAreaName)
return ""
def toJavaObj(self):
self.javaObj.setDisplayName(self.name)
self.javaObj.setGroupName(self.groupName)
if self.editAreaName is not None:
self.javaObj.setHasEditAreaName(True);
return self.javaObj
def __repr__(self):
return self.identifier