Package fr.soleil.lib.project.swing.dialog

Examples of fr.soleil.lib.project.swing.dialog.ErrorDialog


        if (roiDesc.length == ROI_DESC_LENGTH) {
            RoiShape shape = null;
            try {
                shape = RoiShape.valueOf(roiDesc[1].trim().toUpperCase(Locale.US));
            } catch (final IllegalArgumentException e) {
                new ErrorDialog(null, "Can not create ROI", "Invalid ROI Shape not added " + Arrays.toString(roiDesc)
                        + ".\n\nCorrect values are RECTANGLE, OVAL, POINT, TEXT or CROSS and NONE to supress it.",
                        false, null).setVisible(true);
            }

            if (shape != null) {
                CometeColor color = null;

                try {
                    final Field colorField = CometeColor.class.getDeclaredField(roiDesc[7].trim().toUpperCase());
                    color = (CometeColor) colorField.get(colorField);
                } catch (final SecurityException e1) {
                    System.err.println("cant find color => SecurityException");
                } catch (final NoSuchFieldException e1) {
                    System.err.println("color does'nt exist");
                } catch (final IllegalArgumentException e) {
                    System.err.println("cant find color => IllegalArgumentException");
                } catch (final IllegalAccessException e) {
                    System.err.println("cant find color => IllegalAccessException");
                }

                if (color != null) {
                    try {
                        roi = new CometeRoi(roiDesc[0].trim(), shape, Integer.parseInt(roiDesc[2].trim()),
                                Integer.parseInt(roiDesc[3].trim()), Integer.parseInt(roiDesc[4].trim()),
                                Integer.parseInt(roiDesc[5].trim()), Integer.parseInt(roiDesc[6].trim()), color);
                    } catch (final NumberFormatException e) {
                        // TODO change to logger
                        System.err.println("invalid size or position: " + e.getMessage());
                    }
                } else {
                    new ErrorDialog(
                            null,
                            "Can not create ROI",
                            "Invalid ROI Color not added "
                                    + Arrays.toString(roiDesc)
                                    + ".\n\nCorrects colors are WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ORANGE, CYAN, MAGENTA, PURPLE, PINK, GRAY, DARK_GRAY or LIGHT_GRAY.",
                            false, null).setVisible(true);
                }
            }
        } else {
            new ErrorDialog(null, "Can not create ROI",
                    "Invalid ROI not added, the correct value must be RoiName,shape, LineSize, X, Y, Width, Height, Color.\n\nRoi : "
                            + Arrays.toString(roiDesc), false, null).setVisible(true);
        }

        return roi;
View Full Code Here


              TangoKeyTool.getAttributeName(yKey));
          ((IChartViewer)widget).setDataViewDisplayName(dataViewId, displayName);
        }
       
        if (!connected) {
          new ErrorDialog(null, "Connection Error",
              "Error :can not add brace ["
                  + xAttributeNameList[i] + ", "
                  + yAttributeNameList[i] + "]", false, null);
        }
      }
View Full Code Here

        if (roiDesc.length == ROI_DESC_LENGTH) {
            RoiShape shape = null;
            try {
                shape = RoiShape.valueOf(roiDesc[1].trim().toUpperCase(Locale.US));
            } catch (final IllegalArgumentException e) {
                new ErrorDialog(null, "Can not create ROI", "Invalid ROI Shape not added " + Arrays.toString(roiDesc)
                        + ".\n\nCorrect values are RECTANGLE, OVAL, POINT, TEXT or CROSS and NONE to supress it.",
                        false, null).setVisible(true);
            }

            if (shape != null) {
                CometeColor color = null;

                try {
                    final Field colorField = CometeColor.class.getDeclaredField(roiDesc[7].trim().toUpperCase());
                    color = (CometeColor) colorField.get(colorField);
                } catch (final SecurityException e1) {
                    System.err.println("cant find color => SecurityException");
                } catch (final NoSuchFieldException e1) {
                    System.err.println("color does'nt exist");
                } catch (final IllegalArgumentException e) {
                    System.err.println("cant find color => IllegalArgumentException");
                } catch (final IllegalAccessException e) {
                    System.err.println("cant find color => IllegalAccessException");
                }

                if (color != null) {
                    try {
                        roi = new CometeRoi(roiDesc[0].trim(), shape, Integer.parseInt(roiDesc[2].trim()),
                                Integer.parseInt(roiDesc[3].trim()), Integer.parseInt(roiDesc[4].trim()),
                                Integer.parseInt(roiDesc[5].trim()), Integer.parseInt(roiDesc[6].trim()), color);
                    } catch (final NumberFormatException e) {
                        // TODO change to logger
                        System.err.println("invalid size or position: " + e.getMessage());
                    }
                } else {
                    new ErrorDialog(
                            null,
                            "Can not create ROI",
                            "Invalid ROI Color not added "
                                    + Arrays.toString(roiDesc)
                                    + ".\n\nCorrects colors are WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ORANGE, CYAN, MAGENTA, PURPLE, PINK, GRAY, DARK_GRAY or LIGHT_GRAY.",
                            false, null).setVisible(true);
                }
            }
        } else {
            new ErrorDialog(null, "Can not create ROI",
                    "Invalid ROI not added, the correct value must be RoiName,shape, LineSize, X, Y, Width, Height, Color.\n\nRoi : "
                            + Arrays.toString(roiDesc), false, null).setVisible(true);
        }

        return roi;
