|
26 | 26 | import com.techsenger.shellfx.core.tab.TabFxView; |
27 | 27 | import static com.techsenger.shellfx.layout.dockhost.DockConstants.ONE_HALF; |
28 | 28 | import static com.techsenger.shellfx.layout.dockhost.DockConstants.ONE_THIRD; |
| 29 | +import com.techsenger.shellfx.layout.dockhost.DockHostFxView.Composer; |
29 | 30 | import com.techsenger.shellfx.layout.style.LayoutIcons; |
30 | 31 | import com.techsenger.shellfx.layout.tabhost.TabHostFxView; |
31 | 32 | import com.techsenger.shellfx.material.icon.FontIconView; |
32 | 33 | import com.techsenger.tabpanepro.core.TabPanePro; |
33 | 34 | import com.techsenger.tabpanepro.core.skin.DragAndDropContext; |
| 35 | +import com.techsenger.tabpanepro.core.skin.DragAndDropUtils; |
34 | 36 | import com.techsenger.tabpanepro.core.skin.TabPaneProSkin; |
35 | 37 | import com.techsenger.tabpanepro.core.skin.TabPaneProSkin.TabHeaderArea; |
36 | 38 | import com.techsenger.toolkit.core.Pair; |
|
84 | 86 | import javafx.scene.layout.StackPane; |
85 | 87 | import javafx.scene.layout.VBox; |
86 | 88 | import javafx.scene.shape.Rectangle; |
87 | | -import javafx.scene.transform.Rotate; |
88 | 89 | import javafx.stage.Popup; |
89 | 90 | import org.slf4j.Logger; |
90 | 91 | import org.slf4j.LoggerFactory; |
@@ -197,17 +198,7 @@ public DragAndDropHandler(DockHostFxView<?> dockHost) { |
197 | 198 | } |
198 | 199 |
|
199 | 200 | protected Node createTabDragContent(TabPaneProSkin.TabHeaderSkin tabHeader) { |
200 | | - var tabParams = new SnapshotParameters(); |
201 | | - WritableImage tabImage = tabHeader.snapshot(tabParams, null); |
202 | | - ImageView dragView = new ImageView(tabImage); |
203 | | - var tab = tabHeader.getContext().getTab(); |
204 | | - if (tab.getTabPane().getSide() == Side.BOTTOM) { |
205 | | - Rotate rotate = new Rotate(180, tabImage.getWidth() / 2, tabImage.getHeight() / 2); |
206 | | - dragView.getTransforms().add(rotate); |
207 | | - } |
208 | | - var container = new VBox(dragView); |
209 | | - //container.getStyleClass().add("tab-drag-content"); |
210 | | - return container; |
| 201 | + return DragAndDropUtils.createTabDragContent(tabHeader); |
211 | 202 | } |
212 | 203 |
|
213 | 204 | protected Node createTabDockDragContent(TabPaneProSkin.TabHeaderArea tabHeaderArea) { |
@@ -3065,7 +3056,7 @@ private ReadOnlyObjectWrapper<SideBarFxView<?>> resolveBarWrapper(Side side) { |
3065 | 3056 | */ |
3066 | 3057 | private final BorderPane node = new BorderPane(); |
3067 | 3058 |
|
3068 | | - private final DragAndDropContext dragAndDropContext = new DragAndDropContext(); |
| 3059 | + private final DragAndDropContext dragAndDropContext = createDragAndDropContext(); |
3069 | 3060 |
|
3070 | 3061 | private final Transformer transformer = new Transformer(this); |
3071 | 3062 |
|
@@ -3106,6 +3097,13 @@ protected DragAndDropHandler createDragAndDropHandler() { |
3106 | 3097 | return new DragAndDropHandler(this); |
3107 | 3098 | } |
3108 | 3099 |
|
| 3100 | + /** |
| 3101 | + * Creates the {@code DragAndDropContext} used by this {@link DockHostFxView}. |
| 3102 | + */ |
| 3103 | + protected DragAndDropContext createDragAndDropContext() { |
| 3104 | + return new DragAndDropContext(); |
| 3105 | + } |
| 3106 | + |
3109 | 3107 | @Override |
3110 | 3108 | protected void build() { |
3111 | 3109 | super.build(); |
|
0 commit comments