Search in sources :

Example 6 with NlGraphics

use of com.android.tools.idea.uibuilder.graphics.NlGraphics in project android by JetBrains.

the class PreferenceScreenDragHandlerTest method drawDropZoneLinesPointerIsBetweenSecondAndThirdChildren.

@Test
public void drawDropZoneLinesPointerIsBetweenSecondAndThirdChildren() {
    PreferenceGroupDragHandler handler = newPreferenceScreenDragHandler(newPreferenceScreen());
    NlGraphics graphics = Mockito.mock(NlGraphics.class);
    handler.update(360, 606, 0);
    handler.drawDropZoneLines(graphics);
    List<NlComponent> preferences = handler.myGroup.getChildren();
    Mockito.verify(graphics).drawTop(preferences.get(0));
    Mockito.verify(graphics).drawTop(preferences.get(1));
}
Also used : NlGraphics(com.android.tools.idea.uibuilder.graphics.NlGraphics) NlComponent(com.android.tools.idea.uibuilder.model.NlComponent) Test(org.junit.Test)

Example 7 with NlGraphics

use of com.android.tools.idea.uibuilder.graphics.NlGraphics in project android by JetBrains.

the class PreferenceScreenDragHandlerTest method drawDropRecipientLines.

@Test
public void drawDropRecipientLines() {
    PreferenceGroupDragHandler handler = newPreferenceScreenDragHandler(newPreferenceScreen());
    NlGraphics graphics = Mockito.mock(NlGraphics.class);
    handler.update(360, 502, 0);
    handler.drawDropRecipientLines(graphics);
    Rectangle bounds = new Rectangle(0, 332, 768, 379);
    Mockito.verify(graphics).drawTop(bounds);
    Mockito.verify(graphics).drawLeft(bounds);
    Mockito.verify(graphics).drawRight(bounds);
    Mockito.verify(graphics).drawBottom(bounds);
}
Also used : NlGraphics(com.android.tools.idea.uibuilder.graphics.NlGraphics) Test(org.junit.Test)

Example 8 with NlGraphics

use of com.android.tools.idea.uibuilder.graphics.NlGraphics in project android by JetBrains.

the class PreferenceScreenDragHandlerTest method drawDropZoneLinesPointerIsBetweenFirstAndSecondChildren.

@Test
public void drawDropZoneLinesPointerIsBetweenFirstAndSecondChildren() {
    PreferenceGroupDragHandler handler = newPreferenceScreenDragHandler(newPreferenceScreen());
    NlGraphics graphics = Mockito.mock(NlGraphics.class);
    handler.update(360, 502, 0);
    handler.drawDropZoneLines(graphics);
    List<NlComponent> preferences = handler.myGroup.getChildren();
    Mockito.verify(graphics).drawTop(preferences.get(0));
    Mockito.verify(graphics).drawTop(preferences.get(2));
}
Also used : NlGraphics(com.android.tools.idea.uibuilder.graphics.NlGraphics) NlComponent(com.android.tools.idea.uibuilder.model.NlComponent) Test(org.junit.Test)

Aggregations

NlGraphics (com.android.tools.idea.uibuilder.graphics.NlGraphics)8 NlComponent (com.android.tools.idea.uibuilder.model.NlComponent)6 Test (org.junit.Test)4 AndroidCoordinate (com.android.tools.idea.uibuilder.model.AndroidCoordinate)3 NotNull (org.jetbrains.annotations.NotNull)3 Nullable (org.jetbrains.annotations.Nullable)3 com.android.tools.idea.uibuilder.api (com.android.tools.idea.uibuilder.api)1 SegmentType (com.android.tools.idea.uibuilder.model.SegmentType)1 TextDirection (com.android.tools.idea.uibuilder.model.TextDirection)1 ScreenView (com.android.tools.idea.uibuilder.surface.ScreenView)1 Lists (com.google.common.collect.Lists)1 java.awt (java.awt)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1