Changeset 1176 for trunk/src/org/expeditee/items/widgets
- Timestamp:
- 09/28/18 10:28:21 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/RubbishBin.java
r1102 r1176 11 11 12 12 /** 13 * When the Rubbish Bin Widget is clicked by any of the mouse buttons, 14 * whateveris currently being picked up by the mouse is destroyed.13 * When the Rubbish Bin Widget is clicked by any of the mouse buttons, whatever 14 * is currently being picked up by the mouse is destroyed. 15 15 * 16 16 * @author cts16 17 17 */ 18 public class RubbishBin extends ButtonWidget 19 { 20 public RubbishBin(Text source, String[] args) 21 { 18 public class RubbishBin extends ButtonWidget { 19 public RubbishBin(Text source, String[] args) { 22 20 super(80, "org/expeditee/assets/images/bin.svg", source, args); 23 21 24 clicked_.addActionListener(new ActionListener() 25 { 26 public void actionPerformed(ActionEvent e) 27 { 28 29 } 30 }); 22 clicked_.addActionListener(new ActionListener() { 23 @Override 24 public void actionPerformed(ActionEvent e) { 25 System.err.println("Rubbish Bin action performed"); 26 } 27 }); 31 28 } 32 33 public boolean ItemsLeftClickDropped()34 {35 // Find what the mouse was holding at the time and delete it29 30 @Override 31 public boolean ItemsLeftClickDropped() { 32 // Find what the mouse was holding at the time and delete it 36 33 Item freeItems = FreeItems.getItemAttachedToCursor(); 37 38 if (freeItems != null) {34 35 if (freeItems != null) { 39 36 freeItems.setParent(DisplayController.getCurrentFrame()); 40 37 41 38 try { 42 StandardGestureActions.delete(freeItems, null, null, false); 43 } catch (Exception e) {39 StandardGestureActions.delete(freeItems, null, null, false); 40 } catch (Exception e) { 44 41 e.printStackTrace(); 45 } 42 } 46 43 } 47 44 48 45 return true; 49 46 } 50 47 48 51 49 @Override 52 protected String[] getArgs() 53 { 50 protected String[] getArgs() { 54 51 // TODO Auto-generated method stub 55 52 return null; 56 53 } 57 54 58 55 /** 59 * This should be a generic method for any widget that is clicked while an item is being held. 56 * This should be a generic method for any widget that is clicked while an item 57 * is being held. 60 58 */ 61 public boolean itemHeldWhileClicked(Widget iw)62 {59 @Override 60 public boolean itemHeldWhileClicked(Widget iw) { 63 61 ItemsLeftClickDropped(); 64 62 65 63 return true; 66 64 } 67 68 public boolean getdropInteractableStatus()69 {65 66 @Override 67 public boolean getdropInteractableStatus() { 70 68 return true; 71 69 }
Note:
See TracChangeset
for help on using the changeset viewer.