Skip to content

Commit

Permalink
Issue jawi#132: re-enable click-to-zoom again.
Browse files Browse the repository at this point in the history
- double clicking in the signal diagram zooms in;
- use alt or shift + double click to zoom out.
  • Loading branch information
Jan Willem Janssen committed Jan 26, 2013
1 parent 723ed58 commit b012503
Showing 1 changed file with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,35 @@ public void mouseClicked( final MouseEvent aEvent )
// Ensure the focus is moved to the main signal diagram component...
getSignalDiagram().requestFocusInWindow();

if ( getModel().isCursorMode() && ( aEvent.getClickCount() == 2 ) )
if ( aEvent.getClickCount() == 2 )
{
final MouseEvent event = convertEvent( aEvent );
MouseEvent event = convertEvent( aEvent );
Point point = event.getPoint();

if ( getModel().isCursorMode() )
{
final Cursor hoveredCursor = findCursor( point );
if ( hoveredCursor != null )
{
editCursorProperties( hoveredCursor );
// Consume the event to stop further processing...
aEvent.consume();
}
}

final Cursor hoveredCursor = findCursor( event.getPoint() );
if ( hoveredCursor != null )
// #132: Double clicking can mean a regular zoom event...
if ( !aEvent.isConsumed() )
{
editCursorProperties( hoveredCursor );
// Consume the event to stop further processing...
aEvent.consume();
if ( aEvent.isAltDown() || aEvent.isShiftDown() )
{
// Zoom out...
this.controller.getZoomController().zoomOut( point );
}
else
{
// Zoom in...
this.controller.getZoomController().zoomIn( point );
}
}
}
}
Expand Down

0 comments on commit b012503

Please sign in to comment.