Package diva.canvas

Class GraphicsPane

  • All Implemented Interfaces:
    CanvasComponent, EventAcceptor
    Direct Known Subclasses:
    GraphPane, SimplePane

    public class GraphicsPane
    extends CanvasPane
    A CanvasPane which has a default set of layers that are useful for interactive drawing and editing applications. The layers are organized as follows:
       (front)  Foreground event
                Overlay
                Foreground graphics
                Background graphics
                Background event
     
    This organization allows applications to easily overlay and underlay graphics and event handling around the main application window.

    Typical uses of each of these layers include:

    Foreground event layer
    Grid or object snapping, stroke filtering, event monitoring and debugging, event grab, etc. By default, this layer is not enabled. If you enable it, but still want events to go through to the underlying figure layers, use setConsuming(false).
    Overlay
    An overlay layer for drag-selection outlining and so on. By default, this layer is an instance of OverlayLayer and is set visible.
    Foreground graphics
    The main application graphics. By default, this layer is an instance of FigureLayer and is set enabled and visible.
    Background graphics
    Auxiliary, non-interactive graphics. By default, this layer is an instance of FigureLayer but is set not visible and not enabled.
    Background Event
    "Last chance" event handling layer, for things such as drag-selection rectangle, panning/zooming, etc. By default, this layer is enabled.
    Version:
    $Id$
    Author:
    Michael Shilman, John Reekie
    Pt.AcceptedRating:
    Yellow
    • Constructor Detail

      • GraphicsPane

        public GraphicsPane()
        Create a new Graphics pane with an instance of FigureLayer as the main figure layer.
      • GraphicsPane

        public GraphicsPane​(FigureLayer foregroundLayer)
        Create a new Graphics pane with the passed Layer as the main graphics pane.
        Parameters:
        foregroundLayer - The foreground layer