public final class SelectDestinationDialog extends FreeColDialog<Location> implements javax.swing.event.ListSelectionListener
| Modifier and Type | Class and Description |
|---|---|
private class |
SelectDestinationDialog.Destination
A container for a destination location, with associated
distance and extra characteristics.
|
private class |
SelectDestinationDialog.DestinationComparator |
private class |
SelectDestinationDialog.DistanceComparator |
private static class |
SelectDestinationDialog.LocationRenderer |
private class |
SelectDestinationDialog.NameComparator |
FreeColDialog.DialogTypejavax.swing.JDialog.AccessibleJDialogjava.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityTypejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
private static int |
CELL_HEIGHT
The size of each destination cell.
|
private javax.swing.JComboBox<java.lang.String> |
comparatorBox
Choice of the comparator.
|
private static java.util.Comparator<SelectDestinationDialog.Destination> |
destinationComparator
How to order the destinations.
|
private javax.swing.JList<SelectDestinationDialog.Destination> |
destinationList
The list of destinations.
|
private java.util.List<SelectDestinationDialog.Destination> |
destinations
The available destinations.
|
private static java.util.logging.Logger |
logger |
private javax.swing.JCheckBox |
onlyMyColoniesBox
Restrict to only the player colonies?
|
private static boolean |
showOnlyMyColonies
Show only the player colonies.
|
freeColClient, modal, optionsaccessibleContext, rootPane, rootPaneCheckingEnabledBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
SelectDestinationDialog(FreeColClient freeColClient,
javax.swing.JFrame frame,
Unit unit)
The constructor to use.
|
| Modifier and Type | Method and Description |
|---|---|
Location |
getResponse()
Get the response from this dialog.
|
private void |
loadDestinations(Unit unit,
java.util.List<GoodsType> goodsTypes)
Load destinations for a given unit and carried goods types.
|
private void |
recenter(SelectDestinationDialog.Destination destination)
Show a destination on the map.
|
void |
removeNotify() |
void |
requestFocus() |
private void |
updateDestinationComparator()
Set the selected destination comparator.
|
private void |
updateDestinationList()
Reset the destinations in the model.
|
void |
valueChanged(javax.swing.event.ListSelectionEvent e) |
choices, getFreeColClient, getGame, getGUI, getImageLibrary, getMyPlayer, getSpecification, getValue, igc, initializeDialog, isModal, propertyChange, responded, setSubcomponentsNotOpaque, setValue, setVisibleaddImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getModalityType, getTitle, hide, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprivate static final java.util.logging.Logger logger
private static final int CELL_HEIGHT
private static boolean showOnlyMyColonies
private static java.util.Comparator<SelectDestinationDialog.Destination> destinationComparator
private final java.util.List<SelectDestinationDialog.Destination> destinations
private final javax.swing.JList<SelectDestinationDialog.Destination> destinationList
private javax.swing.JCheckBox onlyMyColoniesBox
private javax.swing.JComboBox<java.lang.String> comparatorBox
public SelectDestinationDialog(FreeColClient freeColClient, javax.swing.JFrame frame, Unit unit)
freeColClient - The FreeColClient for the game.frame - The owner frame.private void loadDestinations(Unit unit, java.util.List<GoodsType> goodsTypes)
unit - The Unit to select destinations for.goodsTypes - A list of GoodsTypes carried.private void updateDestinationList()
private void recenter(SelectDestinationDialog.Destination destination)
destination - The Destination to display.private void updateDestinationComparator()
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListenerpublic Location getResponse()
getResponse in class FreeColDialog<Location>public void removeNotify()
removeNotify in class FreeColDialog<Location>public void requestFocus()
requestFocus in class FreeColDialog<Location>