--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.
Can you give me a hint where I can change the code for the mouse to work on both screens? Thanks.
Em qui, 18 de abr de 2019 às 13:01, Nicolas Roduit escreveu:
If you mean synchronizing the views, it is currently possible only within a Window.--
Le jeudi 18 avril 2019 14:47:20 UTC+2, alex.ga...@gmail.com a écrit :Hello, I have the weasis running on two monitors. How do I make the scrolling of the mouse work on the two viewers? Thanks!
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+unsubscribe@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.
// GA Info: O scroll do mouse só irá funcionar em cima do container de imagens// dicom@Overridepublic void mouseWheelMoved(MouseWheelEvent e) {if (DicomExplorerFactory.tela1Aberta && DicomExplorerFactory.tela2Aberta) {DicomExplorerFactory.tela1Aberta = false;DicomExplorerFactory.tela2Aberta = false;return;}if (isActionEnabled()) {setSliderValue(getSliderValue() + e.getWheelRotation());mouseMovimentSimulator(e);}}public void mouseMovimentSimulator(MouseWheelEvent e) {try {GraphicsDevice telaAtual = selectedView2dContainer.getGraphicsConfiguration().getDevice();Rectangle screenSizeOther;Rectangle screenSizeAtual;Robot robot = new Robot();Point posInicial = MouseInfo.getPointerInfo().getLocation();// GA info: DicomExplorerFactory.tela1 e tela2 para pegar as telas existentes ao// DICA: Duplica a ação do mouse para a tela oposta.if (telaAtual == DicomExplorerFactory.tela1 && DicomExplorerFactory.tela2Aberta == false) {// Robot robot = new Robot(DicomExplorerFactory.tela2);screenSizeAtual = new Rectangle(telaAtual.getDefaultConfiguration().getBounds());screenSizeOther = new Rectangle(DicomExplorerFactory.tela2.getDefaultConfiguration().getBounds());moveMouseScreen2(screenSizeOther, screenSizeAtual, robot, e);retornarMousePosicialInicial(posInicial, robot);DicomExplorerFactory.tela2Aberta = true;return;}if (telaAtual == DicomExplorerFactory.tela2 && DicomExplorerFactory.tela1Aberta == false) {screenSizeAtual = new Rectangle(telaAtual.getDefaultConfiguration().getBounds());screenSizeOther = new Rectangle(DicomExplorerFactory.tela1.getDefaultConfiguration().getBounds());moveMouseScreen1(screenSizeOther, screenSizeAtual, robot, e);retornarMousePosicialInicial(posInicial, robot);DicomExplorerFactory.tela1Aberta = true;return;}} catch (AWTException exc) {exc.printStackTrace();}}public void retornarMousePosicialInicial(Point posInicial, Robot robot) {robot.mouseMove(posInicial.x, posInicial.y);}public void moveMouseScreen1(Rectangle screenSizeOther, Rectangle screenSizeAtual, Robot robot,MouseWheelEvent e) {int x = screenSizeOther.width / 2;int y = (screenSizeOther.height / 2);robot.mouseMove(x, y);robot.mouseWheel(e.getWheelRotation());}public void moveMouseScreen2(Rectangle screenSizeOther, Rectangle screenSizeAtual, Robot robot,MouseWheelEvent e) {int x = -(screenSizeOther.width / 2);int y = (screenSizeOther.height / 2);robot.mouseMove(x, y);robot.mouseWheel(e.getWheelRotation());}
// GA info: Colocando telas para serem usadas no EventManager "scroll do mouse"public static GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();public static GraphicsDevice tela1 = null;public static GraphicsDevice tela2 = null;public static boolean tela1Aberta = false;public static boolean tela2Aberta = false;@Override public DataExplorerView createDataExplorerView(Hashtable<String, Object> properties) { if (explorer == null) { explorer = new DicomExplorer(model); model.addPropertyChangeListener(explorer); UIManager.EXPLORER_PLUGIN_TOOLBARS.add(new ImportToolBar(5, explorer)); UIManager.EXPLORER_PLUGIN_TOOLBARS.add(new ExportToolBar(7, explorer)); ViewerPluginBuilder.DefaultDataModel.firePropertyChange( new ObservableEvent(ObservableEvent.BasicAction.NULL_SELECTION, explorer, null, null)); } getQuantidadeMonitores(); return explorer; }
protected void getQuantidadeMonitores() { for (GraphicsDevice tela : ge.getScreenDevices()) { // GA info: Pega as telas disponiveis para ser usadas no EventManager na ação de // rolagem do mouse. int valor = Integer.parseInt( tela.toString().substring(tela.toString().indexOf("=") + 1, tela.toString().indexOf("]"))); if (valor == 0) { tela1 = tela; } else if (valor == 1) { tela2 = tela; } else { System.out.println("######### HÁ MAIS DE DUAS TELA NO COMPUTADOR #############"); } } }I think that simulating a scroll is not a good approach because it is just one aspect of synchronization and therefore does not cover the zoom, pan, rotation..., crosslines display and some other exception rules. In addition, Weasis has no restrictions on the number of screens that windows can be distributed.A better approach would be to manage hanging protocols that allow multiple screens. This requires extending the recording of the synchronization listeners to multiple windows.