MainPanel prototype

This commit is contained in:
gac-S_Changer
2018-04-10 09:50:23 +02:00
parent fd15d2cf48
commit 1e2fee44d0
7 changed files with 75 additions and 37 deletions

View File

@@ -83,6 +83,16 @@ public class BasePlatePanel extends DevicePanel {
repaint();
}
boolean selectable;
public boolean getSelectable() {
return selectable;
}
public void setSelectable(boolean selectable) {
this.selectable = selectable;
}
/**
* This method is called from within the constructor to initialize the form. WARNING: Do NOT
* modify this code. The content of this method is always regenerated by the Form Editor.
@@ -201,7 +211,7 @@ public class BasePlatePanel extends DevicePanel {
}
private void checkMouseEvent(MouseEvent e, boolean pressed) {
if (isEnabled()) {
if (isEnabled() && selectable) {
try {
Sample sample = getSample(e.getX(), e.getY());
Puck puck = getPuck(e.getX(), e.getY());
@@ -244,13 +254,13 @@ public class BasePlatePanel extends DevicePanel {
public void mouseClicked(MouseEvent e) {
if (isEnabled()) {
if (e.getButton() == java.awt.event.MouseEvent.BUTTON1) {
Sample sample = getSample(e.getX(), e.getY());
Puck puck = getPuck(e.getX(), e.getY());
if (sample != null) {
onSampleClicked(e, sample);
} else {
onPuckClicked(e, puck);
}
Sample sample = getSample(e.getX(), e.getY());
Puck puck = getPuck(e.getX(), e.getY());
if (sample != null) {
onSampleClicked(e, sample);
} else {
onPuckClicked(e, puck);
}
}
}
}