use of com.android.tools.idea.uibuilder.surface.ScreenView in project android by JetBrains.
the class SelectParentAction method update.
@Override
public void update(AnActionEvent e) {
boolean enabled;
ScreenView screenView = mySurface.getCurrentScreenView();
if (screenView != null) {
List<NlComponent> selection = screenView.getSelectionModel().getSelection();
enabled = selection.size() == 1 && !selection.get(0).isRoot();
} else {
enabled = false;
}
e.getPresentation().setEnabled(enabled);
}
use of com.android.tools.idea.uibuilder.surface.ScreenView in project android by JetBrains.
the class CoordinatesTest method testSwingToAndroid.
public void testSwingToAndroid() {
ScreenView screenView = createScreenView(0.5, 100, 110);
assertEquals(0, Coordinates.getAndroidX(screenView, 100));
assertEquals(0, Coordinates.getAndroidY(screenView, 110));
assertEquals(1000, Coordinates.getAndroidX(screenView, 100 + 500));
assertEquals(1000, Coordinates.getAndroidY(screenView, 110 + 500));
assertEquals(1000, Coordinates.getAndroidDimension(screenView, 500));
}
Aggregations