Class SnapToMappings
java.lang.Object
com.levigo.jadice.web.client.grid.SnapToMappings
Stores mappings of
Annotation classes to Grid.SnapTo locations. Each mapping
determines on which location of the Cell bounds annotations of the given class will be
aligned to when creating, moving or resizing an annotation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(Class<? extends Annotation> annoClass, Grid.SnapTo snapTo) Adds a new mapping between anAnnotationclass and aGrid.SnapTolocation.static voidclear()Removes all registered mappings.static Grid.SnapTogetFor(Class<? extends Annotation> annoClass) Returns theGrid.SnapToof a previously added mapping.
-
Constructor Details
-
SnapToMappings
public SnapToMappings()
-
-
Method Details
-
add
Adds a new mapping between anAnnotationclass and aGrid.SnapTolocation. The given SnapTo is used when creating, moving or resizing annotations meaning that the annotation is aligned at the corresponding position on a cell.- Parameters:
annoClass- The annotation classsnapTo- The position on the border or at the center of a cell
-
getFor
Returns theGrid.SnapToof a previously added mapping. The SnapTo is used when creating, moving or resizing annotations meaning that the annotation is aligned at the corresponding position on grid elements.Defaults to the nearest corner when no specific mapping for the given
Annotationclass is found.- Parameters:
annoClass- The annotation class- Returns:
- The position on the border or at the center of a cell
-
clear
public static void clear()Removes all registered mappings. After this method is called all annotations will be aligned to the default position on the correspondingCell(which is the top left corner).
-