Class ChatterBoxOverlay
java.lang.Object
megamek.client.ui.clientGUI.boardview.overlay.ChatterBoxOverlay
- All Implemented Interfaces:
KeyListener,EventListener,IDisplayable,IPreferenceChangeListener
public class ChatterBoxOverlay
extends Object
implements KeyListener, IDisplayable, IPreferenceChangeListener
A graphical chatterbox within the boardview.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChatterBoxOverlay(ClientGUI clientGUI, BoardView boardview, MegaMekController controller, ChatterBox chatterBox) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChatMessage(String line) Adds a line to the chat, and performs line breaking if necessaryvoidvoiddispose()voidDraws the chatter box.booleanReturns true when this IDisplayable is being dragged or resized using mouse movement.booleanReturns true when this IDisplayable is dragged or resized using mouse dragging.booleanReturns true when the mouse position point is considered "within" this IDisplayable.booleanisMouseOver(Point p, Dimension size) Returns true when the mouse position point is considered "within" this IDisplayable.booleanbooleanReturn true while sliding.voidkeyPressed(KeyEvent ke) voidkeyReleased(KeyEvent ke) voidvoidvoidScrolls down one line.voidscrollUp()Scrolls up one line.voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetIdleTime(long timeIdle, boolean add) TheBoardViewcalls this to pass on the elapsed time elTime to the IDisplayable.voidsetMessage(String message) booleanslide()Conducts a frame update when sliding.voidvoidslideUp()
-
Field Details
-
GUIP
-
-
Constructor Details
-
ChatterBoxOverlay
public ChatterBoxOverlay(ClientGUI clientGUI, BoardView boardview, MegaMekController controller, ChatterBox chatterBox)
-
-
Method Details
-
isReleased
public boolean isReleased()- Specified by:
isReleasedin interfaceIDisplayable
-
isSliding
public boolean isSliding()Description copied from interface:IDisplayableReturn true while sliding. "Sliding" means that this IDisplayable is in the process of opening, closing moving or fading. TheBoardViewwill repaint at some fps while an IDisplayable is sliding. The default for this method will always return false.- Specified by:
isSlidingin interfaceIDisplayable
-
slideUp
public void slideUp() -
slideDown
public void slideDown() -
setIdleTime
public void setIdleTime(long timeIdle, boolean add) Description copied from interface:IDisplayableTheBoardViewcalls this to pass on the elapsed time elTime to the IDisplayable. when add is true, elTime is usually the elapsed time since the last call to setIdleTime and should be added to a stored elapsed time. When add is false, elTime should replace the previously stored elapsed time (this is usually used with elTime = 0 to reset the elapsed time). Can be used to make this IDisplayable "slide" after some elapsed time, see slide(). See ChatterBox2 for examples. The default for this method will do nothing.- Specified by:
setIdleTimein interfaceIDisplayable
-
slide
public boolean slide()Description copied from interface:IDisplayableConducts a frame update when sliding. "Sliding" means that this IDisplayable is in the process of opening, closing moving or fading. TheBoardViewwill repaint at some fps while an IDisplayable is sliding. Return true as long as the slide process is not finished. See ChatterBox2 and KeyBindingsOverlay for examples. The default for this method will always return false.- Specified by:
slidein interfaceIDisplayable
-
isDragged
Description copied from interface:IDisplayableReturns true when this IDisplayable is dragged or resized using mouse dragging. This will prevent theBoardViewfrom reacting to this mouse action. The default for this method will always return false.- Specified by:
isDraggedin interfaceIDisplayable
-
isBeingDragged
public boolean isBeingDragged()Description copied from interface:IDisplayableReturns true when this IDisplayable is being dragged or resized using mouse movement. This will prevent theBoardViewfrom reacting to this mouse action. The default for this method will always return false.- Specified by:
isBeingDraggedin interfaceIDisplayable
-
isMouseOver
Description copied from interface:IDisplayableReturns true when the mouse position point is considered "within" this IDisplayable. This is called when the mouse or mouse wheel is moved. backSize is the pixel size of theBoardView. The default for this method will always return false.- Specified by:
isMouseOverin interfaceIDisplayable
-
isHit
Description copied from interface:IDisplayableReturns true when the mouse position point is considered "within" this IDisplayable. This is called when a mouse button is pressed. The default for this method will always return false.- Specified by:
isHitin interfaceIDisplayable
-
draw
Draws the chatter box.- Specified by:
drawin interfaceIDisplayable
-
addChatMessage
Adds a line to the chat, and performs line breaking if necessary -
scrollUp
public void scrollUp()Scrolls up one line. -
scrollDown
public void scrollDown()Scrolls down one line. -
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
getMessage
-
setMessage
-
setChatterBox
Deprecated, for removal: This API element is subject to removal in a future version. -
clearMessage
public void clearMessage() -
preferenceChange
- Specified by:
preferenceChangein interfaceIPreferenceChangeListener
-
dispose
public void dispose()
-