Interface JaxoCanvasComponent

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addMouseListener​(java.awt.event.MouseListener l)
      Adds the specified mouse listener to receive mouse events from this CanvasComponent.
      void addMouseMotionListener​(java.awt.event.MouseMotionListener l)
      Adds the specified mouse motion listener to receive mouse motion events from this CanvasComponent.
      void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Adds a PropertyChangeListener to the listener list.
      java.awt.Component asComponent()
      Return this CanvasComponent as a Component.
      java.awt.Color getCanvasBackground()
      Background color in the region that is actually covered by the canvas getCanvasSize().
      java.awt.Rectangle getCanvasBounds()
      Part of the component that is covered by the actual canvas.
      java.awt.Point getCanvasOrigin()
      Origin of the actual canvas within the component.
      java.awt.Dimension getCanvasSize()
      Canvas size.
      java.awt.Graphics getGraphics()
      Return the graphics context of this CanvasComponent.
      java.awt.Dimension getMaximumCanvasSize()
      Maximum size of the canvas (even if there are objects with a larger bounding box).
      java.awt.Dimension getMinimumCanvasSize()
      Minimum size of the canvas (even if there are no objects or they have a smaller bounding box).
      void print​(java.awt.Graphics g)
      Prints this component.
      void removeMouseListener​(java.awt.event.MouseListener l)
      Removes the specified mouse listener so that it no longer receives mouse events from this component.
      void removeMouseMotionListener​(java.awt.event.MouseMotionListener l)
      Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.
      void repaint()
      Repaints this component.
      void setCanvasBackground​(java.awt.Color color)
      Sets the color of the background.
      void setMaximumCanvasSize​(java.awt.Dimension value)
      Sets the maximum canvas size.
      void setMinimumCanvasSize​(java.awt.Dimension value)
      Sets the minimum canvas size.
    • Method Detail

      • addMouseListener

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

        void addMouseMotionListener​(java.awt.event.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:
        Component.addMouseMotionListener(java.awt.event.MouseMotionListener)
      • addPropertyChangeListener

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

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

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

        java.awt.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:
        getCanvasSize(), getCanvasOrigin()
      • getCanvasOrigin

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

        java.awt.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

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

        java.awt.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

        java.awt.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​(java.awt.Graphics g)
        Prints this component.
        Parameters:
        g - the graphics context to use for printing.
        See Also:
        Component.print(java.awt.Graphics)
      • removeMouseListener

        void removeMouseListener​(java.awt.event.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:
        Component.removeMouseListener(java.awt.event.MouseListener)
      • removeMouseMotionListener

        void removeMouseMotionListener​(java.awt.event.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:
        Component.removeMouseMotionListener(java.awt.event.MouseMotionListener)
      • repaint

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

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

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

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