de.upb.swt.epctools.controllers
Class SnapToGrid

java.lang.Object
  extended by de.upb.swt.epctools.controllers.SnapToGrid

public abstract class SnapToGrid
extends java.lang.Object

This static class snaps geometrical points to a grid with a statically defined spacing value.


Field Summary
(package private) static int m_grid_space
           
 
Constructor Summary
SnapToGrid()
           
 
Method Summary
static int snap(int x)
          Snap the value of x to the grid.
static org.eclipse.draw2d.geometry.Point snap(org.eclipse.draw2d.geometry.Point p)
          Snaps point p to the grid.
static java.awt.Point snap(java.awt.Point p)
          Snaps point p to the grid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_grid_space

static int m_grid_space
Constructor Detail

SnapToGrid

public SnapToGrid()
Method Detail

snap

public static org.eclipse.draw2d.geometry.Point snap(org.eclipse.draw2d.geometry.Point p)
Snaps point p to the grid.


snap

public static java.awt.Point snap(java.awt.Point p)
Snaps point p to the grid.


snap

public static int snap(int x)
Snap the value of x to the grid.