org.globus.cog.gridface.impl.imageviewer
Class ImageViewerImplToolBar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.globus.cog.gridface.impl.imageviewer.ImageViewerImplToolBar
All Implemented Interfaces:
AccessClose, Accessible, GridFace, ImageObserver, ImageViewerPanel, MenuContainer, Serializable, StatusListener, ViewerPanel

public class ImageViewerImplToolBar
extends JPanel
implements ImageViewerPanel, AccessClose, StatusListener

See Also:
Serialized Form

Nested Class Summary
 class ImageViewerImplToolBar.imagePane
          This class extends JComponent and displays the image.
 class ImageViewerImplToolBar.listener
          Provides a generic action listener for all buttons and distinguishes between them on the basis of their text.
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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.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
ImageViewerImplToolBar()
           
ImageViewerImplToolBar(GridCommandManager gcm)
          The constructor calls the parent's constuctor (since the class extends JPanel).
ImageViewerImplToolBar(GridCommandManager gcm, URI imageURI)
           
ImageViewerImplToolBar(URI imageURI)
           
 
Method Summary
 void alert(String message)
           
 void changeSize(double changeSizeFactor)
          Resizes the image by the factor specified in changeSizeFactor.
 boolean close()
           
protected  void createUsernameDialog()
          Create the dialog to be popped up asking the user for their username and password if they are not connecting to a gridftp server.
 void flipHorizontal()
          Flip the image horizontally.
 void flipVertical()
          Flip the image vertically.
 Date lastUpdateTime()
          Records the last time the GridFace was updated.
 void load()
           
 void load(String imagePath)
          Loads up an image, either the first one or a new one.
 void register(GridFace connection)
          Registers another GridFace to this GridFace.
 void register(String mimetype, Object viewer)
          Registers a viewer for a particular protocol.
 void rotate(int angle)
          Rotate the image by the given angle
 void save()
          Save the changed image.
 void saveAS()
          Save as a new image
 void setDefault(Object viewer)
          Sets the default viewer to
 void setLabel(String label)
          sets a label for a GridFace.
 void setName(String name)
          sets the name for a GridFace.
 void statusChanged(StatusEvent event)
           
 void update()
          updates the displaed gridface.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, 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, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, 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, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageViewerImplToolBar

public ImageViewerImplToolBar()
                       throws Exception

ImageViewerImplToolBar

public ImageViewerImplToolBar(GridCommandManager gcm)
The constructor calls the parent's constuctor (since the class extends JPanel).


ImageViewerImplToolBar

public ImageViewerImplToolBar(GridCommandManager gcm,
                              URI imageURI)

ImageViewerImplToolBar

public ImageViewerImplToolBar(URI imageURI)
                       throws Exception
Method Detail

alert

public void alert(String message)

createUsernameDialog

protected void createUsernameDialog()
Create the dialog to be popped up asking the user for their username and password if they are not connecting to a gridftp server.


load

public void load()
Specified by:
load in interface ImageViewerPanel

load

public void load(String imagePath)
Loads up an image, either the first one or a new one.


rotate

public void rotate(int angle)
Rotate the image by the given angle

Specified by:
rotate in interface ImageViewerPanel
Parameters:
angle - int

flipVertical

public void flipVertical()
Flip the image vertically. An AffineTransform is used to do this since there is not operation in the Graphics2D class for this.

Specified by:
flipVertical in interface ImageViewerPanel

flipHorizontal

public void flipHorizontal()
Flip the image horizontally.

Specified by:
flipHorizontal in interface ImageViewerPanel

changeSize

public void changeSize(double changeSizeFactor)
Resizes the image by the factor specified in changeSizeFactor.

Specified by:
changeSize in interface ImageViewerPanel

save

public void save()
Save the changed image.

Specified by:
save in interface ImageViewerPanel

saveAS

public void saveAS()
Save as a new image

Specified by:
saveAS in interface ImageViewerPanel

register

public void register(String mimetype,
                     Object viewer)
Registers a viewer for a particular protocol.

Specified by:
register in interface ViewerPanel
Parameters:
mimetype - a String the mimetype. For now we use a combination of endings and prefixes. E.g. gridftp://..../a.jpg. Will fetch and display in an image in the viewer. The file will be downloaded to the local computer.
viewer - an Object The viewer the displays the result in the view window.

setDefault

public void setDefault(Object viewer)
Sets the default viewer to

Specified by:
setDefault in interface ViewerPanel
Parameters:
viewer - an Object value

update

public void update()
updates the displaed gridface.

Specified by:
update in interface GridFace

lastUpdateTime

public Date lastUpdateTime()
Records the last time the GridFace was updated. The default value is the time of creation.

Specified by:
lastUpdateTime in interface GridFace
Returns:
Date, the last time when the GridFace was updated.

setName

public void setName(String name)
sets the name for a GridFace. Names are useful to distinguish gridfaces from each other. A Name is supposed to be unique. Default is null.

Specified by:
setName in interface GridFace
Parameters:
name - a String thatreturns a uniqe name.

setLabel

public void setLabel(String label)
sets a label for a GridFace. Label are useful to create abbreviations for a GridFace for a graphical display. Labels are ofthe used as a title if applicable. Defaukt is null.

Specified by:
setLabel in interface GridFace
Parameters:
label - a String that returns the assigned label.

register

public void register(GridFace connection)
Registers another GridFace to this GridFace. This will prevent that gridfaces are unnecesarily killed.

Specified by:
register in interface GridFace
Parameters:
connection - a GridFace value

statusChanged

public void statusChanged(StatusEvent event)
Specified by:
statusChanged in interface StatusListener

close

public boolean close()
Specified by:
close in interface AccessClose