Interface JaxoCanvasComponent

All Known Subinterfaces:
JaxoDrawingArea
All Known Implementing Classes:
AbstractJaxoCanvas, JaxoCanvas

public interface JaxoCanvasComponent
The canvas as a component.
Since:
2.1
  • Method Details

    • addMouseListener

      void addMouseListener(MouseListener l)
      Adds the specified mouse listener to receive mouse events from this CanvasComponent.
      Parameters:
      l - the mouse listener. May be null.
      See Also:
    • addMouseMotionListener

      void addMouseMotionListener(MouseMotionListener l)
      Adds the specified mouse motion listener to receive mouse motion events from this CanvasComponent.
      Parameters:
      l - the mouse motion listener. May be null.
      See Also:
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener listener)
      Adds a PropertyChangeListener to the listener list.
      Parameters:
      listener - the property change listener to be added. May be null.
      See Also:
    • asComponent

      Component asComponent()
      Return this CanvasComponent as a Component.
      Returns:
      this CanvasComponent as a Component or null, if this is not a Component.
    • getCanvasBackground

      Color getCanvasBackground()
      Background color in the region that is actually covered by the canvas getCanvasSize().
      Returns:
      The canvas background color.
    • getCanvasBounds

      Rectangle getCanvasBounds()
      Part of the component that is covered by the actual canvas. This includes canvas background and grid, -- i.e. a rectangle with size 'canvasSize' and origin 'canvasOrigin'.
      Returns:
      Rectangle the canvas bounds.
      See Also:
    • getCanvasOrigin

      Point getCanvasOrigin()
      Origin of the actual canvas within the component. This is always the top-left corner.
      Returns:
      a Point at the origin.
    • getCanvasSize

      Dimension getCanvasSize()
      Canvas size. This is equal to the (inner) component size unless because of viewport size tracking, the component has become larger than the effective maximum canvas size.
      Returns:
      The canvas size.
    • getGraphics

      Graphics getGraphics()
      Return the graphics context of this CanvasComponent.
      Returns:
      the graphics context or null if this component is currently not displayable.
      See Also:
    • getMaximumCanvasSize

      Dimension getMaximumCanvasSize()
      Maximum size of the canvas (even if there are objects with a larger bounding box). The default value is larger than (0,0). If the maximum canvas size is smaller (in either direction) than the minimum canvas size, the latter wins.
      Returns:
      The maximum canvas size.
    • getMinimumCanvasSize

      Dimension getMinimumCanvasSize()
      Minimum size of the canvas (even if there are no objects or they have a smaller bounding box). The default value is (0,0).
      Returns:
      The minimum canvas size.
    • print

      void print(Graphics g)
      Prints this component.
      Parameters:
      g - the graphics context to use for printing.
      See Also:
    • removeMouseListener

      void removeMouseListener(MouseListener l)
      Removes the specified mouse listener so that it no longer receives mouse events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.
      Parameters:
      l - the mouse listener
      See Also:
    • removeMouseMotionListener

      void removeMouseMotionListener(MouseMotionListener l)
      Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener l is null, no exception is thrown and no action is performed.
      Parameters:
      l - the mouse motion listener
      See Also:
    • repaint

      void repaint()
      Repaints this component.
      See Also:
    • setCanvasBackground

      void setCanvasBackground(Color color)
      Sets the color of the background.
      Parameters:
      color - The background color.
    • setMaximumCanvasSize

      void setMaximumCanvasSize(Dimension value)
      Sets the maximum canvas size.
      Parameters:
      value - The maximum canvas size.
    • setMinimumCanvasSize

      void setMinimumCanvasSize(Dimension value)
      Sets the minimum canvas size.
      Parameters:
      value - The minimum canvas size.