Class LayerTree

    • Field Detail

      • DEFAULT_OFFSET

        protected static final Offset DEFAULT_OFFSET
        The default screen location: 20x140 pixels from the upper left screen corner.
      • DEFAULT_FRAME_IMAGE

        protected static final java.lang.String DEFAULT_FRAME_IMAGE
        The default frame image. Appears to the left of the frame title.
        See Also:
        Constant Field Values
      • DEFAULT_FRAME_TITLE

        protected static final java.lang.String DEFAULT_FRAME_TITLE
        The default frame title: "Layers".
        See Also:
        Constant Field Values
    • Constructor Detail

      • LayerTree

        public LayerTree()
        Creates a new LayerTree with an empty LayerTreeModel and the default screen location. The tree's upper left corner is placed 20x140 pixels from the upper left screen corner.
      • LayerTree

        public LayerTree​(LayerTreeModel model)
        Creates a new LayerTree with the specified model and the default screen location. The tree's upper left corner is placed 20x140 pixels from the upper left screen corner.
        Parameters:
        model - the tree model to use.
        Throws:
        java.lang.IllegalArgumentException - if model is null.
      • LayerTree

        public LayerTree​(Offset offset)
        Creates a new LayerTree with an empty LayerTreeModel and the specified screen location.
        Parameters:
        offset - the screen location of the tree's upper left corner, relative to the screen's upper left corner.
        Throws:
        java.lang.IllegalArgumentException - if offset is null.
      • LayerTree

        public LayerTree​(LayerTreeModel model,
                         Offset offset)
        Creates a new LayerTree with the specified model and the specified screen location.
        Parameters:
        model - the tree model to use.
        offset - the screen location of the tree's upper left corner, relative to the screen's upper left corner.
        Throws:
        java.lang.IllegalArgumentException - if model is null, or if offset is null.
    • Method Detail

      • initialize

        protected void initialize​(LayerTreeModel model,
                                  Offset offset)
        Initializes this tree with the specified model and offset. This configures the tree's model, its layout, and expands the path to the root node. If either parameter is null this uses a suitable default.
        Parameters:
        model - this tree's model to use, or null to create a new LayerTreeModel.
        offset - the screen location of this tree's upper left corner, or null to use the default.
      • createTreeModel

        protected LayerTreeModel createTreeModel()
        Returns a new LayerTreeModel. Called from initialize when no model is specified.
        Returns:
        a new LayerTreeModel.
      • createTreeLayout

        protected TreeLayout createTreeLayout​(Offset offset)
        Returns a new TreeLayout suitable for displaying the layer tree on a WorldWindow. If the offset is null this the default value.
        Parameters:
        offset - the screen location of this tree's upper left corner, or null to use the default.
        Returns:
        new TreeLayout.