Interface JImageFeature


  • public interface JImageFeature
    An image feature that can be displayed within a JImagePanel.
    Since:
    1.0.4
    Version:
    1.0.0
    Author:
    Julien Seinturier - COMEX S.A. - http://www.seinturier.fr
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean contains​(double x, double y)
      Check if the point described by the given coordinates (x, y) is inside the feature.
      boolean contains​(java.awt.Shape s)
      Check if the shape given in parameter is inside the feature.
      void draw​(java.awt.Graphics2D g2d, java.awt.geom.AffineTransform transform)
      Draw this feature on the given graphic context.
      boolean inside​(java.awt.Shape s)
      Check if the shape given in parameter is inside the feature.
      boolean intersects​(java.awt.Shape s)
      Check if the shape given in parameter is intersecting the feature.
    • Method Detail

      • draw

        void draw​(java.awt.Graphics2D g2d,
                  java.awt.geom.AffineTransform transform)
        Draw this feature on the given graphic context. The given graphic context is related to the original image space. The transformation applied to the current display is given as transform and can be used to avoid rotation or scale for feature that have constant size or orientation (for example text features).
        Parameters:
        g2d - a graphic context expressed within image space.
        transform - the transform applied to the view within the JImagePanel.
      • contains

        boolean contains​(double x,
                         double y)
        Check if the point described by the given coordinates (x, y) is inside the feature. The coordinates have to be expressed within original image space.
        Parameters:
        x - the x coordinate of the point to check.
        y - the y coordinate of the point to check.
        Returns:
        true if the feature is containing the point and false otherwise.
        See Also:
        contains(Shape), intersects(Shape), inside(Shape)
      • contains

        boolean contains​(java.awt.Shape s)
        Check if the shape given in parameter is inside the feature. The shape have to be expressed within original image space.
        Parameters:
        s - the shape to check.
        Returns:
        true if the feature is containing the shape and false otherwise.
        See Also:
        contains(double, double), intersects(Shape), inside(Shape)
      • intersects

        boolean intersects​(java.awt.Shape s)
        Check if the shape given in parameter is intersecting the feature. The shape have to be expressed within original image space.
        Parameters:
        s - the shape to check.
        Returns:
        true if the feature is intersecting the shape and false otherwise.
        See Also:
        contains(double, double), contains(Shape), inside(Shape)
      • inside

        boolean inside​(java.awt.Shape s)
        Check if the shape given in parameter is inside the feature. The shape have to be expressed within original image space.
        Parameters:
        s - the shape to check.
        Returns:
        true if the feature is inside the shape and false otherwise.
        See Also:
        contains(Shape), contains(double, double), intersects(Shape)