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 -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected ComponentcreatePopupMenuEntry(N node, Column c) booleanbooleanbooleanbooleanvoidsetImprovedBorderZooming(boolean improvedBorderZooming) Enabling it will make use of the DefaultTreeMapController.zoomingCenterFunction() to correct the focus point of the zoom.voidsetMultipleSelectionEnabled(boolean multipleSelectionEnabled) voidsetPopupMenu(JPopupMenu popupMenu) voidsetSelectOnPopupTrigger(boolean selectOnPopupTrigger) Defines whether selection will occur prior to the display of the context menu.voidsetView(TreeMapView<JComponent, N, Row, Column, Color, Font> view) Replace the view currently under control.voidsetZoomingEnabled(boolean zoomingEnabled) Controls whether the zooming is permitted.protected doublezoomingCenterFunction(double center) Currently returnsMath.tanh(x * 3).
-
Field Details
-
_view
-
-
Constructor Details
-
DefaultTreeMapController
public DefaultTreeMapController() -
DefaultTreeMapController
-
-
Method Details
-
zoomingCenterFunction
protected double zoomingCenterFunction(double center) Currently returnsMath.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
Replace the view currently under control.- Specified by:
setViewin interfaceTreeMapController<JComponent,N, Row, Column, Color, Font> - Parameters:
view- the TreeMapView to use
-
createPopupMenuEntry
- 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
-
setPopupMenu
-
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:TreeMapControllerControls whether the zooming is permitted.- Specified by:
setZoomingEnabledin interfaceTreeMapController<JComponent,N, Row, Column, Color, Font> - Parameters:
zoomingEnabled- true to enable zooming, false otherwise.
-
isZoomingEnabled
public boolean isZoomingEnabled()- Specified by:
isZoomingEnabledin interfaceTreeMapController<JComponent,N, Row, Column, Color, Font>
-