Examples of CometeRoi


Examples of fr.soleil.comete.definition.widget.util.CometeRoi

        return monochrome;
    }

    public void addRoi(final String roiDesc) {
        if (widget != null) {
            final CometeRoi roi = createRoi(roiDesc.split(","));
            if (roi != null) {
                widget.addRoi(roi, true);
            }
        }
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

            // for each roi we add the missing parameter and add it to widget
            for (int i = 0; i < ROI_LIST_LENGTH; i++) {
                final String[] roiDesc = roiList[i].split(",");

                final CometeRoi roiTemp = createRoi(new String[] { roiDesc[0], "RECTANGLE", "10",
                        roiDesc[1], roiDesc[2], roiDesc[3], roiDesc[4], "WHITE" });

                if (roiTemp != null) {
                    widget.addRoi(roiTemp);
                }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

    public String[] getRoiList() {
        return Arrays.copyOf(roiList, roiList.length);
    }

    private CometeRoi createRoi(final String[] roiDesc) {
        CometeRoi roi = null;

        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) {
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

        return transfList;
    }

    public void addRoi(final String roiDesc) {
        if (widget != null) {
            final CometeRoi roi = createRoi(roiDesc.split(","));
            if (roi != null) {
                addRoi(roi);
            }
        }
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

        if (roiList != null && roiListLength != 0) {
            // for each roi we add the missing parameter and add it to widget
            for (int i = 0; i < roiListLength; i++) {
                final String[] roiDesc = roiList[i].split(",");

                final CometeRoi roiTemp = createRoi(new String[] { roiDesc[0], "RECTANGLE", "2", roiDesc[1],
                        roiDesc[2], roiDesc[3], roiDesc[4], "WHITE" });

                if (roiTemp != null) {
                    addRoi(roiTemp);
                } else {
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

    public String[] getRoiList() {
        return roiList;
    }

    private CometeRoi createRoi(final String[] roiDesc) {
        CometeRoi roi = null;

        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());
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

        return monochrome;
    }

    public void addRoi(final String roiDesc) {
        if (widget != null) {
            final CometeRoi roi = createRoi(roiDesc.split(","));
            if (roi != null) {
                addRoi(roi);
            }
        }
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

        if (roiList != null && roiListLength != 0) {
            // for each roi we add the missing parameter and add it to widget
            for (int i = 0; i < roiListLength; i++) {
                final String[] roiDesc = roiList[i].split(",");

                final CometeRoi roiTemp = createRoi(new String[] { roiDesc[0], "RECTANGLE", "2",
                        roiDesc[1], roiDesc[2], roiDesc[3], roiDesc[4], "WHITE" });

                if (roiTemp != null) {
                    addRoi(roiTemp);
                } else {
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

    public String[] getRoiList() {
        return roiList;
    }

    private CometeRoi createRoi(final String[] roiDesc) {
        CometeRoi roi = null;

        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
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.CometeRoi

        return monochrome;
    }

    public void addRoi(final String roiDesc) {
        if (widget != null) {
            final CometeRoi roi = createRoi(roiDesc.split(","));
            if (roi != null) {
                addRoi(roi);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.