use of us.mn.state.dot.tms.RoadClass in project iris by mnit-rtmc.
the class RoadModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<Road>> createColumns() {
ArrayList<ProxyColumn<Road>> cols = new ArrayList<ProxyColumn<Road>>(4);
cols.add(new ProxyColumn<Road>("location.road", 200) {
public Object getValueAt(Road r) {
return r.getName();
}
});
cols.add(new ProxyColumn<Road>("location.road.abbrev", 80) {
public Object getValueAt(Road r) {
return r.getAbbrev();
}
public boolean isEditable(Road r) {
return canWrite(r);
}
public void setValueAt(Road r, Object value) {
r.setAbbrev(value.toString());
}
});
cols.add(new ProxyColumn<Road>("location.road.class", 120) {
public Object getValueAt(Road r) {
return RoadClass.fromOrdinal(r.getRClass());
}
public boolean isEditable(Road r) {
return canWrite(r);
}
public void setValueAt(Road r, Object value) {
if (value instanceof RoadClass) {
RoadClass c = (RoadClass) value;
r.setRClass((short) c.ordinal());
}
}
protected TableCellEditor createCellEditor() {
JComboBox<RoadClass> cbx = new JComboBox<RoadClass>(RoadClass.values());
return new DefaultCellEditor(cbx);
}
});
cols.add(new ProxyColumn<Road>("location.direction", 120) {
public Object getValueAt(Road r) {
return Direction.fromOrdinal(r.getDirection());
}
public boolean isEditable(Road r) {
return canWrite(r);
}
public void setValueAt(Road r, Object value) {
if (value instanceof Direction) {
Direction d = (Direction) value;
r.setDirection((short) d.ordinal());
}
}
protected TableCellEditor createCellEditor() {
JComboBox<Direction> cbx = new JComboBox<Direction>(Direction.values());
return new DefaultCellEditor(cbx);
}
});
return cols;
}
use of us.mn.state.dot.tms.RoadClass in project iris by mnit-rtmc.
the class MapSegment method roadClassScale.
/**
* Get the scale factor for the road class
*/
private float roadClassScale() {
Road r = getR_Node().getGeoLoc().getRoadway();
RoadClass rc = RoadClass.fromOrdinal(r.getRClass());
return rc.scale * UI.scale;
}
Aggregations