WebObjects 5.2.3

com.webobjects.eointerface.swing
Class EOSwingImageViewPlugin

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
      extended bycom.webobjects.eointerface.EOValueAssociation.ValuePlugin
          extended bycom.webobjects.eointerface.swing.EOSwingImageViewPlugin
All Implemented Interfaces:
NSDisposable

public class EOSwingImageViewPlugin
extends EOValueAssociation.ValuePlugin

EOSwingImageViewPlugin is a concrete subclass of EOValueAssociation.ValuePlugin that displays NSData as an java.awt.Image in an EOImageView.

Associations classes: EOValueAssociation

Widgets classes: EOImageView


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOSwingImageViewPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOSwingImageViewPlugin connected to an association and a UI widget.
 
Method Summary
 void breakConnection()
          Clean up (end) the plugin's connection to its widget.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
protected  Image imageFromData(NSData data)
          Converts the NSData object into an java.awt.Image, using Toolkit.createImage.
 void setValue(Object value, boolean isEnabled)
          Set NSData object to be used for the image, and set the enabled state of the view.
 Object value()
          Returns the data object used to create the plugin view's image.
 
Methods inherited from class com.webobjects.eointerface.EOValueAssociation.ValuePlugin
endEditing, useURLAsValue
 
Methods inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
association, dispose, unacceptableAspects, widget, widgetKeysTaken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOSwingImageViewPlugin

public EOSwingImageViewPlugin(EOWidgetAssociation association,
                              Object widget)
Creates a new EOSwingImageViewPlugin connected to an association and a UI widget.

Parameters:
association - EOValueAssociation object for the plugin to use
widget - EOImageView that the plugin will manage
Method Detail

breakConnection

public void breakConnection()
Clean up (end) the plugin's connection to its widget. In this case, however, it just re-initializes the data.

Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

establishConnection

public void establishConnection()
Establishes a connection between the plugin and its UI widget. In this case, however, it just re-initializes the data.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

imageFromData

protected Image imageFromData(NSData data)
Converts the NSData object into an java.awt.Image, using Toolkit.createImage.

Override this method for custom behaviour.

Parameters:
data - the NSData object to be used as an image (usually coming from the association)
Returns:
an object of class java.awt.Image or subclass

setValue

public void setValue(Object value,
                     boolean isEnabled)
Set NSData object to be used for the image, and set the enabled state of the view.

Specified by:
setValue in class EOValueAssociation.ValuePlugin
Parameters:
value - NSData object to be used as an image; its bytes will be converted to an java.awt.Image with the method imageFromData
isEnabled - Boolean indicating wether to set the enabled state for the view; currently not used for EOImageView

value

public Object value()
Returns the data object used to create the plugin view's image.

Specified by:
value in class EOValueAssociation.ValuePlugin
Returns:
an Object of class NSData (or subclass)

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.