Class LayerViewPanel

All Implemented Interfaces:
LayerListener, LayerManagerProxy, SelectionManagerProxy, ImageObserver, MenuContainer, Serializable, Accessible

public class LayerViewPanel extends JPanel implements LayerListener, LayerManagerProxy, SelectionManagerProxy
Be sure to call #dispose() when the LayerViewPanel is no longer needed.
Author:
ed
See Also:
  • Constructor Details

  • Method Details

    • getToolTipWriter

      public ToolTipWriter getToolTipWriter()
    • getToolTipText

      public String getToolTipText(MouseEvent event)
      Overrides:
      getToolTipText in class JComponent
    • visibleLayerToFeaturesInFenceMap

      public Map<Layer, Set<Feature>> visibleLayerToFeaturesInFenceMap()
      The Fence layer will be excluded.
    • visibleLayerToFeaturesInFenceMap

      public Map<Layer, Set<Feature>> visibleLayerToFeaturesInFenceMap(org.locationtech.jts.geom.Geometry fence)
      The Fence layer will be included.
    • popupMenu

      public static JPopupMenu popupMenu()
    • getCurrentCursorTool

      public CursorTool getCurrentCursorTool()
    • reSetCurrentCursorTool

      public void reSetCurrentCursorTool()
      force the current tool to be reactivated on us. e.g. on task switches
    • setCurrentCursorTool

      public void setCurrentCursorTool(CursorTool newct)
      set a cursortool to associate with the layer view. will return immediatly if the old cursor tools is identical to the new one.
      Parameters:
      newct - the new CursorTool
    • removeCurrentCursorTool

      public void removeCurrentCursorTool()
    • getWorkBenchFrame

      public WorkbenchFrame getWorkBenchFrame()
      Find the parent WorkBenchFrame.
      Returns:
      WorkbenchFrame
    • setViewportInitialized

      public void setViewportInitialized(boolean viewportInitialized)
      When a layer is added, if this flag is false, the viewport will be zoomed to the extent of the layer.
    • getLastClickedPoint

      public Point getLastClickedPoint()
      Note: the popup menu is shown only if the user right-clicks the panel. Thus, popup-menu event handlers don't need to check whether the return value is null.
    • getLastMouseLocation

      public Point getLastMouseLocation()
    • getViewport

      public Viewport getViewport()
    • getJava2DConverter

      public Java2DConverter getJava2DConverter()
    • getFence

      public org.locationtech.jts.geom.Geometry getFence()
      Returns:
      the fence in model-coordinates, or null if there is no fence
    • getLayerManager

      public LayerManager getLayerManager()
      Specified by:
      getLayerManager in interface LayerManagerProxy
    • featuresChanged

      public void featuresChanged(FeatureEvent e)
      Description copied from interface: LayerListener
      Fired when a feature is added to or removed from a layer, or when a feature is edited (using an EditTransaction). Warning: this event is fired often.
      Specified by:
      featuresChanged in interface LayerListener
    • categoryChanged

      public void categoryChanged(CategoryEvent e)
      Specified by:
      categoryChanged in interface LayerListener
    • layerChanged

      public void layerChanged(LayerEvent e)
      Specified by:
      layerChanged in interface LayerListener
    • createBlankPanelImage

      public Image createBlankPanelImage()
      Returns an image with the dimensions of this panel. Note that the image has an alpha component, and thus is not suitable for creating JPEGs -- they will look pinkish.
    • repaint

      public void repaint()
      Overrides:
      repaint in class Component
    • superRepaint

      public void superRepaint()
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • erase

      public void erase(Graphics2D g)
    • fill

      public void fill(Graphics2D g, Color color)
    • getContext

      public LayerViewPanelContext getContext()
    • addListener

      public void addListener(LayerViewPanelListener listener)
    • removeListener

      public void removeListener(LayerViewPanelListener listener)
    • format

      public String format(double d)
      Returns:
      d rounded off to the distance represented by one pixel
    • format

      protected String format(double d, double pixelWidthInModelUnits)
    • fireSelectionChanged

      public void fireSelectionChanged()
    • getRenderingManager

      public RenderingManager getRenderingManager()
    • featuresWithVertex

      public Collection<Feature> featuresWithVertex(Point2D viewPoint, double viewTolerance, Collection<Feature> features) throws NoninvertibleTransformException
      Throws:
      NoninvertibleTransformException
    • dispose

      public void dispose()
    • flash

      public void flash(Shape shape, Color color, Stroke stroke, int millisecondDelay)
      Parameters:
      millisecondDelay - the GUI will be unresponsive for this length of time, so keep it short!
    • getSelectionManager

      public SelectionManager getSelectionManager()
      Specified by:
      getSelectionManager in interface SelectionManagerProxy
    • getBlackboard

      public Blackboard getBlackboard()
    • flash

      public void flash(org.locationtech.jts.geom.GeometryCollection geometryCollection) throws NoninvertibleTransformException
      Throws:
      NoninvertibleTransformException
    • setDeferLayerEvents

      public void setDeferLayerEvents(boolean defer)