com.xinapse.multisliceimage.roi
Class Handle

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.Point
          extended by com.xinapse.multisliceimage.roi.Handle
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AxisHandle, CentreHandle, CornerHandle, EdgeHandle, EndHandle, VertexHandle

public abstract class Handle
extends java.awt.Point

A Class representing an ROI Handle, used for changing the shape of an ROI.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
static int SIZE_LARGE
          The size of Handles (in screen pixels) when they are drawn large.
static int SIZE_SMALL
          The size of Handles (in screen pixels) when they are drawn small.
 
Fields inherited from class java.awt.Point
x, y
 
Constructor Summary
Handle(int x, int y, int size)
          Creates a new Handle at the location (x,y) with the given size in screen pixels.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws this Handle using the given Graphics context.
static java.awt.Color getBorderColor()
          Returns the Color with which ROI Handle borders are to be drawn.
static java.awt.Color getColor()
          Returns the Color with which ROI Handles are to be drawn.
 int getSize()
          Returns the size of this ROI in screen pixels.
static int getSize(int separation)
          Returns a suitable size of Handle for drawing an ROI of the given size.
static int getSize(int objectWidth, int objectHeight)
          Returns a suitable size of Handle for drawing an ROI of the given width and height.
 boolean pointOver(java.awt.Point point)
          Returns true if the specified point is over this handle; false otherwise.
static void setBorderColor(java.awt.Color c)
          Sets the Color with which ROI Handle borders are to be drawn.
static void setColor(java.awt.Color c)
          Sets the Color with which ROI Handles are to be drawn.
 void setSize(int size)
          Sets the size of this ROI in screen pixels.
abstract  java.lang.String toString()
          Returns a java.lang.String describing this Handle.
 
Methods inherited from class java.awt.Point
equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE_SMALL

public static final int SIZE_SMALL
The size of Handles (in screen pixels) when they are drawn small.

See Also:
Constant Field Values

SIZE_LARGE

public static final int SIZE_LARGE
The size of Handles (in screen pixels) when they are drawn large.

See Also:
Constant Field Values
Constructor Detail

Handle

public Handle(int x,
              int y,
              int size)
Creates a new Handle at the location (x,y) with the given size in screen pixels.

Parameters:
x - the x location of the Handle in screen coords.
y - the y location of the Handle in screen coords.
size - the size of the Handle in screen pixels.
Method Detail

setSize

public final void setSize(int size)
Sets the size of this ROI in screen pixels.

Parameters:
size - the new size of this ROI in screen pixels.

getSize

public final int getSize()
Returns the size of this ROI in screen pixels.

Returns:
the size of this ROI in screen pixels.

pointOver

public boolean pointOver(java.awt.Point point)
Returns true if the specified point is over this handle; false otherwise.

Returns:
true if the specified point is over this handle; false otherwise.

draw

public void draw(java.awt.Graphics g)
Draws this Handle using the given Graphics context.

Parameters:
g - the Graphics object on which the drawing operation is to be peformed.

getSize

public static int getSize(int objectWidth,
                          int objectHeight)
Returns a suitable size of Handle for drawing an ROI of the given width and height.

Parameters:
objectWidth - the width of the ROI to which this handle is to be attached in screen pixels.
objectHeight - the height of the ROI to which this handle is to be attached in screen pixels.
Returns:
a Handle size in screen pixels.

getSize

public static int getSize(int separation)
Returns a suitable size of Handle for drawing an ROI of the given size.

Parameters:
separation - the distance in screen pixels bewtween adjacent vertices of an ROI.
Returns:
a Handle size in screen pixels.

getColor

public static java.awt.Color getColor()
Returns the Color with which ROI Handles are to be drawn.

Returns:
the Color with which ROI Handles are to be drawn.

getBorderColor

public static java.awt.Color getBorderColor()
Returns the Color with which ROI Handle borders are to be drawn.

Returns:
the Color with which ROI Handle borders are to be drawn.

setColor

public static void setColor(java.awt.Color c)
Sets the Color with which ROI Handles are to be drawn.

Parameters:
c - the new Color with which ROI Handles are to be drawn.

setBorderColor

public static void setBorderColor(java.awt.Color c)
Sets the Color with which ROI Handle borders are to be drawn.

Parameters:
c - the new Color with which ROI Handle borders are to be drawn.

toString

public abstract java.lang.String toString()
Returns a java.lang.String describing this Handle.

Overrides:
toString in class java.awt.Point
Returns:
a String describing this Handle.


Copyright 2006-2008 Xinapse Systems Limited. All Rights Reserved.