borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.control 

ShapeControl component

java.lang.Object
   +----java.awt.Component
           +----borland.jbcl.control.ShapeControl

About the ShapeControl component

Variables  Constructors  Properties  Methods  Event Listeners

Implements MenuContainer, ImageObserver, Serializable

Draws graphics shapes, such as rectangles with rounded corners. You can place ShapeControl objects on any container, such as a panel or canvas. When you drop a ShapeControl from the Component Palette onto the UI Designer, the shape defaults to a filled rectangle. You can then change the shape to any of the following:

Rectangle
Square
Round Rectangle
Round Square
Ellipse
Circle
Horizontal Line
Vertical Line
Positive Slope Line (bottom left to top right)
Negative Slope Line (top left to bottom right)

The edgeColor and drawEdge properties enable you to put a colored border on a shape. To control layering, in the UI Designer, right-click and choose Move To First or Move To Last.


ShapeControl variables

Variables implemented in this class

Variables implemented in java.awt.Component

ShapeControl constructors

ShapeControl properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.lang.Object

ShapeControl methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.lang.Object

ShapeControl event listeners


ShapeControl variables

CIRCLE

  public static final int CIRCLE = 5
Indicates that the shape object is a circle.

ELLIPSE

  public static final int ELLIPSE = 4
Indicates that the shape object is an ellipse.

HORZ_LINE

  public static final int HORZ_LINE = 6
Indicates that the shape object is a horizontal line.

NEG_SLOPE_LINE

  public static final int NEG_SLOPE_LINE = 9
Indicates that the shape object is a line sloping from the upper left corner of the specified region to the lower right corner.

POS_SLOPE_LINE

  public static final int POS_SLOPE_LINE = 8
Indicates that the shape object is a line sloping from the lower left corner of the specified region to the upper right corner.

RECTANGLE

  public static final int RECTANGLE = 0
Indicates that the shape object is a rectangle.

ROUND_RECT

  public static final int ROUND_RECT = 1
Indicates that the shape object is a rectangle with rounded corners.

ROUND_SQUARE

  public static final int ROUND_SQUARE = 3
Indicates that the shape object is a square with rounded corners.

SQUARE

  public static final int SQUARE = 2
Indicates that the shape object is a square.

VERT_LINE

  public static final int VERT_LINE = 7
Indicates that the shape object is a vertical line.


ShapeControl constructors

ShapeControl()

  public ShapeControl()
Constructs a ShapeControl 100 pixels by 100 pixels, with a white foreground fill and a black edge.

ShapeControl(int)

  public ShapeControl(int type)
Constructs a ShapeControl of the specified type, such as circle or square. Like the default constructor, this constructor defaults to 100 pixels by 100 pixels, with a white foreground fill and a black edge.


ShapeControl properties

drawEdge

 public boolean isDrawEdge()
 public void setDrawEdge(boolean drawEdge)
The drawEdge property stores whether to show a colored edge marking the edge of the shape object.

edgeColor

 public Color getEdgeColor()
 public void setEdgeColor(java.awt.Color edgeColor)
The edgeColor property stores the color of the line that marks the edge of the shape object. By default, black.

fill

 public boolean isFill()
 public void setFill(boolean fill)
The fill property stores whether to fill the shape with a foreground color. If false, the shape is filled with the color of the container on which the shape object is placed.

foreground

 public void setForeground(java.awt.Color color)
The foreground property stores the foreground color of the shape object. This is the color used to fill the shape if the fill property is true.

minimumSize

 public Dimension getMinimumSize()
The minimumSize property stores the minimum size that you will allow a layout manager to use for this shape control.

preferredSize

 public Dimension getPreferredSize()
The preferredSize property stores the size that you would prefer that a layout manager use to display this shape control.

type

 public int getType()
 public void setType(int type)
The type property stores the type of shape, such as circle or square.


ShapeControl methods

paint(java.awt.Graphics)

  public void paint(java.awt.Graphics g)
Calls super.paint() to let other objects paint the background region, then draws the graphics object.

Parameters:

g
The graphics object to paint.

Overrides: java.awt.Component.paint(Graphics)


ShapeControl event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener l)
 public synchronized void removeComponentListener(java.awt.event.ComponentListener l)

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener l)
 public synchronized void removeFocusListener(java.awt.event.FocusListener l)

key

 public synchronized void addKeyListener(java.awt.event.KeyListener l)
 public synchronized void removeKeyListener(java.awt.event.KeyListener l)

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener l)
 public synchronized void removeMouseListener(java.awt.event.MouseListener l)

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener l)
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener l)