|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.util.propertyEditor.Inspector
public class Inspector
Class to inspect a PropertyConsumer. Used by the LayerAddPanel class to
interactively configure a Layer object before it gets added to the map. This
class should suffice to "inspect" any PropertyConsumer on a very basic level,
handling is more convenient if property editor classes are available. The
behavior of the Inspector is configured through properties; the
propertiesInfo object of a PropertyConsumer may contain a
initPropertiesProperty which determines which properties are to be shown and
in which order, in a space separated list, i.e.
initPropertiesProperty=class prettyName shapeFile
If this property is not defined, then all the properties will be
displayed, in alphabetical order.
For each property there may be a editorProperty entry giving a PropertyEditor
class to instantiate as an editor for the property, i.e.
shapeFile.editor=com.bbn.openmap.util.propertyEditor.FilePropertyEditor
.
Field Summary | |
---|---|
protected java.awt.event.ActionListener |
actionListener
Handle to call back the object that invokes this Inspector. |
static java.lang.String |
cancelCommand
Action command for the cancelButton. |
protected java.lang.String |
defaultEditorClass
A simple TextField as a String editor. |
static java.lang.String |
doneCommand
The action command for the doneButton. |
protected java.util.Hashtable<java.lang.String,java.beans.PropertyEditor> |
editors
Hashtable containing property names, and their editors. |
protected boolean |
print
Flag to print out the properties. |
protected PropertyConsumer |
propertyConsumer
The PropertyConsumer being inspected. |
protected WindowSupport |
windowSupport
Handle to the GUI. |
Constructor Summary | |
---|---|
Inspector()
Does nothing. |
|
Inspector(java.awt.event.ActionListener al)
Sets the actionListener. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Implement the ActionListener interface. |
void |
addActionListener(java.awt.event.ActionListener al)
Set an ActionListener for callbacks. |
void |
collectAndSetProperties()
Tells the Inspector to collect the properties from the editors and set them on its PropertyConsumer. |
java.util.Properties |
collectProperties()
Extracts properties from textfield[]. |
javax.swing.JComponent |
createEmbeddedPropertyGUI(PropertyConsumer pc)
Creates a JComponent with the properties to be changed. |
javax.swing.JComponent |
createEmbeddedPropertyGUI(java.lang.String prefix,
java.util.Properties props,
java.util.Properties info)
Creates a JComponent with the properties to be changed. |
javax.swing.JComponent |
createPropertyGUI(PropertyConsumer pc)
Creates a JComponent with the properties to be changed. |
javax.swing.JComponent |
createPropertyGUI(java.lang.String prefix,
java.util.Properties props,
java.util.Properties info)
Creates a JComponent with the properties to be changed. |
boolean |
getPrint()
|
WindowSupport |
getWindowSupport()
|
void |
inspectPropertyConsumer(PropertyConsumer propertyConsumer)
Inspect and configure a PropertyConsumer object. |
static void |
main(java.lang.String[] args)
test cases. |
void |
setPrint(boolean p)
|
java.util.Vector<java.lang.String> |
sortKeys(java.util.Collection keySet)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String defaultEditorClass
protected PropertyConsumer propertyConsumer
protected WindowSupport windowSupport
public static final java.lang.String cancelCommand
public static final java.lang.String doneCommand
protected java.util.Hashtable<java.lang.String,java.beans.PropertyEditor> editors
protected java.awt.event.ActionListener actionListener
protected boolean print
Constructor Detail |
---|
public Inspector()
public Inspector(java.awt.event.ActionListener al)
Method Detail |
---|
public void addActionListener(java.awt.event.ActionListener al)
public void inspectPropertyConsumer(PropertyConsumer propertyConsumer)
public java.util.Vector<java.lang.String> sortKeys(java.util.Collection keySet)
public javax.swing.JComponent createEmbeddedPropertyGUI(PropertyConsumer pc)
pc
- The property consumer to create a gui for.
public javax.swing.JComponent createEmbeddedPropertyGUI(java.lang.String prefix, java.util.Properties props, java.util.Properties info)
prefix
- the property prefix for the property consumer. Received
from the PropertyConsumer.getPropertyPrefix() method. Properties
that start with this prefix will have the prefix removed from the
display, so the GUI will only show the actual property name.props
- the properties received from the
PropertyConsumer.getProperties() method.info
- the properties received from the
PropertyConsumer.getPropertyInfo() method, containing descriptions
and any specific PropertyEditors that should be used for a
particular property named in the PropertyConsumer.getProperties()
properties.
public javax.swing.JComponent createPropertyGUI(PropertyConsumer pc)
pc
- The property consumer to create a gui for.
public javax.swing.JComponent createPropertyGUI(java.lang.String prefix, java.util.Properties props, java.util.Properties info)
prefix
- the property prefix for the property consumer. Received
from the PropertyConsumer.getPropertyPrefix() method. Properties
that start with this prefix will have the prefix removed from the
display, so the GUI will only show the actual property name.props
- the properties received from the
PropertyConsumer.getProperties() method.info
- the properties received from the
PropertyConsumer.getPropertyInfo() method, containing descriptions
and any specific PropertyEditors that should be used for a
particular property named in the PropertyConsumer.getProperties()
properties.
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void collectAndSetProperties()
public java.util.Properties collectProperties()
public void setPrint(boolean p)
public boolean getPrint()
public WindowSupport getWindowSupport()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |