Search in sources :

Example 1 with DMS

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);
    }
}
Also used : SignGroup(us.mn.state.dot.tms.SignGroup) Shape(java.awt.Shape) Color(java.awt.Color) AffineTransform(java.awt.geom.AffineTransform) DMS(us.mn.state.dot.tms.DMS) AlertState(us.mn.state.dot.tms.AlertState)

Example 2 with DMS

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);
}
Also used : DMS(us.mn.state.dot.tms.DMS) MapObject(us.mn.state.dot.tms.client.map.MapObject)

Example 3 with 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;
}
Also used : SignConfig(us.mn.state.dot.tms.SignConfig) DMS(us.mn.state.dot.tms.DMS)

Example 4 with DMS

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);
        }
    }
}
Also used : DMS(us.mn.state.dot.tms.DMS)

Example 5 with DMS

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);
}
Also used : SignMessage(us.mn.state.dot.tms.SignMessage) DMS(us.mn.state.dot.tms.DMS)

Aggregations

DMS (us.mn.state.dot.tms.DMS)31 SignGroup (us.mn.state.dot.tms.SignGroup)8 DmsSignGroup (us.mn.state.dot.tms.DmsSignGroup)6 ArrayList (java.util.ArrayList)3 SignConfig (us.mn.state.dot.tms.SignConfig)3 HashMap (java.util.HashMap)2 ActionPlan (us.mn.state.dot.tms.ActionPlan)2 LCS (us.mn.state.dot.tms.LCS)2 MapObject (us.mn.state.dot.tms.client.map.MapObject)2 DMSImpl (us.mn.state.dot.tms.server.DMSImpl)2 Color (java.awt.Color)1 Shape (java.awt.Shape)1 AffineTransform (java.awt.geom.AffineTransform)1 HashSet (java.util.HashSet)1 TreeSet (java.util.TreeSet)1 AlertState (us.mn.state.dot.tms.AlertState)1 ChangeVetoException (us.mn.state.dot.tms.ChangeVetoException)1 Device (us.mn.state.dot.tms.Device)1 DevicePurpose (us.mn.state.dot.tms.DevicePurpose)1 DmsAction (us.mn.state.dot.tms.DmsAction)1