Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > IDragStrategy
Interfejs IDragStrategy
Podpis:
export interface IDragStrategy
Metody
Metoda |
Opis |
drag(newLoc, e) |
Obsługuje przenoszenie elementów do nowej lokalizacji i aktualizowanie na tej podstawie wszelkich elementów wizualnych (np.podglądów połączeń w przypadku bloków). |
endDrag(e) |
Obsługuje wszystkie przeciąganie, w tym m.in. łącząc lub usuwając bloki. |
isMovable() |
Zwraca wartość Prawda, jeśli element jest obecnie przenośny. |
revertDrag() |
Przenosi element przesuwany z powrotem do miejsca, w którym znajdował się na początku przeciągania. |
startDrag(e) |
Obsługuje każde uruchomienie przeciągania (np.przenoszenie elementów na przód obszaru roboczego). |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-12 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2024-09-12 UTC."],[[["The `IDragStrategy` interface defines methods for managing the dragging behavior of elements, such as blocks, within a Blockly workspace."],["It includes methods for initiating, handling, and concluding drag operations, as well as reverting to the original position if necessary."],["The interface handles visual updates during the drag, like connection previews, and ensures elements are moved and cleaned up appropriately."],["`IDragStrategy` determines the movability of elements and enables the execution of specific actions based on drag events."]]],["The `IDragStrategy` interface defines methods for managing drag operations. Key actions include: `drag`, which moves elements and updates visuals; `endDrag`, which finalizes the drag, connecting or deleting elements; `startDrag`, which initiates the drag; `revertDrag`, which returns elements to their original position; and `isMovable`, which checks if an element can be moved. These methods collectively control the lifecycle and behavior of draggable elements within the system.\n"]]