public void setDeviceNumber(Integer deviceNumber) throws PropertyVetoException { if (deviceNumber != null) { try { if (frameGrabber != null) { try { frameGrabber.getConstructor(int.class); } catch (NoSuchMethodException e) { frameGrabber.getConstructor(Integer.class); } } setDevicePath(null); setDeviceFile(null); } catch (NoSuchMethodException e) { throw new PropertyVetoExceptionThatNetBeansLikes(frameGrabber.getSimpleName() + " does not accept a deviceNumber.", new PropertyChangeEvent(this, "deviceNumber", this.deviceNumber, this.deviceNumber = null)); } } String oldDescription = getDescription(); firePropertyChange("deviceNumber", this.deviceNumber, this.deviceNumber = deviceNumber); firePropertyChange("description", oldDescription, getDescription()); }
public void setDevicePath(String devicePath) throws PropertyVetoException { if (devicePath != null) { try { if (frameGrabber != null) { frameGrabber.getConstructor(String.class); } setDeviceNumber(null); setDeviceFile(null); } catch (NoSuchMethodException e) { devicePath = ""; throw new PropertyVetoExceptionThatNetBeansLikes(frameGrabber.getSimpleName() + " does not accept a devicePath.", new PropertyChangeEvent(this, "devicePath", this.devicePath, this.devicePath = null)); } } String oldDescription = getDescription(); firePropertyChange("devicePath", this.devicePath, this.devicePath = devicePath); firePropertyChange("description", oldDescription, getDescription()); }
public void setDeviceFile(File deviceFile) throws PropertyVetoException { if (deviceFile != null) { try { if (frameGrabber != null) { frameGrabber.getConstructor(File.class); } setDeviceNumber(null); setDevicePath(null); } catch (NoSuchMethodException e) { deviceFile = null; throw new PropertyVetoExceptionThatNetBeansLikes(frameGrabber.getSimpleName() + " does not accept a deviceFile.", new PropertyChangeEvent(this, "deviceFile", this.deviceFile, this.deviceFile = null)); } } String oldDescription = getDescription(); firePropertyChange("deviceFile", this.deviceFile, this.deviceFile = deviceFile); firePropertyChange("description", oldDescription, getDescription()); } public String getDeviceFilename() {
public void setFrameGrabber(Class<? extends FrameGrabber> frameGrabber) { String oldDescription = getDescription(); firePropertyChange("frameGrabber", this.frameGrabber, this.frameGrabber = frameGrabber); firePropertyChange("description", oldDescription, getDescription()); firePropertyChange("deviceNumber", this.deviceNumber, this.deviceNumber = null); firePropertyChange("deviceFile", this.deviceFile, this.deviceFile = null); firePropertyChange("devicePath", this.devicePath, this.devicePath = null); return; hasDeviceNumber = true; } catch (NoSuchMethodException e2) { firePropertyChange("deviceNumber", this.deviceNumber, this.deviceNumber = null); frameGrabber.getConstructor(File.class); } catch (NoSuchMethodException e) { firePropertyChange("deviceFile", this.deviceFile, this.deviceFile = null); firePropertyChange("devicePath", this.devicePath, this.devicePath = null);