Search this API

y.view
Class ShapeDrawable

java.lang.Object
  extended by y.view.ShapeDrawable
All Implemented Interfaces:
Drawable

public class ShapeDrawable
extends Object
implements Drawable

A convenience class that makes it easy to specify a Drawable using any Shape instance.


Constructor Summary
ShapeDrawable(Shape shape, Color fillColor)
          Creates a new instance of ShapeDrawable
ShapeDrawable(Shape shape, Color fillColor, Color lineColor)
          Creates a new instance of ShapeDrawable
ShapeDrawable(Shape shape, Color fillColor, Paint paint, Color lineColor, Stroke stroke)
          Creates a new instance of ShapeDrawable
 
Method Summary
 Rectangle getBounds()
          returns the bounds of this drawable.
 Color getFillColor()
          Getter for property fillColor.
 Color getLineColor()
          Getter for property lineColor.
 Paint getPaint()
          Getter for property paint.
 Shape getShape()
          Getter for property shape.
 Stroke getStroke()
          Getter for property stroke.
 void paint(Graphics2D g)
          Paints itself on the given graphics context.
 void setFillColor(Color fillColor)
          Setter for property fillColor.
 void setLineColor(Color lineColor)
          Setter for property lineColor.
 void setPaint(Paint paint)
          Setter for property paint.
 void setShape(Shape shape)
          Setter for property shape.
 void setStroke(Stroke stroke)
          Setter for property stroke.
 void updateBounds()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeDrawable

public ShapeDrawable(Shape shape,
                     Color fillColor)
Creates a new instance of ShapeDrawable


ShapeDrawable

public ShapeDrawable(Shape shape,
                     Color fillColor,
                     Color lineColor)
Creates a new instance of ShapeDrawable


ShapeDrawable

public ShapeDrawable(Shape shape,
                     Color fillColor,
                     Paint paint,
                     Color lineColor,
                     Stroke stroke)
Creates a new instance of ShapeDrawable

Method Detail

getBounds

public Rectangle getBounds()
Description copied from interface: Drawable
returns the bounds of this drawable.

Specified by:
getBounds in interface Drawable

paint

public void paint(Graphics2D g)
Description copied from interface: Drawable
Paints itself on the given graphics context.

Specified by:
paint in interface Drawable

getShape

public Shape getShape()
Getter for property shape.

Returns:
Value of property shape.

setShape

public void setShape(Shape shape)
Setter for property shape.

Parameters:
shape - New value of property shape.

updateBounds

public void updateBounds()

getFillColor

public Color getFillColor()
Getter for property fillColor.

Returns:
Value of property fillColor.

setFillColor

public void setFillColor(Color fillColor)
Setter for property fillColor.

Parameters:
fillColor - New value of property fillColor.

getLineColor

public Color getLineColor()
Getter for property lineColor.

Returns:
Value of property lineColor.

setLineColor

public void setLineColor(Color lineColor)
Setter for property lineColor.

Parameters:
lineColor - New value of property lineColor.

getStroke

public Stroke getStroke()
Getter for property stroke.

Returns:
Value of property stroke.

setStroke

public void setStroke(Stroke stroke)
Setter for property stroke.

Parameters:
stroke - New value of property stroke.

getPaint

public Paint getPaint()
Getter for property paint.

Returns:
Value of property paint.

setPaint

public void setPaint(Paint paint)
Setter for property paint.

Parameters:
paint - New value of property paint.

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.