omero.model
Class SmartShape.Util

java.lang.Object
  extended by omero.model.SmartShape.Util
Enclosing interface:
SmartShape

public static class SmartShape.Util
extends 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
SmartShape.Util()
           
 
Method Summary
static void appendDbPoint(StringBuilder sb, double cx, double cy)
           
static void appendDbPoint(StringBuilder sb, omero.model.Point p)
           
static boolean appendSegement(StringBuilder sb, boolean first, double cx, double cy)
           
static void appendSvgPoint(StringBuilder sb, double cx, double cy)
           
static void appendSvgPoint(StringBuilder sb, omero.model.Point p)
           
static boolean checkNonNull(List<omero.model.Point> points)
          Used from assert statements of the form: assert Util.checkNonNull(points) : "Null points in " + this; in all the implementations of SmartShape.asPoints().
static Shape parseAwtPath(String str)
           
static List<omero.model.Point> parsePoints(String str)
           
static String parsePointsToPath(String str, boolean close)
           
static List<omero.model.Point> points(double x, double y, double w, double h)
          Returns the four corner points of a rectangle
static void pointsByBoundingBox(Shape s, Rectangle2D r, SmartShape.PointCallback cb)
           
static String pointsToPath(List<omero.model.Point> points, boolean close)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartShape.Util

public SmartShape.Util()
Method Detail

checkNonNull

public static boolean checkNonNull(List<omero.model.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 -
Returns:
false if iterating through the points list and dereferencing the cx and cy fields would cause a NullPointerException

appendDbPoint

public static void appendDbPoint(StringBuilder sb,
                                 omero.model.Point p)

appendDbPoint

public static void appendDbPoint(StringBuilder sb,
                                 double cx,
                                 double cy)

appendSvgPoint

public static void appendSvgPoint(StringBuilder sb,
                                  omero.model.Point p)

appendSvgPoint

public static void appendSvgPoint(StringBuilder sb,
                                  double cx,
                                  double cy)

appendSegement

public static boolean appendSegement(StringBuilder sb,
                                     boolean first,
                                     double cx,
                                     double cy)

pointsToPath

public static String pointsToPath(List<omero.model.Point> points,
                                  boolean close)

parsePointsToPath

public static String parsePointsToPath(String str,
                                       boolean close)

parseAwtPath

public static Shape parseAwtPath(String str)

parsePoints

public static List<omero.model.Point> parsePoints(String str)

points

public static List<omero.model.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(Shape s,
                                       Rectangle2D r,
                                       SmartShape.PointCallback cb)


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.