com.dbarnes.sgme
Class Widget

java.lang.Object
  extended by com.dbarnes.sgme.Item
      extended by com.dbarnes.sgme.Widget

public class Widget
extends Item

Represents a widget in a project. A widget is any application-specific entity which can exist on a map, in addition to the tile map. Widgets are placed on the map via associative MapWidget objects.

See Also:
MapWidget

Constructor Summary
Widget(Project project)
          Creates a new Widget object.
 
Method Summary
 java.awt.Image getImage()
          Returns the image which represents this Widget in the graphical user interface.
 java.io.File getImageFile()
          Returns the File object representing the image for this widget.
 java.lang.String getImageFilePath()
          Returns the path to the image file for this widget, or null if none has been set.
protected  Project getProject()
          Returns the project to which this widget belongs.
 void setImage(java.awt.Image icon)
          Sets the image which represents this Widget in the graphical user interface.
 void setImageFile(java.io.File imageFile)
          Sets the File object representing the image for this widget, and loads the image from the specified file.
protected  void setProject(Project project)
          Sets the project to which this widget belongs.
 
Methods inherited from class com.dbarnes.sgme.Item
clearAttributes, getAttribute, getAttributeNames, getId, getName, setAttribute, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Widget

public Widget(Project project)
Creates a new Widget object.

Parameters:
project - The Project to which this Widget belongs.
Method Detail

getImage

public java.awt.Image getImage()
Returns the image which represents this Widget in the graphical user interface.

Specified by:
getImage in class Item

setImage

public void setImage(java.awt.Image icon)
Sets the image which represents this Widget in the graphical user interface.


getImageFile

public java.io.File getImageFile()
Returns the File object representing the image for this widget.


setImageFile

public void setImageFile(java.io.File imageFile)
                  throws java.lang.InterruptedException
Sets the File object representing the image for this widget, and loads the image from the specified file.

Throws:
java.lang.InterruptedException

getImageFilePath

public java.lang.String getImageFilePath()
Returns the path to the image file for this widget, or null if none has been set.


getProject

protected Project getProject()
Returns the project to which this widget belongs.


setProject

protected void setProject(Project project)
Sets the project to which this widget belongs.



Copyright 2006-2009 Don Barnes. All Rights Reserved.