Search in sources :

Example 1 with TypicalCaseListener

use of com.cas.sim.tis.app.listener.TypicalCaseListener in project TeachingInSimulation by ScOrPiOzzy.

the class TypicalCaseState method bindEvents.

private void bindEvents() {
    listener = new TypicalCaseListener(this);
    listener.registerWithInput(inputManager);
    addListener(desktop, new MouseEventAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (elecComp == null) {
                return;
            }
            // moved_before_putdown = false;
            putDown();
            super.mouseClicked(e);
        }

        @Override
        public void mouseRightClicked(MouseEvent e) {
            if (holding == null) {
                return;
            }
            holding.removeFromParent();
            holding = null;
            elecComp = null;
            cameraState.setZoomEnable(true);
            super.mouseRightClicked(e);
        }
    });
}
Also used : TypicalCaseListener(com.cas.sim.tis.app.listener.TypicalCaseListener) MouseEvent(com.cas.sim.tis.app.event.MouseEvent) MouseEventAdapter(com.cas.sim.tis.app.event.MouseEventAdapter)

Aggregations

MouseEvent (com.cas.sim.tis.app.event.MouseEvent)1 MouseEventAdapter (com.cas.sim.tis.app.event.MouseEventAdapter)1 TypicalCaseListener (com.cas.sim.tis.app.listener.TypicalCaseListener)1