public class GUIMetaElementList extends GUIList<GUIMetaElement>
GUIList
that tracks a Metaserver
instance.javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private AbstractLabel |
comment
The comment field to update; may be
null . |
private GUIElementListener |
elementListener
The
GUIElementListener to use. |
private java.awt.Font |
font
The font for drawing list entries.
|
private java.lang.String |
format
The format for drawing list entries.
|
private GUIText |
hostname
The hostname input field to update; may be
null . |
private java.awt.Image |
image
The image for drawing list entries.
|
private MetaserverEntryListener |
metaserverEntryListener
The
MetaserverEntryListener attached to all tracked metaserver
entries. |
private MetaserverListener |
metaserverListener
The
MetaserverListener attached to metaserverModel . |
private MetaserverModel |
metaserverModel
The metaserver model to track.
|
private java.lang.String |
name
The name of this element.
|
private static long |
serialVersionUID
The serial version UID.
|
private java.lang.String |
tooltip
The tooltip format for drawing list entries.
|
private TooltipManager |
tooltipManager
The
TooltipManager to update. |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
GUIMetaElementList(TooltipManager tooltipManager,
GUIElementListener elementListener,
java.lang.String name,
int cellWidth,
int cellHeight,
MetaserverModel metaserverModel,
java.awt.Image image,
java.awt.Font font,
java.lang.String format,
java.lang.String tooltip,
GUIText hostname,
AbstractLabel comment,
CommandList connectCommandList)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activeChanged()
Will be called whenever the active state has changed.
|
void |
dispose()
Releases all allocated resources.
|
private void |
rebuildList()
Rebuild the list cells.
|
protected void |
selectionChanged(int selectedIndex)
Called whenever the selected list entry has changed.
|
void |
setSelectedHostname(java.lang.String serverName)
Select an entry by server name.
|
protected void |
updateTooltip(int index,
int x,
int y,
int w,
int h)
Updates the tooltip text.
|
addElement, canMoveSelection, canScroll, execute, getElement, getMinimumSize, getPreferredSize, getSelectedObject, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, moveSelection, resetScroll, resizeElements, scroll, selectionChanged, setBounds, setChanged, setLayoutOrientation, setSelectedIndex
isActive, markInactivePending, setActive, setInactiveIfPending
getName, hasTooltipText, isDefault, isIgnore, mouseReleased, setChangedListener, setDefault, setIgnore, setTooltipText, setTooltipText, toString
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, updateUI
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, validateTree
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, getPeer, 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, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
@Nullable private final AbstractLabel comment
null
.@NotNull private final GUIElementListener elementListener
GUIElementListener
to use.@NotNull private final java.awt.Font font
@NotNull private final java.lang.String format
@Nullable private final GUIText hostname
null
.@Nullable private final java.awt.Image image
@NotNull private final MetaserverEntryListener metaserverEntryListener
MetaserverEntryListener
attached to all tracked metaserver
entries. It detects changed contents and updates the list accordingly.@NotNull private final MetaserverListener metaserverListener
MetaserverListener
attached to metaserverModel
. It
detects added or removed entries and updates the list accordingly.@NotNull private final MetaserverModel metaserverModel
@NotNull private final java.lang.String name
private static final long serialVersionUID
@NotNull private final java.lang.String tooltip
@NotNull private final TooltipManager tooltipManager
TooltipManager
to update.public GUIMetaElementList(@NotNull TooltipManager tooltipManager, @NotNull GUIElementListener elementListener, @NotNull java.lang.String name, int cellWidth, int cellHeight, @NotNull MetaserverModel metaserverModel, @Nullable java.awt.Image image, @NotNull java.awt.Font font, @NotNull java.lang.String format, @NotNull java.lang.String tooltip, @Nullable GUIText hostname, @Nullable AbstractLabel comment, @NotNull CommandList connectCommandList)
tooltipManager
- the tooltip manager to updateelementListener
- the element listener to notifyname
- the name of this elementcellWidth
- the width of each cellcellHeight
- the height of each cellmetaserverModel
- the metaserver model to trackimage
- the image for drawing list entriesfont
- the font for drawing list entriesformat
- the format for drawing list entriestooltip
- the tooltip format for drawing list entrieshostname
- the hostname input field to update; may be null
comment
- the comment field to update; may be null
connectCommandList
- the command list to connect to the serverprotected void activeChanged()
activeChanged
in class ActivatableGUIElement
public void dispose()
dispose
in interface GUIElement
dispose
in class GUIList<GUIMetaElement>
private void rebuildList()
protected void selectionChanged(int selectedIndex)
selectionChanged
in class GUIList<GUIMetaElement>
selectedIndex
- the selected list entrypublic void setSelectedHostname(@NotNull java.lang.String serverName)
serverName
- the server nameprotected void updateTooltip(int index, int x, int y, int w, int h)
updateTooltip
in class GUIList<GUIMetaElement>
index
- the index to checkx
- the x coordinate of the celly
- the y coordinate of the cellw
- the width of the cellh
- the height of the cell