From: <aki...@us...> - 2007-01-10 22:52:23
|
Revision: 1553 http://svn.sourceforge.net/gridarta/?rev=1553&view=rev Author: akirschbaum Date: 2007-01-10 14:52:20 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Unify selected square control code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-01-10 22:50:15 UTC (rev 1552) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2007-01-10 22:52:20 UTC (rev 1553) @@ -97,12 +97,6 @@ /** The amount of space to be left around the dialog borders. */ int DIALOG_INSETS = 4; - /** - * Two mouseclicks within 'DOUBLECLICK_MS' millisecs are considered a - * doubleclick. - */ - int DOUBLECLICK_MS = 300; - /** The Border object to be used when creating dialogs. */ Border DIALOG_BORDER = new EmptyBorder(new Insets(4, 4, 4, 4)); Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-10 22:50:15 UTC (rev 1552) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-10 22:52:20 UTC (rev 1553) @@ -59,14 +59,6 @@ private final CMainView mainView; - /** - * Time of last click in the panel (value in msec by Date.getTime()) - * and arch-ID of arch that received last click. - */ - private long lastClick = -1; - - private GameObject lastClickGameObject = null; - /** The view for this controller. */ private final SelectedSquareView view; @@ -97,15 +89,11 @@ @Override public void mousePressed(final MouseEvent e) { if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) { final long thisClick = (new Date()).getTime(); - if (thisClick - lastClick < IGUIConstants.DOUBLECLICK_MS && lastClickGameObject != null && lastClickGameObject == getMapTileSelection()) { + if (e.getClickCount() > 1) { // LMB Double click mainControl.openAttrDialog(getMapTileSelection()); } else { mainView.setMapArchPanelObject(getMapTileSelection()); } - - // save values for next click - lastClick = thisClick; - lastClickGameObject = getMapTileSelection(); } else if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) { insertGameObjectFromArchPanel(view.getListIndex(e)); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |