use of com.android.tools.idea.uibuilder.surface.DesignSurface in project android by JetBrains.
the class Display method draw.
public void draw(@NotNull SceneContext sceneContext, @NotNull Graphics2D g, @NotNull Scene scene) {
mTime = System.currentTimeMillis();
if (scene.getNeedsDisplayListRebuilt()) {
myNeedsDisplayListRebuild = true;
}
if (sceneContext.getScale() != myScale) {
myScale = sceneContext.getScale();
myNeedsDisplayListRebuild = true;
}
myNeedsDisplayListRebuild |= myDisplayList.getCommands().size() == 0;
if (myNeedsDisplayListRebuild) {
myDisplayList.clear();
myNeedsDisplayListRebuild = scene.buildDisplayList(myDisplayList, mTime, sceneContext);
scene.clearNeedsRebuildList();
}
if (ConstraintLayoutHandler.USE_SCENE_INTERACTION) {
draw(sceneContext, g, myDisplayList);
}
if (myNeedsDisplayListRebuild) {
DesignSurface designSurface = sceneContext.getSurface();
if (designSurface != null) {
designSurface.repaint();
}
}
}
use of com.android.tools.idea.uibuilder.surface.DesignSurface in project android by JetBrains.
the class NlPalettePanelTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
Configuration configuration = mock(Configuration.class);
when(configuration.getModule()).thenReturn(myModule);
DesignSurface surface = mock(DesignSurface.class);
when(surface.getLayoutType()).thenReturn(NlLayoutType.LAYOUT);
when(surface.getConfiguration()).thenReturn(configuration);
myCopyPasteManager = mock(CopyPasteManager.class);
myPanel = new NlPalettePanel(getProject(), surface, myCopyPasteManager);
}
Aggregations