Class ContourPlot.BlankCanvasFallback
- All Implemented Interfaces:
ContourPlot.JPlotterCanvas,ImageObserver,MenuContainer,Serializable
- Enclosing class:
ContourPlot
invalid reference
BlankCanvas
invalid reference
org.lwjgl.opengl.awt.AWTGLCanvas
This JComponent uses a single ContourPlot.Renderer to draw its contents.
- Author:
- hageldave
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContourPlot.Imgprotected booleanprotected booleanprotected ContourPlot.Imgprivate final ImageObserverprotected ContourPlot.Imgprotected ContourPlot.Rendererprotected AtomicBooleanprivate static final longFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionImplicit cast of this canvas to a class extendingComponent.voidenablePDFAsImageRendering(boolean enable) En/disables PDF rendering as image.voidenableSvgAsImageRendering(boolean enable) En/disables SVG rendering as image.intgetPixel(int x, int y, boolean picking, int areaSize) Reads the color value of the pixel at the specified location if areaSize == 1.booleanbooleanvoidprotected voidrender()protected voidrender(Graphics2D g, Graphics2D p, int w, int h) voidrepaint()On AWT event dispatch thread:
Uses the setContourPlot.Rendererrender to render display contents, then calls super.repaint() to display rendered content.voidSchedules a repaint call on the AWT event dispatch thread.setRenderer(ContourPlot.Renderer renderer) Sets the renderer of this canvas.toImg()Fetches the current contents of the framebuffer and returns them as anContourPlot.Img.Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, update, updateUIMethods inherited from class java.awt.Container
add, 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, validateTreeMethods inherited from class java.awt.Component
action, 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, getAccessibleContext, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gov.nih.mipav.model.algorithms.ContourPlot.JPlotterCanvas
addCleanupOnWindowClosingListener, paintToPDF
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
obs_allbits
-
repaintIsSheduled
-
mainRenderBuffer
-
pickingRenderBuffer
-
displayBuffer
-
renderer
-
isRenderSvgAsImage
protected boolean isRenderSvgAsImage -
isRenderPDFAsImage
protected boolean isRenderPDFAsImage
-
-
Constructor Details
-
BlankCanvasFallback
public BlankCanvasFallback()Creates a newContourPlot.BlankCanvasFallbackinstance.
-
-
Method Details
-
setRenderer
Description copied from interface:ContourPlot.JPlotterCanvasSets the renderer of this canvas.- Specified by:
setRendererin interfaceContourPlot.JPlotterCanvas- Parameters:
renderer- to draw contents.- Returns:
- this for chaining
-
getRenderer
- Specified by:
getRendererin interfaceContourPlot.JPlotterCanvas- Returns:
- the current renderer
-
scheduleRepaint
public void scheduleRepaint()Description copied from interface:ContourPlot.JPlotterCanvasSchedules a repaint call on the AWT event dispatch thread. If a repaint is already pending, this method will not schedule an additional call until the render method within repaint is about to be executed.- Specified by:
scheduleRepaintin interfaceContourPlot.JPlotterCanvas
-
repaint
public void repaint()Description copied from interface:ContourPlot.JPlotterCanvasOn AWT event dispatch thread:
Uses the setContourPlot.Rendererrender to render display contents, then calls super.repaint() to display rendered content.Schedules a repaint call call on the AWT event dispatch thread if not on it.
This method is only deprecated for calling directly, call
ContourPlot.JPlotterCanvas.scheduleRepaint()instead.
Of course super.repaint() is implemented by the implementingComponentalready.- Specified by:
repaintin interfaceContourPlot.JPlotterCanvas- Overrides:
repaintin classComponent
-
render
protected void render() -
render
-
paint
- Overrides:
paintin classJComponent
-
enableSvgAsImageRendering
public void enableSvgAsImageRendering(boolean enable) Description copied from interface:ContourPlot.JPlotterCanvasEn/disables SVG rendering as image. When rendering to SVG and this is enabled, instead of translating the contents of the renderers into SVG elements, the current framebuffer image is used and put into the dom.This can be useful for example when too many SVG elements would be created resulting in a huge dom and file size when exporting as SVG.
- Specified by:
enableSvgAsImageRenderingin interfaceContourPlot.JPlotterCanvas- Parameters:
enable- true when no SVG elements should be created from the content of this JPlotterCanvas but instead a simple image element with the framebuffer's content.
-
isSvgAsImageRenderingEnabled
public boolean isSvgAsImageRenderingEnabled()- Specified by:
isSvgAsImageRenderingEnabledin interfaceContourPlot.JPlotterCanvas- Returns:
- true when enabled
- See Also:
-
enablePDFAsImageRendering
public void enablePDFAsImageRendering(boolean enable) Description copied from interface:ContourPlot.JPlotterCanvasEn/disables PDF rendering as image. When rendering to PDF and this is enabled, instead of translating the contents of the renderers into PDF elements, the current framebuffer image is used and put into the pdf document.This can be useful for example when too many PDF elements would be created resulting in a huge dom and file size when exporting as PDF.
- Specified by:
enablePDFAsImageRenderingin interfaceContourPlot.JPlotterCanvas- Parameters:
enable- true when no PDF elements should be created from the content of this JPlotterCanvas but instead a simple image element with the framebuffer's content.
-
isPDFAsImageRenderingEnabled
public boolean isPDFAsImageRenderingEnabled()- Specified by:
isPDFAsImageRenderingEnabledin interfaceContourPlot.JPlotterCanvas- Returns:
- true when enabled
- See Also:
-
toImg
Description copied from interface:ContourPlot.JPlotterCanvasFetches the current contents of the framebuffer and returns them as anContourPlot.Img.- Specified by:
toImgin interfaceContourPlot.JPlotterCanvas- Returns:
- image of the current framebuffer.
-
getPixel
public int getPixel(int x, int y, boolean picking, int areaSize) Description copied from interface:ContourPlot.JPlotterCanvasReads the color value of the pixel at the specified location if areaSize == 1. This can be used to get the color or picking color under the mouse cursor.Since the cursor placement may be inexact and thus miss the location the user was actually interested in, the areaSize parameter can be increased to create a window of pixels around the specified location. This window area will be examined and the most prominent non zero color value will be returned.
- Specified by:
getPixelin interfaceContourPlot.JPlotterCanvas- Parameters:
x- coordinate of the pixels locationy- coordinate of the pixels locationpicking- whether the picking color or the visible color should be retrieved.areaSize- width and height of the area around the specified location.- Returns:
- the most prominent color in the area as integer packed ARGB value.
If the returned value is to be used as an object id from picking color, then the
alpha value probably has to be discarded first using
0x00ffffff & returnValue.
-
asComponent
Description copied from interface:ContourPlot.JPlotterCanvasImplicit cast of this canvas to a class extendingComponent. This implies that the implementing class is aComponent.- Specified by:
asComponentin interfaceContourPlot.JPlotterCanvas- Returns:
- this, but cast to
Component
-