Package com.treemap.swing

# Class DefaultTreeMapController<N,Row,Column>

java.lang.Object
com.treemap.swing.DefaultTreeMapController<N,Row,Column>

All Implemented Interfaces:
  `TreeMapController<JComponent,N,Row,Column,Color,Font>`

public class DefaultTreeMapController<N,Row,Column> extends Object implements TreeMapController<JComponent,N,Row,Column,Color,Font>
Default controller mediating user interactions with a TreeMapView. It currently supports selection, zooming, panning and drilling.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `DefaultTreeMapController.Mode`
  Interaction mode.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected TreeMapView<JComponent,N,Row,Column,Color,Font>`
  `_view`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultTreeMapController()`
  `DefaultTreeMapController(TreeMapView<JComponent,N,Row,Column,Color,Font> view)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Component`
  `createPopupMenuEntry(N node, Column c)`
  `JPopupMenu`
  `getPopupMenu()`
  `boolean`
  `isImprovedBorderZooming()`
  `boolean`
  `isMultipleSelectionEnabled()`
  `boolean`
  `isSelectOnPopupTrigger()`
  `boolean`
  `isZoomingEnabled()`
  `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<JComponent,N,Row,Column,Color,Font> view)`
  Replace the view currently under control.
  `void`
  `setZoomingEnabled(boolean zoomingEnabled)`
  Controls whether the zooming is permitted.
  `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 Details

  - ### _view

    protected TreeMapView<JComponent,N,Row,Column,Color,Font> _view

- ## Constructor Details

  - ### DefaultTreeMapController

    public DefaultTreeMapController()

  - ### DefaultTreeMapController

    public DefaultTreeMapController(TreeMapView<JComponent,N,Row,Column,Color,Font> view)

- ## Method Details

  - ### 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<JComponent,N,Row,Column,Color,Font> view)
    Replace the view currently under control.
    Specified by:
      `setView` in interface `TreeMapController<JComponent,N,Row,Column,Color,Font>`
    Parameters:
      `view` - the TreeMapView to use

  - ### createPopupMenuEntry

    protected Component createPopupMenuEntry(N node, Column c) throws URISyntaxException
    Throws:
      `URISyntaxException`

  - ### 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.

  - ### setZoomingEnabled

    public void setZoomingEnabled(boolean zoomingEnabled)
    Description copied from interface: `TreeMapController`
    Controls whether the zooming is permitted.
    Specified by:
      `setZoomingEnabled` in interface `TreeMapController<JComponent,N,Row,Column,Color,Font>`
    Parameters:
      `zoomingEnabled` - true to enable zooming, false otherwise.

  - ### isZoomingEnabled

    public boolean isZoomingEnabled()
    Specified by:
      `isZoomingEnabled` in interface `TreeMapController<JComponent,N,Row,Column,Color,Font>`