WebObjects 5.2.3

com.webobjects.eointerface.cocoa
Class EOCocoaImageViewPlugin

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

public class EOCocoaImageViewPlugin
extends EOValueAssociation.ValuePlugin

EOCocoaImageViewPlugin is a concrete subclass of EOValueAssociation.ValuePlugin that displays NSData as an NSImage in an NSImageView. Images dropped onto its NSImageView are saved out as NSData in TIFF format.

Usage:
associations classes: EOValueAssociation
widgets classes: NSImageView
value classes: NSData containing image data (gif, tiff, jpeg)


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOCocoaImageViewPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOCocoaImageViewPlugin connected to an association and a UI widget.
 
Method Summary
 void breakConnection()
          Tells the plugin to halt communication with its NSImageView object.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 void setValue(Object value, boolean enabled)
          Sets the image data to be used by this plugin's NSImageView object.
 Object value()
          Returns the image data held by this plugin's NSImageView
 String[] widgetKeysTaken()
          Returns an array of Strings which represent outlet names in Interface Builder.
 
Methods inherited from class com.webobjects.eointerface.EOValueAssociation.ValuePlugin
endEditing, useURLAsValue
 
Methods inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
association, dispose, unacceptableAspects, widget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOCocoaImageViewPlugin

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

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

breakConnection

public void breakConnection()
Tells the plugin to halt communication with its NSImageView object. This makes sure that actions from the NSImageView don't get to this plugin.

Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

establishConnection

public void establishConnection()
Establishes a connection between the plugin and its UI widget. This makes sure that actions from the NSImageView are sent to this plugin.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

setValue

public void setValue(Object value,
                     boolean enabled)
Sets the image data to be used by this plugin's NSImageView object.

Specified by:
setValue in class EOValueAssociation.ValuePlugin
Parameters:
value - com.webobjects.foundation.NSData object conatining the byte
enabled - if true, the editable flag of the plugin's NSImageView is enabled, so the user is able to drag-and-drop a new image into the NSImageView; if false, the NSImageView is not editable; data of the NSImage to display in the NSImageView managed by this plugin

value

public Object value()
Returns the image data held by this plugin's NSImageView

Specified by:
value in class EOValueAssociation.ValuePlugin
Returns:
com.webobjects.foundation.NSData object conatining the bytes of the TIFF representation of the NSImage of the NSImageView managed by this plugin

widgetKeysTaken

public String[] widgetKeysTaken()
Returns an array of Strings which represent outlet names in Interface Builder. These outlets are disabled by Interface Builder once the NSImageView is connected to this plugin's association.

EOCocoaImageViewPlugin takes over outlets with keys "action" and "target".

Overrides:
widgetKeysTaken in class EOWidgetAssociation.WidgetPlugin
Returns:
String array of outlet names

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

Copyright © 2004 Apple Computer, Inc.