public class NavigableSVGPanel
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Rectangle |
animationControls |
protected java.awt.Rectangle |
controlsPlayPause |
static float[] |
dash1 |
protected java.util.List<java.lang.String> |
helperControlsExplanations |
static java.awt.Font |
helperControlsFont |
protected java.util.List<java.lang.String> |
helperControlsShortcuts |
static int |
helperControlsWidth |
protected SVGDiagram |
image |
protected java.awt.geom.AffineTransform |
image2user |
protected boolean |
isDraggingAnimation |
protected boolean |
isDraggingImage |
static java.awt.Color |
navigationImageBorderColor |
static java.awt.BasicStroke |
navigationImageOutlineStroke |
static double |
navigationImageWidthInPartOfPanel |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
NavigableSVGPanel(SVGDiagram newImage) |
| Modifier and Type | Method and Description |
|---|---|
void |
centerImageAround(java.awt.Point pointInNavigationCoordinates)
The user clicked within the navigation image and this part of the image
is displayed in the panel.
|
protected void |
drawAnimation(java.awt.Graphics2D g)
Draw the animation.
|
static void |
drawSVG(java.awt.Graphics2D g,
SVGDiagram image,
int x,
int y,
int width,
int height)
Draw an svg image at the given coordinates and of the given size.
|
double |
getAnimationMaximumTime()
Needs to be overridden by a subclass.
|
double |
getAnimationMinimumTime()
Needs to be overridden by a subclass.
|
double |
getAnimationTime()
Needs to be overridden by a subclass.
|
java.awt.Rectangle |
getControlsProgressLine() |
java.util.List<java.lang.String> |
getHelperControlsExplanations() |
java.util.List<java.lang.String> |
getHelperControlsShortcuts() |
SVGDiagram |
getImage() |
java.awt.Rectangle |
getImageBoundingBoxInUserCoordinates() |
java.awt.Rectangle |
getVisibleImageBoundingBoxInUserCoordinates() |
boolean |
isAnimationControlsShowing() |
boolean |
isAnimationEnabled()
Needs to be overridden by a subclass.
|
boolean |
isAnimationPlaying()
Needs to be overridden by a subclass.
|
boolean |
isImageCompletelyInPanel()
Returns whether the image is completely visible in the panel
|
protected boolean |
isInAnimationControls(java.awt.Point p) |
boolean |
isInHelperControls(java.awt.Point pointInUserCoordinates) |
boolean |
isInImage(java.awt.Point pointInUserCoordinates)
Returns whether a point (in user coordinates) is in the image and not in
the navigation image.
|
boolean |
isInNavigation(java.awt.Point pointInUserCoordinates)
Returns whether a point (in user coordinates) is in the navigation image.
|
protected void |
paintComponent(java.awt.Graphics g)
Paints the panel and its image at the current zoom level, location, and
interpolation method dependent on the image scale.
|
protected void |
paintImage(java.awt.Graphics2D g) |
void |
pause()
Request the animation to pause.
|
void |
pauseResume()
Request the animation to pause or resume.
|
protected boolean |
processMouseClick(java.awt.event.MouseEvent e)
Process a mouse click
|
protected boolean |
processMouseDrag(java.awt.event.MouseEvent e)
Process a mouse drag;
|
protected boolean |
processMouseExit(java.awt.event.MouseEvent e)
Process a mouse exit
|
protected boolean |
processMouseMove(java.awt.event.MouseEvent e)
Process a mouse move.
|
protected boolean |
processMousePress(java.awt.event.MouseEvent e)
Process a mouse press.
|
protected boolean |
processMouseRelease(java.awt.event.MouseEvent e)
Process a mouse release
|
void |
renderOneFrame()
Request one frame of the animation to be rendered.
|
void |
resetView()
Scale and center the image just in the viewport.
|
void |
resume()
Resume the animation from pausing.
|
void |
seek(double time)
Request the next animation frame to be rendered at the given time.
|
void |
setHelperControlsExplanations(java.util.List<java.lang.String> helperControlsExplanations)
Sets the shortcut explanations, displayed when hovering over the question
mark in the lower right corner.
|
void |
setHelperControlsShortcuts(java.util.List<java.lang.String> helperControlsShortcuts)
Sets the shortcuts, displayed when hovering over the question mark in the
lower right corner.
|
void |
setImage(SVGDiagram image,
boolean resetView)
Sets an image for display in the panel.
|
void |
setImageTransformationChangedListener(ImageTransformationChangedListener listener) |
void |
setupListeners() |
java.awt.geom.Point2D |
transformImage2User(java.awt.geom.Point2D p) |
java.awt.geom.Point2D |
transformImageToNavigation(java.awt.geom.Point2D p)
Transforms the given point in image coordinates to navigation coordinates
|
java.awt.geom.Point2D |
transformNavigationToImage(java.awt.geom.Point2D p)
Transforms the given point in navigation coordinates to image coordinates
|
java.awt.geom.Point2D |
transformUser2Image(java.awt.geom.Point2D p) |
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, 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 SVGDiagram image
protected java.awt.geom.AffineTransform image2user
protected boolean isDraggingImage
protected boolean isDraggingAnimation
protected java.awt.Rectangle animationControls
protected java.awt.Rectangle controlsPlayPause
public static final double navigationImageWidthInPartOfPanel
public static final java.awt.Color navigationImageBorderColor
public static final float[] dash1
public static final java.awt.BasicStroke navigationImageOutlineStroke
public static final int helperControlsWidth
public static final java.awt.Font helperControlsFont
protected java.util.List<java.lang.String> helperControlsShortcuts
protected java.util.List<java.lang.String> helperControlsExplanations
public NavigableSVGPanel(SVGDiagram newImage)
public void setupListeners()
protected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - the Graphics context for paintingprotected void paintImage(java.awt.Graphics2D g)
public static void drawSVG(java.awt.Graphics2D g,
SVGDiagram image,
int x,
int y,
int width,
int height)
g - image - x - y - width - height - protected void drawAnimation(java.awt.Graphics2D g)
g - public java.awt.geom.Point2D transformNavigationToImage(java.awt.geom.Point2D p)
p - public java.awt.geom.Point2D transformImageToNavigation(java.awt.geom.Point2D p)
p - public boolean isInImage(java.awt.Point pointInUserCoordinates)
pointInUserCoordinates - public boolean isInNavigation(java.awt.Point pointInUserCoordinates)
pointInUserCoordinates - public boolean isInHelperControls(java.awt.Point pointInUserCoordinates)
public java.util.List<java.lang.String> getHelperControlsShortcuts()
public void setHelperControlsShortcuts(java.util.List<java.lang.String> helperControlsShortcuts)
helperControlsShortcuts - public java.util.List<java.lang.String> getHelperControlsExplanations()
public void setHelperControlsExplanations(java.util.List<java.lang.String> helperControlsExplanations)
helperControlsExplanations - public SVGDiagram getImage()
public java.awt.Rectangle getVisibleImageBoundingBoxInUserCoordinates()
public java.awt.Rectangle getImageBoundingBoxInUserCoordinates()
public boolean isImageCompletelyInPanel()
panState - diagram - panel - public void setImage(SVGDiagram image, boolean resetView)
Sets an image for display in the panel.
image - an image to be set in the panelpublic void resetView()
throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformExceptionpublic void centerImageAround(java.awt.Point pointInNavigationCoordinates)
throws java.awt.geom.NoninvertibleTransformException
pointInNavigationCoordinates - java.awt.geom.NoninvertibleTransformExceptionprotected boolean processMousePress(java.awt.event.MouseEvent e)
e - protected boolean processMouseRelease(java.awt.event.MouseEvent e)
e - protected boolean processMouseDrag(java.awt.event.MouseEvent e)
e - protected boolean processMouseMove(java.awt.event.MouseEvent e)
e - protected boolean processMouseClick(java.awt.event.MouseEvent e)
e - protected boolean processMouseExit(java.awt.event.MouseEvent e)
e - public void setImageTransformationChangedListener(ImageTransformationChangedListener listener)
public java.awt.geom.Point2D transformUser2Image(java.awt.geom.Point2D p)
public java.awt.geom.Point2D transformImage2User(java.awt.geom.Point2D p)
public boolean isAnimationEnabled()
public boolean isAnimationPlaying()
public double getAnimationTime()
public double getAnimationMinimumTime()
public double getAnimationMaximumTime()
protected boolean isInAnimationControls(java.awt.Point p)
p - public void seek(double time)
time - public void pause()
public void resume()
public void pauseResume()
public void renderOneFrame()
public java.awt.Rectangle getControlsProgressLine()
public boolean isAnimationControlsShowing()