treebolic.control
Class Controller

java.lang.Object
  extended by treebolic.control.Commander
      extended by treebolic.control.Controller

public class Controller
extends Commander

Controller

Author:
Bernard Bou

Nested Class Summary
static class Controller.Action
          Action types
static class Controller.Event
          Event types
static class Controller.MatchMode
          Match mode
static class Controller.MatchScope
          Match scope
 
Nested classes/interfaces inherited from class treebolic.control.Commander
Commander.Command
 
Field Summary
private  AbstractLayerOut theLayerOut
          Connected layout agent
private static java.lang.String[] theMatchModeString
          Match modes
private static java.lang.String[] theMatchScopeString
          Match scopes
private  Model theModel
          Connected model
private  View theView
          Connected view
private  Widget theWidget
          Connected widget
private static boolean verbose
          Verbose status flag (use for debug purposes)
 
Constructor Summary
Controller()
          Constructor
 
Method Summary
 void connect(AbstractLayerOut thisLayerOut)
          Connect with layout agent
 void connect(Model thisModel)
          Connect
 void connect(View thisView)
          Connect with view
 void connect(Widget thisWidget)
          Connect with widget
private  java.lang.String decode(java.lang.String thisString)
          Decode encoded URL (for display)
 void dispatch(Controller.Action thisAction, java.lang.String thisLink, java.lang.String thisLinkTarget, java.lang.String thisMatchTarget, Controller.MatchScope thisMatchScope, Controller.MatchMode thisMatchMode, INode thisNode)
          Dispatch action
 INode findNode(int vx, int vy)
          Find node
 void focus(java.lang.String thisNodeId)
          Focus node
protected  AbstractLayerOut getLayerOut()
          Get layout agent
protected  Model getModel()
          Get model
protected  View getView()
          Get view
 void handle(Controller.Event thisEventType, java.lang.Object thisParameter)
          Handle events
 void linkTo(java.lang.String thisHref, java.lang.String thisTarget)
          Follow hypertext link
 java.lang.String match(java.lang.String thisString, Controller.MatchScope thisScope, Controller.MatchMode thisMode)
          Match node against string (wrapper)
private  INode match(java.lang.String thisString, Controller.MatchScope thisScope, Controller.MatchMode thisMode, INode thisNode)
          Match node against for string
 void popup(int x, int y, INode thisNode)
           
private  void putNode(INode thisNode)
          Display node
 Complex viewToUnitCircle(java.awt.Point thisPoint)
          Convert view space to unit circle
 
Methods inherited from class treebolic.control.Commander
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theWidget

private Widget theWidget
Connected widget


theModel

private Model theModel
Connected model


theView

private View theView
Connected view


theLayerOut

private AbstractLayerOut theLayerOut
Connected layout agent


verbose

private static final boolean verbose
Verbose status flag (use for debug purposes)

See Also:
Constant Field Values

theMatchScopeString

private static final java.lang.String[] theMatchScopeString
Match scopes


theMatchModeString

private static final java.lang.String[] theMatchModeString
Match modes

Constructor Detail

Controller

public Controller()
Constructor

Method Detail

connect

public void connect(Widget thisWidget)
Connect with widget

Parameters:
thisWidget - widget

connect

public void connect(Model thisModel)
Connect

Parameters:
thisModel - model

connect

public void connect(View thisView)
Connect with view

Parameters:
thisView - view

connect

public void connect(AbstractLayerOut thisLayerOut)
Connect with layout agent

Parameters:
thisLayerOut - layerout

getModel

protected Model getModel()
Description copied from class: Commander
Get model

Specified by:
getModel in class Commander
Returns:
model

getView

protected View getView()
Description copied from class: Commander
Get view

Specified by:
getView in class Commander
Returns:
view

getLayerOut

protected AbstractLayerOut getLayerOut()
Description copied from class: Commander
Get layout agent

Specified by:
getLayerOut in class Commander
Returns:
layout agent

handle

public void handle(Controller.Event thisEventType,
                   java.lang.Object thisParameter)
Handle events

Parameters:
thisEventType - event type
thisParameter - event-specific object

dispatch

public void dispatch(Controller.Action thisAction,
                     java.lang.String thisLink,
                     java.lang.String thisLinkTarget,
                     java.lang.String thisMatchTarget,
                     Controller.MatchScope thisMatchScope,
                     Controller.MatchMode thisMatchMode,
                     INode thisNode)
Dispatch action

Parameters:
thisAction - action
thisLink - url
thisLinkTarget - url link target
thisMatchTarget - match target
thisMatchScope - match scope
thisMatchMode - match mode
thisNode - node

putNode

private void putNode(INode thisNode)
Display node

Parameters:
thisNode - node

popup

public void popup(int x,
                  int y,
                  INode thisNode)

match

private INode match(java.lang.String thisString,
                    Controller.MatchScope thisScope,
                    Controller.MatchMode thisMode,
                    INode thisNode)
Match node against for string

Parameters:
thisString - string to match
thisScope - scope
thisMode - mode
thisNode - node
Returns:
node

match

public java.lang.String match(java.lang.String thisString,
                              Controller.MatchScope thisScope,
                              Controller.MatchMode thisMode)
Match node against string (wrapper)

Parameters:
thisString - string to match
thisScope - scope (LABEL, CONTENT, LINK, ID)
thisMode - mode (EQUALS, STARTSWITH, INCLUDES)
Returns:
node id

findNode

public INode findNode(int vx,
                      int vy)
Find node

Parameters:
vx - at view x position
vy - at view y position
Returns:
found node or null

focus

public void focus(java.lang.String thisNodeId)
Focus node

Parameters:
thisNodeId - node id to get focus

decode

private java.lang.String decode(java.lang.String thisString)
Decode encoded URL (for display)

Parameters:
thisString - encode URL string
Returns:
decoded URL string

linkTo

public void linkTo(java.lang.String thisHref,
                   java.lang.String thisTarget)
Follow hypertext link

Parameters:
thisHref - url string
thisTarget - target frame

viewToUnitCircle

public Complex viewToUnitCircle(java.awt.Point thisPoint)
Convert view space to unit circle

Parameters:
thisPoint - view space coordinate
Returns:
unit circle coordinate