com.miginfocom.ashape.shapes
Class SlicedImageAShape

java.lang.Object
  extended by com.miginfocom.ashape.shapes.AbstractAShape
      extended by com.miginfocom.ashape.shapes.ImageAShape
          extended by com.miginfocom.ashape.shapes.SlicedImageAShape
All Implemented Interfaces:
AShape, PropertyProvider

public class SlicedImageAShape
extends ImageAShape

A shape that holds a SlicedImage.

Can paint an Image, Icon or XtdImage (which is an Icon but it can be scaled).

The following attibutes is currently used by this shape:
A_SLICE_SPEC

Note that any attributes used by AbstractAShape will also be adhered to.


Field Summary
static PropertyKey A_SLICE_SPEC
          Value type: SliceSpec, not null.
 
Fields inherited from class com.miginfocom.ashape.shapes.AbstractAShape
hitShape, RETURN_LIVE_ATTR_MAP, SIZE_CONV_MAP
 
Fields inherited from interface com.miginfocom.ashape.shapes.AShape
A_ALIGN_X, A_ALIGN_Y, A_ANTI_ALIAS, A_BORDER, A_CLIP_TYPE, A_COMPOSITE, A_CROP, A_CROP_TO_VISIBILITY_BOUNDS, A_FONT, A_HIT_AREA_Z, A_ICON, A_IMAGE, A_INHERIT, A_LAYOUT, A_MAXIMUM_HEIGHT, A_MAXIMUM_WIDTH, A_MINIMUM_HEIGHT, A_MINIMUM_WIDTH, A_MOUSE_CURSOR, A_PAINT, A_PAINT_LAYER, A_PLACE_RECT, A_PREFERRED_HEIGHT, A_PREFERRED_WIDTH, A_REPORT_HIT_AREA, A_SHADOW_TARGET_PAINT, A_SHAPE, A_SHAPES, A_STROKE, A_SUB_SHAPE_SORTER, A_TEXT, A_TEXTURE_PAINT_ANCHOR, A_UNDERLINE_HEIGHT, A_VISIBILITY, A_WRAPPED_ASHAPE, CLIP_PARENT_BOUNDS, CLIP_PARENT_SHAPE
 
Constructor Summary
SlicedImageAShape()
          Empty constructor for XML builders.
SlicedImageAShape(java.lang.String name, javax.swing.Icon icon, SliceSpec sliceSpec, PlaceRect placeRect)
          Contructor.
SlicedImageAShape(java.lang.String name, java.awt.Image image, SliceSpec sliceSpec, PlaceRect placeRect)
          Contructor.
 
Method Summary
protected  java.lang.Object getWrappedImage(java.lang.Object imgOrIc)
          Gives the possibility for subclasses to return a wrapped or chached image to paint instead of the original image.
 
Methods inherited from class com.miginfocom.ashape.shapes.ImageAShape
drawImage, getHitBounds, getImageOrIcon, getNaturalSize, getSize, paintShape
 
Methods inherited from class com.miginfocom.ashape.shapes.AbstractAShape
addAttributes, addSubShape, addSubShape, addToHitShapeList, containsProperty, getAttribute, getAttributes, getClipShape, getDoubleAttribute, getFloatAttribute, getHitShape, getIntAttribute, getLayout, getLayoutSize, getLongAttribute, getModCount, getName, getPaintLayer, getParent, getProperty, getReferenceBounds, getRoot, getShapeBounds, getSubShapeDeep, getSubShapes, getSubShapesImpl, hasAttribute, increaseModCount, isRoot, isVisible, layout, paintBorder, paintSubTree, removeAttribute, removeSubShape, setAttribute, setAttributeDeep, setAttributes, setHitShape, setName, setParent, setReferenceBounds, setReferenceBounds, setSubShapes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A_SLICE_SPEC

public static final PropertyKey A_SLICE_SPEC
Value type: SliceSpec, not null. A specification for how to slice the shape.

Constructor Detail

SlicedImageAShape

public SlicedImageAShape()
Empty constructor for XML builders.


SlicedImageAShape

public SlicedImageAShape(java.lang.String name,
                         javax.swing.Icon icon,
                         SliceSpec sliceSpec,
                         PlaceRect placeRect)
Contructor.

Parameters:
name - The name used for referencing this shape/sub shape
icon - The image to use (as an Icon). Can for instance be an XtdImage
sliceSpec - The specification on how to slice the image
placeRect - How the shape will fill the bounds (or the parent's bounds)
See Also:
SlicedImage

SlicedImageAShape

public SlicedImageAShape(java.lang.String name,
                         java.awt.Image image,
                         SliceSpec sliceSpec,
                         PlaceRect placeRect)
Contructor.

Parameters:
name - The name used for referencing this shape/sub shape
image - The image to use
sliceSpec - The specification on how to slice the image
placeRect - How the shape will fill the bounds (or the parent's bounds)
See Also:
SlicedImage
Method Detail

getWrappedImage

protected java.lang.Object getWrappedImage(java.lang.Object imgOrIc)
Description copied from class: ImageAShape
Gives the possibility for subclasses to return a wrapped or chached image to paint instead of the original image.

Overrides:
getWrappedImage in class ImageAShape
Parameters:
imgOrIc - An Image/Icon or null in which case nothing is painted.
Returns:
Default implementation returns imgOrIc without intervention.
See Also:
SlicedImageAShape


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.