Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.maloi.evolvo.gui
Class SwingImagePanel  view SwingImagePanel download SwingImagePanel.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.maloi.evolvo.gui.ImagePanel
                      extended byorg.maloi.evolvo.gui.SwingImagePanel
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.image.ImageConsumer, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SwingImagePanel
extends ImagePanel
implements java.awt.image.ImageConsumer


Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  boolean finished
           
(package private)  int height
           
(package private)  java.awt.image.BufferedImage image
           
(package private)  int width
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SwingImagePanel(org.maloi.evolvo.expressiontree.renderer.RendererInterface ri)
           
SwingImagePanel(org.maloi.evolvo.expressiontree.renderer.RendererInterface ri, java.awt.Image thumb)
          Creates an image panel, drawing a scaled up instance of a thumbnail of the RendererInterface's image to act as a placeholder until the RendererInterface is done drawing the full sized version.
 
Method Summary
 void flush()
           
 java.awt.image.RenderedImage getImage()
           
 java.awt.Dimension getPreferredSize()
          Get the component's preferred size.
 void imageComplete(int status)
          The ImageProducer calls this method to indicate a single frame or the entire image is complete.
 void paintComponent(java.awt.Graphics g)
          Paint the component's body.
 void setColorModel(java.awt.image.ColorModel model)
          This ColorModel should indicate the model used by the majority of calls to setPixels.
 void setDimensions(int width, int height)
          An ImageProducer indicates the size of the image being produced using this method.
 void setHints(int hintflags)
          The ImageProducer should call this method with a bit mask of hints from any of RANDOMPIXELORDER, TOPDOWNLEFTRIGHT, COMPLETESCANLINES, SINGLEPASS, SINGLEFRAME.
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)
          Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
 void setPixels(int startx, int starty, int w, int h, java.awt.image.ColorModel cm, int[] pixels, int off, int scansize)
          Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
 void setProperties(java.util.Hashtable props)
          An ImageProducer can set a list of properties associated with this image by using this method.
 void stateChanged(javax.swing.event.ChangeEvent ce)
          Called by an object to notify the listener that the object's state has changed.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

image

java.awt.image.BufferedImage image

finished

boolean finished

width

int width

height

int height
Constructor Detail

SwingImagePanel

public SwingImagePanel(org.maloi.evolvo.expressiontree.renderer.RendererInterface ri)

SwingImagePanel

public SwingImagePanel(org.maloi.evolvo.expressiontree.renderer.RendererInterface ri,
                       java.awt.Image thumb)
Creates an image panel, drawing a scaled up instance of a thumbnail of the RendererInterface's image to act as a placeholder until the RendererInterface is done drawing the full sized version.

Method Detail

paintComponent

public void paintComponent(java.awt.Graphics g)
Description copied from class: javax.swing.JComponent
Paint the component's body. This usually means calling ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)>ComponentUI.update(java.awt.Graphics, javax.swing.JComponent) 55 on the JComponent.ui>JComponent.ui 55 property of the component, if it is non-null. You may override this if you wish to customize the component's body-painting behavior. The component's body is painted first, before the border and children.


getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from class: javax.swing.JComponent
Get the component's preferred size. If the JComponent.preferredSize>JComponent.preferredSize 55 property has been explicitly set, it is returned. If the JComponent.preferredSize>JComponent.preferredSize 55 property has not been set but the JComponent.ui>JComponent.ui 55 property has been, the result of ComponentUI.getPreferredSize(javax.swing.JComponent)>ComponentUI.getPreferredSize(javax.swing.JComponent) 55 is returned. If neither property has been set, the result of Container.getPreferredSize()>Container.getPreferredSize() 55 is returned.

Overrides:
getPreferredSize in class ImagePanel

getImage

public java.awt.image.RenderedImage getImage()
Overrides:
getImage in class ImagePanel

flush

public void flush()
Overrides:
flush in class ImagePanel

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent ce)
Description copied from interface: javax.swing.event.ChangeListener
Called by an object to notify the listener that the object's state has changed. The incoming event identifies the source of the event, allowing the listener to differentiate when it is listening for changes in multiple sources.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

imageComplete

public void imageComplete(int status)
Description copied from interface: java.awt.image.ImageConsumer
The ImageProducer calls this method to indicate a single frame or the entire image is complete. The method is also used to indicate an error in loading or producing the image.

Specified by:
imageComplete in interface java.awt.image.ImageConsumer

setColorModel

public void setColorModel(java.awt.image.ColorModel model)
Description copied from interface: java.awt.image.ImageConsumer
This ColorModel should indicate the model used by the majority of calls to setPixels. Each call to setPixels could however indicate a different ColorModel.

Specified by:
setColorModel in interface java.awt.image.ImageConsumer

setDimensions

public void setDimensions(int width,
                          int height)
Description copied from interface: java.awt.image.ImageConsumer
An ImageProducer indicates the size of the image being produced using this method.

Specified by:
setDimensions in interface java.awt.image.ImageConsumer

setHints

public void setHints(int hintflags)
Description copied from interface: java.awt.image.ImageConsumer
The ImageProducer should call this method with a bit mask of hints from any of RANDOMPIXELORDER, TOPDOWNLEFTRIGHT, COMPLETESCANLINES, SINGLEPASS, SINGLEFRAME.

Specified by:
setHints in interface java.awt.image.ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      byte[] pixels,
                      int off,
                      int scansize)
Description copied from interface: java.awt.image.ImageConsumer
Deliver a subset of an ImageProducer's pixels to this ImageConsumer. Each element of the pixels array represents one pixel. The pixel data is formatted according to the color model model. The x and y parameters are the coordinates of the block of pixels being delivered to this ImageConsumer. They are specified relative to the top left corner of the image being produced. Likewise, w and h are the pixel block's dimensions.

Specified by:
setPixels in interface java.awt.image.ImageConsumer

setPixels

public void setPixels(int startx,
                      int starty,
                      int w,
                      int h,
                      java.awt.image.ColorModel cm,
                      int[] pixels,
                      int off,
                      int scansize)
Description copied from interface: java.awt.image.ImageConsumer
Deliver a subset of an ImageProducer's pixels to this ImageConsumer. Each element of the pixels array represents one pixel. The pixel data is formatted according to the color model model. The x and y parameters are the coordinates of the rectangular region of pixels being delivered to this ImageConsumer, specified relative to the top left corner of the image being produced. Likewise, w and h are the pixel region's dimensions.

Specified by:
setPixels in interface java.awt.image.ImageConsumer

setProperties

public void setProperties(java.util.Hashtable props)
Description copied from interface: java.awt.image.ImageConsumer
An ImageProducer can set a list of properties associated with this image by using this method.

Specified by:
setProperties in interface java.awt.image.ImageConsumer