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.
  • Field Details

  • Constructor Details

  • 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>