use of us.mn.state.dot.tms.DMS in project iris by mnit-rtmc.
the class AlertTheme method drawAlert.
/**
* Draw an alert
*/
private void drawAlert(Graphics2D g, AlertInfo ai) {
// save the current transform before drawing anything
AffineTransform t = g.getTransform();
// use alert state to set outline and fill color
Color outline = CLEARED_ALERT_COLOR;
Color fill = CLEARED_ALERT_FILL;
AlertState st = AlertState.fromOrdinal(ai.getAlertState());
switch(st) {
case PENDING:
outline = PENDING_ALERT_COLOR;
fill = PENDING_ALERT_FILL;
break;
case ACTIVE:
outline = ACTIVE_ALERT_COLOR;
fill = ACTIVE_ALERT_FILL;
break;
}
// draw the polygons on the graphics context
g.setStroke(LINE_SOLID);
ArrayList<Shape> shapes = getShapes(ai);
for (Shape shp : shapes) {
g.setColor(outline);
g.draw(shp);
g.setColor(fill);
g.fill(shp);
}
// set the scale on the theme before getting the symbol
float scale = dManager.getLayerState().getScale();
dmsTheme.setScale(scale);
dmsSymbol = (VectorSymbol) dmsTheme.getSymbol();
if (st == AlertState.PENDING) {
// draw all DMS in group, then auto DMS
// (in that order so the styles look right)
SignGroup sg = ai.getSignGroup();
for (DMS d : SignGroupHelper.getAllSigns(sg)) drawDms(g, d, dmsAvailableStyle, t);
for (DMS d : findPlanSigns(ai)) drawDms(g, d, dmsDeployedStyle, t);
} else if (st == AlertState.ACTIVE) {
// for active alerts draw only deployed DMS
for (DMS d : findPlanSigns(ai)) drawDms(g, d, dmsDeployedStyle, t);
} else {
// but using "all" style
for (DMS d : findPlanSigns(ai)) drawDms(g, d, dmsAllStyle, t);
}
}
use of us.mn.state.dot.tms.DMS in project iris by mnit-rtmc.
the class AlertDmsDispatcher method selectDmsInTable.
/**
* Select a DMS at the specified point
*/
public void selectDmsInTable(Point2D p) {
MapObject mo = dms_manager.getLayerState().search(p);
DMS dms = dms_manager.findProxy(mo);
selectDmsInTable(dms);
}
use of us.mn.state.dot.tms.DMS in project iris by mnit-rtmc.
the class DMSDispatcher method getValidSelected.
/**
* Get set of selected DMS with the same sign configuration
*/
private Set<DMS> getValidSelected() {
SignConfig sc = null;
Set<DMS> sel = sel_mdl.getSelected();
Iterator<DMS> it = sel.iterator();
while (it.hasNext()) {
DMS dms = it.next();
if (sc != null && dms.getSignConfig() != sc)
it.remove();
else
sc = dms.getSignConfig();
}
return sel;
}
use of us.mn.state.dot.tms.DMS in project iris by mnit-rtmc.
the class DMSDispatcher method updateSelected.
/**
* Update the selected sign(s)
*/
private void updateSelected() {
Set<DMS> sel = sel_mdl.getSelected();
if (sel.size() == 0)
clearSelected();
else {
for (DMS dms : sel) {
composer.setSign(dms);
setSelected(dms);
break;
}
if (sel.size() > 1) {
singleTab.setSelected(null);
setEnabled(true);
}
}
}
use of us.mn.state.dot.tms.DMS in project iris by mnit-rtmc.
the class DMSDispatcher method sendMessage.
/**
* Send a new message to all selected DMS
*/
private void sendMessage() {
Set<DMS> signs = getValidSelected();
if (signs.size() > 1)
unlinkIncident();
for (DMS dms : signs) {
SignMessage sm = createMessage(dms);
if (sm != null)
dms.setMsgUser(sm);
composer.updateMessageLibrary();
}
selectPreview(false);
}
Aggregations