pl.edu.agh.cast.figure
Class ImageFigure

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by pl.edu.agh.cast.figure.ImageFigure
All Implemented Interfaces:
org.eclipse.draw2d.IFigure

public class ImageFigure
extends org.eclipse.draw2d.Figure

A Figure with an Image. The images are provided from ResourceRegistry.

Author:
AGH CAST Team

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch
 
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
ImageFigure(String resourceId, ImageSize size)
          Creates new figure with an image in resource by given id and with given size.
ImageFigure(String resourceId, ImageSize size, String defaultResourceId)
          Creates new figure with an image in resource by given id and with given size.
 
Method Summary
 org.eclipse.draw2d.geometry.Dimension getMinimumSize(int arg0, int arg1)
          
 org.eclipse.draw2d.geometry.Dimension getPreferredSize(int x, int y)
          
protected  void paintFigure(org.eclipse.draw2d.Graphics gc)
          
 void setBounds(org.eclipse.draw2d.geometry.Rectangle bounds)
          
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFigure

public ImageFigure(String resourceId,
                   ImageSize size)
Creates new figure with an image in resource by given id and with given size.

Parameters:
resourceId - id of the image to be used
size - image size
Throws:
IllegalArgumentException - when resource does not exist or resource does not contain image with given size

ImageFigure

public ImageFigure(String resourceId,
                   ImageSize size,
                   String defaultResourceId)
Creates new figure with an image in resource by given id and with given size.

Parameters:
resourceId - id of the image to be used
size - image size
defaultResourceId - id of the default image to be used (in case the specific one could not be located)
Throws:
IllegalArgumentException - when resource nor default resource does not exist or resource does not contain image with given size
Method Detail

paintFigure

protected void paintFigure(org.eclipse.draw2d.Graphics gc)

Overrides:
paintFigure in class org.eclipse.draw2d.Figure
See Also:
Figure.paintFigure(org.eclipse.draw2d.Graphics)

setBounds

public void setBounds(org.eclipse.draw2d.geometry.Rectangle bounds)

Specified by:
setBounds in interface org.eclipse.draw2d.IFigure
Overrides:
setBounds in class org.eclipse.draw2d.Figure
See Also:
Figure.setBounds(org.eclipse.draw2d.geometry.Rectangle)

getMinimumSize

public org.eclipse.draw2d.geometry.Dimension getMinimumSize(int arg0,
                                                            int arg1)

Specified by:
getMinimumSize in interface org.eclipse.draw2d.IFigure
Overrides:
getMinimumSize in class org.eclipse.draw2d.Figure
See Also:
Figure.getMinimumSize(int, int)

getPreferredSize

public org.eclipse.draw2d.geometry.Dimension getPreferredSize(int x,
                                                              int y)

Specified by:
getPreferredSize in interface org.eclipse.draw2d.IFigure
Overrides:
getPreferredSize in class org.eclipse.draw2d.Figure
See Also:
Figure.getPreferredSize(int, int)


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.