public class EsriLayer extends OMGraphicHandlerLayer implements ShapeConstants
URL dbf = new URL("http://www.webserver.com/file.dbf");URL shp = new URL("http://www.webserver.com/file.shp");
URL shx = new URL("http://www.webserver.com/file.shx");
EsriLayer layer = new EsriLayer("name", dbf, shp, shx);
To open a shape file set from the local file system:
String dbf = "c:/data/file.dbf";String shp = "c:/data/file.shp";
String shx = "c:/data/file.shx";
EsriLayer layer = new EsriLayer("name", dbf, shp, shx, DrawingAttributes.DEFAULT);
To create a zero content shape file set from which the user can add shapes at runtime:
EsriLayer layer = new EsriLayer("name", EsriLayer.TYPE_POLYLINE);
To add features to an EsriLayer:
OMGraphicList shapeData = new OMGraphicList();
ArrayList tabularData = new ArrayList();
float[] part0 = new float[]{35.0f, -120.0f, -25.0f, -95.0f, 56.0f, -30.0f};
float[] part1 = new float[]{-15.0f, -110.0f, 13.0f, -80.0f, -25.0f, 10.0f};
OMPoly poly0 = new OMPoly(part0, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_RHUMB);
OMPoly poly1 = new OMPoly(part1, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_RHUMB);
shapeData.add(poly0); //part 1
shapeData.add(poly1); //part 2
shapeData.generate(_mapBean.getProjection());
tabularData.add(0, "a value");
layer.addRecord(shapeData, tabularData);
layer.repaint();
To configure an EsriLayer through a properties file, specify file references
in terms of resources, files or URLs.
To reference a file on Windows 2000:
esri.class = com.bbn.openmap.plugin.esri.EsriLayer
esri.prettyName = Esri Example
esri.dbf = file:///c:/data/shapefile.dbf
esri.shp = file:///c:/data/shapefile.shp
esri.shx = file:///c:/data/shapefile.shx
To reference a file on RedHat Linux 6.2:
esri.class = com.bbn.openmap.plugin.esri.EsriLayer
esri.prettyName = Esri Example
esri.dbf = /home/dvanauke/resources/shapefile.dbf
esri.shp = /home/dvanauke/resources/shapefile.shp
esri.shx = /home/dvanauke/resources/shapefile.shx
To reference a file on a web server:
esri.class = com.bbn.openmap.plugin.esri.EsriLayer
esri.prettyName = Esri Example
esri.dbf = http://www.webserver.com/shapefile.dbf
esri.shp = http://www.webserver.com/shapefile.shp
esri.shx = http://www.webserver.com/shapefile.shx
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected DbfTableModel |
_model |
protected java.lang.String |
dbf |
protected DrawingAttributes |
drawingAttributes |
protected java.lang.String |
shp |
protected java.lang.String |
shx |
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DBF_ATTRIBUTE, DBF_AUTOINCREMENT, DBF_BINARY, DBF_CHARACTER, DBF_DATE, DBF_DOUBLE, DBF_FLOAT, DBF_LOGICAL, DBF_LONG, DBF_MEMO, DBF_NUMERIC, DBF_OLE, DBF_TIMESTAMP, DBF_TYPE_AUTOINCREMENT, DBF_TYPE_BINARY, DBF_TYPE_CHARACTER, DBF_TYPE_DATE, DBF_TYPE_DOUBLE, DBF_TYPE_FLOAT, DBF_TYPE_LOGICAL, DBF_TYPE_LONG, DBF_TYPE_MEMO, DBF_TYPE_NUMERIC, DBF_TYPE_OLE, DBF_TYPE_TIMESTAMP, PARAM_DBF, PARAM_SHP, PARAM_SHX, SHAPE_BOUNDS_ATTRIBUTE, SHAPE_DBF_DASHPATTERN, SHAPE_DBF_DASHPHASE, SHAPE_DBF_DESCRIPTION, SHAPE_DBF_FILLCOLOR, SHAPE_DBF_INFO_ATTRIBUTE, SHAPE_DBF_LINECOLOR, SHAPE_DBF_LINEWIDTH, SHAPE_DBF_SELECTCOLOR, SHAPE_FILE_HEADER_LENGTH, SHAPE_FILE_RECORD_HEADER_LENGTH, SHAPE_INDEX_ATTRIBUTE, SHAPE_MAX_MEASURE_ATTRIBUTE, SHAPE_MAX_Z_ATTRIBUTE, SHAPE_MEASURE_ATTRIBUTE, SHAPE_MIN_MEASURE_ATTRIBUTE, SHAPE_MIN_Z_ATTRIBUTE, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTIPATCH, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_MULTIPOINTM, SHAPE_TYPE_MULTIPOINTZ, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POINTM, SHAPE_TYPE_POINTZ, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYGONM, SHAPE_TYPE_POLYGONZ, SHAPE_TYPE_POLYLINE, SHAPE_TYPE_POLYLINEM, SHAPE_TYPE_POLYLINEZ, SHAPE_Z_ATTRIBUTE
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
EsriLayer()
Creates an EsriLayer that will be configured through the
setProperties() method |
EsriLayer(java.lang.String name,
int type,
int columnCount)
Creates an empty EsriLayer, usable for adding features at
run-time
|
EsriLayer(java.lang.String name,
java.lang.String dbf,
java.lang.String shp,
java.lang.String shx,
DrawingAttributes da)
Creates an EsriLayer from a set of shape files
|
EsriLayer(java.lang.String name,
java.net.URL dbf,
java.net.URL shp,
java.net.URL shx)
Creates an EsriLayer from a set of shape files
|
EsriLayer(java.lang.String name,
java.net.URL dbf,
java.net.URL shp,
java.net.URL shx,
DrawingAttributes da)
Creates an EsriLayer from a set of shape files
|
Modifier and Type | Method and Description |
---|---|
void |
addRecord(OMGraphic graphic,
java.util.ArrayList<java.lang.Object> record)
Handles adding records to the geometry list and the
DbfTableModel
|
EsriGraphicList |
getEsriGraphicList()
Returns the EsriGraphicList for this layer
|
DbfTableModel |
getModel()
Returns the associated table model for this layer
|
java.util.Properties |
getProperties(java.util.Properties properties)
PropertyConsumer method.
|
java.util.Properties |
getPropertyInfo(java.util.Properties list)
Method to fill in a Properties object with values reflecting
the properties able to be set on this PropertyConsumer.
|
int |
getType()
Returns whether this layer is of type 0 (point), 3 (polyline),
or 5(polygon)
|
void |
query(java.lang.String query)
Filters the DbfTableModel given a SQL like string
|
void |
setModel(DbfTableModel model)
Sets the DbfTableModel
|
void |
setProperties(java.lang.String prefix,
java.util.Properties properties)
Sets the properties for the
Layer . |
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getRenderPolicy, getSelected, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, interrupt, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paint, paste, prepare, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setCancelled, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, findAndInit, findAndUndo, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getGUI, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected DbfTableModel _model
protected java.lang.String dbf
protected java.lang.String shx
protected java.lang.String shp
protected DrawingAttributes drawingAttributes
public EsriLayer()
setProperties()
methodpublic EsriLayer(java.lang.String name, int type, int columnCount) throws java.lang.Exception
name
- The name of the layertype
- The type of layercolumnCount
- The number of columns in the dbf modeljava.lang.Exception
public EsriLayer(java.lang.String name, java.lang.String dbf, java.lang.String shp, java.lang.String shx, DrawingAttributes da) throws java.net.MalformedURLException
name
- The name of the layer that may be used to reference
the layerdbf
- The url referencing the dbf extension fileshp
- The url referencing the shp extension fileshx
- The url referencing the shx extension filejava.net.MalformedURLException
public EsriLayer(java.lang.String name, java.net.URL dbf, java.net.URL shp, java.net.URL shx)
name
- The name of the layer that may be used to reference
the layerdbf
- The url referencing the dbf extension fileshp
- The url referencing the shp extension fileshx
- The url referencing the shx extension filepublic EsriLayer(java.lang.String name, java.net.URL dbf, java.net.URL shp, java.net.URL shx, DrawingAttributes da)
name
- The name of the layer that may be used to reference
the layerdbf
- The url referencing the dbf extension fileshp
- The url referencing the shp extension fileshx
- The url referencing the shx extension fileda
- DrawingAttributes to use to render the layer
contents.public void addRecord(OMGraphic graphic, java.util.ArrayList<java.lang.Object> record)
graphic
- An OMGraphic to add the graphics listrecord
- A record to add to the DbfTableModelpublic EsriGraphicList getEsriGraphicList()
public DbfTableModel getModel()
public int getType()
public void query(java.lang.String query)
query
- A SQL like string to filter the DbfTableModelpublic void setModel(DbfTableModel model)
model
- The DbfModel to set for this layerpublic void setProperties(java.lang.String prefix, java.util.Properties properties)
Layer
.setProperties
in interface PropertyConsumer
setProperties
in class OMGraphicHandlerLayer
prefix
- the token to prefix the property namesproperties
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties properties)
getProperties
in interface PropertyConsumer
getProperties
in class OMGraphicHandlerLayer
properties
- the Properties
objectProperties
objectpublic java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class OMGraphicHandlerLayer
list
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details