Class ShapefileLayer

java.lang.Object
edu.cnu.mdi.item.Layer
edu.cnu.mdi.mapping.layer.ShapefileLayer

public class ShapefileLayer extends Layer
MDI layer that hosts one shapefile renderer.

The layer owns visibility, ordering, editing, and picking. The renderer remains responsible only for projecting and drawing the shapefile geometry.

  • Constructor Details

    • ShapefileLayer

      public ShapefileLayer(IContainer container, String name, ShapeFeatureRenderer renderer)
      Creates a shapefile layer.
      Parameters:
      container - owning container
      name - display name
      renderer - shapefile renderer
  • Method Details

    • getRenderer

      public ShapeFeatureRenderer getRenderer()
      Returns the hosted renderer.
      Returns:
      shapefile renderer
    • setProjection

      public void setProjection(IMapProjection projection)
      Updates the renderer's active map projection.
      Parameters:
      projection - current projection
    • beforeDraw

      public void beforeDraw(Graphics2D g2, IContainer container)
      Draws the shapefile geometry.
      Overrides:
      beforeDraw in class Layer
      Parameters:
      g2 - the graphics context
      container - the container being rendered
    • pick

      public String pick(Point point, IContainer container)
      Delegates shapefile hit testing when this layer is visible.
      Parameters:
      point - local screen point
      container - rendering container
      Returns:
      tooltip text, or null
    • edit

      public void edit(Component parentComponent)
      Opens a geometry-appropriate shapefile style editor.
      Overrides:
      edit in class Layer
      Parameters:
      parentComponent - the parent component for any dialogs; may be null