Package jmri.jmrix.can.cbus
Class CbusEventHighlighter
- java.lang.Object
-
- jmri.jmrix.can.cbus.CbusEventHighlighter
-
public class CbusEventHighlighter extends java.lang.Object
Class to implement highlighting of CBUS events.
-
-
Constructor Summary
Constructors Constructor Description CbusEventHighlighter()Creates a new instance of CbusEventHighlighter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ColorgetColor()Get value of Colour to highlight.intgetDir()intgetEv()booleangetEvEnable()intgetNn()booleangetNnEnable()intgetType()booleanhighlight(AbstractMessage m)Highlight a CAN Frame, based on previous settings.voidsetColor(java.awt.Color c)Set value of ColourvoidsetDir(int n)Set value of direction to match.voidsetEv(int n)Set an Event Number to highlight.voidsetEvEnable(boolean b)Set whether Ev (event number) will be included in highlight.voidsetNn(int n)Set a Node Number to highlight.voidsetNnEnable(boolean b)Set whether NN (Node Number) will be included in highlight.voidsetType(int n)Set value of type to match.Type is the ON, OFF, etc. value in the CBUS frame.
-
-
-
Constructor Detail
-
CbusEventHighlighter
public CbusEventHighlighter()
Creates a new instance of CbusEventHighlighter
-
-
Method Detail
-
highlight
public boolean highlight(AbstractMessage m)
Highlight a CAN Frame, based on previous settings.- Parameters:
m- CanMessage or CanReply to highlight.- Returns:
- true if event matches
-
setNnEnable
public void setNnEnable(boolean b)
Set whether NN (Node Number) will be included in highlight.- Parameters:
b- True to highlight a Node Number
-
getNnEnable
public boolean getNnEnable()
-
setEvEnable
public void setEvEnable(boolean b)
Set whether Ev (event number) will be included in highlight.- Parameters:
b- True to highlight an Event Number
-
getEvEnable
public boolean getEvEnable()
-
setNn
public void setNn(int n)
Set a Node Number to highlight.- Parameters:
n- Node Number
-
getNn
public int getNn()
-
setEv
public void setEv(int n)
Set an Event Number to highlight.- Parameters:
n- Event Number
-
getEv
public int getEv()
-
setType
public void setType(int n)
Set value of type to match.Type is the ON, OFF, etc. value in the CBUS frame. CbusConstants.EVENT_EITHER matches either ON or OFF.- Parameters:
n- SeeCbusConstantsfor values
-
getType
public int getType()
-
setDir
public void setDir(int n)
Set value of direction to match.- Parameters:
n- EVENT_DIR_UNSET EVENT_DIR_IN, EVENT_DIR_OUT, EVENT_EITHER_DIR EVENT_DIR_EITHER
-
getDir
public int getDir()
-
setColor
public void setColor(java.awt.Color c)
Set value of Colour- Parameters:
c- Colour to use
-
getColor
public java.awt.Color getColor()
Get value of Colour to highlight.- Returns:
- Colour to use
-
-