View Full Code Here

                                "An error has occur for the connection of : \n");
                        builder.append(widget.getClass().getSimpleName());
                        builder.append("\nWith :\n");
                        builder.append(key.getInformationKey());

                        new ErrorDialog(null, "Error at " + this.getClass().getName(), builder
                                .toString(), false, null).setVisible(true);
                    }
                }

            }
            catch (final Exception e) {
                if (graphicalErrorManagement) {
                    final StringBuilder builder = new StringBuilder();
                    builder.append("An error has occur for the connection of : \n");
                    builder.append(widget.getClass().getSimpleName());
                    builder.append("\nWith :\n");
                    builder.append(key.getInformationKey());
                    builder.append("\nError type : ");
                    builder.append(e.getClass().getName());
                    builder.append("\nError message : ");
                    builder.append(e.getMessage());

                    final ErrorDialog dialog = new ErrorDialog(null, "Error at "
                            + this.getClass().getName(), builder.toString(), false, e
                            .getStackTrace());

                    dialog.setVisible(true);
                }
                else {
                    e.printStackTrace();
                }
            }
View Full Code Here

                TangoKeyTool.registerAttribute(aKey, element);

                connected = ((ChartViewerBox) mybox).connectWidget(widget, aKey);

                if (!connected) {
                    new ErrorDialog(null, "Connection Error", "Error :can not add " + element,
                            false, null);
                }
            }
            isInit = true;
        }
View Full Code Here

            RoiShape shape = null;
            try {
                shape = RoiShape.valueOf(roiDesc[1].trim().toUpperCase(Locale.US));
            }
            catch (final IllegalArgumentException e) {
                new ErrorDialog(
                        null,
                        "Can not create ROI",
                        "Invalid ROI Shape not added "
                                + Arrays.toString(roiDesc)
                                + ".\n\nCorrect values are RECTANGLE, OVAL, POINT, TEXT or CROSS and NONE to supress it.",
                        false, null).setVisible(true);
            }

            if (shape != null) {
                CometeColor color = null;

                try {
                    final Field colorField = CometeColor.class.getDeclaredField(roiDesc[7].trim()
                            .toUpperCase());
                    color = (CometeColor) colorField.get(colorField);
                }
                catch (final SecurityException e1) {
                    System.err.println("cant find color => SecurityException");
                }
                catch (final NoSuchFieldException e1) {
                    System.err.println("color does'nt exist");
                }
                catch (final IllegalArgumentException e) {
                    System.err.println("cant find color => IllegalArgumentException");
                }
                catch (final IllegalAccessException e) {
                    System.err.println("cant find color => IllegalAccessException");
                }

                if (color != null) {
                    try {
                        roi = new CometeRoi(roiDesc[0].trim(), shape, Integer.parseInt(roiDesc[2]
                                .trim()), Integer.parseInt(roiDesc[3].trim()),
                                Integer.parseInt(roiDesc[4].trim()), Integer.parseInt(roiDesc[5]
                                        .trim()), Integer.parseInt(roiDesc[6].trim()), color);
                    }
                    catch (final NumberFormatException e) {
                        // TODO change to logger
                        System.err.println("invalid size or position: " + e.getMessage());
                    }
                }
                else {
                    new ErrorDialog(
                            null,
                            "Can not create ROI",
                            "Invalid ROI Color not added "
                                    + Arrays.toString(roiDesc)
                                    + ".\n\nCorrects colors are WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ORANGE, CYAN, MAGENTA, PURPLE, PINK, GRAY, DARK_GRAY or LIGHT_GRAY.",
                            false, null).setVisible(true);
                }
            }
        }
        else {
            new ErrorDialog(
                    null,
                    "Can not create ROI",
                    "Invalid ROI not added, the correct value must be RoiName,shape, LineSize, X, Y, Width, Height, Color.\n\nRoi : "
                            + Arrays.toString(roiDesc), false, null).setVisible(true);
        }
