Package org.onosproject.ui.topo
Class NodeBadge
- java.lang.Object
-
- org.onosproject.ui.topo.NodeBadge
-
public final class NodeBadge extends Object
Designates a badge to be applied to a node in the topology view.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeBadge.StatusDesignates the badge status.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeBadgeglyph(String gid)Returns a glyph badge, with default status.static NodeBadgeglyph(NodeBadge.Status s, String gid)Returns a glyph badge, with the given status.static NodeBadgeglyph(NodeBadge.Status s, String gid, String msg)Returns a glyph badge, with the given status and optional message.booleanisGlyph()Returns true if the text for this badge designates a glyph ID.Stringmessage()Returns the message associated with the badge.static NodeBadgenumber(int n)Returns a numeric badge, with default status.static NodeBadgenumber(NodeBadge.Status s, int n)Returns a numeric badge, with the given status and optional message.static NodeBadgenumber(NodeBadge.Status s, int n, String msg)Returns a numeric badge, with the given status and optional message.NodeBadge.Statusstatus()Returns the badge status.Stringtext()Returns the text for the badge.static NodeBadgetext(String txt)Returns an arbitrary text badge, with default status.static NodeBadgetext(NodeBadge.Status s, String txt)Returns an arbitrary text badge, with the given status.static NodeBadgetext(NodeBadge.Status s, String txt, String msg)Returns an arbitrary text badge, with the given status and optional message.StringtoString()
-
-
-
Method Detail
-
status
public NodeBadge.Status status()
Returns the badge status.- Returns:
- badge status
-
isGlyph
public boolean isGlyph()
Returns true if the text for this badge designates a glyph ID.- Returns:
- true if badge uses glyph
-
text
public String text()
Returns the text for the badge. Note that ifisGlyphis true, the text is a glyph ID, otherwise the text is displayed verbatim in the badge.- Returns:
- text for badge
-
message
public String message()
Returns the message associated with the badge.- Returns:
- associated message
-
text
public static NodeBadge text(String txt)
Returns an arbitrary text badge, with default status.- Parameters:
txt- the text- Returns:
- node badge to display text
-
glyph
public static NodeBadge glyph(String gid)
Returns a glyph badge, with default status.- Parameters:
gid- the glyph ID- Returns:
- node badge to display glyph
-
number
public static NodeBadge number(int n)
Returns a numeric badge, with default status.- Parameters:
n- the number- Returns:
- node badge to display a number
-
text
public static NodeBadge text(NodeBadge.Status s, String txt)
Returns an arbitrary text badge, with the given status.- Parameters:
s- the statustxt- the text- Returns:
- node badge to display text
-
glyph
public static NodeBadge glyph(NodeBadge.Status s, String gid)
Returns a glyph badge, with the given status.- Parameters:
s- the statusgid- the glyph ID- Returns:
- node badge to display glyph
-
number
public static NodeBadge number(NodeBadge.Status s, int n)
Returns a numeric badge, with the given status and optional message.- Parameters:
s- the statusn- the number- Returns:
- node badge to display a number
-
text
public static NodeBadge text(NodeBadge.Status s, String txt, String msg)
Returns an arbitrary text badge, with the given status and optional message.- Parameters:
s- the statustxt- the textmsg- the optional message- Returns:
- node badge to display text
-
glyph
public static NodeBadge glyph(NodeBadge.Status s, String gid, String msg)
Returns a glyph badge, with the given status and optional message.- Parameters:
s- the statusgid- the glyph IDmsg- the optional message- Returns:
- node badge to display glyph
-
number
public static NodeBadge number(NodeBadge.Status s, int n, String msg)
Returns a numeric badge, with the given status and optional message.- Parameters:
s- the statusn- the numbermsg- the optional message- Returns:
- node badge to display a number
-
-