From 34ea20eedd818f71ca96249aed4f6b9d4701b83b Mon Sep 17 00:00:00 2001 From: Branislav Stojkovic Date: Sat, 2 Feb 2019 12:18:37 +0100 Subject: [PATCH] Ability to drag components directly from the tree to the canvas for faster process --- .../src/org/diylc/common/IPlugInPort.java | 5 +- .../diylc/presenter/InstantiationManager.java | 4 +- .../src/org/diylc/presenter/Presenter.java | 92 +++++++++++-------- .../swing/plugins/canvas/CanvasPanel.java | 6 +- .../swing/plugins/statusbar/StatusBar.java | 91 +++++++++--------- .../toolbox/ComponentButtonFactory.java | 6 +- .../plugins/toolbox/ComponentTabbedPane.java | 2 +- .../plugins/tree/TreeGestureListener.java | 64 +++++++++++++ .../diylc/swing/plugins/tree/TreePanel.java | 16 +++- .../plugins/tree/TreeSourceListener.java | 68 ++++++++++++++ diylc/diylc-swing/update.xml | 6 +- 11 files changed, 261 insertions(+), 99 deletions(-) create mode 100644 diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java create mode 100644 diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeSourceListener.java diff --git a/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java b/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java index cb1e9b21..356dec3a 100644 --- a/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java +++ b/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java @@ -278,9 +278,10 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP * component. * * @param componentType - * @param template + * @param template + * @param forceInstatiate */ - void setNewComponentTypeSlot(ComponentType componentType, Template template); + void setNewComponentTypeSlot(ComponentType componentType, Template template, boolean forceInstatiate); /** * Changes default size notation, true for metric, false for imperial. diff --git a/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java b/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java index 341159f3..fa608110 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java +++ b/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java @@ -94,7 +94,7 @@ public class InstantiationManager { this.potentialControlPoint = potentialControlPoint; } - public void setComponentTypeSlot(ComponentType componentTypeSlot, Template template, Project currentProject) + public void setComponentTypeSlot(ComponentType componentTypeSlot, Template template, Project currentProject, boolean forceInstatiate) throws Exception { this.componentTypeSlot = componentTypeSlot; this.template = template; @@ -103,7 +103,7 @@ public class InstantiationManager { } else { switch (componentTypeSlot.getCreationMethod()) { case POINT_BY_POINT: - this.componentSlot = null; + this.componentSlot = forceInstatiate ? instantiateComponent(componentTypeSlot, template, new Point(0, 0), currentProject) : null; break; case SINGLE_CLICK: this.componentSlot = instantiateComponent(componentTypeSlot, template, new Point(0, 0), currentProject); diff --git a/diylc/diylc-core/src/org/diylc/presenter/Presenter.java b/diylc/diylc-core/src/org/diylc/presenter/Presenter.java index 9c58b497..eaed37ce 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/Presenter.java +++ b/diylc/diylc-core/src/org/diylc/presenter/Presenter.java @@ -97,7 +97,7 @@ public class Presenter implements IPlugInPort { List allVersions = (List) xStream.fromXML(in); CURRENT_VERSION = allVersions.get(allVersions.size() - 1).getVersionNumber(); LOG.info("Current DIYLC version: " + CURRENT_VERSION); - RECENT_VERSIONS = allVersions.subList(allVersions.size() - 3, allVersions.size()); + RECENT_VERSIONS = allVersions.subList(allVersions.size() - 10, allVersions.size()); Collections.sort(RECENT_VERSIONS, new Comparator() { @Override @@ -571,9 +571,9 @@ public class Presenter implements IPlugInPort { editSelection(); } if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.CONTINUOUS_CREATION_KEY, false)) { - setNewComponentTypeSlot(componentTypeSlot, template); + setNewComponentTypeSlot(componentTypeSlot, template, false); } else { - setNewComponentTypeSlot(null, null); + setNewComponentTypeSlot(null, null, false); } break; case POINT_BY_POINT: @@ -595,33 +595,7 @@ public class Presenter implements IPlugInPort { } else { // On the second click, add the component to the // project. - List> componentSlot = instantiationManager.getComponentSlot(); - Point firstPoint = componentSlot.get(0).getControlPoint(0); - // don't allow to create component with the same points - if (scaledPoint.equals(firstPoint)) - return; - componentSlot.get(0).setControlPoint(scaledPoint, 1); - List> newSelection = new ArrayList>(); - for (IDIYComponent component : componentSlot) { - addComponent(component, true); - // Select the new component if it's not locked and invisible. - if (!isComponentLocked(component) && isComponentVisible(component)) { - newSelection.add(component); - } - } - - updateSelection(newSelection); - messageDispatcher.dispatchMessage(EventType.REPAINT); - - if (componentTypeSlot.isAutoEdit() - && ConfigurationManager.getInstance().readBoolean(IPlugInPort.AUTO_EDIT_KEY, false)) { - editSelection(); - } - if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.CONTINUOUS_CREATION_KEY, false)) { - setNewComponentTypeSlot(componentTypeSlot, template); - } else { - setNewComponentTypeSlot(null, null); - } + addPendingComponentsToProject(scaledPoint, componentTypeSlot, template); } break; default: @@ -675,6 +649,36 @@ public class Presenter implements IPlugInPort { } } + private void addPendingComponentsToProject(Point scaledPoint, ComponentType componentTypeSlot, Template template) { + List> componentSlot = instantiationManager.getComponentSlot(); + Point firstPoint = componentSlot.get(0).getControlPoint(0); + // don't allow to create component with the same points + if (scaledPoint == null || scaledPoint.equals(firstPoint)) + return; +// componentSlot.get(0).setControlPoint(scaledPoint, 1); + List> newSelection = new ArrayList>(); + for (IDIYComponent component : componentSlot) { + addComponent(component, true); + // Select the new component if it's not locked and invisible. + if (!isComponentLocked(component) && isComponentVisible(component)) { + newSelection.add(component); + } + } + + updateSelection(newSelection); + messageDispatcher.dispatchMessage(EventType.REPAINT); + + if (componentTypeSlot.isAutoEdit() + && ConfigurationManager.getInstance().readBoolean(IPlugInPort.AUTO_EDIT_KEY, false)) { + editSelection(); + } + if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.CONTINUOUS_CREATION_KEY, false)) { + setNewComponentTypeSlot(componentTypeSlot, template, false); + } else { + setNewComponentTypeSlot(null, null, false); + } + } + @Override public boolean keyPressed(int key, boolean ctrlDown, boolean shiftDown, boolean altDown) { if (key != VK_DOWN && key != VK_LEFT && key != VK_UP && key != VK_RIGHT && key != IKeyProcessor.VK_H @@ -1162,6 +1166,10 @@ public class Presenter implements IPlugInPort { } // messageDispatcher.dispatchMessage(EventType.SELECTION_RECT_CHANGED, // selectionRect); + } else if (instantiationManager.getComponentSlot() != null) { + this.previousScaledPoint = scalePoint(point); + instantiationManager.updateSingleClick(previousScaledPoint, isSnapToGrid(), + currentProject.getGridSpacing()); } messageDispatcher.dispatchMessage(EventType.REPAINT); return true; @@ -1448,10 +1456,15 @@ public class Presenter implements IPlugInPort { @Override public void dragEnded(Point point) { LOG.debug(String.format("dragEnded(%s)", point)); - if (!dragInProgress) { - return; - } + Point scaledPoint = scalePoint(point); + + if (!dragInProgress) { + if (instantiationManager.getComponentSlot() != null) + addPendingComponentsToProject(scaledPoint, instantiationManager.getComponentTypeSlot(), null); + return; + } + if (selectedComponents.isEmpty()) { // If there's no selection finalize selectionRect and see which // components intersect with it. @@ -2113,11 +2126,11 @@ public class Presenter implements IPlugInPort { } @Override - public void setNewComponentTypeSlot(ComponentType componentType, Template template) { + public void setNewComponentTypeSlot(ComponentType componentType, Template template, boolean forceInstatiate) { LOG.info(String.format("setNewComponentSlot(%s)", componentType == null ? null : componentType.getName())); if (componentType != null && componentType.getInstanceClass() == null) { LOG.info("Cannot set new component type slot for type " + componentType.getName()); - setNewComponentTypeSlot(null, null); + setNewComponentTypeSlot(null, null, false); return; } @@ -2135,10 +2148,13 @@ public class Presenter implements IPlugInPort { } try { - instantiationManager.setComponentTypeSlot(componentType, template, currentProject); - if (componentType != null) { + instantiationManager.setComponentTypeSlot(componentType, template, currentProject, forceInstatiate); + + if (forceInstatiate) + updateSelection(instantiationManager.getComponentSlot()); + else if (componentType != null) updateSelection(EMPTY_SELECTION); - } + messageDispatcher.dispatchMessage(EventType.REPAINT); // messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED, // selectedComponents); diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java index e5ee7d99..d4fc4f47 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java @@ -148,7 +148,7 @@ public class CanvasPanel extends JComponent implements Autoscroll { @Override public void actionPerformed(ActionEvent e) { - CanvasPanel.this.plugInPort.setNewComponentTypeSlot(null, null); + CanvasPanel.this.plugInPort.setNewComponentTypeSlot(null, null, false); } }); @@ -167,7 +167,7 @@ public class CanvasPanel extends JComponent implements Autoscroll { for (Map.Entry> entry : componentTypes.entrySet()) { for (ComponentType type : entry.getValue()) { if (type.getInstanceClass().getCanonicalName().equals(clazz)) { - CanvasPanel.this.plugInPort.setNewComponentTypeSlot(type, null); + CanvasPanel.this.plugInPort.setNewComponentTypeSlot(type, null, false); // hack: fake mouse movement to repaint CanvasPanel.this.plugInPort.mouseMoved(getMousePosition(), false, false, false); return; @@ -201,7 +201,7 @@ public class CanvasPanel extends JComponent implements Autoscroll { LOG.error("Could not find type: " + typeName); return; } - this.plugInPort.setNewComponentTypeSlot(type, null); + this.plugInPort.setNewComponentTypeSlot(type, null, false); } // hack: fake mouse movement to repaint diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/statusbar/StatusBar.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/statusbar/StatusBar.java index 3a6fcd72..6613c87d 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/statusbar/StatusBar.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/statusbar/StatusBar.java @@ -21,58 +21,57 @@ */ package org.diylc.swing.plugins.statusbar; -import java.awt.BorderLayout; -import java.awt.Cursor; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.geom.Point2D; -import java.text.DecimalFormat; -import java.text.Format; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.List; -import java.util.Map; +import java.awt.BorderLayout; +import java.awt.Cursor; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; +import java.text.DecimalFormat; +import java.text.Format; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.List; +import java.util.Map; -import javax.swing.BorderFactory; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; +import javax.swing.BorderFactory; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; -import net.java.balloontip.BalloonTip; -import net.java.balloontip.styles.EdgedBalloonStyle; +import net.java.balloontip.BalloonTip; +import net.java.balloontip.styles.EdgedBalloonStyle; -import org.apache.log4j.Logger; -import org.diylc.announcements.AnnouncementProvider; -import org.diylc.appframework.miscutils.Utils; +import org.apache.log4j.Logger; +import org.diylc.announcements.AnnouncementProvider; +import org.diylc.appframework.miscutils.Utils; import org.diylc.appframework.update.UpdateChecker; import org.diylc.appframework.update.Version; -import org.diylc.common.BadPositionException; -import org.diylc.common.ComponentType; -import org.diylc.common.EventType; -import org.diylc.common.IPlugIn; -import org.diylc.common.IPlugInPort; -import org.diylc.common.ITask; -import org.diylc.core.IDIYComponent; -import org.diylc.core.IView; -import org.diylc.images.IconLoader; -import org.diylc.swing.ISwingUI; -import org.diylc.swingframework.MemoryBar; -import org.diylc.swingframework.miscutils.PercentageListCellRenderer; +import org.diylc.common.BadPositionException; +import org.diylc.common.ComponentType; +import org.diylc.common.EventType; +import org.diylc.common.IPlugIn; +import org.diylc.common.IPlugInPort; +import org.diylc.common.ITask; +import org.diylc.core.IDIYComponent; +import org.diylc.core.IView; +import org.diylc.images.IconLoader; +import org.diylc.swing.ISwingUI; +import org.diylc.swingframework.MemoryBar; +import org.diylc.swingframework.miscutils.PercentageListCellRenderer; import org.diylc.swingframework.update.UpdateDialog; -import org.diylc.swingframework.update.UpdateLabel; +import org.diylc.swingframework.update.UpdateLabel; public class StatusBar extends JPanel implements IPlugIn { diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java index 81b0c782..8e0e28b4 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java @@ -69,7 +69,7 @@ public class ComponentButtonFactory { @Override public void actionPerformed(ActionEvent e) { - plugInPort.setNewComponentTypeSlot(componentType, null); + plugInPort.setNewComponentTypeSlot(componentType, null, false); } }); @@ -90,7 +90,7 @@ public class ComponentButtonFactory { newSelection.addAll(plugInPort.getSelectedComponents()); } plugInPort.updateSelection(newSelection); - plugInPort.setNewComponentTypeSlot(null, null); + plugInPort.setNewComponentTypeSlot(null, null, false); plugInPort.refresh(); } } @@ -122,7 +122,7 @@ public class ComponentButtonFactory { @Override public void actionPerformed(ActionEvent e) { - plugInPort.setNewComponentTypeSlot(componentType, variant); + plugInPort.setNewComponentTypeSlot(componentType, variant, false); } }); diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java index cdc44c6b..30df37f8 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java @@ -84,7 +84,7 @@ class ComponentTabbedPane extends JTabbedPane { @Override public void stateChanged(ChangeEvent e) { - ComponentTabbedPane.this.plugInPort.setNewComponentTypeSlot(null, null); + ComponentTabbedPane.this.plugInPort.setNewComponentTypeSlot(null, null, false); // Refresh recent components if needed if (pendingRecentComponents != null) { refreshRecentComponentsToolbar(getRecentToolbar(), pendingRecentComponents); diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java new file mode 100644 index 00000000..852d9b3a --- /dev/null +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java @@ -0,0 +1,64 @@ +/* + * + * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors. + * + * This file is part of DIYLC. + * + * DIYLC is free software: you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * DIYLC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with DIYLC. If not, see + * . + */ +package org.diylc.swing.plugins.tree; + +import java.awt.Point; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; + +import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreePath; + +import org.diylc.common.IPlugInPort; +import org.diylc.swing.plugins.canvas.EmptyTransferable; +import org.diylc.swing.plugins.tree.TreePanel.Payload; + +/** + * {@link DragGestureListener} for {@link TreePanel}. + * + * @author Branislav Stojkovic + */ +class TreeGestureListener implements DragGestureListener { + + private IPlugInPort presenter; + + public TreeGestureListener(IPlugInPort presenter) { + super(); + this.presenter = presenter; + } + + @Override + public void dragGestureRecognized(DragGestureEvent dge) { + JTree tree = (JTree) dge.getComponent(); + Point p = dge.getDragOrigin(); + TreePath path = tree.getClosestPathForLocation(p.x, p.y); + if (path != null && path.getLastPathComponent() instanceof DefaultMutableTreeNode) { + DefaultMutableTreeNode leaf = (DefaultMutableTreeNode)path.getLastPathComponent(); + Payload payload = (Payload) leaf.getUserObject(); + if (payload != null) { + if (payload.getComponentType() != null) + presenter.setNewComponentTypeSlot(payload.getComponentType(), null, true); + else + payload.getClickListener().mouseClicked(null); + dge.startDrag(presenter.getCursorAt(dge.getDragOrigin()), new EmptyTransferable(), new TreeSourceListener( + presenter)); + } + } + } +} diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java index 4dc5a40f..31aaecc5 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java @@ -25,6 +25,8 @@ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragSource; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; @@ -167,6 +169,14 @@ public class TreePanel extends JPanel { }); getTree().expandRow(0); + + initializeDnD(); + } + + private void initializeDnD() { + // Initialize drag source recognizer. + DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(getTree(), + DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK, new TreeGestureListener(plugInPort)); } public JScrollPane getTreeScroll() { @@ -226,7 +236,7 @@ public class TreePanel extends JPanel { @Override public void mouseClicked(MouseEvent e) { if (plugInPort.getNewComponentTypeSlot() != componentType) - plugInPort.setNewComponentTypeSlot(componentType, null); + plugInPort.setNewComponentTypeSlot(componentType, null, false); } }); final DefaultMutableTreeNode componentNode = new DefaultMutableTreeNode(payload, false); @@ -289,7 +299,7 @@ public class TreePanel extends JPanel { @Override public void mouseClicked(MouseEvent e) { - plugInPort.setNewComponentTypeSlot(type, null); + plugInPort.setNewComponentTypeSlot(type, null, false); } }), false); categoryNode.add(componentNode); @@ -710,7 +720,7 @@ public class TreePanel extends JPanel { } plugInPort.updateSelection(newSelection); - plugInPort.setNewComponentTypeSlot(null, null); + plugInPort.setNewComponentTypeSlot(null, null, false); plugInPort.refresh(); } } diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeSourceListener.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeSourceListener.java new file mode 100644 index 00000000..5c2a2d00 --- /dev/null +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeSourceListener.java @@ -0,0 +1,68 @@ +/* + + DIY Layout Creator (DIYLC). + Copyright (c) 2009-2018 held jointly by the individual authors. + + This file is part of DIYLC. + + DIYLC is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DIYLC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DIYLC. If not, see . + +*/ +package org.diylc.swing.plugins.tree; + +import java.awt.Point; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; +import java.awt.dnd.DragSourceListener; + +import org.diylc.common.IPlugInPort; + + +/** + * {@link DragSourceListener} for {@link TreePanel}. + * + * @author Branislav Stojkovic + */ +class TreeSourceListener implements DragSourceListener { + + private IPlugInPort presenter; + + public TreeSourceListener(IPlugInPort presenter) { + super(); + this.presenter = presenter; + } + + @Override + public void dragDropEnd(DragSourceDropEvent dsde) { + presenter.dragEnded(null); + } + + @Override + public void dragEnter(DragSourceDragEvent dsde) {} + + @Override + public void dragExit(DragSourceEvent dse) {} + + @Override + public void dragOver(DragSourceDragEvent dsde) { + Point p = dsde.getDragSourceContext().getComponent().getMousePosition(); + if (p != null) { + dsde.getDragSourceContext().getComponent().firePropertyChange("dragPoint", p.x, p.y); + } + } + + @Override + public void dropActionChanged(DragSourceDragEvent dsde) {} +} diff --git a/diylc/diylc-swing/update.xml b/diylc/diylc-swing/update.xml index f0d55ecc..543f6c14 100644 --- a/diylc/diylc-swing/update.xml +++ b/diylc/diylc-swing/update.xml @@ -2357,7 +2357,11 @@ 2019-01-28 00:00:00.000 CET - + + + NEW_FEATURE + Ability to drag components directly from the tree to the canvas for faster process + NEW_FEATURE "Fuse Symbol" added