⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vijxtadialogpanel.java

📁 jxta官方例程
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                                        while(updateThreadRun) {                        EventQueue.invokeLater(new Runnable() {                            public void run() {                                                                long tmp = 0;                                                                if(getCallControl().getLocalMonitorControl().isTransmit()) {                                    refreshRateLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getRefreshRate()) + " fps");                                                                        bytesSentLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getBytesSent()));                                                                        messagesSentLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getMessagesSent()));                                                                        outgoingImageCompressionLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getImageCompression()));                                                                        tmp = getCallControl().getLocalMonitorControl().getMessagesSent();                                    outgoingMessagesPerSecondLabel.setText(String.valueOf(                                            tmp - previousOutgoingMessagesValue));                                    previousOutgoingMessagesValue = tmp;                                                                                                            tmp = getCallControl().getLocalMonitorControl().getBytesSent();                                    outgoingBytesPerSecondLabel.setText(String.valueOf(                                            tmp - previousOutgoingBytesValue));                                    previousOutgoingBytesValue = tmp;                                                                        encodeTimeLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getImageEncodeTime()));                                                                        averageEncodeTimeLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getAverageImageEncodeTime()));                                                                        outgoingBufferSizeLabel.setText(String.valueOf(getCallControl().getLocalMonitorControl().getBufferSize()));                                                                                                        }                                                                bytesReceivedLabel.setText(String.valueOf(getCallControl().getRemoteMonitorControl().getBytesReceived()));                                                                messagesReceivedLabel.setText(String.valueOf(getCallControl().getRemoteMonitorControl().getMessagesReceived()));                                                                incomingImageCompressionLabel.setText(String.valueOf(getCallControl().getRemoteMonitorControl().getImageCompression()));                                                                roundTripTimeLabel.setText(String.valueOf(getCallControl().getRoundTripTime()));                                                                callEndTimeLabel.setText(getCallControl().getCallEndTimeString());                                                                callStartTimeLabel.setText(getCallControl().getCallStartTimeString());                                                                callElapsedTimeLabel.setText(getCallControl().getCallElapseTimeString());                                                                tmp = getCallControl().getRemoteMonitorControl().getMessagesReceived();                                incomingMessagesPerSecondLabel.setText(String.valueOf(                                        tmp - previousIncomingMessagesValue));                                previousIncomingMessagesValue = tmp;                                                                tmp = getCallControl().getRemoteMonitorControl().getBytesReceived();                                incomingBytesPerSecondLabel.setText(String.valueOf(                                        tmp - previousIncomingBytesValue));                                previousIncomingBytesValue = tmp;                                                                decodeTimeLabel.setText(String.valueOf(getCallControl().getRemoteMonitorControl().getImageDecodeTime()));                                                                averageDecodeTimeLabel.setText(String.valueOf(getCallControl().getRemoteMonitorControl().getAverageImageDecodeTime()));                                                                                                incomingBufferSizeLabel.setText(String.valueOf(getCallControl().getRemoteMonitorControl().getBufferSize()));                            }                        });                                                try{                                                        Thread.sleep(UI_UPDATE_INTERVAL);                                                    }catch(InterruptedException ix) {                            ix.printStackTrace();                        }                    }                                    }            });                        updateThread.setDaemon(true);            updateThread.setPriority(Thread.MIN_PRIORITY);                        if (LOG.isEnabledFor(Level.INFO)) {                LOG.info("before init session");;            }                        this.getCallControl().initSession();                        if (LOG.isEnabledFor(Level.INFO)) {                LOG.info("after init session");;            }                    }    }            public void protocolStateChanged(int protocolState) {                        if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_INVITE_REQUEST_SENT) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_INVITE_REQUEST + " Sent");                        showPanel(this.CONFIG_PANEL);                        showConfigPanel(this.CONFIG_VIDEO_SOURCE_PANEL);                    }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_INVITE_REQUEST_RECEIVED) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_INVITE_REQUEST + " Received");                        String tmpString = this.getCallControl().getRemoteMonitorControl().getOriginator();                        final String originator = tmpString == null ? "Unknown Remote" : tmpString;                        final String localPeer = this.myJxtaView.getControl().getPeerName();                        this.myJxtaView.updatePluginPanel(this, originator);                        EventQueue.invokeLater(new Runnable() {                public void run() {                                        holdResumeCallButton.setEnabled(false);                                        endCallButton.setEnabled(true);                                        statsButton.setEnabled(true);                                        placeAcceptCallButton.setText(STRINGS.getString("action.vijxta.acceptcall"));                                        placeAcceptCallButton.setEnabled(false);                                                            remoteMonitorPanel.setBorder(new TitledBorder(originator));                                        localMonitorPanel.setBorder(new TitledBorder(localPeer));                                    }            });                        showPanel(this.CONFIG_PANEL);                        showConfigPanel(this.CONFIG_VIDEO_SOURCE_PANEL);                                }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_INVITE_ACCEPT_RECEIVED) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_INVITE_ACCEPT + " Received");                        String tmpString = this.getCallControl().getRemoteMonitorControl().getOriginator();                        final String originator = tmpString == null ? "Unknown Remote" : tmpString;                        final String localPeer = this.myJxtaView.getControl().getPeerName();                        EventQueue.invokeLater(new Runnable() {                public void run() {                                        remoteMonitorPanel.setBorder(new TitledBorder(originator));                                        localMonitorPanel.setBorder(new TitledBorder(localPeer));                                                                                placeAcceptCallButton.setText(STRINGS.getString("action.vijxta.placecall"));                                    }            });                        showPanel(this.CONFIG_PANEL);                        showConfigPanel(this.CONFIG_VIDEO_SOURCE_PANEL);                        this.myJxtaView.updatePluginPanel(this, originator);                                }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_CONFIG_REQUEST_SENT) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_CONFIG_REQUEST + " Sent");                                }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_CONFIG_ACCEPT_RECEIVED) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_CONFIG_ACCEPT + " Received");                        if(getCallControl().getLocalMonitorControl() == null) {                                                                EventQueue.invokeLater(new Runnable() {                    public void run() {                                                errorMessageLabel.setText("LocalMonitorControl not available, null");                                                                    }                });                                showPanel(this.ERROR_PANEL);                                if (LOG.isEnabledFor(Level.INFO)) {                    LOG.info("LocalMonitorControl is NULL, Ending Call");                }                                getCallControl().viewActionEndCall();                            }            boolean transmit = getCallControl().getLocalMonitorControl().isTransmit();                        boolean receive = this.getCallControl().getRemoteMonitorControl().isReceive();                        Dimension transmitSize = null;            Dimension receiveSize = null;                        int padding = 40;                        Dimension tmpSize = null;            /** from the config elements aattempt to make all vid panels the same size */            if(transmit) {                                tmpSize = this.getCallControl().getLocalMonitorControl().getFormatSize();                                transmitSize = new Dimension((int)tmpSize.getWidth() + padding, (int)tmpSize.getHeight() + padding);                                if(!receive) {                                        receiveSize = new Dimension((int)transmitSize.getWidth() + padding, (int)transmitSize.getHeight() + padding);                }            }            if(receive) {                if (LOG.isEnabledFor(Level.INFO)) {                    LOG.info("RECEIVE");                }                tmpSize = this.getCallControl().getRemoteMonitorControl().getFormatSize();                                receiveSize = new Dimension((int)tmpSize.getWidth() + padding, (int) tmpSize.getHeight() + padding);                                if(!transmit) {                                        transmitSize = new Dimension((int)receiveSize.getWidth() + padding,(int) receiveSize.getHeight() + padding);                }                            }else{                if (LOG.isEnabledFor(Level.INFO)) {                    LOG.info("NOT RECEIVE");                }            }                        final Dimension tSize = transmitSize;            final Dimension rSize = receiveSize;            if (LOG.isEnabledFor(Level.INFO)) {                LOG.info("transmitPanelSize "+transmitSize);                LOG.info("receivePanelSize "+receiveSize);            }                        EventQueue.invokeLater(new Runnable() {                public void run() {                                        localMonitorPanel.setPreferredSize(tSize);                                        remoteMonitorPanel.setPreferredSize(rSize);                                        placeAcceptCallButton.setEnabled(true);                                        if(getCallControl().getLocalMonitorControl().getRefreshRateLabelTable() != null) {                        refreshRateSlider.setLabelTable(getCallControl().getLocalMonitorControl().getRefreshRateLabelTable());                    }                }            });                                }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_CONFIG_REQUEST_RECEIVED) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_CONFIG_REQUEST + " Received");                                            }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_CONFIG_ACCEPT_SENT) {                        final boolean transmit = getCallControl().getLocalMonitorControl().isTransmit();                        final boolean receive = this.getCallControl().getRemoteMonitorControl().isReceive();                        Dimension transmitSize = null;            Dimension receiveSize = null;                        int padding = 40;                        Dimension tmpSize = null;                        if(transmit) {                                tmpSize = this.getCallControl().getLocalMonitorControl().getFormatSize();                                transmitSize = new Dimension((int)tmpSize.getWidth() + padding, (int)tmpSize.getHeight() + padding);                                if(!receive) {                                        receiveSize = new Dimension((int)transmitSize.getWidth() + padding, (int)transmitSize.getHeight() + padding);                }            }            if(receive) {                                tmpSize = this.getCallControl().getRemoteMonitorControl().getFormatSize();                                receiveSize = new Dimension((int)tmpSize.getWidth() + padding, (int) tmpSize.getHeight() + padding);                                if(!transmit) {                                        transmitSize = new Dimension((int)receiveSize.getWidth() + padding,(int) receiveSize.getHeight() + padding);                }                            }                        final Dimension tSize = transmitSize;            final Dimension rSize = receiveSize;                                    final boolean isTransmit = transmit;                        EventQueue.invokeLater(new Runnable() {                public void run() {                                        localMonitorPanel.setPreferredSize(tSize);                                        remoteMonitorPanel.setPreferredSize(rSize);                                        if(isTransmit) {                                                imageQualitySlider.setEnabled(true);                                                refreshRateSlider.setEnabled(true);                    }                                        if(getCallControl().getLocalMonitorControl().getRefreshRateLabelTable() != null) {                                                refreshRateSlider.setLabelTable(getCallControl().getLocalMonitorControl().getRefreshRateLabelTable());                                            }                                    }            });                                }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_START_REQUEST_SENT) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_START_REQUEST + " Sent");                                }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_START_REQUEST_RECEIVED) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_START_REQUEST + " Received");                        if(this.getCallControl().isRemotePeerTransmit()) {                                this.getCallControl().getRemoteMonitorControl().obtainHardware();                            }else{                // nothing to do... we are transmit only            }                        EventQueue.invokeLater(new Runnable() {                public void run() {                                        placeAcceptCallButton.setEnabled(true);                                    }            });                                            }else if(protocolState == ViJxtaCallControl.SESSION_VIJXTA_START_ACCEPT_RECEIVED) {                        updateProtocolStateLabel(ViJxtaCallControl.COMMAND_VIJXTA_START_ACCEPT + " Received");                        if(this.getCallControl().isRemotePeerTransmit()) {                                this.getCallControl().getRemoteMonitorControl().obtainHardware();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -