ilog.views.hypergraph.interactor
Class IlvMakeHyperEdgeBaseInteractor

java.lang.Object
  extended by ilog.views.IlvManagerViewInteractor
      extended by ilog.views.hypergraph.interactor.IlvMakeHyperEdgeBaseInteractor
All Implemented Interfaces:
IlvPermanentInteractorInterface, Serializable
Direct Known Subclasses:
IlvMakeHyperEdgeInteractor, IlvMakeHyperEdgePinConnectorInteractor

public class IlvMakeHyperEdgeBaseInteractor
extends IlvManagerViewInteractor
implements IlvPermanentInteractorInterface

This is the base class of interactors that allow to create hyperedges and hyperedge connectors. It contains services that are common to all these interactors. You cannot use this class directly; you can only use subclasses of this class.

Since:
JViews 8.0
See Also:
Serialized Form

Constructor Summary
protected IlvMakeHyperEdgeBaseInteractor()
          Initialize the interactor.
 
Method Summary
protected  void attach(IlvManagerView v)
          This method is called when the interactor is attached to the manager view.
protected  void detach()
          This method is called when the interactor is detached from the view.
 Cursor getCursor()
          Returns the cursor used for editing.
protected  IlvGraphic getHighlightedGraphic()
          Returns the highlighted graphic.
protected  IlvHyperGrapherPin getHighlightedPin()
          Returns the highlighted pin.
protected  IlvTransformer getObjectDrawingTransformer(IlvGraphic g)
          Returns the transformer the input object is drawn.
protected  IlvGraphic getObjectToBeHighlighted(IlvPoint p, boolean allowNode, boolean allowHyperEdge)
          Returns the object at the input position to be highlighted.
protected  IlvHyperGrapherPin getPin(IlvPoint p)
          Returns the pin at input position, or null if there is no pin at that position.
 Cursor getPinCursor()
          Returns the cursor when the mouse is on top of a pin of a hyperedge pin connector.
 float getPinMargin()
          Returns the the margin for pins.
protected  void highlightObject(IlvGraphic object)
          Highlight the input object.
protected  void highlightPin(IlvPoint p)
          If a hypergrapher pin is at the input position, this pin is highlighted.
 boolean isCreationInSubManagersAllowed()
          Returns true if the creation of objects in submanagers is allowed, and false otherwise.
 boolean isGridMode()
          Returns true if the interactor snaps the points to the grid of the view.
protected  boolean isHyperEdge(IlvGraphic obj)
          Tests if the object is managed by an IlvHyperGrapher and if the object is a hyperedge in this IlvHyperGrapher.
protected  boolean isManagerToBeHighlighted(IlvPoint p, IlvManager manager)
          Check whether the manager is to be highlighted.
protected  boolean isNode(IlvGraphic obj)
          Tests if the object is managed by an IlvHyperGrapher and if the object is a node in this IlvHyperGrapher.
 boolean isPermanent()
          Returns false if the interactor will be removed from the view once the object is created.
protected  void reInitialize()
          Reinitializes the interactor.
 void setCreationInSubManagersAllowed(boolean set)
          Allows objects to be created in submanagers (see IlvManager.getManagers()).
 void setCursor(Cursor cursor)
          Changes the cursor used for editing.
 void setGridMode(boolean enable)
          Changes the way the interactor works with the grid.
 void setPermanent(boolean permanent)
          Specifies if the interactor will be removed from the view once the object is created.
 void setPinCursor(Cursor cursor)
          Changes the cursor when the mouse is on top of a pin of a hyperedge pin connector.
 void setPinMargin(float margin)
          Sets the margin for pins.
protected  void setPinSelected(IlvHyperGrapherPin pin, boolean selected)
          Select or deselect a pin of a hyperedge pin connector.
 
Methods inherited from class ilog.views.IlvManagerViewInteractor
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMakeHyperEdgeBaseInteractor

protected IlvMakeHyperEdgeBaseInteractor()
Initialize the interactor.

Method Detail

isGridMode

public boolean isGridMode()
Returns true if the interactor snaps the points to the grid of the view. The default value is true.

See Also:
IlvGrid, setGridMode(boolean)

setGridMode

public final void setGridMode(boolean enable)
Changes the way the interactor works with the grid. The grid mode is enabled by default.

Parameters:
enable - If true, the interactor snaps points to the grid.
See Also:
IlvGrid, isGridMode()

getPinMargin

public float getPinMargin()
Returns the the margin for pins.

See Also:
setPinMargin(float)

setPinMargin

