Package omero.model

Class SmartShape.Util

  • Enclosing interface:
    SmartShape

    public static class SmartShape.Util
    extends java.lang.Object
    Utility class used as a mixin by all of the SmartShape implementations. The inheritance hierarchy of Ice-generated objects doesn't allow for simply subclassing .
    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void appendDbPoint​(java.lang.StringBuilder sb, double x, double y)  
      static void appendDbPoint​(java.lang.StringBuilder sb, Point p)  
      static boolean appendSegment​(java.lang.StringBuilder sb, boolean first, double x, double y)  
      static void appendSvgPoint​(java.lang.StringBuilder sb, double x, double y)  
      static void appendSvgPoint​(java.lang.StringBuilder sb, Point p)  
      static boolean checkNonNull​(java.util.List<Point> points)
      Used from assert statements of the form:
      static java.awt.geom.AffineTransform getAwtTransform​(AffineTransform transform)  
      static java.util.Set<java.awt.geom.Point2D> getQuantizedLinePoints​(java.awt.geom.Line2D line, java.util.Set<java.awt.geom.Point2D> points)  
      static java.awt.Shape parseAwtPath​(java.lang.String str)  
      static java.util.List<Point> parsePoints​(java.lang.String str)  
      static java.lang.String parsePointsToPath​(java.lang.String str, boolean close)  
      static java.util.List<Point> points​(double x, double y, double w, double h)
      Returns the four corner points of a rectangle
      static void pointsByBoundingBox​(java.awt.Shape s, java.awt.geom.Rectangle2D r, SmartShape.PointCallback cb)  
      static java.lang.String pointsToPath​(java.util.List<Point> points, boolean close)  
      static java.awt.Shape transformAwtShape​(java.awt.Shape shape, AffineTransform transform)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • checkNonNull

        public static boolean checkNonNull​(java.util.List<Point> points)
        Used from assert statements of the form:
         assert Util.checkNonNull(points) : "Null points in " + this;
         
        in all the implementations of SmartShape.asPoints().
        Parameters:
        points - the points
        Returns:
        false if iterating through the points list and dereferencing the x and y fields would cause a NullPointerException
      • appendDbPoint

        public static void appendDbPoint​(java.lang.StringBuilder sb,
                                         Point p)
      • appendDbPoint

        public static void appendDbPoint​(java.lang.StringBuilder sb,
                                         double x,
                                         double y)
      • appendSvgPoint

        public static void appendSvgPoint​(java.lang.StringBuilder sb,
                                          Point p)
      • appendSvgPoint

        public static void appendSvgPoint​(java.lang.StringBuilder sb,
                                          double x,
                                          double y)
      • appendSegment

        public static boolean appendSegment​(java.lang.StringBuilder sb,
                                            boolean first,
                                            double x,
                                            double y)
      • pointsToPath

        public static java.lang.String pointsToPath​(java.util.List<Point> points,
                                                    boolean close)
      • parsePointsToPath

        public static java.lang.String parsePointsToPath​(java.lang.String str,
                                                         boolean close)
      • parseAwtPath

        public static java.awt.Shape parseAwtPath​(java.lang.String str)
      • parsePoints

        public static java.util.List<Point> parsePoints​(java.lang.String str)
      • points

        public static java.util.List<Point> points​(double x,
                                                   double y,
                                                   double w,
                                                   double h)
        Returns the four corner points of a rectangle
        Parameters:
        x - the top-left corner's x coordinate (the lowest x)
        y - the top-left corner's y coordinate (the lowest y)
        w - width of the rectangle so that x+w gives the highest x
        h - height of the rectange so taht y+h gives the highest y
        Returns:
        a list of points of the form: (x,y),(x+w,y),(x+w,y+h),(x,y+h)
      • pointsByBoundingBox

        public static void pointsByBoundingBox​(java.awt.Shape s,
                                               java.awt.geom.Rectangle2D r,
                                               SmartShape.PointCallback cb)
      • getAwtTransform

        public static java.awt.geom.AffineTransform getAwtTransform​(AffineTransform transform)
      • transformAwtShape

        public static java.awt.Shape transformAwtShape​(java.awt.Shape shape,
                                                       AffineTransform transform)
      • getQuantizedLinePoints

        public static java.util.Set<java.awt.geom.Point2D> getQuantizedLinePoints​(java.awt.geom.Line2D line,
                                                                                  java.util.Set<java.awt.geom.Point2D> points)