mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
fix ctrl selection
This commit is contained in:
+10
-11
@@ -100,17 +100,24 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
|||||||
canvasPanel = new CanvasPanel(plugInPort);
|
canvasPanel = new CanvasPanel(plugInPort);
|
||||||
canvasPanel.addMouseListener(new MouseAdapter() {
|
canvasPanel.addMouseListener(new MouseAdapter() {
|
||||||
|
|
||||||
|
private boolean processedPressed = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
canvasPanel.requestFocus();
|
canvasPanel.requestFocus();
|
||||||
mouseReleased(e);
|
mouseReleased(e);
|
||||||
|
processedPressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(final MouseEvent e) {
|
public void mouseReleased(final MouseEvent e) {
|
||||||
plugInPort.mouseClicked(e.getPoint(), e.getButton(), e
|
if (processedPressed) {
|
||||||
.isControlDown(), e.isShiftDown(), e.isAltDown(), e
|
processedPressed = false;
|
||||||
.getClickCount());
|
} else {
|
||||||
|
plugInPort.mouseClicked(e.getPoint(), e.getButton(), e
|
||||||
|
.isControlDown(), e.isShiftDown(), e
|
||||||
|
.isAltDown(), e.getClickCount());
|
||||||
|
}
|
||||||
// Invoke the rest of the code later so we get the chance to
|
// Invoke the rest of the code later so we get the chance to
|
||||||
// process selection messages.
|
// process selection messages.
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@@ -176,14 +183,6 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
|||||||
.isShiftDown(), e.isAltDown());
|
.isShiftDown(), e.isAltDown());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
canvasPanel.addMouseListener(new MouseAdapter() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return canvasPanel;
|
return canvasPanel;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user