T - The type of data to plot on the imagepublic class WorldMap<T> extends XYPlotVisualisation<T> implements AnimatedVisualisationProvider
XYPlotVisualisation.LocatedObject<O>JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyaxesRenderer2D, plotterclearBeforeDraw, data, visImagelistenerList, 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 |
|---|
WorldMap(int width,
int height,
ItemPlotter<T,Float[],MBFImage> plotter) |
WorldMap(int width,
int height,
ItemPlotter<T,Float[],MBFImage> plotter,
int xmin,
int xmax,
int ymin,
int ymax) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnimatedVisualisationListener(AnimatedVisualisationListener avl)
Add a visualisation listener to be informed of animation events.
|
void |
addHighlightCountry(String countryCode)
Add a country to highlight
|
void |
addHighlightCountry(String countryCode,
Float[] colour)
Add a country to highlight
|
void |
animateCountryColour(String countryCode,
ValueAnimator<Float[]> colourAnimator)
Animate the colour of a country
|
void |
beforeAxesRender(MBFImage visImage,
AxesRenderer2D<Float[],MBFImage> axesRenderer)
A method that can be overridden to plot something prior to the axes being
drawn.
|
void |
clearData()
Clear the data list.
|
protected void |
drawSea(MBFImage img)
Fill the image with the sea's colour.
|
protected void |
fireAnimationEvent()
Fire the animation event
|
String |
getCountryCodeByName(String countryName)
Returns a country code for a given country name.
|
Point2d |
getCountryLocation(String countryCode)
Returns the lat/long of a country given its country code
|
Float[] |
getDefaultCountryLandColour() |
Float[] |
getDefaultCountryOutlineColour() |
Float[] |
getHighlightCountryLandColour() |
Float[] |
getSeaColour() |
static void |
main(String[] args)
Demonstration method.
|
void |
removeAnimatedVisualisationListener(AnimatedVisualisationListener avl)
Remove a given listener from being informed of animation events.
|
void |
removeHighlightCountry(String countryCode)
Remove a highlighted country
|
void |
setDefaultCountryLandColour(Float[] defaultCountryLandColour) |
void |
setDefaultCountryOutlineColour(Float[] defaultCountryOutlineColour) |
void |
setHighlightCountryLandColour(Float[] highlightCountryLandColour) |
void |
setSeaColour(Float[] seaColour) |
addPoint, getAxesRenderer, isAutoPositionXAxis, isAutoScaleAxes, isRenderAxesLast, removePoint, setAutoPositionXAxis, setAutoScaleAxes, setData, setItemPlotter, setRenderAxesLast, update, validateDataaddOverlay, componentHidden, componentMoved, componentResized, componentShown, getRequiredSize, getVisualisationImage, isAllowResize, newVisualisationAvailable, paint, removeOverlay, setAllowResize, setClearBeforeDraw, setRequiredSize, showWindow, update, updateVis, updateVisgetAccessibleContext, 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, 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, unregisterKeyboardActionadd, 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, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetVisualisationImage, setRequiredSize, updateVispublic WorldMap(int width, int height, ItemPlotter<T,Float[],MBFImage> plotter)
width - Width of the visualisationheight - Height of the visualisationplotter - The plotter to plot data withpublic WorldMap(int width, int height, ItemPlotter<T,Float[],MBFImage> plotter, int xmin, int xmax, int ymin, int ymax)
width - Width of the visualisationheight - Height of the visualisationplotter - The plotter to plot data withxmin - min x value to be plottedxmax - max x value to be plottedymin - min y value to be plottedymax - max y value to be plottedpublic void addHighlightCountry(String countryCode)
countryCode - The country code to highlightpublic void addHighlightCountry(String countryCode, Float[] colour)
countryCode - The country code to highlightcolour - The colour to highlight the countrypublic void removeHighlightCountry(String countryCode)
countryCode - The country code to removeprotected void drawSea(MBFImage img)
public void beforeAxesRender(MBFImage visImage, AxesRenderer2D<Float[],MBFImage> axesRenderer)
beforeAxesRender in class XYPlotVisualisation<T>visImage - The image to draw toaxesRenderer - The axes rendererXYPlotVisualisation.beforeAxesRender(org.openimaj.image.MBFImage,
org.openimaj.vis.general.AxesRenderer2D)public Float[] getSeaColour()
public void setSeaColour(Float[] seaColour)
seaColour - the seaColour to setpublic Float[] getDefaultCountryOutlineColour()
public void setDefaultCountryOutlineColour(Float[] defaultCountryOutlineColour)
defaultCountryOutlineColour - the defaultCountryOutlineColour to setpublic Float[] getDefaultCountryLandColour()
public void setDefaultCountryLandColour(Float[] defaultCountryLandColour)
defaultCountryLandColour - the defaultCountryLandColour to setpublic Float[] getHighlightCountryLandColour()
public void setHighlightCountryLandColour(Float[] highlightCountryLandColour)
highlightCountryLandColour - the highlightCountryLandColour to setpublic String getCountryCodeByName(String countryName)
countryName - The country namepublic Point2d getCountryLocation(String countryCode)
countryCode - The country codepublic void clearData()
XYPlotVisualisationclearData in class XYPlotVisualisation<T>public void addAnimatedVisualisationListener(AnimatedVisualisationListener avl)
addAnimatedVisualisationListener in interface AnimatedVisualisationProvideravl - The listener to addAnimatedVisualisationProvider.addAnimatedVisualisationListener(org.openimaj.vis.AnimatedVisualisationListener)public void removeAnimatedVisualisationListener(AnimatedVisualisationListener avl)
removeAnimatedVisualisationListener in interface AnimatedVisualisationProvideravl - The listener to removeAnimatedVisualisationProvider.removeAnimatedVisualisationListener(org.openimaj.vis.AnimatedVisualisationListener)protected void fireAnimationEvent()
public void animateCountryColour(String countryCode, ValueAnimator<Float[]> colourAnimator)
countryCode - The country to animatecolourAnimator - The colour animator