Puck detection dialog is maximized
This commit is contained in:
@@ -57,6 +57,7 @@ import javax.swing.table.DefaultTableModel;
|
|||||||
*/
|
*/
|
||||||
public class Controller {
|
public class Controller {
|
||||||
|
|
||||||
|
final boolean DIALOG_PUCK_LOAD_SHOW_BASEPLATE = true;
|
||||||
static Controller instance;
|
static Controller instance;
|
||||||
final BasePlate basePlate;
|
final BasePlate basePlate;
|
||||||
RoomTemperatureBasePlate roomTemperatureBasePlate;
|
RoomTemperatureBasePlate roomTemperatureBasePlate;
|
||||||
@@ -735,13 +736,23 @@ public class Controller {
|
|||||||
if ( hasLoadDialog()) {
|
if ( hasLoadDialog()) {
|
||||||
if (puckLoading) {
|
if (puckLoading) {
|
||||||
showDialogPuckLoading();
|
showDialogPuckLoading();
|
||||||
mainFrame.setViewDesign();
|
if (!DIALOG_PUCK_LOAD_SHOW_BASEPLATE){
|
||||||
|
mainFrame.setViewDesign();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
hideDialogPuckLoading();
|
hideDialogPuckLoading();
|
||||||
mainFrame.setViewCamera();
|
if (!DIALOG_PUCK_LOAD_SHOW_BASEPLATE){
|
||||||
|
mainFrame.setViewCamera();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (puckLoading) {
|
||||||
|
if ((dialogPuckLoading != null) && (dialogPuckLoading.isVisible())) {
|
||||||
|
dialogPuckLoading.restore();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,7 +865,7 @@ public class Controller {
|
|||||||
if ((dialogPuckLoading != null) && (dialogPuckLoading.isVisible())) {
|
if ((dialogPuckLoading != null) && (dialogPuckLoading.isVisible())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dialogPuckLoading = new PuckLoadingDialog(mainFrame.getTopLevel(), false, false, true);
|
dialogPuckLoading = new PuckLoadingDialog(mainFrame.getTopLevel(), false, false, DIALOG_PUCK_LOAD_SHOW_BASEPLATE);
|
||||||
dialogPuckLoading.setVisible(true);
|
dialogPuckLoading.setVisible(true);
|
||||||
checkPuckDetectionEnabling();
|
checkPuckDetectionEnabling();
|
||||||
|
|
||||||
|
|||||||
@@ -53,16 +53,7 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
if (!showBasePlate){
|
if (!showBasePlate){
|
||||||
splitPanel.setDividerLocation(0);
|
splitPanel.setDividerLocation(0);
|
||||||
}
|
}
|
||||||
if (!showBasePlate && !persist){
|
setLocationRelativeTo(parent);
|
||||||
Rectangle bounds = parent.getBounds();
|
|
||||||
int width = bounds.width / 3;
|
|
||||||
int height = bounds.height;
|
|
||||||
int x = bounds.x + bounds.width - width;
|
|
||||||
int y = bounds.y;
|
|
||||||
setBounds(x, y, width, height);
|
|
||||||
} else {
|
|
||||||
setLocationRelativeTo(parent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePlatePanel getBasePlatePanel(){
|
public BasePlatePanel getBasePlatePanel(){
|
||||||
@@ -84,24 +75,35 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
super.setVisible(visible);
|
super.setVisible(visible);
|
||||||
|
|
||||||
if ( visible){
|
if ( visible){
|
||||||
if (persist){
|
restore();
|
||||||
try {
|
|
||||||
MainFrame.restore(PuckLoadingDialog.this, dialogPersistPath);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Logger.getLogger(DataPanel.class.getName()).log(Level.WARNING, null, ex);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(showBasePlate){
|
|
||||||
Rectangle bounds = getParent().getBounds();
|
|
||||||
setSize(new Dimension(bounds.width * 3 / 4, bounds.height * 3 / 4));
|
|
||||||
setLocationRelativeTo(getParent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void restore(){
|
||||||
|
if (persist){
|
||||||
|
try {
|
||||||
|
MainFrame.restore(PuckLoadingDialog.this, dialogPersistPath);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.getLogger(DataPanel.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Rectangle bounds = getParent().getBounds();
|
||||||
|
if(showBasePlate){
|
||||||
|
//setSize(new Dimension(bounds.width * 3 / 4, bounds.height * 3 / 4));
|
||||||
|
//setLocationRelativeTo(getParent());
|
||||||
|
setBounds(bounds);
|
||||||
|
} else {
|
||||||
|
int width = bounds.width / 3;
|
||||||
|
int height = bounds.height;
|
||||||
|
int x = bounds.x + bounds.width - width;
|
||||||
|
int y = bounds.y;
|
||||||
|
setBounds(x, y, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void update() {
|
void update() {
|
||||||
Map dms = Controller.getInstance().getPuckDatamatrixInfo();
|
Map dms = Controller.getInstance().getPuckDatamatrixInfo();
|
||||||
if (dms == null) {
|
if (dms == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user