VisualRunService Interface


The VisualRunService interface extends BasicRunService to provide general utility methods and queries for all visual plug-ins. The interface is specified in the file VisualRunService.java

package kinetix.hyperc1.userplugins;

import java.awt.Event;
import java.awt.Rectangle;
import java.awt.Point;
import java.awt.Graphics;
import java.awt.image.ImageObserver;
public interface VisualRunService extends BasicRunService
{

To call these methods, cast the instance variable (handle) mRunService to the type VisualRunService, or call the method piGetVisualRunService().

siGenerateMouseDownEvent

Prototype:

public void siGenerateMouseDownEvent(Event evt, int x, int y)
	throws HwException;

Parameters:
evt Identifies the event.
x The mouse X location.
y The mouse Y location.

Description: Generates a mouse-down event, triggering wires connected to the mouse-down (Button Down) output port. (Does not trigger piMouseDown().)

siGenerateClickedEvent

Prototype:

public void siGenerateClickedEvent(Event evt, int x, int y)
	throws HwException;

Parameters:
evt Identifies the event.
x The mouse X location.
y The mouse Y location.

Description: Generates a mouse-up event, triggering wires connected to the mouse-up (Button Up) output port. (Does not trigger piMouseUp().)

siGetAbsRect

Prototype:

public Rectangle siGetAbsRect();

Returns:
Rectangle The bounding rectangle of the plug-in, relative to the surrounding applet.

Description: Returns the plug-in�s bounding rectangle, relative to the applet (not to any intermediary visual containers).

siGetImageObserver

Prototype:

public ImageObserver siGetImageObserver();

Returns:
ImageObserver The implementer of this interface, cast to an image observer object.

Description: Returns the implementer of this interface, cast to an ImageObserver (a Java AWT object). This method is primarily for the use of plug-ins that must handle asynchronous image loading and don�t want to write an imageUpdate callback method.

siGetIsClickable

Prototype:

public boolean siGetIsClickable();

Returns:
boolean true if the plug-in instance is currently clickable, false otherwise.

Description: The clickable state depends on a previous call to siSetIsClickable() or on the author's setting of the module's Clickable state.

siGetLastPosition

Prototype:

public Point siGetLastPosition();

Returns:
Point The previous position of the plug-in.

Description: This is the plug-in�s previous position, relative to the applet.

siGetPosition

Prototype:

public Point siGetPosition();

Returns:
Point The current position of the plug-in.

Description: This is the plug-in�s current position, relative to the applet.

siGetRelativeRect

Prototype:

public Rectangle siGetRelativeRect();

Returns:
Rectangle The bounding rectangle of the plug-in, relative to its immediate parent.

Description: This is the plug-in�s bounding rectangle, relative to its immediate parent container.

siGetScreenRect

Prototype:

public Rectangle siGetScreenRect();

Returns:
Rectangle The bounding rectangle of the plug-in, relative to the entire screen.

Description: This is the plug-in�s bounding rectangle, relative to the screen.

siGetIsSelectable

Prototype:

public boolean siGetIsSelectable();

Returns:
boolean true if the plug-in instance is currently selectable, false otherwise.

Description: The selectable state depends on the previous call to siSetIsSelectable().

siGetIsVisible

Prototype:

public boolean siGetIsVisible();

Returns:
boolean true if the plug-in instance is currently visible, false otherwise.

Description: The plug-in is visible when it and all of its parent containers are visible.

siGetIsMoveable

Prototype:

public boolean siGetIsMoveable();

Returns:
boolean true if the plug-in instance is currently movable, false otherwise.

Description: The plug-in is movable if it is a visual plug-in that is currently visible and active.

siPaintRect

Prototypes:

	public void siPaintRect(Rectangle aRect);

	public void siPaintRect();

Parameter:
aRect The portion of the applet to paint.

Description: Paints the portion of the applet specified by aRect. The coordinates in aRect are relative to the applet, not to any intervening visual containers. If aRect is null, siPaintRect() paints the entire bounding rectangle of the applet.

Call this method to signal a paint request—siPaintRect() schedules a call to piDraw(). This method is not synchronous. There might be a delay between the siPaintRect() request and the call to piDraw().

siSetAbsRect

Prototype:

public void siSetAbsRect(Rectangle aRect);

Parameter:
aRect The bounding rectangle for the plug-in, relative to the applet.

Description: Explicitly sets a new bounding rectangle for the plug-in. Does not redraw the plug-in. To redraw the plug-in in the new area, follow this call with a call to siPaintRect().

siSetIsClickable

Prototype:

public void siSetIsClickable(boolean aValue);

Parameter:
aValue true to make the plug-in clickable, false to make it not clickable.

Description: Call to make the plug-in either clickable or not clickable.

siSetPosition

Prototype:

public void siSetPosition(Point aPos)
	throws HwException;

Parameter:
aPos The position of the plug-in.

Description: Call to change the plug-in�s position, relative to the applet. The Hyperwire runtime redraws the plug-in in the new position.

siSetIsSelectable

Prototype:

public void siSetIsSelectable(boolean aValue);

Parameter:
aValue true to make the plug-in selectable, false to make it not selectable.

Description: Call to make the plug-in selectable or not selectable.

siSetIsVisible

Prototype:

public void siSetIsVisible(boolean aValue);

Parameter:
aValue true to make the plug-in visible, false to make it invisible.

Description: Call to make the plug-in either visible or invisible. Does not redraw the plug-in. To redraw the plug-in after making it visible, follow this call with a call to siPaintRect().

All parent visual containers must be visible for the plug-in module to be visible.

This call can be useful for radio button plug-ins.

Return to Contents