|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.lib.min_interactor | +--sub_arctic.lib.base_interactor | +--sub_arctic.lib.base_parent_interactor | +--sub_arctic.lib.shrink_wrap_container | +--sub_arctic.lib.drag_container | +--sub_arctic.lib.shadow_drag_container
Specialized subclass of drag_container that casts a shadow under the objects it drags while they are being dragged. This is done by drawing the child objects twice (when they are being dragged), once as a shadow using a shadow_drawable drawable object, and then again normally on top of that.
drag_container
,
shadow_caster
,
shadow_drawable
Field Summary | |
protected boolean |
_expensive_draw
Do we do expensive but realistic drawing of shadows for images, or do we just do their bounding rectangle? Default is to be cheap about it. |
protected int |
_x_offset
X offset for shadow |
protected int |
_y_offset
Y offset for shadow |
Fields inherited from class sub_arctic.lib.drag_container |
_callback_obj,
DO_BB_FEEDBACK,
DOING_DRAG,
END_MOVE_CALLBACK,
MOVE_CALLBACK |
Fields inherited from class sub_arctic.lib.shrink_wrap_container |
_border,
DRAW_BORDER |
Fields inherited from class sub_arctic.lib.base_interactor |
_child_index,
_child_list,
_clip_bounds,
_constraint_flags,
_enabled_constraint,
_flags,
_h,
_h_constraint,
_parent,
_part_a_constraint,
_part_b_constraint,
_user_data,
_visible_constraint,
_w,
_w_constraint,
_x,
_x_constraint,
_y,
_y_constraint,
default_child_hint |
Constructor Summary | |
shadow_drag_container(int x,
int y)
Constructor with default shadow offsets. |
|
shadow_drag_container(int x,
int y,
int shad_x_off,
int shad_y_off)
Full constructor. |
Method Summary | |
void |
damage_from_child(interactor originator,
java.lang.Object user_info,
java.awt.Point top_left,
java.awt.Dimension sz)
Catch damage from our children and make it bigger to account for the shadow. |
boolean |
drag_end(event evt,
int x_pos,
int y_pos,
int start_x,
int start_y,
int grab_x,
int grab_y,
java.lang.Object user_info)
Handle input corresponding to the end of a drag. |
boolean |
drag_feedback(event evt,
int x_pos,
int y_pos,
int st_x,
int st_y,
int grab_x,
int grab_y,
java.lang.Object user_info)
Handle a movement during a drag. |
boolean |
drag_start(event evt,
int x_pos,
int y_pos,
int grab_x,
int grab_y,
java.lang.Object user_info)
Handle the start of a drag to the object. |
protected void |
draw_self_local(drawable d)
Draw self. |
boolean |
expensive_draw()
Are currently doing expensive but realistic drawing shadows for images, or do are we just drawing their bounding rectangle? |
void |
set_expensive_draw(boolean v)
Set whether we draw image shadows realistically, but expensively (slow), or just draw their bounding rectangles (fast). |
void |
set_offset(int xoff,
int yoff)
Set offset for shadow |
void |
set_x_offset(int xoff)
Set x offset for shadow. |
void |
set_y_offset(int yoff)
Set y offset for shadow. |
int |
x_offset()
X offset for shadow. |
int |
y_offset()
Y offset for shadow. |
Methods inherited from class sub_arctic.lib.drag_container |
bounding_box_feedback,
callback_obj,
first_callback_num,
last_callback_num,
pick,
press,
release,
set_bounding_box_feedback,
set_callback_obj |
Methods inherited from class sub_arctic.lib.shrink_wrap_container |
border,
draw_border,
set_border,
set_draw_border,
setup_constraints |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean _expensive_draw
protected int _x_offset
protected int _y_offset
Constructor Detail |
public shadow_drag_container(int x, int y, int shad_x_off, int shad_y_off)
x
- x position of the container within its parent's coordsy
- y position of the container within its parent's coordsshad_x_offset
- offset of shadow in x directionshad_y_offset
- offset of shadow in y directionpublic shadow_drag_container(int x, int y)
x
- x position of the container within its parent's coordsy
- y position of the container within its parent's coordsMethod Detail |
public boolean expensive_draw()
public void set_expensive_draw(boolean v)
v
- true if we draw slow but realistic images, false if we draw fastpublic int x_offset()
public void set_x_offset(int xoff)
xoff
- the new x offsetpublic int y_offset()
public void set_y_offset(int yoff)
yoff
- the new y offsetpublic void set_offset(int xoff, int yoff)
xoff
- the new x offsetyoff
- the new y offsetpublic boolean drag_start(event evt, int x_pos, int y_pos, int grab_x, int grab_y, java.lang.Object user_info)
evt
- the event starting the dragx_pos
- x position of the drag (in parent's coordinates)y_pos
- y position of the drag (in parent's coordinates)grab_x
- x position where object was grabbed (in local coords)grab_y
- y position where object was grabbed (in local coords)user_info
- info object (originally passed to the focus agent)public boolean drag_feedback(event evt, int x_pos, int y_pos, int st_x, int st_y, int grab_x, int grab_y, java.lang.Object user_info)
evt
- the event starting the dragx_pos
- x position of the drag (in parent's coordinates)y_pos
- y position of the drag (in parent's coordinates)st_x
- starting x position of the drag (in parent's coords)st_y
- starting y position of the drag (in parent's coords)grab_x
- x position where object was grabbed (in local coords)grab_y
- y position where object was grabbed (in local coords)user_info
- info object (originally passed to the focus agent)public boolean drag_end(event evt, int x_pos, int y_pos, int start_x, int start_y, int grab_x, int grab_y, java.lang.Object user_info)
evt
- the event starting the dragx_pos
- x position of the drag (in parent's coordinates)y_pos
- y position of the drag (in parent's coordinates)st_x
- starting x position of the drag (in parent's coords)st_y
- starting y position of the drag (in parent's coords)grab_x
- x position where object was grabbed (in local coords)grab_y
- y position where object was grabbed (in local coords)user_info
- info object (originally passed to the focus agent)protected void draw_self_local(drawable d)
d
- the drawable object we are to draw on.public void damage_from_child(interactor originator, java.lang.Object user_info, java.awt.Point top_left, java.awt.Dimension sz)
interactor
- originator the interactor that caused the damage.Object
- user_info uninterpreted information supplied by
the originator at damage time.Point
- top_left top-left corner of child's damage area
(in our coordinate system).Dimension
- sz size of the damage area.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |