com.bbn.openmap.layer.link
Class LinkProperties

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--com.bbn.openmap.layer.link.LinkProperties
All Implemented Interfaces:
java.lang.Cloneable, LinkGraphicConstants, LinkPropertiesConstants, java.util.Map, java.io.Serializable

public class LinkProperties
extends java.util.Properties
implements LinkPropertiesConstants, LinkGraphicConstants

A LinkProperties object is a set of key-value strings that are going to be sent over the link. In java-land, they are handled with the Properties object. In link-land, they are handled like an array of strings. Requests have a properties section, and graphic objects have them as well.

See Also:
Serialized Form

Field Summary
static LinkProperties EMPTY_PROPERTIES
          Used by the graphics if no properties were sent with it.
 
Fields inherited from class java.util.Properties
defaults
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkPropertiesConstants
LPC_BACKWARD_DIAG_PATTERN, LPC_CENTER_LAT, LPC_CENTER_LONG, LPC_CROSS_PATTERN, LPC_DASH, LPC_DASH_DOT, LPC_DASH_DOT_DOT, LPC_DIAG_CROSS_PATTERN, LPC_DOT, LPC_FILLCOLOR, LPC_FILLPATTERN, LPC_FORWARD_DIAG_PATTERN, LPC_GRAPHICID, LPC_HEIGHT, LPC_HIGHLIGHTCOLOR, LPC_HORIZONTAL_PATTERN, LPC_HTML, LPC_INFO, LPC_LATMAX, LPC_LATMIN, LPC_LINECOLOR, LPC_LINESTYLE, LPC_LINEWIDTH, LPC_LINKRASTERIMAGEURL, LPC_LINKROTATION, LPC_LINKTEXTBASELINE, LPC_LINKTEXTFONT, LPC_LINKTEXTSTRING, LPC_LONG_DASH, LPC_LONMAX, LPC_LONMIN, LPC_MESSAGE, LPC_PROJECTION, LPC_SCALE, LPC_SOLID, LPC_SOLID_PATTERN, LPC_TIME, LPC_URL, LPC_VERTICAL_PATTERN, LPC_WIDTH
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkGraphicConstants
BASELINE_BOTTOM, BASELINE_MIDDLE, BASELINE_TOP, BLACK_COLOR_STRING, CLEAR_COLOR_STRING, COLORMODEL_DIRECT, COLORMODEL_INDEXED, COLORMODEL_URL, COLUMN_MAJOR, COORDMODE_ORIGIN, COORDMODE_PREVIOUS, DECIMAL_DEGREES, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, KM, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, MILES, NMILES, RADIANS, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, ROW_MAJOR
 
Constructor Summary
LinkProperties()
           
LinkProperties(java.io.DataInput dis)
          Create a LinkProperties, and read it's contents off a link.
LinkProperties(Link link)
          Create a LinkProperties, and read it's contents off a link.
LinkProperties(java.lang.String keyString, java.lang.String valueString)
          Create a LinkProperties object with it's first pair.
 
Method Summary
 java.awt.Paint getFillPaint()
           
 java.awt.Paint getPaint(java.lang.String paintProperty, java.lang.String defaultPaintString)
           
 java.awt.Stroke getStroke()
           
 void read(java.io.DataInput dis)
          Read the link to create the properties object.
 void setProperties(OMGraphic omg)
          Method to call on the LinkProperties object to set the DrawingAttributes properties on an OMGraphic.
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Calls the hashtable method put.
 void write(java.io.DataOutputStream dos)
          Write the properties as several strings.
 void write(Link link)
          Write the properties as several strings.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_PROPERTIES

public static final LinkProperties EMPTY_PROPERTIES
Used by the graphics if no properties were sent with it.

Constructor Detail

LinkProperties

public LinkProperties()

LinkProperties

public LinkProperties(java.lang.String keyString,
                      java.lang.String valueString)
Create a LinkProperties object with it's first pair.

Parameters:
keyString - the key for the pair.
valueString - the value for the pair.

LinkProperties

public LinkProperties(Link link)
               throws java.io.IOException
Create a LinkProperties, and read it's contents off a link. Assumes the properties are the next thing to be read, starting with the string count.

Parameters:
link - the Link to read properties from
Throws:
IOException.
java.io.IOException

LinkProperties

public LinkProperties(java.io.DataInput dis)
               throws java.io.IOException
Create a LinkProperties, and read it's contents off a link.

Parameters:
dis - DataInput to read from.
Throws:
IOException.
java.io.IOException
Method Detail

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)
Calls the hashtable method put. Provided to provide a similar interface in jdk1.1.x or jdk1.2.x, enforcing that only strings can be in properties files.

Overrides:
setProperty in class java.util.Properties

write

public void write(Link link)
           throws java.io.IOException
Write the properties as several strings. There is a string count (Key count + value count), and then for each key and value string, a character count, and the characters.

Parameters:
link - the link to write to.
java.io.IOException

write

public void write(java.io.DataOutputStream dos)
           throws java.io.IOException
Write the properties as several strings. There is a string count (Key count + value count), and then for each key and value string, a character count, and the characters.

Parameters:
dos - the DataOutputStream to write to.
java.io.IOException

read

public void read(java.io.DataInput dis)
          throws java.io.IOException
Read the link to create the properties object. Assumes the properties are the next thing to be read, starting with the string count.

Parameters:
dis - DataInput to read from.
Throws:
IOException.
java.io.IOException

setProperties

public void setProperties(OMGraphic omg)
Method to call on the LinkProperties object to set the DrawingAttributes properties on an OMGraphic. Will set the line and select colors, fill paints (including patterns) and stroke based on the properties contained in this LinkProperties object. Will set default values in the OMGraphic if the applicable properties aren't defined, and will set the LinkProperties in the AppObject of the OMGraphic.


getStroke

public java.awt.Stroke getStroke()

getPaint

public java.awt.Paint getPaint(java.lang.String paintProperty,
                               java.lang.String defaultPaintString)

getFillPaint

public java.awt.Paint getFillPaint()


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details