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.
-
internalComponent
-
-
lastMouseLocation
-
-
MARGIN
-
-
ComponentWrapper(Component)
- Initialize the component wrapper to wrap internalComponent.
-
componentDragged(MouseEvent)
- called whenever a component gets dragged and performas the drag
on the internal Component as well.
-
componentResized(MouseEvent)
- this method is called whenever a component gets resized
and it handles the resizeing for the internal component too.
-
deselect()
- remove the selected marking on this component.
-
getComponent()
- get the internal component.
-
mouseClicked(MouseEvent)
- required by the MouseListener interface.
-
mouseDragged(MouseEvent)
- This method is a part of the MouseMotionListener interface and is
called whenever a mouse is dragged.
-
mouseEntered(MouseEvent)
- required by the MouseMotionListener interface.
-
mouseExited(MouseEvent)
- required by the MouseMotionListener interface.
-
mouseMoved(MouseEvent)
- required by the MouseMotionListener interface.
-
mousePressed(MouseEvent)
- required by the MouseListener interface.
-
mouseReleased(MouseEvent)
- required by the MouseListener interface.
-
select()
- mark this component as selected.
-
setSize(Dimension)
- set the size of the component (and the container).
-
setSize(int, int)
- set the size of the component (and the container).
lastMouseLocation
private Point lastMouseLocation
MARGIN
private static int MARGIN
internalComponent
private Component internalComponent
ComponentWrapper
public ComponentWrapper(Component internalComponent)
- Initialize the component wrapper to wrap internalComponent.
componentDragged
private void componentDragged(MouseEvent ev)
- called whenever a component gets dragged and performas the drag
on the internal Component as well.
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.
deselect
public void deselect()
- remove the selected marking on this component.
getComponent
public Component getComponent()
- get the internal component.
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.
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.
mouseEntered
public void mouseEntered(MouseEvent ev)
- required by the MouseMotionListener interface.
mouseExited
public void mouseExited(MouseEvent ev)
- required by the MouseMotionListener interface.
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.
mousePressed
public void mousePressed(MouseEvent ev)
- required by the MouseListener interface.
mouseReleased
public void mouseReleased(MouseEvent ev)
- required by the MouseListener interface.
The drop operation when dragging is implemented here.
select
public void select()
- mark this component as selected.
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
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