The order of the layers in the list reflects the order that the layers are displayed on the map, with the bottom-most layer listed on the panel underneath all the the other layers displayed on the map. The order of the layers is determined by their order in the Layer[] passed in the setLayers method.
The order of the layers can be changed by sending the LayersPanel an ActionEvent with one of the string commands in the class, or by sending a PropertyChangeEvent with a command and a Layer as the new value.
In the standard GUI, the order can be changed by selecting a layer by clicking on the layer's name (or on either of buttons), then clicking on one of the four buttons on the left side of the panel. The four buttons signify, from top to bottom: Move the selected layer to the top; Move the selected layer up one position; Move the selected layer down one position; Move the selected layer to the bottom.
The LayersPanel can be used within a BeanContext. If it is added to a BeanConext, it will look for a LayerHandler to add itself to as a LayerListener. The LayersPanel can only listen to one LayerHandler, so if more than one is found, only the last one found will be used. If another LayerHandler is added to the BeanContext later, the new LayerHandler will be used. The LayersPanel is also considered to be a Tool, which will cause a button that will bring up the LayersPanel to be automatically added to the ToolPanel if a ToolPanel is part of the BeanContext.
When the LayersPanel discovers a BufferedLayerMapBean is being used, it adds a special LayerPane to its LayerPane list that shows which layers are being buffered in the MapBean. This special LayerPane shows up as a line in the list, and all layers below that line are being specially buffered by the BufferedLayerMapBean.
The properties that can be set for the LayersPanel:
# Use LayerStatusPanes for the layers if true, otherwise # LayerPanes. LayerStatusPanes turn the on/off bulbs to green/red # bulbs when the layer is resting/working. LayerPanes just show # yellow bulbs when the layer is part of the map. showStatus=true # When the BufferedLayerMapBean is used, a divider will be # displayed in the list of layers showing which layers are in the # MapBean buffer (below the line). Commands to move layers, by # default, respect this divider, requiring more commands to have # layers cross it. boundary=true # Add control buttons - use "none" for no button. If undefined, # the LayerControlButtonPanel will be created automatically. controls=com.bbn.openmap.gui.LayerControlButtonPanel # Any control properties added here, prepended by "controls"... controls.configuration=WEST
|
|