use of us.mn.state.dot.tms.FlowStream in project iris by mnit-rtmc.
the class FlowStreamModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<FlowStream>> createColumns() {
ArrayList<ProxyColumn<FlowStream>> cols = new ArrayList<ProxyColumn<FlowStream>>(9);
cols.add(new ProxyColumn<FlowStream>("flow.stream", 140) {
public Object getValueAt(FlowStream fs) {
return fs.getName();
}
});
cols.add(new ProxyColumn<FlowStream>("video.restricted", 100, Boolean.class) {
public Object getValueAt(FlowStream fs) {
return fs.getRestricted();
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "restricted");
}
public void setValueAt(FlowStream fs, Object value) {
if (value instanceof Boolean)
fs.setRestricted((Boolean) value);
}
});
cols.add(new ProxyColumn<FlowStream>("flow.stream.loc.overlay", 120, Boolean.class) {
public Object getValueAt(FlowStream fs) {
return fs.getLocOverlay();
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "locOverlay");
}
public void setValueAt(FlowStream fs, Object value) {
if (value instanceof Boolean)
fs.setLocOverlay((Boolean) value);
}
});
cols.add(new ProxyColumn<FlowStream>("flow.stream.quality", 80) {
public Object getValueAt(FlowStream fs) {
return EncodingQuality.fromOrdinal(fs.getQuality());
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "quality");
}
public void setValueAt(FlowStream fs, Object value) {
if (value instanceof EncodingQuality) {
EncodingQuality q = (EncodingQuality) value;
fs.setQuality(q.ordinal());
}
}
protected TableCellEditor createCellEditor() {
return new DefaultCellEditor(new JComboBox<EncodingQuality>(EncodingQuality.values()));
}
});
cols.add(new ProxyColumn<FlowStream>("camera", 160) {
public Object getValueAt(FlowStream fs) {
return fs.getCamera();
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "camera");
}
public void setValueAt(FlowStream fs, Object value) {
fs.setCamera((value instanceof Camera) ? (Camera) value : null);
}
protected TableCellEditor createCellEditor() {
JComboBox<Camera> cbx = new JComboBox<Camera>();
cbx.setModel(new IComboBoxModel<Camera>(camera_mdl));
return new DefaultCellEditor(cbx);
}
});
cols.add(new ProxyColumn<FlowStream>("video.monitor.num", 90, Integer.class) {
public Object getValueAt(FlowStream fs) {
return fs.getMonNum();
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "monNum");
}
public void setValueAt(FlowStream fs, Object value) {
fs.setMonNum((value instanceof Integer) ? (Integer) value : null);
}
});
cols.add(new ProxyColumn<FlowStream>("flow.stream.address", 110) {
public Object getValueAt(FlowStream fs) {
return fs.getAddress();
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "address");
}
public void setValueAt(FlowStream fs, Object value) {
String v = value.toString().trim();
fs.setAddress(v.length() > 0 ? v : null);
}
});
cols.add(new ProxyColumn<FlowStream>("flow.stream.port", 90, Integer.class) {
public Object getValueAt(FlowStream fs) {
return fs.getPort();
}
public boolean isEditable(FlowStream fs) {
return canWrite(fs, "port");
}
public void setValueAt(FlowStream fs, Object value) {
fs.setPort((value instanceof Integer) ? (Integer) value : null);
}
});
cols.add(new ProxyColumn<FlowStream>("flow.stream.status", 120) {
public Object getValueAt(FlowStream fs) {
return FlowStreamStatus.fromOrdinal(fs.getStatus());
}
});
return cols;
}
use of us.mn.state.dot.tms.FlowStream in project iris by mnit-rtmc.
the class VideoMonitorImpl method doSetCamMirrored.
/**
* Set camera on all video monitors / flow streams with a given number.
* @param mn Monitor number.
* @param c Camera to display.
* @param src Source of command.
* @param select Was source a new camera selection.
*/
private static void doSetCamMirrored(int mn, CameraImpl c, String src, boolean select) throws TMSException {
Iterator<VideoMonitor> it = VideoMonitorHelper.iterator();
while (it.hasNext()) {
VideoMonitor m = it.next();
if (m instanceof VideoMonitorImpl) {
VideoMonitorImpl vm = (VideoMonitorImpl) m;
if (vm.getMonNum() == mn)
vm.setCamNotify(c, src, select);
}
}
Iterator<FlowStream> fit = FlowStreamHelper.iterator();
while (fit.hasNext()) {
FlowStream f = fit.next();
if (f instanceof FlowStreamImpl) {
FlowStreamImpl fs = (FlowStreamImpl) f;
Integer num = fs.getMonNum();
if (num != null && num == mn)
fs.setMonCamera(c);
}
}
}
use of us.mn.state.dot.tms.FlowStream in project iris by mnit-rtmc.
the class VideoMonitorImpl method blankRestrictedMonitors.
/**
* Blank restricted video monitors viewing a camera
*/
public static void blankRestrictedMonitors() {
Iterator<VideoMonitor> it = VideoMonitorHelper.iterator();
while (it.hasNext()) {
VideoMonitor m = it.next();
if (m instanceof VideoMonitorImpl) {
VideoMonitorImpl vm = (VideoMonitorImpl) m;
vm.blankRestricted();
}
}
Iterator<FlowStream> fit = FlowStreamHelper.iterator();
while (fit.hasNext()) {
FlowStream f = fit.next();
if (f instanceof FlowStreamImpl) {
FlowStreamImpl fs = (FlowStreamImpl) f;
fs.updateStream();
}
}
}
Aggregations