use of us.mn.state.dot.tms.PlanPhase in project iris by mnit-rtmc.
the class DmsActionModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<DmsAction>> createColumns() {
ArrayList<ProxyColumn<DmsAction>> cols = new ArrayList<ProxyColumn<DmsAction>>(5);
cols.add(new ProxyColumn<DmsAction>("action.plan.dms.group", 120) {
public Object getValueAt(DmsAction da) {
return da.getSignGroup();
}
});
cols.add(new ProxyColumn<DmsAction>("action.plan.phase", 100) {
public Object getValueAt(DmsAction da) {
return da.getPhase();
}
public boolean isEditable(DmsAction da) {
return canWrite(da);
}
public void setValueAt(DmsAction da, Object value) {
if (value instanceof PlanPhase)
da.setPhase((PlanPhase) value);
}
protected TableCellEditor createCellEditor() {
JComboBox<PlanPhase> cbx = new JComboBox<PlanPhase>();
cbx.setModel(new IComboBoxModel<PlanPhase>(phase_mdl));
return new DefaultCellEditor(cbx);
}
});
cols.add(new ProxyColumn<DmsAction>("quick.message", 160) {
public Object getValueAt(DmsAction da) {
return da.getQuickMessage();
}
public boolean isEditable(DmsAction da) {
return canWrite(da);
}
public void setValueAt(DmsAction da, Object value) {
String v = value.toString().trim();
da.setQuickMessage(QuickMessageHelper.lookup(v));
}
});
cols.add(new ProxyColumn<DmsAction>("dms.beacon.enabled", 100, Boolean.class) {
public Object getValueAt(DmsAction da) {
return da.getBeaconEnabled();
}
public boolean isEditable(DmsAction da) {
return canWrite(da);
}
public void setValueAt(DmsAction da, Object value) {
if (value instanceof Boolean)
da.setBeaconEnabled((Boolean) value);
}
});
cols.add(new ProxyColumn<DmsAction>("dms.msg.priority", 120) {
public Object getValueAt(DmsAction da) {
return DmsMsgPriority.fromOrdinal(da.getMsgPriority());
}
public boolean isEditable(DmsAction da) {
return canWrite(da);
}
public void setValueAt(DmsAction da, Object value) {
if (value instanceof DmsMsgPriority) {
DmsMsgPriority p = (DmsMsgPriority) value;
da.setMsgPriority(p.ordinal());
}
}
protected TableCellEditor createCellEditor() {
JComboBox<DmsMsgPriority> cbx = new JComboBox<DmsMsgPriority>(PRIORITIES);
return new DefaultCellEditor(cbx);
}
});
return cols;
}
use of us.mn.state.dot.tms.PlanPhase in project iris by mnit-rtmc.
the class PlanDispatcher method createPhaseSet.
/**
* Create a set of phases for an action plan
*/
private TreeSet<PlanPhase> createPhaseSet(final ActionPlan ap) {
final TreeSet<PlanPhase> phases = new TreeSet<PlanPhase>(comparator);
Iterator<DmsAction> dit = DmsActionHelper.iterator();
while (dit.hasNext()) {
DmsAction da = dit.next();
if (da.getActionPlan() == ap)
phases.add(da.getPhase());
}
Iterator<BeaconAction> bit = BeaconActionHelper.iterator();
while (bit.hasNext()) {
BeaconAction ba = bit.next();
if (ba.getActionPlan() == ap)
phases.add(ba.getPhase());
}
Iterator<CameraAction> cit = CameraActionHelper.iterator();
while (cit.hasNext()) {
CameraAction ca = cit.next();
if (ca.getActionPlan() == ap)
phases.add(ca.getPhase());
}
Iterator<LaneAction> lit = LaneActionHelper.iterator();
while (lit.hasNext()) {
LaneAction la = lit.next();
if (la.getActionPlan() == ap)
phases.add(la.getPhase());
}
Iterator<MeterAction> mit = MeterActionHelper.iterator();
while (mit.hasNext()) {
MeterAction ma = mit.next();
if (ma.getActionPlan() == ap)
phases.add(ma.getPhase());
}
return phases;
}
use of us.mn.state.dot.tms.PlanPhase in project iris by mnit-rtmc.
the class PlanPhaseModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<PlanPhase>> createColumns() {
ArrayList<ProxyColumn<PlanPhase>> cols = new ArrayList<ProxyColumn<PlanPhase>>(3);
cols.add(new ProxyColumn<PlanPhase>("action.plan.phase.name", 120) {
public Object getValueAt(PlanPhase p) {
return p.getName();
}
});
cols.add(new ProxyColumn<PlanPhase>("action.plan.phase.hold", 120, Integer.class) {
public Object getValueAt(PlanPhase p) {
return p.getHoldTime();
}
public boolean isEditable(PlanPhase p) {
return canWrite(p);
}
public void setValueAt(PlanPhase p, Object value) {
if (value instanceof Integer)
p.setHoldTime((Integer) value);
}
});
cols.add(new ProxyColumn<PlanPhase>("action.plan.phase.next", 120) {
public Object getValueAt(PlanPhase p) {
return p.getNextPhase();
}
public boolean isEditable(PlanPhase p) {
return canWrite(p);
}
public void setValueAt(PlanPhase p, Object value) {
if (value instanceof PlanPhase)
p.setNextPhase((PlanPhase) value);
else
p.setNextPhase(null);
}
protected TableCellEditor createCellEditor() {
JComboBox<PlanPhase> cbx = new JComboBox<PlanPhase>();
cbx.setModel(new IComboBoxModel<PlanPhase>(phase_mdl));
return new DefaultCellEditor(cbx);
}
});
return cols;
}
use of us.mn.state.dot.tms.PlanPhase in project iris by mnit-rtmc.
the class TimeActionModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<TimeAction>> createColumns() {
ArrayList<ProxyColumn<TimeAction>> cols = new ArrayList<ProxyColumn<TimeAction>>(4);
cols.add(new ProxyColumn<TimeAction>("action.plan.day", 100) {
public Object getValueAt(TimeAction ta) {
return ta.getDayPlan();
}
});
cols.add(new ProxyColumn<TimeAction>("action.plan.date", 100) {
public Object getValueAt(TimeAction ta) {
return ta.getSchedDate();
}
});
cols.add(new ProxyColumn<TimeAction>("action.plan.time", 80) {
public Object getValueAt(TimeAction ta) {
return ta.getTimeOfDay();
}
});
cols.add(new ProxyColumn<TimeAction>("action.plan.phase", 100) {
public Object getValueAt(TimeAction ta) {
return ta.getPhase();
}
public boolean isEditable(TimeAction ta) {
return canWrite(ta);
}
public void setValueAt(TimeAction ta, Object value) {
if (value instanceof PlanPhase)
ta.setPhase((PlanPhase) value);
}
protected TableCellEditor createCellEditor() {
JComboBox<PlanPhase> cbx = new JComboBox<PlanPhase>();
cbx.setModel(new IComboBoxModel<PlanPhase>(phase_mdl));
return new DefaultCellEditor(cbx);
}
});
return cols;
}
use of us.mn.state.dot.tms.PlanPhase in project iris by mnit-rtmc.
the class ActionPlanPanel method createObject.
/**
* Create a new proxy object
*/
@Override
protected void createObject() {
ActionPlanModel mdl = getActionPlanModel();
if (mdl != null) {
PlanPhase p = phase_mdl.getSelectedProxy();
if (p != null) {
String name = add_txt.getText().trim();
mdl.create(name, p);
}
}
add_txt.setText("");
phase_mdl.setSelectedItem(null);
}
Aggregations