Search this API

y.view
Class ShapeDrawable

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

public class ShapeDrawable
extends java.lang.Object
implements Drawable

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

 

Constructor Summary
ShapeDrawable(java.awt.Shape shape, java.awt.Color fillColor)
          Creates a new instance of ShapeDrawable
ShapeDrawable(java.awt.Shape shape, java.awt.Color fillColor, java.awt.Color lineColor)
          Creates a new instance of ShapeDrawable
ShapeDrawable(java.awt.Shape shape, java.awt.Color fillColor, java.awt.Paint paint, java.awt.Color lineColor, java.awt.Stroke stroke)
          Creates a new instance of ShapeDrawable
 
Method Summary
 java.awt.Rectangle getBounds()
          returns the bounds of this drawable.
 java.awt.Color getFillColor()
          Getter for property fillColor.
 java.awt.Color getLineColor()
          Getter for property lineColor.
 java.awt.Paint getPaint()
          Getter for property paint.
 java.awt.Shape getShape()
          Getter for property shape.
 java.awt.Stroke getStroke()
          Getter for property stroke.
 void paint(java.awt.Graphics2D g)
          Paints itself on the given graphics context.
 void setFillColor(java.awt.Color fillColor)
          Setter for property fillColor.
 void setLineColor(java.awt.Color lineColor)
          Setter for property lineColor.
 void setPaint(java.awt.Paint paint)
          Setter for property paint.
 void setShape(java.awt.Shape shape)
          Setter for property shape.
 void setStroke(java.awt.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(java.awt.Shape shape,
                     java.awt.Color fillColor)
Creates a new instance of ShapeDrawable


ShapeDrawable

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


ShapeDrawable

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

Method Detail

getBounds

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

Specified by:
getBounds in interface Drawable

paint

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

Specified by:
paint in interface Drawable

getShape

public java.awt.Shape getShape()
Getter for property shape.

Returns:
Value of property shape.

setShape

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

Parameters:
shape - New value of property shape.

updateBounds

public void updateBounds()

getFillColor

public java.awt.Color getFillColor()
Getter for property fillColor.

Returns:
Value of property fillColor.

setFillColor

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

Parameters:
fillColor - New value of property fillColor.

getLineColor

public java.awt.Color getLineColor()
Getter for property lineColor.

Returns:
Value of property lineColor.

setLineColor

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

Parameters:
lineColor - New value of property lineColor.

getStroke

public java.awt.Stroke getStroke()
Getter for property stroke.

Returns:
Value of property stroke.

setStroke

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

Parameters:
stroke - New value of property stroke.

getPaint

public java.awt.Paint getPaint()
Getter for property paint.

Returns:
Value of property paint.

setPaint

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

Parameters:
paint - New value of property paint.

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