Package gov.nasa.arc.mct.gui.View

Examples of gov.nasa.arc.mct.gui.View.GlassPanel


       
        // Verify control manifestation is wrapped
        JComponent controlManifestation = manifestation.getControlManifestation();
        Assert.assertTrue(controlManifestation instanceof ControlWrapper);
        ControlWrapper controlWrapper = (ControlWrapper) controlManifestation;
        GlassPanel controlGlass = controlWrapper.getGlassPanel();
        manifestation.exitLockedState();
        Assert.assertTrue(controlGlass.getMouseListeners().length > 0);
        Assert.assertTrue(controlGlass.getKeyListeners().length > 0);
       
        // Verify that the input listeners are removed when the glass panel is turned off
        manifestation.enterLockedState();
        Assert.assertEquals(controlGlass.getMouseListeners().length, 0);
        Assert.assertEquals(controlGlass.getKeyListeners().length, 0);

        manifestation.exitLockedState();
        Graphics mockGraphics = Mockito.mock(Graphics.class);
        Rectangle rectangle = new Rectangle();
        Mockito.when(mockGraphics.getClipBounds()).thenReturn(rectangle);
        controlGlass.paintComponent(mockGraphics);
        Mockito.verify(mockGraphics).setColor(Mockito.any(Color.class));
        Mockito.verify(mockGraphics).fillRect(0, 0, 0, 0);
       
        // now check that we don't use the graphics context when we are in transparent mode
        manifestation.enterLockedState();
        Graphics mockGraphics2 = Mockito.mock(Graphics.class);
        controlGlass.paintComponent(mockGraphics2);
        Mockito.verifyNoMoreInteractions(mockGraphics2);
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.gui.View.GlassPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.