|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface provides the input protocol for objects which are dragged and may be snapped to objects which implement the snap_targetable interface. (This is a subclass of move_draggable.) These "drag" objects are moved over the top of snap "target" objects. Where the right conditions occur, feedback is produced which snaps the objects together in some way (typically by pulling the drag object to the target object). The snap is said to occur "from" drag (snap_draggable) objects "to" target (snap_targetable) objects. Both this protocol and the snap_targetable protocol are managed and delivered by the snap_drag_agent.
Snapping requires a two part test. The first part is geometric. In this part we determine if a feature point of the drag object is close enough geometrically to snap to the target. If this test passes, then a second semantic test is performed to determine if the two objects are semantically compatible (this second test by snap_targetable.snap_from_ok() may involve type tests and/or exchange of information between the target object and this object using the protocol of an application specific interface defined elsewhere). If both snapping tests succeed, and the snap is the closest candidate snap, the snap will occur.
If their are no suitable snaps, but some snaps pass the geometric test (i.e., are close enough) then "anti-snaps" will be considered. An anti-snap is designed to provide feedback about a negative condition -- it is typically used to produce a kind of dynamic "error message" that indicates why a geometrically possible snap is not semantically suitable. Anti-snaps must pass a second semantic test (performed by snap_targetable.anti_snap_from_ok()) before they are activated.
move_draggable
,
snap_targetable
,
snap_drag_agent
Fields inherited from class sub_arctic.constraints.std_constraint_consts |
FIRST_CHILD,
LAST_CHILD,
MAX_CHILD,
MIN_CHILD,
NEXT_SIBLING,
NO_CONSTRAINT,
OTHER,
PARENT,
PREV_SIBLING,
SELF,
ZERO |
Method Summary | |
boolean |
anti_snap_feedback(event evt,
java.awt.Point orig_pt,
java.awt.Point snap_pt,
int feature_pt_indx,
snap_targetable target_obj,
java.lang.Object anti_snap_info,
java.lang.Object user_info)
Perform feedback while an anti-snap is active. |
boolean |
anti_snap_to(event evt,
java.awt.Point orig_pt,
java.awt.Point snap_pt,
int feature_pt_indx,
snap_targetable target_obj,
java.lang.Object anti_snap_info,
java.lang.Object user_info)
Indicate that the object should anti-snap to a given target object. |
boolean |
snap_feedback(event evt,
java.awt.Point orig_pt,
java.awt.Point snap_pt,
int feature_pt_indx,
snap_targetable target_obj,
java.lang.Object user_info)
Perform feedback while a snap is active. |
boolean |
snap_to(event evt,
java.awt.Point orig_pt,
java.awt.Point snap_pt,
int feature_pt_indx,
snap_targetable target_obj,
java.lang.Object user_info)
Indicate that the object should snap to a given target object. |
boolean |
unanti_snap_to(event evt,
java.awt.Point orig_pt,
java.awt.Point snap_pt,
int feature_pt_indx,
snap_targetable target_obj,
java.lang.Object anti_snap_info,
java.lang.Object user_info)
Indicate that the object is no longer anti-snapped to a given target object. |
boolean |
unsnap_to(event evt,
java.awt.Point orig_pt,
java.awt.Point snap_pt,
int feature_pt_indx,
snap_targetable target_obj,
java.lang.Object user_info)
Indicate that the object is no longer snapped to a given target object. |
Methods inherited from interface sub_arctic.input.move_draggable |
drag_end,
drag_feedback,
drag_start |
Methods inherited from interface sub_arctic.input.focusable |
focus_set_enter,
focus_set_exit |
Method Detail |
public boolean snap_to(event evt, java.awt.Point orig_pt, java.awt.Point snap_pt, int feature_pt_indx, snap_targetable target_obj, java.lang.Object user_info)
event
- evt the event "causing" the snap.Point
- orig_pt where this object would be without
the snap.Point
- snap_pt where this object is with the snap.int
- feature_pt_indx the feature point of this object
that we are snapping with.snap_targetable
- target_obj the target object we are snapping
to.Object
- user_info the user info for this input.public boolean snap_feedback(event evt, java.awt.Point orig_pt, java.awt.Point snap_pt, int feature_pt_indx, snap_targetable target_obj, java.lang.Object user_info)
event
- evt the event "causing" the snap.Point
- orig_pt where this object would be without
the snap.Point
- snap_pt where this object is with the snap.int
- feature_pt_indx the feature point of this object
that we are snapping with.snap_targetable
- target_obj the target object we are snapping
to.Object
- user_info the user info for this input.public boolean unsnap_to(event evt, java.awt.Point orig_pt, java.awt.Point snap_pt, int feature_pt_indx, snap_targetable target_obj, java.lang.Object user_info)
event
- evt the event "causing" the unsnap.Point
- orig_pt where this object should be without
the snap.Point
- snap_pt where this object was with the snap.int
- feature_pt_indx the feature point of this object
that we were snapping with.snap_targetable
- target_obj the target object we were snapping
to.Object
- user_info the user info for this input.public boolean anti_snap_to(event evt, java.awt.Point orig_pt, java.awt.Point snap_pt, int feature_pt_indx, snap_targetable target_obj, java.lang.Object anti_snap_info, java.lang.Object user_info)
event
- evt the event "causing" the anti-snap.Point
- orig_pt where this object would be without
the anti-snap.Point
- snap_pt where this object is with the
anti-snap.int
- feature_pt_indx the feature point of this object
that we are anti-snapping with.snap_targetable
- target_obj the target object we are
anti-snapping to.Object
- user_info the user info for this input.public boolean anti_snap_feedback(event evt, java.awt.Point orig_pt, java.awt.Point snap_pt, int feature_pt_indx, snap_targetable target_obj, java.lang.Object anti_snap_info, java.lang.Object user_info)
event
- evt the event "causing" the anti-snap.Point
- orig_pt where this object would be without
the anti-snap.Point
- snap_pt where this object is with the
anti-snap.int
- feature_pt_indx the feature point of this object
that we are anti-snapping with.snap_targetable
- target_obj the target object we are
anti-snapping to.Object
- user_info the user info for this input.public boolean unanti_snap_to(event evt, java.awt.Point orig_pt, java.awt.Point snap_pt, int feature_pt_indx, snap_targetable target_obj, java.lang.Object anti_snap_info, java.lang.Object user_info)
event
- evt the event "causing" the unanti-snap.Point
- orig_pt where this object should be without
the anti-snap.Point
- snap_pt where this object was with the
anti-snap.int
- feature_pt_indx the feature point of this object
that we were anti-snapping with.snap_targetable
- target_obj the target object we were
anti-snapping to.Object
- user_info the user info for this input.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |