This commit is contained in:
gac-S_Changer
2018-08-22 11:43:29 +02:00
parent 250af86505
commit 52a8daf5c0
6 changed files with 64 additions and 23 deletions

View File

@@ -4,6 +4,7 @@
package ch.psi.mxsc;
import ch.psi.mxsc.BasePlate.DrawMode;
import ch.psi.mxsc.BasePlate.SelectionMode;
import ch.psi.pshell.imaging.Data;
import ch.psi.pshell.imaging.ImageListener;
import ch.psi.pshell.imaging.Source;
@@ -302,24 +303,25 @@ public class BasePlatePanel extends DevicePanel {
}
void selectSample(Sample sample){
if (getDevice().isSelectable()){
if (getDevice().getSelectionMode()==SelectionMode.Samples){
sample.setSelected(true);
repaint();
Controller.getInstance().onSamplePressed(sample);
}
Controller.getInstance().onSamplePressed(sample);
}
void onSamplePressed(MouseEvent e, Sample sample){
if (getDevice().isSelectable()){
if (getDevice().getSelectionMode()==SelectionMode.Samples){
if (TOGGLE_SELECTION){
sample.toggleSelected(true);
} else {
sample.setSelected(true);
}
repaint();
Controller.getInstance().onSamplePressed(sample);
} else if (getDevice().getSelectionMode()==SelectionMode.Pucks){
onPuckPressed(e, sample.getPuck());
}
Controller.getInstance().onSamplePressed(sample);
}
void onSampleReleased(MouseEvent e, Sample sample){
@@ -342,23 +344,23 @@ public class BasePlatePanel extends DevicePanel {
}
void selectPuck(Puck puck){
if (getDevice().isSelectable()){
if (getDevice().getSelectionMode()!=SelectionMode.None){
puck.setSelected(true);
repaint();
}
Controller.getInstance().onPuckPressed(puck);
repaint();
Controller.getInstance().onPuckPressed(puck);
}
}
void onPuckPressed(MouseEvent e, Puck puck){
if (getDevice().isSelectable()){
if (getDevice().getSelectionMode()!=SelectionMode.None){
if (TOGGLE_SELECTION){
puck.toggleSelected(true);
} else {
puck.setSelected(true);
}
repaint();
repaint();
Controller.getInstance().onPuckPressed(puck);
}
Controller.getInstance().onPuckPressed(puck);
}
void onPuckReleased(MouseEvent e, Puck puck){