All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class macrolanguage.ComponentWrapper

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----macrolanguage.ComponentWrapper

public class ComponentWrapper
extends Panel
implements MouseListener, MouseMotionListener
the ComponentWrapper class wrapps a component with a panel allowing it to be manipulated in the FreeFormEdit with greater freedom. The need for the ComponentWrapper arose when TextArea and similar classes would not resize since they block some of the events which should be sent by them.


Variable Index

 o internalComponent
 o lastMouseLocation
 o MARGIN

Constructor Index

 o ComponentWrapper(Component)
Initialize the component wrapper to wrap internalComponent.

Method Index

 o componentDragged(MouseEvent)
called whenever a component gets dragged and performas the drag on the internal Component as well.
 o componentResized(MouseEvent)
this method is called whenever a component gets resized and it handles the resizeing for the internal component too.
 o deselect()
remove the selected marking on this component.
 o getComponent()
get the internal component.
 o mouseClicked(MouseEvent)
required by the MouseListener interface.
 o mouseDragged(MouseEvent)
This method is a part of the MouseMotionListener interface and is called whenever a mouse is dragged.
 o mouseEntered(MouseEvent)
required by the MouseMotionListener interface.
 o mouseExited(MouseEvent)
required by the MouseMotionListener interface.
 o mouseMoved(MouseEvent)
required by the MouseMotionListener interface.
 o mousePressed(MouseEvent)
required by the MouseListener interface.
 o mouseReleased(MouseEvent)
required by the MouseListener interface.
 o select()
mark this component as selected.
 o setSize(Dimension)
set the size of the component (and the container).
 o setSize(int, int)
set the size of the component (and the container).

Variables

 o lastMouseLocation
 private Point lastMouseLocation
 o MARGIN
 private static int MARGIN
 o internalComponent
 private Component internalComponent

Constructors

 o ComponentWrapper
 public ComponentWrapper(Component internalComponent)
Initialize the component wrapper to wrap internalComponent.

Methods

 o componentDragged
 private void componentDragged(MouseEvent ev)
called whenever a component gets dragged and performas the drag on the internal Component as well.

 o componentResized
 private void componentResized(MouseEvent ev)
this method is called whenever a component gets resized and it handles the resizeing for the internal component too.

 o deselect
 public void deselect()
remove the selected marking on this component.

 o getComponent
 public Component getComponent()
get the internal component.

 o mouseClicked
 public void mouseClicked(MouseEvent ev)
required by the MouseListener interface. When a mouse is clicked that could mean 2 things: 1. Selection of a component on the surface. 2. Dropping a new component onto the surface.

 o mouseDragged
 public void mouseDragged(MouseEvent ev)
This method is a part of the MouseMotionListener interface and is called whenever a mouse is dragged. This method abstracts the dragging and dropping of components on the free form surface.

 o mouseEntered
 public void mouseEntered(MouseEvent ev)
required by the MouseMotionListener interface.

 o mouseExited
 public void mouseExited(MouseEvent ev)
required by the MouseMotionListener interface.

 o mouseMoved
 public void mouseMoved(MouseEvent ev)
required by the MouseMotionListener interface. used to determin when to diplay the resize mouse pointer on the components. The resize mode is used not only for the look of the mouse pointer it is used to determin whether to resize a component or move it when dragging.

 o mousePressed
 public void mousePressed(MouseEvent ev)
required by the MouseListener interface.

 o mouseReleased
 public void mouseReleased(MouseEvent ev)
required by the MouseListener interface. The drop operation when dragging is implemented here.

 o select
 public void select()
mark this component as selected.

 o setSize
 public void setSize(int width,
                     int height)
set the size of the component (and the container). accepts the new height and width of the component.

Overrides:
setSize in class Component
 o setSize
 public void setSize(Dimension size)
set the size of the component (and the container).

Overrides:
setSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index