public abstract class AbstractViewer extends JPanelimplements MouseUser , ComponentListener , MouseMotionListener , MouseListener , MouseWheelListener
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractViewer
|
JPanel.AccessibleJPanel JComponent.AccessibleJComponent Container.AccessibleAWTContainer Component.AccessibleAWTComponent , Component.BaselineResizeBehavior , Component.BltBufferStrategy , Component.FlipBufferStrategy | Modifier and Type | Field and Description |
|---|---|
protected Color |
colorBackground
|
protected Color |
colorBorder
|
protected Color |
colorCrosshair
|
protected Color |
colorTilenumbers
|
protected boolean |
drawBorder
|
protected boolean |
drawCrosshair
|
protected boolean |
drawOverlay
|
protected boolean |
drawTileNumbers
|
protected boolean |
mouseActive
|
protected Collection |
mouseListeners
|
protected TileConfig |
overlayTileConfig
|
protected List |
paintListeners
|
protected TileConfig |
tileConfig
|
protected ZoomMode |
zoomMode
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
AbstractViewer()
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOverlayTileConfigListener(TileConfigListener
Add this listener to the set of listeners.
|
void |
addPaintListener(PaintListener
Add the given PaintListener to the list of paintListeners
|
void |
addTileConfigListener(TileConfigListener
Add this listener to the set of listeners.
|
void |
componentHidden(ComponentEvent
|
void |
componentMoved(ComponentEvent
|
void |
componentResized(ComponentEvent
|
void |
componentShown(ComponentEvent
|
protected void |
dispatchRepaint()
|
protected void |
drawCrosshair(Graphics2D
|
protected void |
drawOverlayPoints(Graphics2D
|
Color |
getColorBackground()
Get the color of the background
|
Color |
getColorBorder()
Get the color of the tile borders
|
Color |
getColorCrosshair()
Get the color of the crosshair
|
Color |
getColorTilenumbers()
Get the color of the tile number font
|
abstract MapWindow |
getMapWindow()
|
boolean |
getMouseActive()
|
TileConfig |
getOverlayTileConfig()
Get the current overlay configuration.
|
TileConfig |
getTileConfig()
Get the current configuration.
|
ZoomMode |
getZoomMode()
|
void |
gotoOverlayPoints()
Set the viewport to display the overlay points...
|
boolean |
isDrawBorder()
|
boolean |
isDrawCrosshair()
|
boolean |
isDrawOverlay()
|
boolean |
isDrawTileNumbers()
|
void |
mouseClicked(MouseEvent
|
void |
mouseDragged(MouseEvent
|
void |
mouseEntered(MouseEvent
|
void |
mouseExited(MouseEvent
|
void |
mouseMoved(MouseEvent
|
void |
mousePressed(MouseEvent
|
void |
mouseReleased(MouseEvent
|
void |
mouseWheelMoved(MouseWheelEvent
|
void |
removePaintListener(PaintListener
Remove the given PaintListener from the list of paintListeners.
|
void |
setColorBackground(Color
Set the color of the background
|
void |
setColorBorder(Color
Set the color of the tile borders
|
void |
setColorCrosshair(Color
Set the color of the crosshair
|
void |
setColorTilenumbers(Color
Set the color of the tile number font
|
void |
setDragGestureListener(DragGestureListener
Set the DragGestureListener to use.
|
void |
setDragging(boolean drag)
Set whether dragging the mouse starts an drag event.
|
void |
setDrawBorder(boolean drawBorder)
Set whether a border shall be drawn around tiles.
|
void |
setDrawCrosshair(boolean drawCrosshair)
Set whether a crosshair shall be drawn in the middle of the viewport.
|
void |
setDrawOverlay(boolean drawOverlay)
Set whether the overlay will be drawn.
|
void |
setDrawTileNumbers(boolean drawTileNumbers)
Set whether the tile's numbers will be drawn.
|
void |
setMouseActive(boolean state)
|
void |
setMouseListeners(Collection
|
void |
setOverlayPoints(Set
Display the given points as an overlay.
|
void |
setZoomMode(ZoomMode
|
protected void |
triggerOverlayTileConfigListeners()
|
protected void |
triggerTileConfigListeners()
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, updateadd, 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, validateTreeaction, 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, 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, getName, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected ColorcolorBackground
protected ColorcolorBorder
protected ColorcolorTilenumbers
protected ColorcolorCrosshair
protected boolean mouseActive
protected ZoomModezoomMode
protected boolean drawBorder
protected boolean drawCrosshair
protected boolean drawOverlay
protected boolean drawTileNumbers
protected TileConfigtileConfig
protected TileConfigoverlayTileConfig
protected List<PaintListener > paintListeners
protected Collection<MouseListener > mouseListeners
public abstract MapWindowgetMapWindow()
public boolean getMouseActive()
getMouseActive in interface
MouseUser
public void setMouseActive(boolean state)
setMouseActive in interface
MouseUser
state - whether to react on mouse events.
public ZoomModegetZoomMode()
public void setZoomMode(ZoomModezoomMode)
public boolean isDrawBorder()
public boolean isDrawCrosshair()
public boolean isDrawOverlay()
public boolean isDrawTileNumbers()
public void setDrawBorder(boolean drawBorder)
drawBorder - whether to draw a border around tiles.
public void setDrawCrosshair(boolean drawCrosshair)
drawCrosshair - whether to draw a crosshair.
public void setDrawOverlay(boolean drawOverlay)
drawOverlay - whether to draw an overlay.
public void setDrawTileNumbers(boolean drawTileNumbers)
drawTileNumbers - whether to draw each tile's number.
public ColorgetColorBackground()
public void setColorBackground(Colorcolor)
color - the color to set
public ColorgetColorBorder()
public void setColorBorder(Colorcolor)
color - the color to set
public ColorgetColorTilenumbers()
public void setColorTilenumbers(Colorcolor)
color - the color to set
public ColorgetColorCrosshair()
public void setColorCrosshair(Colorcolor)
color - the color to set
public TileConfiggetTileConfig()
public TileConfiggetOverlayTileConfig()
protected void dispatchRepaint()
public void setDragging(boolean drag)
drag - whether to allow dragging.
public void setDragGestureListener(DragGestureListenerlistener)
listener - the listener to use after invoking setDragging();
public void addTileConfigListener(TileConfigListenerlistener)
listener - the listener to add.
public void addOverlayTileConfigListener(TileConfigListenerlistener)
listener - the listener to add.
protected void triggerTileConfigListeners()
protected void triggerOverlayTileConfigListeners()
public void addPaintListener(PaintListenerpaintListener)
paintListener - the listener to add.
public void removePaintListener(PaintListenerpaintListener)
paintListener - the listener to remove.
public void setMouseListeners(Collection<MouseListener > listeners)
listeners - the collection of mouse listeners to notify about mouse events.
public void componentResized(ComponentEvente)
public void componentMoved(ComponentEvente)
public void componentShown(ComponentEvente)
public void componentHidden(ComponentEvente)
public void mouseDragged(MouseEvente)
public void mouseMoved(MouseEvente)
public void mouseClicked(MouseEvente)
public void mousePressed(MouseEvente)
public void mouseReleased(MouseEvente)
public void mouseEntered(MouseEvente)
public void mouseExited(MouseEvente)
public void mouseWheelMoved(MouseWheelEvente)
protected void drawCrosshair(Graphics2Dg)
protected void drawOverlayPoints(Graphics2Dg)
public void setOverlayPoints(Set<OverlayPoint > points)
points - a set of points to display.
public void gotoOverlayPoints()