public class FactHexMapDisplay extends JPanel implements SliceObserver, MouseListener
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
String |
defaultKey |
double |
radius |
double |
scalingX |
double |
scalingY |
double[][] |
sliceValues |
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 |
|---|
FactHexMapDisplay(double radius,
int canvasWidth,
int canvasHeight) |
FactHexMapDisplay(double radius,
int canvasWidth,
int canvasHeight,
boolean mouseAction)
A Hexagon in this case is defined by the passed radius.
|
| Modifier and Type | Method and Description |
|---|---|
Point |
cameraCoordinateToPixels(double x,
double y) |
int |
getHeight() |
Dimension |
getMaximumSize() |
Dimension |
getMinimumSize() |
int |
getOffsetX() |
int |
getOffsetY() |
Dimension |
getPreferredSize() |
double |
getTileRadiusInPixels() |
FactHexTile[] |
getTiles() |
int |
getWidth() |
void |
handleEventChange(org.apache.commons.math3.util.Pair<stream.Data,String> itemKeyPair) |
void |
handleSliceChangeEvent(SliceChangedEvent ev)
In case we display dynamic data we can set which slice/point in time we want to display
|
boolean |
isDrawScaleNumbers() |
boolean |
isIncludeScale() |
boolean |
isPatchSelectionMode() |
void |
mouseClicked(MouseEvent arg0) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(Graphics g) |
void |
paint(Graphics g,
boolean transparentBackground) |
void |
setColorMap(ColorMapping m) |
void |
setDrawScaleNumbers(boolean drawScaleNumbers) |
void |
setIncludeScale(boolean includeScale) |
void |
setOffsetX(int offsetX) |
void |
setOffsetY(int offsetY) |
void |
setOverlayItemsToDisplay(Set<org.apache.commons.math3.util.Pair<String,Color>> items) |
void |
setPatchSelectionMode(boolean patchSelectionMode) |
void |
update(Graphics g) |
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, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, 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, transferFocusUpCyclepublic final double radius
public final double scalingX
public final double scalingY
public double[][] sliceValues
public String defaultKey
public FactHexMapDisplay(double radius,
int canvasWidth,
int canvasHeight,
boolean mouseAction)
radius - the radius of the circle the hexagon should fit intopublic FactHexMapDisplay(double radius,
int canvasWidth,
int canvasHeight)
public Point cameraCoordinateToPixels(double x, double y)
public FactHexTile[] getTiles()
public void handleSliceChangeEvent(SliceChangedEvent ev)
SliceObserverhandleSliceChangeEvent in interface SliceObserverev - the time slice to display. has to be between 0 and numberOfSlices - 1public void handleEventChange(org.apache.commons.math3.util.Pair<stream.Data,String> itemKeyPair)
public void setOverlayItemsToDisplay(Set<org.apache.commons.math3.util.Pair<String,Color>> items)
public void setColorMap(ColorMapping m)
public void paint(Graphics g)
paint in class JComponentJComponent.paint(java.awt.Graphics)public void paint(Graphics g, boolean transparentBackground)
public void mouseClicked(MouseEvent arg0)
mouseClicked in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void update(Graphics g)
update in class JComponentpublic Dimension getMinimumSize()
getMinimumSize in class JComponentJComponent.getMinimumSize()public int getHeight()
getHeight in class JComponentJComponent.getHeight()public int getWidth()
getWidth in class JComponentJComponent.getWidth()public Dimension getMaximumSize()
getMaximumSize in class JComponentJComponent.getMaximumSize()public Dimension getPreferredSize()
getPreferredSize in class JComponentJComponent.getPreferredSize()public double getTileRadiusInPixels()
public void setPatchSelectionMode(boolean patchSelectionMode)
public boolean isPatchSelectionMode()
public boolean isDrawScaleNumbers()
public void setDrawScaleNumbers(boolean drawScaleNumbers)
drawScaleNumbers - the drawScaleNumbers to setpublic boolean isIncludeScale()
public void setIncludeScale(boolean includeScale)
includeScale - the includeScale to setpublic int getOffsetX()
public void setOffsetX(int offsetX)
offsetX - the offsetX to setpublic int getOffsetY()
public void setOffsetY(int offsetY)
offsetY - the offsetY to setCopyright © 2019. All rights reserved.