Class GUILog
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
com.realtime.crossfire.jxclient.gui.log.GUILog
- All Implemented Interfaces:
GUIElement,GUIScrollable,GUIScrollable2,ImageObserver,MenuContainer,Serializable
- Direct Known Subclasses:
GUILabelLog,GUIMessageLog
Abstract base class for gui elements implementing text fields.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGUILog(@NotNull TooltipManager tooltipManager, @NotNull GUIElementListener elementListener, @NotNull String name, @Nullable Image backgroundImage, @NotNull Fonts fonts, @NotNull GuiFactory guiFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScrollableListener(@NotNull ScrollableListener listener) Adds a scrollable listener to be informed about changes.booleancanScroll(int distance) Returns whether scrolling is possible.voiddispose()Releases all allocated resources.@NotNull BufferReturns theBufferinstance containing the text messages.voidmouseDragged(@NotNull MouseEvent e) Will be called when the mouse moves within this component while the button is pressed.voidmousePressed(@NotNull MouseEvent e) Will be called when the user has pressed the mouse inside this element.voidmouseReleased(@NotNull MouseEvent e) Will be called when the user has released the mouse.voidmouseWheelMoved(int wheelRotation) Will be called when the mouse wheel has been moved.voidpaintComponent(@NotNull Graphics g) voidremoveScrollableListener(@NotNull ScrollableListener listener) Removes a scrollable listener.voidResets the scroll index to the default value.voidscroll(int distance) Scrolls the element.voidscrollTo(int pos) Scrolls to the given location.voidsetBounds(int x, int y, int width, int height) voidsetShowSentCommands(boolean showSentCommands) Sets whether the commands sent to the server should be shown.voidsetShowTimestamps(boolean showTimestamps) Sets whether the timestamps are shown.Methods inherited from class com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
getDialogBorderBottom, getDialogBorderLeft, getDialogBorderRight, getDialogBorderTop, getName, getTooltip, inhibitListeners, isDefault, isIgnore, mouseClicked, mouseEntered, mouseExited, mouseMoved, newTooltipText, setChanged, setChangedListener, setDefault, setIgnore, tooltipChanged, toStringMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.realtime.crossfire.jxclient.gui.gui.GUIElement
notifyOpen
-
Constructor Details
-
GUILog
protected GUILog(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, @Nullable @Nullable Image backgroundImage, @NotNull @NotNull Fonts fonts, @NotNull @NotNull GuiFactory guiFactory) Creates a new instance.- Parameters:
tooltipManager- the tooltip manager to updateelementListener- the element listener to notifyname- the name of this elementbackgroundImage- the background image; may benullif unusedfonts- theFontsinstance for looking up fontsguiFactory- the global GUI factory instance
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:GUIElementReleases all allocated resources.- Specified by:
disposein interfaceGUIElement- Overrides:
disposein classAbstractGUIElement
-
paintComponent
- Overrides:
paintComponentin classJComponent
-
canScroll
public boolean canScroll(int distance) Description copied from interface:GUIScrollableReturns whether scrolling is possible.- Specified by:
canScrollin interfaceGUIScrollable- Parameters:
distance- the distance to scroll- Returns:
- whether scrolling is possible
-
scroll
public void scroll(int distance) Description copied from interface:GUIScrollableScrolls the element.- Specified by:
scrollin interfaceGUIScrollable- Parameters:
distance- the distance to scroll
-
resetScroll
public void resetScroll()Description copied from interface:GUIScrollableResets the scroll index to the default value.- Specified by:
resetScrollin interfaceGUIScrollable
-
scrollTo
public void scrollTo(int pos) Description copied from interface:GUIScrollable2Scrolls to the given location. The possible range is given by a previous notification through a listener registered withGUIScrollable2.addScrollableListener(ScrollableListener).- Specified by:
scrollToin interfaceGUIScrollable2- Parameters:
pos- the location to scroll to
-
addScrollableListener
Description copied from interface:GUIScrollable2Adds a scrollable listener to be informed about changes.- Specified by:
addScrollableListenerin interfaceGUIScrollable2- Parameters:
listener- the listener to add
-
removeScrollableListener
Description copied from interface:GUIScrollable2Removes a scrollable listener.- Specified by:
removeScrollableListenerin interfaceGUIScrollable2- Parameters:
listener- the listener to remove
-
getBuffer
Returns theBufferinstance containing the text messages.- Returns:
- the buffer instance
-
setBounds
public void setBounds(int x, int y, int width, int height) -
mousePressed
Description copied from interface:GUIElementWill be called when the user has pressed the mouse inside this element.- Specified by:
mousePressedin interfaceGUIElement- Overrides:
mousePressedin classAbstractGUIElement- Parameters:
e- the mouse event relative to this element
-
mouseReleased
Description copied from interface:GUIElementWill be called when the user has released the mouse. This event may be delivered even if no previousGUIElement.mousePressed(MouseEvent)has been delivered before.- Specified by:
mouseReleasedin interfaceGUIElement- Overrides:
mouseReleasedin classAbstractGUIElement- Parameters:
e- the mouse event relative to this element
-
mouseDragged
Description copied from interface:GUIElementWill be called when the mouse moves within this component while the button is pressed. This event will be delivered afterGUIElement.mouseMoved(MouseEvent).Note: if the mouse leaves this element's bounding box while the mouse button is still pressed, further
mouseDragged(but nomouseMoved) events will be generated.- Specified by:
mouseDraggedin interfaceGUIElement- Overrides:
mouseDraggedin classAbstractGUIElement- Parameters:
e- the mouse event relative to this element
-
mouseWheelMoved
public void mouseWheelMoved(int wheelRotation) Description copied from interface:GUIElementWill be called when the mouse wheel has been moved.- Specified by:
mouseWheelMovedin interfaceGUIElement- Overrides:
mouseWheelMovedin classAbstractGUIElement- Parameters:
wheelRotation- the movement amount; negative=away from the user, positive=towards the user
-
setShowSentCommands
public void setShowSentCommands(boolean showSentCommands) Sets whether the commands sent to the server should be shown.- Parameters:
showSentCommands- whether to show the commands
-
setShowTimestamps
public void setShowTimestamps(boolean showTimestamps) Sets whether the timestamps are shown.- Parameters:
showTimestamps- whether timestamps are shown
-