path.append(new Rectangle(width, height), false);
return path;
}
});
MapMouseEvent event=new MapMouseEvent( null, 0,0, MapMouseEvent.NONE,
MapMouseEvent.BUTTON1, MapMouseEvent.BUTTON1);
assertTrue(behav.isValid(handler, event, EventType.DRAGGED));
//released no legal
event=new MapMouseEvent( null, 0,0, MapMouseEvent.NONE,
MapMouseEvent.BUTTON1, MapMouseEvent.BUTTON1);
assertFalse(behav.isValid(handler, event, EventType.RELEASED));
// must be mouse button 1
event=new MapMouseEvent( null, 0,0, MapMouseEvent.NONE,
MapMouseEvent.BUTTON2, MapMouseEvent.BUTTON1);
assertFalse(behav.isValid(handler, event, EventType.DRAGGED));
// cannot be Modify state
handler.setCurrentState(EditState.MODIFYING);
event=new MapMouseEvent( null, 0,0, MapMouseEvent.NONE,
MapMouseEvent.BUTTON1, MapMouseEvent.BUTTON1);
assertFalse(behav.isValid(handler, event, EventType.DRAGGED));
// cannot be creating state
handler.setCurrentState(EditState.CREATING);
event=new MapMouseEvent( null, 0,0, MapMouseEvent.NONE,
MapMouseEvent.BUTTON1, MapMouseEvent.BUTTON1);
assertFalse(behav.isValid(handler, event, EventType.DRAGGED));
// make sure state is good
handler.setCurrentState(EditState.NONE);
event=new MapMouseEvent( null, 0,0, MapMouseEvent.NONE,
MapMouseEvent.BUTTON1, MapMouseEvent.BUTTON1);
assertTrue(behav.isValid(handler, event, EventType.DRAGGED));
// Alt down is not legal
handler.setCurrentState(EditState.NONE);
event=new MapMouseEvent( null, 0,0, MapMouseEvent.ALT_DOWN_MASK,
MapMouseEvent.BUTTON2, MapMouseEvent.BUTTON1);
assertFalse(behav.isValid(handler, event, EventType.DRAGGED));
}