org.grinvin.gred.mouse

Class SelectElements


public class SelectElements
extends NullMouseHandler

Mouse handler which allows changing the selection by clicking on elements in a GraphPanel. Consumes all first button click events on a vertex or edge.

Method Summary

@Override
boolean canHandle(JComponent parent)
This mouse handler needs a GraphPanel as parent.
static SelectElements
getHandler()
Return the singleton object of this type.
@Override
void doMouseClicked(JComponent parent, MouseEvent mouseEvent)
Sets the selection to the current element or toggles the current element when 'Control' is down.

Method Details

boolean canHandle

public @Override boolean canHandle(JComponent parent)

getHandler

public static SelectElements getHandler()
Return the singleton object of this type.

void doMouseClicked

public @Override void doMouseClicked(JComponent parent,
                                     MouseEvent mouseEvent)
Sets the selection to the current element or toggles the current element when 'Control' is down.