mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Two components are created instead of one
This commit is contained in:
+3
-5
@@ -193,11 +193,9 @@ class CanvasPanel extends JComponent implements Autoscroll {
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
plugInPort.mouseClicked(e.getPoint(), e.getButton(), e
|
||||
.isControlDown(), e.isShiftDown(), e.isAltDown(), e
|
||||
.getClickCount());
|
||||
}
|
||||
plugInPort.mouseClicked(e.getPoint(), e.getButton(), e
|
||||
.isControlDown(), e.isShiftDown(), e.isAltDown(), e
|
||||
.getClickCount());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-5
@@ -31,7 +31,6 @@ import org.diylc.common.BadPositionException;
|
||||
import org.diylc.common.EventType;
|
||||
import org.diylc.common.IPlugIn;
|
||||
import org.diylc.common.IPlugInPort;
|
||||
import org.diylc.core.CreationMethod;
|
||||
import org.diylc.core.ExpansionMode;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.measures.Size;
|
||||
@@ -102,10 +101,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (plugInPort.getNewComponentTypeSlot() != null && plugInPort.getNewComponentTypeSlot().getCreationMethod() == CreationMethod.SINGLE_CLICK) {
|
||||
plugInPort.mouseClicked(e.getPoint(), e.getButton(),
|
||||
false, false, false, e.getClickCount());
|
||||
} else if (e.isPopupTrigger()) {
|
||||
if (plugInPort.getNewComponentTypeSlot() == null && e.isPopupTrigger()) {
|
||||
// Enable actions.
|
||||
boolean enabled = !plugInPort.getSelectedComponents()
|
||||
.isEmpty();
|
||||
|
||||
Reference in New Issue
Block a user