|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvManagerViewInteractor
ilog.views.prototypes.IlvConnectInteractor
public abstract class IlvConnectInteractor
This class is a subclass of IlvManagerViewInteractor. It is used
to interconnect the values handled by different objects in an interactive way.
When the user clicks on a source object (for example, a prototype
instance) and drags the mouse to a destination object, the
interactor prompts for the names of the output and input properties
and connects these values by calling the subscribe method
for the source object.
When the connect interactor is attached to a manager view, existing connections are displayed with green arrows. The user can delete a connection by double-clicking on the connecting line.
This interactor also displays the value sources contained in the group bag associated with the manager to which the view is attached. The value sources are drawn as green outlined labels in the top-left corner of the view. Value sources can be connected like any other objects by clicking in and/or dragging to these labels.
This class is abstract. It must be subclassed and its
promptValues method must be overridden to define a
GUI in which the user can select the output and input values.
IlvGroupElement.subscribe(IlvGroupElement, String, String),
IlvGroupElement.unsubscribe(ilog.views.prototypes.IlvGroupElement, java.lang.String, java.lang.String),
IlvGroup,
IlvPrototypeInstance,
IlvValueSource,
Serialized Form| Constructor Summary | |
|---|---|
IlvConnectInteractor()
Creates a new connection interactor. |
|
| Method Summary | |
|---|---|
protected void |
attach(IlvManagerView v)
Repaints the view to display existing connections. |
protected void |
connectionCreated(IlvGroupElement from,
IlvGroupElement to,
String fromProperty,
String toProperty)
This method is called when a new connection is created. |
protected void |
connectionDeleted(IlvGroupElement from,
IlvGroupElement to,
String fromProperty,
String toProperty)
This method is called when a connection is deleted. |
protected void |
detach()
Repaints the view to erase displayed connections. |
protected void |
drawGhost(Graphics g)
Draws a ghost line between the source and the destination objects when a connection is being established. |
IlvGroupElement |
getElementAt(int x,
int y)
Returns the group element (or the value source) located at the position defined by ( x, y) in the manager view to which this
interactor is attached. |
protected void |
handleExpose(Graphics g)
Draws the existing connections and the value sources. |
boolean |
isPermanent()
Returns false (the default value) if the interactor is removed from the
view once the object has been created. |
protected void |
processMouseEvent(MouseEvent event)
Processes the MOUSE_PRESSED
and MOUSE_RELEASED events to define a connection. |
protected void |
processMouseMotionEvent(MouseEvent event)
Processes the MOUSE_DRAGGED
events to define a connection. |
protected abstract String[] |
promptValues(IlvGroupElement from,
IlvGroupElement to,
boolean create)
Prompts the user for the names of the source and destination values when a connection is created or deleted. |
void |
refresh()
Refreshes the display of connections and value sources. |
void |
setPermanent(boolean permanent)
Specifies whether the interactor is removed from the view once the object has been created. |
protected void |
showDetails(MouseEvent event,
IlvGroupElement from,
IlvGroupElement to)
Called when the mouse is moved near a connecting line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlvConnectInteractor()
| Method Detail |
|---|
public final boolean isPermanent()
false (the default value) if the interactor is removed from the
view once the object has been created.
isPermanent in interface IlvPermanentInteractorInterfacepublic final void setPermanent(boolean permanent)
false.
setPermanent in interface IlvPermanentInteractorInterfacepermanent - the new mode.protected void processMouseEvent(MouseEvent event)
MOUSE_PRESSED
and MOUSE_RELEASED events to define a connection.
processMouseEvent in class IlvManagerViewInteractorevent - The event.IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)
protected void connectionCreated(IlvGroupElement from,
IlvGroupElement to,
String fromProperty,
String toProperty)
from - the source of the connection.to - the target of the connection.fromProperty - the source property name.toProperty - the target property name.
protected void connectionDeleted(IlvGroupElement from,
IlvGroupElement to,
String fromProperty,
String toProperty)
from - the source of the connection.to - the target of the connection.fromProperty - the source property name.toProperty - the target property name.protected void processMouseMotionEvent(MouseEvent event)
MOUSE_DRAGGED
events to define a connection.
processMouseMotionEvent in class IlvManagerViewInteractorevent - The event.IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)protected void drawGhost(Graphics g)
drawGhost in class IlvManagerViewInteractorg - The graphics.IlvManagerViewInteractor.handleExpose(java.awt.Graphics),
IlvManagerViewInteractor.setXORGhost(boolean)protected void handleExpose(Graphics g)
handleExpose in class IlvManagerViewInteractorg - The graphics.IlvManagerViewInteractor.drawGhost(java.awt.Graphics),
IlvManagerViewInteractor.isXORGhost(),
IlvManagerView.getDefaultXORColor()protected void attach(IlvManagerView v)
attach in class IlvManagerViewInteractorv - The manager view.IlvManagerViewInteractor.detach()protected void detach()
detach in class IlvManagerViewInteractorIlvManagerViewInteractor.attach(ilog.views.IlvManagerView)public void refresh()
protected abstract String[] promptValues(IlvGroupElement from,
IlvGroupElement to,
boolean create)
from - the source of the connection.to - the destination of the connection.create - true if a connection is being
established, false if a connection is being deleted.
String objects: the first element
is the source value and the second element is the destination
value. If the user canceled the dialog, the method returns
null.
protected void showDetails(MouseEvent event,
IlvGroupElement from,
IlvGroupElement to)
The default implementation does nothing.
event - the event that can be used to get the mouse location.from - the source of the connection.to - the destination of the connection.
public IlvGroupElement getElementAt(int x,
int y)
x, y) in the manager view to which this
interactor is attached.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||