Package fr.soleil.comete.swing

Examples of fr.soleil.comete.swing.ImageViewer


    }

    public Rectangle getViewerBounds() {
        Rectangle result = null;
        if (playerMode) {
            ImageViewer viewer = imageViewerMap.get(IMAGE_PLAYER_ID);
            result = new Rectangle(viewer.getLocationOnScreen(), viewer.getSize());
        }
        return result;
    }
View Full Code Here


                        int y = Double.valueOf(point[1]).intValue();
                        actuatorsInput.setActuatorIndex(x, y);
                        Object source = event.getSource();
                        if (source != null && source instanceof ImageViewer
                                && resultListener != null && resultListener.isSelectionActivated()) {
                            ImageViewer imageViewer = (ImageViewer) source;
                            if (startRoi == null) {
                                // Remove endRoi
                                endRoi = new CometeRoi("To", RoiShape.NONE, 0, 0, 0, 0, 0,
                                        CometeColor.WHITE);
                                imageViewer.addRoi(endRoi);
                                startRoi = new CometeRoi("From", RoiShape.CROSS, 0, x, y, 2, 2,
                                        CometeColor.CYAN);
                                imageViewer.addRoi(startRoi, true);
                                endRoi = null;
                                if (resultListener != null) {
                                    resultListener.startPointSelectedChanged(x, y);
                                }
                            }
                            else if (endRoi == null && startRoi != null) {
                                endRoi = new CometeRoi("To", RoiShape.CROSS, 0, x, y, 2, 2,
                                        CometeColor.GREEN);
                                imageViewer.addRoi(endRoi, true);
                                startRoi = null;
                                if (resultListener != null) {
                                    resultListener.endPointSelectedChanged(x, y);
                                }
                            }
View Full Code Here

                    int y = Double.valueOf(point[1]).intValue();
                    actuatorsInput.setActuatorIndex(x, y);
                    Object source = event.getSource();
                    if (source != null && source instanceof ImageViewer && resultListener != null
                            && resultListener.isSelectionActivated()) {
                        ImageViewer imageViewer = (ImageViewer) source;
                        if (startRoi == null) {
                            // Remove endRoi
                            endRoi = new CometeRoi("To", RoiShape.NONE, 0, 0, 0, 0, 0, CometeColor.WHITE);
                            imageViewer.addRoi(endRoi);
                            startRoi = new CometeRoi("From", RoiShape.CROSS, 0, x, y, 2, 2, CometeColor.CYAN);
                            imageViewer.addRoi(startRoi, true);
                            endRoi = null;
                            if (resultListener != null) {
                                resultListener.startPointSelectedChanged(x, y);
                            }
                        } else if (endRoi == null && startRoi != null) {
                            endRoi = new CometeRoi("To", RoiShape.CROSS, 0, x, y, 2, 2, CometeColor.GREEN);
                            imageViewer.addRoi(endRoi, true);
                            startRoi = null;
                            if (resultListener != null) {
                                resultListener.endPointSelectedChanged(x, y);
                            }
                        }
View Full Code Here

        }
    }

    private void changeImagePlayerValues(BasicNumberMatrixTarget numberMatrix, String name) {

        ImageViewer viewer = imageViewerMap.get(IMAGE_PLAYER_ID);
        viewer.setAlwaysFitMaxSize(false);
        if (currentPlayerData != numberMatrix) {
            if (currentPlayerData != null) {
                currentPlayerData.removeTargetListener(this);
            }
            currentPlayerData = numberMatrix;
            numberMatrix.addTargetListener(this);
        }
        viewer.setNumberMatrix(numberMatrix.getNumberMatrix());
        viewer.setText(name);
        lastName = name;
    }
View Full Code Here

        }
    }

    private void changeImagePlayerValues(BasicNumberMatrixTarget numberMatrix, String name) {

        ImageViewer viewer = imageViewerMap.get(IMAGE_PLAYER_ID);
        viewer.setAlwaysFitMaxSize(false);
        if (currentPlayerData != numberMatrix) {
            if (currentPlayerData != null) {
                currentPlayerData.removeTargetListener(this);
            }
            currentPlayerData = numberMatrix;
            numberMatrix.addTargetListener(this);
        }
        viewer.setNumberMatrix(numberMatrix.getNumberMatrix());
        viewer.setText(name);
        lastName = name;
    }
View Full Code Here

    @Override
    public void mouseEntered(MouseEvent arg0) {
        // First delete the old cursor
        Object source = arg0.getSource();
        if (source != null && source instanceof ImageViewer) {
            ImageViewer imageViewer = (ImageViewer) source;
            Point mousePosition = arg0.getPoint();
            Point imagePosition = imageViewer.getImagePosition(mousePosition);
            cursorRoi = new CometeRoi(".", RoiShape.CROSS, 1, imagePosition.x, imagePosition.y,
                    imageViewer.getDimY(), imageViewer.getDimX(), CometeColor.YELLOW);
            imageViewer.addRoi(cursorRoi, true);
        }
    }
View Full Code Here

    @Override
    public void mouseEntered(MouseEvent arg0) {
        // First delete the old cursor
        Object source = arg0.getSource();
        if (source != null && source instanceof ImageViewer) {
            ImageViewer imageViewer = (ImageViewer) source;
            Point mousePosition = arg0.getPoint();
            Point imagePosition = imageViewer.getImagePosition(mousePosition);
            cursorRoi = new CometeRoi(".", RoiShape.CROSS, 1, imagePosition.x, imagePosition.y, imageViewer.getDimY(),
                    imageViewer.getDimX(), CometeColor.YELLOW);
            imageViewer.addRoi(cursorRoi, true);
        }
    }
View Full Code Here

        // REMOVE ROI
        cursorRoi = null;
        cursorRoi = new CometeRoi(".", RoiShape.NONE, 0, 0, 0, 0, 0, CometeColor.YELLOW);
        Object source = arg0.getSource();
        if (source != null && source instanceof ImageViewer) {
            ImageViewer imageViewer = (ImageViewer) source;
            imageViewer.addRoi(cursorRoi, true);
        }
    }
View Full Code Here

    }

    private void buildImageViewerMap() {
        clearGUI();
        if (zSensorsDataList != null) {
            ImageViewer imageViewer = null;
            for (String element : zSensorsDataList) {
                imageViewer = new ImageViewer();
                WidgetUtils.setMonochrom(imageViewer, monochrome);
                imageViewer.addMouseListener(this);
                imageViewer.setApplicationId(element);
                imageViewer.setAlwaysFitMaxSize(alwaysFittedSize);
                imageViewer.setCleanOnDataSetting(false);
                imageViewerMap.put(element, imageViewer);
                tabbedPane.add(element, imageViewer);
                imageViewer.addImageViewerListener(this);
            }
        }

    }
View Full Code Here

        // REMOVE ROI
        cursorRoi = null;
        cursorRoi = new CometeRoi(".", RoiShape.NONE, 0, 0, 0, 0, 0, CometeColor.YELLOW);
        Object source = arg0.getSource();
        if (source != null && source instanceof ImageViewer) {
            ImageViewer imageViewer = (ImageViewer) source;
            imageViewer.addRoi(cursorRoi, true);
        }
    }
View Full Code Here

TOP

Related Classes of fr.soleil.comete.swing.ImageViewer

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.