Search in sources :

Example 1 with AnchorTarget

use of com.android.tools.idea.uibuilder.scene.target.AnchorTarget in project android by JetBrains.

the class SceneComponent method setExpandTargetArea.

public void setExpandTargetArea(boolean expandArea) {
    int count = myTargets.size();
    for (int i = 0; i < count; i++) {
        Target target = myTargets.get(i);
        if (target instanceof AnchorTarget) {
            AnchorTarget anchor = (AnchorTarget) target;
            anchor.setExpandSize(expandArea);
        }
    }
    myScene.needsRebuildList();
}
Also used : ResizeTarget(com.android.tools.idea.uibuilder.scene.target.ResizeTarget) DragDndTarget(com.android.tools.idea.uibuilder.scene.target.DragDndTarget) AnchorTarget(com.android.tools.idea.uibuilder.scene.target.AnchorTarget) Target(com.android.tools.idea.uibuilder.scene.target.Target) AnchorTarget(com.android.tools.idea.uibuilder.scene.target.AnchorTarget)

Example 2 with AnchorTarget

use of com.android.tools.idea.uibuilder.scene.target.AnchorTarget in project android by JetBrains.

the class SceneMouseInteraction method mouseRelease.

/**
   * Simulate releasing the mouse above the given anchor of the component
   * with the given componentId
   *
   * @param componentId the id of the component we will release the mouse above
   * @param type        the type of anchor we need to be above
   */
public void mouseRelease(String componentId, AnchorTarget.Type type) {
    SceneComponent component = myScene.getSceneComponent(componentId);
    if (component != null) {
        AnchorTarget target = component.getAnchorTarget(type);
        float x = target.getCenterX();
        float y = target.getCenterY();
        mouseRelease(x, y);
    }
}
Also used : AnchorTarget(com.android.tools.idea.uibuilder.scene.target.AnchorTarget)

Example 3 with AnchorTarget

use of com.android.tools.idea.uibuilder.scene.target.AnchorTarget in project android by JetBrains.

the class SceneMouseInteraction method mouseDown.

/**
   * Simulate a click on a given anchor of the component with componentId
   *
   * @param componentId the id of the component we want to click on
   * @param type        the type of anchor we want to click on
   */
public void mouseDown(String componentId, AnchorTarget.Type type) {
    SceneComponent component = myScene.getSceneComponent(componentId);
    if (component != null) {
        AnchorTarget target = component.getAnchorTarget(type);
        mouseDown(target.getCenterX(), target.getCenterY());
    }
}
Also used : AnchorTarget(com.android.tools.idea.uibuilder.scene.target.AnchorTarget)

Aggregations

AnchorTarget (com.android.tools.idea.uibuilder.scene.target.AnchorTarget)3 DragDndTarget (com.android.tools.idea.uibuilder.scene.target.DragDndTarget)1 ResizeTarget (com.android.tools.idea.uibuilder.scene.target.ResizeTarget)1 Target (com.android.tools.idea.uibuilder.scene.target.Target)1