/** * Sets whether or not the user can drag images. When set to true the user can * drag the photo around with their mouse. Also the cursor will be set to the * 'hand' cursor. When set to false the user cannot drag photos around * and the cursor will be set to the default. * @param editable whether or not the user can drag images */ public void setEditable(boolean editable) { boolean old = isEditable(); this.editable = editable; if(editable) { addMouseMotionListener(moveHandler); addMouseListener(moveHandler); this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); try { this.setTransferHandler(new DnDHandler()); } catch (ClassNotFoundException ex) { ex.printStackTrace(); fireError(ex); } } else { removeMouseMotionListener(moveHandler); removeMouseListener(moveHandler); this.setCursor(Cursor.getDefaultCursor()); setTransferHandler(null); } firePropertyChange("editable", old, isEditable()); }
/** * Sets whether or not the user can drag images. When set to true the user can * drag the photo around with their mouse. Also the cursor will be set to the * 'hand' cursor. When set to false the user cannot drag photos around * and the cursor will be set to the default. * @param editable whether or not the user can drag images */ public void setEditable(boolean editable) { boolean old = isEditable(); this.editable = editable; if(editable) { addMouseMotionListener(moveHandler); addMouseListener(moveHandler); this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); try { this.setTransferHandler(new DnDHandler()); } catch (ClassNotFoundException ex) { ex.printStackTrace(); fireError(ex); } } else { removeMouseMotionListener(moveHandler); removeMouseListener(moveHandler); this.setCursor(Cursor.getDefaultCursor()); setTransferHandler(null); } firePropertyChange("editable", old, isEditable()); }
/** * Sets whether or not the user can drag images. When set to true the user can * drag the photo around with their mouse. Also the cursor will be set to the * 'hand' cursor. When set to false the user cannot drag photos around * and the cursor will be set to the default. * @param editable whether or not the user can drag images */ public void setEditable(boolean editable) { boolean old = isEditable(); this.editable = editable; if(editable) { addMouseMotionListener(moveHandler); addMouseListener(moveHandler); this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); try { this.setTransferHandler(new DnDHandler()); } catch (ClassNotFoundException ex) { ex.printStackTrace(); fireError(ex); } } else { removeMouseMotionListener(moveHandler); removeMouseListener(moveHandler); this.setCursor(Cursor.getDefaultCursor()); setTransferHandler(null); } firePropertyChange("editable", old, isEditable()); }
/** * Sets whether or not the user can drag images. When set to true the user can * drag the photo around with their mouse. Also the cursor will be set to the * 'hand' cursor. When set to false the user cannot drag photos around * and the cursor will be set to the default. * @param editable whether or not the user can drag images */ public void setEditable(boolean editable) { boolean old = isEditable(); this.editable = editable; if(editable) { addMouseMotionListener(moveHandler); addMouseListener(moveHandler); this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); try { this.setTransferHandler(new DnDHandler()); } catch (ClassNotFoundException ex) { ex.printStackTrace(); fireError(ex); } } else { removeMouseMotionListener(moveHandler); removeMouseListener(moveHandler); this.setCursor(Cursor.getDefaultCursor()); setTransferHandler(null); } firePropertyChange("editable", old, isEditable()); }
/** * Sets whether or not the user can drag images. When set to true the user can * drag the photo around with their mouse. Also the cursor will be set to the * 'hand' cursor. When set to false the user cannot drag photos around * and the cursor will be set to the default. * @param editable whether or not the user can drag images */ public void setEditable(boolean editable) { boolean old = isEditable(); this.editable = editable; if(editable) { addMouseMotionListener(moveHandler); addMouseListener(moveHandler); this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); try { this.setTransferHandler(new DnDHandler()); } catch (ClassNotFoundException ex) { ex.printStackTrace(); fireError(ex); } } else { removeMouseMotionListener(moveHandler); removeMouseListener(moveHandler); this.setCursor(Cursor.getDefaultCursor()); setTransferHandler(null); } firePropertyChange("editable", old, isEditable()); }