Updates alias list to provide a list of aliases for an identifier so that (#474)

we can account for multi-alias identifiers like patch groups and ensure
that patch group alias intentions are carried throughout the system for
recording, streaming, etc.

Updates all consumers of alias list data to ensure it can operate with
a list of aliases versus an assumed single alias.

Refactors APCO25 unit/user status identifiers from a base status class
so that alias list can support status identifiers.
This commit is contained in:
Denny Sheirer
2018-12-31 07:24:25 -05:00
committed by GitHub
parent 08ea5ab7cb
commit 3a39ae76ba
23 changed files with 484 additions and 189 deletions

View File

@@ -32,6 +32,7 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Point2D;
import java.util.Collections;
import java.util.List;
public class PlottableEntityRenderer
@@ -58,7 +59,10 @@ public class PlottableEntityRenderer
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
Alias alias = getAlias(entity);
List<Alias> aliases = getAliases(entity);
Alias alias = aliases.isEmpty() ? null : aliases.get(0);
/**
* Use the entity's preferred color for lines and labels
*/
@@ -99,16 +103,16 @@ public class PlottableEntityRenderer
/**
* Optional alias that matches the identifier for the entity history
*/
private Alias getAlias(PlottableEntityHistory entityHistory)
private List<Alias> getAliases(PlottableEntityHistory entityHistory)
{
AliasList aliasList = mAliasModel.getAliasList(entityHistory.getIdentifierCollection());
if(aliasList != null)
{
return aliasList.getAlias(entityHistory.getIdentifier());
return aliasList.getAliases(entityHistory.getIdentifier());
}
return null;
return Collections.EMPTY_LIST;
}
private ImageIcon getIcon(Alias alias)