Commit 726a3366 authored by Piotr Różański's avatar Piotr Różański Committed by Marian Dovgialo

#45481 Small cleanup around "Add camera" button

parent fc423d04
......@@ -28,18 +28,12 @@ public AddCameraAction(ViewerElementManager viewerElementManager) {
@Override
public void actionPerformed(ActionEvent ev) {
if (!VideoFrame.isVideoAvailable()) {
return;
}
GetAvailableVideoWorker worker = new GetAvailableVideoWorker(viewerElementManager.getDialogParent());
worker.addPropertyChangeListener(new OnlineVideoFrameInitializer(worker));
worker.execute();
}
/**
* Enables this action if and only if
* the software support for video preview is available.
*/
@Override
public void setEnabledAsNeeded() {
setEnabled(VideoFrame.isVideoAvailable());
}
}
......@@ -4,10 +4,12 @@
package org.signalml.app.view.workspace;
import com.alee.laf.tabbedpane.WebTabbedPane;
import static org.signalml.app.util.i18n.SvarogI18n._;
import static org.signalml.app.util.i18n.SvarogI18n._R;
import com.alee.laf.tabbedpane.WebTabbedPane;
import com.thoughtworks.xstream.XStream;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Window;
......@@ -25,6 +27,9 @@
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import org.signalml.SignalMLOperationMode;
import org.signalml.app.action.HelpContentsAction;
import org.signalml.app.action.RunMethodAction;
......@@ -93,6 +98,7 @@
import org.signalml.app.model.workspace.WorkspaceTreeModel;
import org.signalml.app.task.ApplicationTaskManager;
import org.signalml.app.util.IconUtils;
import org.signalml.app.video.VideoFrame;
import org.signalml.app.view.View;
import org.signalml.app.view.book.AtomTableDialog;
import org.signalml.app.view.book.BookView;
......@@ -119,6 +125,7 @@
import org.signalml.app.view.tag.TagStylePaletteDialog;
import org.signalml.app.view.tag.TagStylePresetDialog;
import org.signalml.app.view.tag.comparison.TagComparisonDialog;
import org.signalml.app.worker.monitor.ObciServerCapabilities;
import org.signalml.codec.SignalMLCodecManager;
import org.signalml.domain.montage.filter.TimeDomainSampleFilter;
import org.signalml.method.Method;
......@@ -129,17 +136,10 @@
import org.signalml.plugin.export.view.DocumentView;
import org.signalml.plugin.export.view.ViewerTreePane;
import org.signalml.psychopy.view.PsychopyExperimentDialog;
import org.signalml.psychopy.action.ShowPsychopyDialogButton;
import org.signalml.util.SvarogConstants;
import com.thoughtworks.xstream.XStream;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import org.signalml.app.worker.monitor.ObciServerCapabilities;
/** ViewerElementManager
*
/**
* ViewerElementManager
*
* @author Michal Dobaczewski © 2007-2008 CC Otwarte Systemy Komputerowe Sp. z o.o.
*/
......@@ -675,6 +675,7 @@ public void menuSelected(MenuEvent me) {
);
getAddCameraAction().setEnabled(
ObciServerCapabilities.getSharedInstance().hasCameraServer()
&& VideoFrame.isVideoAvailable()
);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment