JIDE 3.5.15

com.jidesoft.treemap
Class DefaultTreeMapController<N>

java.lang.Object
  extended by com.jidesoft.treemap.DefaultTreeMapController<N>
All Implemented Interfaces:
TreeMapController<N>

public class DefaultTreeMapController<N>
extends Object
implements TreeMapController<N>

Default controller mediating user interactions with a TreeMapView. It currently supports selection, zooming, panning and drilling.


Nested Class Summary
static class DefaultTreeMapController.Mode
          Interaction mode.
 
Field Summary
protected  TreeMapView<N> _view
           
 
Constructor Summary
DefaultTreeMapController()
           
DefaultTreeMapController(TreeMapView<N> view)
           
 
Method Summary
protected  Component createPopupMenuEntry(N node, int c)
           
 JPopupMenu getPopupMenu()
           
 boolean isImprovedBorderZooming()
           
 boolean isMultipleSelectionEnabled()
           
 boolean isSelectOnPopupTrigger()
           
 void setImprovedBorderZooming(boolean improvedBorderZooming)
          Enabling it will make use of the DefaultTreeMapController.zoomingCenterFunction() to correct the focus point of the zoom.
 void setMultipleSelectionEnabled(boolean multipleSelectionEnabled)
           
 void setPopupMenu(JPopupMenu popupMenu)
           
 void setSelectOnPopupTrigger(boolean selectOnPopupTrigger)
          Defines whether selection will occur prior to the display of the context menu.
 void setView(TreeMapView<N> view)
          Replace the view currently under control.
protected  double zoomingCenterFunction(double center)
          Currently returns Math.tanh(x * 3).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_view

protected TreeMapView<N> _view
Constructor Detail

DefaultTreeMapController

public DefaultTreeMapController()

DefaultTreeMapController

public DefaultTreeMapController(TreeMapView<N> view)
Method Detail

zoomingCenterFunction

protected double zoomingCenterFunction(double center)
Currently returns Math.tanh(x * 3). Can be overridden to use other (e.g. logistic) function.

Parameters:
center - the center within a normalized (-1..1) range
Returns:
the new center within a normalized (-1..1) range

setView

public void setView(TreeMapView<N> view)
Replace the view currently under control.

Specified by:
setView in interface TreeMapController<N>
Parameters:
view - the TreeMapView to use

createPopupMenuEntry

protected Component createPopupMenuEntry(N node,
                                         int c)

isMultipleSelectionEnabled

public boolean isMultipleSelectionEnabled()

setMultipleSelectionEnabled

public void setMultipleSelectionEnabled(boolean multipleSelectionEnabled)

isSelectOnPopupTrigger

public boolean isSelectOnPopupTrigger()

setSelectOnPopupTrigger

public void setSelectOnPopupTrigger(boolean selectOnPopupTrigger)
Defines whether selection will occur prior to the display of the context menu.

Parameters:
selectOnPopupTrigger - true if selection should occur, false otherwise

getPopupMenu

public JPopupMenu getPopupMenu()

setPopupMenu

public void setPopupMenu(JPopupMenu popupMenu)

isImprovedBorderZooming

public boolean isImprovedBorderZooming()

setImprovedBorderZooming

public void setImprovedBorderZooming(boolean improvedBorderZooming)
Enabling it will make use of the DefaultTreeMapController.zoomingCenterFunction() to correct the focus point of the zoom.

Parameters:
improvedBorderZooming - true to enable customized zooming function, false otherwise.

JIDE 3.5.15