View Full Code Here

              TangoKeyTool.getAttributeName(yKey));
          ((IChartViewer)widget).setDataViewDisplayName(dataViewId, displayName);
        }
       
        if (!connected) {
          new ErrorDialog(null, "Connection Error",
              "Error :can not add brace ["
                  + xAttributeNameList[i] + ", "
                  + yAttributeNameList[i] + "]", false, null);
        }
      }
View Full Code Here

                TangoKeyTool.registerAttribute(aKey, element);

                connected = ((ChartViewerBox) mybox).connectWidget(widget, aKey);

                if (!connected) {
                    new ErrorDialog(null, "Connection Error", "Error :can not add " + element,
                            false, null);
                }
            }
            init = true;
        }
View Full Code Here

              TangoKeyTool.getAttributeName(yKey));
          ((IChartViewer)widget).setDataViewDisplayName(dataViewId, displayName);
        }
       
        if (!connected) {
          new ErrorDialog(null, "Connection Error",
              "Error :can not add brace ["
                  + xAttributeNameList[i] + ", "
                  + yAttributeNameList[i] + "]", false, null);
        }
      }
View Full Code Here

            RoiShape shape = null;
            try {
                shape = RoiShape.valueOf(roiDesc[1].trim().toUpperCase(Locale.US));
            }
            catch (final IllegalArgumentException e) {
                new ErrorDialog(
                        null,
                        "Can not create ROI",
                        "Invalid ROI Shape not added "
                                + Arrays.toString(roiDesc)
                                + ".\n\nCorrect values are RECTANGLE, OVAL, POINT, TEXT or CROSS and NONE to supress it.",
                        false, null).setVisible(true);
            }

            if (shape != null) {
                CometeColor color = null;

                try {
                    final Field colorField = CometeColor.class.getDeclaredField(roiDesc[7].trim()
                            .toUpperCase());
                    color = (CometeColor) colorField.get(colorField);
                }
                catch (final SecurityException e1) {
                    System.err.println("cant find color => SecurityException");
                }
                catch (final NoSuchFieldException e1) {
                    System.err.println("color does'nt exist");
                }
                catch (final IllegalArgumentException e) {
                    System.err.println("cant find color => IllegalArgumentException");
                }
                catch (final IllegalAccessException e) {
                    System.err.println("cant find color => IllegalAccessException");
                }

                if (color != null) {
                    try {
                        roi = new CometeRoi(roiDesc[0].trim(), shape, Integer.parseInt(roiDesc[2]
                                .trim()), Integer.parseInt(roiDesc[3].trim()),
                                Integer.parseInt(roiDesc[4].trim()), Integer.parseInt(roiDesc[5]
                                        .trim()), Integer.parseInt(roiDesc[6].trim()), color);
                    }
                    catch (final NumberFormatException e) {
                        // TODO change to logger
                        System.err.println("invalid size or position: " + e.getMessage());
                    }
                }
                else {
                    new ErrorDialog(
                            null,
                            "Can not create ROI",
                            "Invalid ROI Color not added "
                                    + Arrays.toString(roiDesc)
                                    + ".\n\nCorrects colors are WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ORANGE, CYAN, MAGENTA, PURPLE, PINK, GRAY, DARK_GRAY or LIGHT_GRAY.",
                            false, null).setVisible(true);
                }
            }
        }
        else {
            new ErrorDialog(
                    null,
                    "Can not create ROI",
                    "Invalid ROI not added, the correct value must be RoiName,shape, LineSize, X, Y, Width, Height, Color.\n\nRoi : "
                            + Arrays.toString(roiDesc), false, null).setVisible(true);
        }
View Full Code Here

TOP

Related Classes of fr.soleil.lib.project.swing.dialog.ErrorDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.