/** * Hide the left part of the main split pane if both it's components are visible. If either of * them are visible, show it. */ private void layoutSplitPane() { boolean visible = channelListPanel.isVisible() || metadataPanel.isVisible(); if (leftPanel.isVisible() != visible) { leftPanel.setVisible(visible); splitPane.resetToPreferredSizes(); } }
private void initFrame() { frame = Application.getInstance(RDV.class).getMainFrame(); setLayout(new BorderLayout()); c = new GridBagConstraints(); initActions(); initMenuBar(); initChannelListPanel(); initMetadataPanel(); initLeftPanel(); initRightPanel(); initControls(); initDataPanelContainer(); initAudioPlayerPanel(); initMarkerSubmitPanel(); initSplitPane(); channelListPanel.addChannelSelectionListener(metadataPanel); rbnb.addSubscriptionListener(controlPanel); rbnb.addTimeListener(controlPanel); rbnb.addStateListener(channelListPanel); rbnb.addStateListener(controlPanel); rbnb.addStateListener(this); rbnb.getMetadataManager().addMetadataListener(channelListPanel); rbnb.getMetadataManager().addMetadataListener(metadataPanel); rbnb.getMetadataManager().addMetadataListener(controlPanel); rbnb.addPlaybackRateListener(controlPanel); rbnb.addTimeScaleListener(controlPanel); rbnb.addMessageListener(this); rbnb.addConnectionListener(this); }
public void showExportVideoDialog() { List<String> channels = channelListPanel.getSelectedChannels(); // remove non-data channels for (int i = channels.size() - 1; i >= 0; i--) { Channel channel = RBNBController.getInstance().getChannel(channels.get(i)); String mime = channel.getMetadata("mime"); if (!mime.equals("image/jpeg")) { channels.remove(i); } } // don't bring up the dialog if there are no channels specified if (channels.isEmpty()) { JOptionPane.showMessageDialog( null, "There are no video channels selected.", "Error", JOptionPane.ERROR_MESSAGE); return; } new ExportVideoDialog(frame, rbnb, channels); }
private void initChannelListPanel() { channelListPanel = new ChannelListPanel(dataPanelManager, rbnb); channelListPanel.setMinimumSize(new Dimension(0, 0)); log.info("Created channel list panel."); }
/** * Gets if hidden channels are visible in the UI. * * @return true if hidden channels are visible, false otherwise */ public boolean isHiddenChannelsVisible() { return channelListPanel.isShowingHiddenChannles(); }
/** * Gets a list of channels selected in the channel list. * * @return a list of selected channels */ public List<String> getSelectedChannels() { return channelListPanel.getSelectedChannels(); }