com.monkeycoder.monkeyfractal.gui
Class RenderPanel

java.lang.Object
  extended by java.awt.Component
      extended by com.monkeycoder.monkeyfractal.gui.RenderPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
BasicRenderPanel, PlasmaRenderPanel

public abstract class RenderPanel
extends java.awt.Component

This is the parent class for all RenderPanels. Note that this class is abstract and provides absolutely no rendering on it's own. To create a child class, this class should be extended and the doRender() method overridden.

Originally part of the MonkeyFractal project.

Author:
David Stephens
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ParameterList params
          Holds the configuration of this RenderPanel in the form of a ParameterList.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RenderPanel()
          RenderPanel is abstract and cannot be directly constructed.
 
Method Summary
abstract  java.awt.Image doRender(FractalBuffer inFb)
          This is the core render function that converts data in a FractalBuffer into an Image for display.
 void enableForcedRender()
           
abstract  java.lang.String getHelpAboutInfo()
          This method returns a String containing Help About information about this plugin.
 ParameterList getParameterList()
          This function returns the current ParameterList being used by this RenderPanel.
 java.awt.Image getRenderImage()
          This function accepts the two corner points that represent rubberband box.
 void paint(java.awt.Graphics gfx)
          This function controls the generalized rendering of FractalBuffer data.
abstract  void resetParameterList()
          This function creates a default ParameterList for this RenderPanel.
 void setComplexRange(ComplexRange inCr)
          This function sets the ComplexRange to be shown in the corner of the render.
 void setFractalBuffer(FractalBuffer inFb)
          This function sets the FractalBuffer of data to be rendered.
 void setParameterList(ParameterList inParamList)
          This function takes in a ParameterList that will replace the internal ParameterList being used by this RenderPanel.
 void setRubberBandBox(java.awt.Point inUpperLeft, java.awt.Point inLowerRight)
          This function accepts the two corner points that represent rubberband box.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

params

protected ParameterList params
Holds the configuration of this RenderPanel in the form of a ParameterList.

Constructor Detail

RenderPanel

public RenderPanel()
RenderPanel is abstract and cannot be directly constructed. Extend this class implement the required abstract methods and instantiate the child class.

Method Detail

getParameterList

public ParameterList getParameterList()
This function returns the current ParameterList being used by this RenderPanel. If there is not yet an internal ParameterList this method calls resetParameterList() to create one and fill it in with default values.

Returns:
The current ParameterList being used by this RenderPanel.
See Also:
resetParameterList()

setParameterList

public void setParameterList(ParameterList inParamList)
This function takes in a ParameterList that will replace the internal ParameterList being used by this RenderPanel. The basis for the ParameterList that is passed in via this method should be one that was originally acquired by getParameterList(). No new parameters should be added externally as each plugin will know only its own parameter list.

Parameters:
inParamList - The new ParameterList to be used by this RenderPanel.
See Also:
getParameterList()

resetParameterList

public abstract void resetParameterList()
This function creates a default ParameterList for this RenderPanel. This ParameterList should replace the one used internally by this RenderPanel and should contain useful default values.


setFractalBuffer

public void setFractalBuffer(FractalBuffer inFb)
This function sets the FractalBuffer of data to be rendered.

Parameters:
inFb - The FractalBuffer to be rendered.

setComplexRange

public void setComplexRange(ComplexRange inCr)
This function sets the ComplexRange to be shown in the corner of the render.

Parameters:
inCr - The ComplexRange to be shown.

paint

public void paint(java.awt.Graphics gfx)
This function controls the generalized rendering of FractalBuffer data. It provides automatic detection of the need to rerender the base image, as well as the ability to display both a dynamic rubberband box, and a display of the ComplexRange being shown.

This function should NOT be called directly. It will be called as appropriate when a call to repaint() is made on this object.

Overrides:
paint in class java.awt.Component
Parameters:
gfx - The Graphics object passed to this function.

setRubberBandBox

public void setRubberBandBox(java.awt.Point inUpperLeft,
                             java.awt.Point inLowerRight)
This function accepts the two corner points that represent rubberband box. Passing in null points will cause the rubberband box to not be shown.

Parameters:
inUpperLeft - The upper left point of the rubberband box.
inLowerRight - The lower right point of the rubberband box.

getRenderImage

public java.awt.Image getRenderImage()
This function accepts the two corner points that represent rubberband box. Passing in null points will cause the rubberband box to not be shown.

Returns:
The current rendered image.

enableForcedRender

public void enableForcedRender()

doRender

public abstract java.awt.Image doRender(FractalBuffer inFb)
This is the core render function that converts data in a FractalBuffer into an Image for display. This abstract method must be implemented by children of this class.

Parameters:
inFb - The FractalBuffer to render.
Returns:
The rendered image.

getHelpAboutInfo

public abstract java.lang.String getHelpAboutInfo()
This method returns a String containing Help About information about this plugin. This information will be displayed in the Help About dialog box when this plugin is active.

Returns:
Help About information for this plugin.