public final void setPinMargin(float margin)
Sets the margin for pins. When creating pins, you first move the mouse pointer over the node and the at the border of the node to create the pin. For ergonomic reasons, it is allowed to move the mouse pointer a little bit outside the node to create the pin. The pin margin specifies how much you can move outside the node before the node gets deselected and pin creation is not anymore possible.

See Also:
getPinMargin()

isPermanent

public final boolean isPermanent()
Returns false if the interactor will be removed from the view once the object is created. The default value is false.

Specified by:
isPermanent in interface IlvPermanentInteractorInterface
See Also:
setPermanent(boolean)

setPermanent

public final void setPermanent(boolean permanent)
Specifies if the interactor will be removed from the view once the object is created. The default value is false.

Specified by:
setPermanent in interface IlvPermanentInteractorInterface
Parameters:
permanent - the new mode.
See Also:
isPermanent()

isCreationInSubManagersAllowed

public boolean isCreationInSubManagersAllowed()
Returns true if the creation of objects in submanagers is allowed, and false otherwise.

See Also:
setCreationInSubManagersAllowed(boolean)

setCreationInSubManagersAllowed

public void setCreationInSubManagersAllowed(boolean set)
Allows objects to be created in submanagers (see IlvManager.getManagers()). If creation in submanagers is not allowed, the object is always created in the IlvManager displayed by the IlvManagerView to which this interactor is attached.

Disabling this option for hyperedges means also that creation of intergraph hyperedges is not allowed.

The default value is true

See Also:
isCreationInSubManagersAllowed()

getCursor

public Cursor getCursor()
Returns the cursor used for editing.

See Also:
setCursor(java.awt.Cursor)

setCursor

public void setCursor(Cursor cursor)
Changes the cursor used for editing.

See Also:
getCursor()

getPinCursor

public Cursor getPinCursor()
Returns the cursor when the mouse is on top of a pin of a hyperedge pin connector.

See Also:
setCursor(java.awt.Cursor)

setPinCursor

public void setPinCursor(Cursor cursor)
Changes the cursor when the mouse is on top of a pin of a hyperedge pin connector.

See Also:
getCursor()

attach

protected void attach(IlvManagerView v)
This method is called when the interactor is attached to the manager view.

Overrides:
attach in class IlvManagerViewInteractor
Parameters:
v - The manager view.
See Also:
detach()

detach

protected void detach()
This method is called when the interactor is detached from the view.

Overrides:
detach in class IlvManagerViewInteractor
See Also:
attach(ilog.views.IlvManagerView)

reInitialize

protected void reInitialize()
Reinitializes the interactor. This is called a the end of attach(ilog.views.IlvManagerView) and detach(). You do not have to use this method.


setPinSelected

protected void setPinSelected(IlvHyperGrapherPin pin,
                              boolean selected)
Select or deselect a pin of a hyperedge pin connector. If the pin is selected, it is exclusively selected.


getPin

protected IlvHyperGrapherPin getPin(IlvPoint p)
Returns the pin at input position, or null if there is no pin at that position.


highlightPin

protected void highlightPin(IlvPoint p)
If a hypergrapher pin is at the input position, this pin is highlighted.


getHighlightedPin

protected IlvHyperGrapherPin getHighlightedPin()
Returns the highlighted pin.


getObjectToBeHighlighted

protected IlvGraphic getObjectToBeHighlighted(IlvPoint p,
                                              boolean allowNode,
                                              boolean allowHyperEdge)
Returns the object at the input position to be highlighted.

Parameters:
p - The position in view coordinates.
allowNode - Whether we search for a node.
allowHyperEdge - Whether we search for a hyperedge.

highlightObject

protected void highlightObject(IlvGraphic object)
Highlight the input object.


getHighlightedGraphic

protected IlvGraphic getHighlightedGraphic()
Returns the highlighted graphic.


isNode

protected boolean isNode(IlvGraphic obj)
Tests if the object is managed by an IlvHyperGrapher and if the object is a node in this IlvHyperGrapher.


isHyperEdge

protected boolean isHyperEdge(IlvGraphic obj)
Tests if the object is managed by an IlvHyperGrapher and if the object is a hyperedge in this IlvHyperGrapher.


isManagerToBeHighlighted

protected boolean isManagerToBeHighlighted(IlvPoint p,
                                           IlvManager manager)
Check whether the manager is to be highlighted.

Parameters:
p - The point in the coordinate system of the view.
manager - The manager to be tested.

getObjectDrawingTransformer

protected IlvTransformer getObjectDrawingTransformer(IlvGraphic g)
Returns the transformer the input object is drawn.

Parameters:
g - The object to be drawn.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.