borland Packages Class Hierarchy jbcl.control Package Index
ShapeControl component
java.lang.Object
+----java.awt.Component
+----java.awt.Container
+----com.sun.java.swing.JComponent
+----borland.jbcl.control.ShapeControl
About the ShapeControl component
Variables Constructors Properties Methods Event Listeners
Implements BlackBox, ImageObserver, MenuContainer, 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 with the type property:
- 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. If the fill
property is true, the shape is filled with the
color specified as the value of the foreground property.
To paint the shape, call the paint() method.
ShapeControl variables
Variables implemented in this class
ShapeControl constructors
ShapeControl properties
*Read-only properties **Write-only properties
Properties implemented in this class
ShapeControl methods
Methods implemented in this class
- addNotify()
- computeVisibleRect(java.awt.Rectangle)
- contains(int, int)
- createToolTip()
- firePropertyChange(java.lang.String, boolean, boolean)
- firePropertyChange(java.lang.String, byte, byte)
- firePropertyChange(java.lang.String, char, char)
- firePropertyChange(java.lang.String, double, double)
- firePropertyChange(java.lang.String, float, float)
- firePropertyChange(java.lang.String, int, int)
- firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
- firePropertyChange(java.lang.String, long, long)
- firePropertyChange(java.lang.String, short, short)
- fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object)
- getActionForKeyStroke(com.sun.java.swing.KeyStroke)
- getBounds(java.awt.Rectangle)
- getClientProperty(java.lang.Object)
- getComponentGraphics(java.awt.Graphics)
- getConditionForKeyStroke(com.sun.java.swing.KeyStroke)
- getLocation(java.awt.Point)
- getSize(java.awt.Dimension)
- getToolTipLocation(java.awt.event.MouseEvent)
- getToolTipText(java.awt.event.MouseEvent)
- grabFocus()
- hasFocus()
- isLightweightComponent(java.awt.Component)
- paint(java.awt.Graphics)
- paintBorder(java.awt.Graphics)
- paintChildren(java.awt.Graphics)
- paintImmediately(int, int, int, int)
- paintImmediately(java.awt.Rectangle)
- processComponentKeyEvent(java.awt.event.KeyEvent)
- processFocusEvent(java.awt.event.FocusEvent)
- processKeyEvent(java.awt.event.KeyEvent)
- processMouseMotionEvent(java.awt.event.MouseEvent)
- putClientProperty(java.lang.Object, java.lang.Object)
- registerKeyboardAction(java.awt.event.ActionListener, com.sun.java.swing.KeyStroke, int)
- registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, com.sun.java.swing.KeyStroke, int)
- removeNotify()
- repaint(java.awt.Rectangle)
- repaint(long, int, int, int, int)
- requestDefaultFocus()
- requestFocus()
- resetKeyboardActions()
- reshape(int, int, int, int)
- revalidate()
- scrollRectToVisible(java.awt.Rectangle)
- setUI(com.sun.java.swing.plaf.ComponentUI)
- unregisterKeyboardAction(com.sun.java.swing.KeyStroke)
- update(java.awt.Graphics)
- updateUI()
- action(java.awt.Event, java.lang.Object)
- add(java.awt.PopupMenu)
- bounds()
- checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
- checkImage(java.awt.Image, java.awt.image.ImageObserver)
- contains(java.awt.Point)
- createImage(int, int)
- createImage(java.awt.image.ImageProducer)
- disable()
- disableEvents(long)
- dispatchEvent(java.awt.AWTEvent)
- enable()
- enable(boolean)
- enableEvents(long)
- getFontMetrics(java.awt.Font)
- gotFocus(java.awt.Event, java.lang.Object)
- handleEvent(java.awt.Event)
- hide()
- imageUpdate(java.awt.Image, int, int, int, int, int)
- inside(int, int)
- keyDown(java.awt.Event, int)
- keyUp(java.awt.Event, int)
- list()
- list(java.io.PrintStream)
- list(java.io.PrintWriter)
- location()
- lostFocus(java.awt.Event, java.lang.Object)
- mouseDown(java.awt.Event, int, int)
- mouseDrag(java.awt.Event, int, int)
- mouseEnter(java.awt.Event, int, int)
- mouseExit(java.awt.Event, int, int)
- mouseMove(java.awt.Event, int, int)
- mouseUp(java.awt.Event, int, int)
- move(int, int)
- nextFocus()
- paintAll(java.awt.Graphics)
- postEvent(java.awt.Event)
- prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
- prepareImage(java.awt.Image, java.awt.image.ImageObserver)
- printAll(java.awt.Graphics)
- processComponentEvent(java.awt.event.ComponentEvent)
- processMouseEvent(java.awt.event.MouseEvent)
- remove(java.awt.MenuComponent)
- repaint()
- repaint(int, int, int, int)
- repaint(long)
- resize(int, int)
- resize(java.awt.Dimension)
- setBounds(int, int, int, int)
- setLocation(int, int)
- setSize(int, int)
- show()
- show(boolean)
- size()
- toString()
- transferFocus()
- add(java.awt.Component)
- add(java.awt.Component, int)
- add(java.awt.Component, java.lang.Object)
- add(java.awt.Component, java.lang.Object, int)
- add(java.lang.String, java.awt.Component)
- addImpl(java.awt.Component, java.lang.Object, int)
- countComponents()
- deliverEvent(java.awt.Event)
- doLayout()
- getComponent(int)
- getComponentAt(int, int)
- getComponentAt(java.awt.Point)
- insets()
- invalidate()
- isAncestorOf(java.awt.Component)
- layout()
- list(java.io.PrintStream, int)
- list(java.io.PrintWriter, int)
- locate(int, int)
- minimumSize()
- paintComponents(java.awt.Graphics)
- paramString()
- preferredSize()
- print(java.awt.Graphics)
- printComponents(java.awt.Graphics)
- processContainerEvent(java.awt.event.ContainerEvent)
- processEvent(java.awt.AWTEvent)
- remove(int)
- remove(java.awt.Component)
- removeAll()
- validate()
- validateTree()
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, it is 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. The possible values are one of the ShapeControl
variables.
ShapeControl methods
paintComponent(java.awt.Graphics)
public void paintComponent(java.awt.Graphics g)
Paints or repaints the ShapeControl.
Parameters:
- g
- The Graphics object to paint on.
Overrides:
com.sun.java.swing.JComponent.paintComponent(java.awt.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.
ancestor
public void addAncestorListener(com.sun.java.swing.event.AncestorListener )
public void removeAncestorListener(com.sun.java.swing.event.AncestorListener )
component
public synchronized void addComponentListener(java.awt.event.ComponentListener )
public synchronized void removeComponentListener(java.awt.event.ComponentListener )
container
public synchronized void addContainerListener(java.awt.event.ContainerListener )
public void removeContainerListener(java.awt.event.ContainerListener )
focus
public synchronized void addFocusListener(java.awt.event.FocusListener )
public synchronized void removeFocusListener(java.awt.event.FocusListener )
key
public synchronized void addKeyListener(java.awt.event.KeyListener )
public synchronized void removeKeyListener(java.awt.event.KeyListener )
mouse
public synchronized void addMouseListener(java.awt.event.MouseListener )
public synchronized void removeMouseListener(java.awt.event.MouseListener )
mouseMotion
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
propertyChange
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
vetoableChange
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )