Skip to content
miroiu edited this page Dec 23, 2024 · 1 revision

Minimap Class

Namespace: Nodify

Assembly: Nodify

Inheritance: ObjectDispatcherObjectDependencyObjectVisualUIElementFrameworkElementControlItemsControlMinimap

References: InputProcessor, MinimapItem, NodifyEditor, MinimapState.Panning, ZoomEventArgs, ZoomEventHandler, MinimapState.Zooming

A minimap control that can position the viewport, and zoom in and out.

public class Minimap : ItemsControl  

Constructors

Minimap()

public Minimap();  

Properties

AllowPanningCancellation

Gets or sets whether panning cancellation is allowed (see Nodify.Interactivity.EditorGestures.MinimapGestures.CancelAction).

public static bool AllowPanningCancellation { get; set; }  

Property Value

Boolean

Extent

The area covered by the items and the viewport rectangle in graph space.

public Rect Extent { get; set; }  

Property Value

Rect

InputProcessor

protected InputProcessor InputProcessor { get; set; }  

Property Value

InputProcessor

IsPanning

Whether the user is currently panning the minimap.

protected bool IsPanning { get; set; }  

Property Value

Boolean

IsReadOnly

Whether the minimap can move and zoom the viewport.

public bool IsReadOnly { get; set; }  

Property Value

Boolean

ItemsExtent

The area covered by the MinimapItems in graph space.

public Rect ItemsExtent { get; set; }  

Property Value

Rect

ItemsHost

Gets the panel that holds all the MinimapItems.

protected Panel ItemsHost { get; set; }  

Property Value

Panel

MaxViewportOffset

The max position from the NodifyEditor.ItemsExtent that the viewport can move to.

public Size MaxViewportOffset { get; set; }  

Property Value

Size

MouseLocation

Gets the current mouse location in graph space coordinates (relative to the Minimap.ItemsHost).

public Point MouseLocation { get; set; }  

Property Value

Point

ResizeToViewport

Whether the minimap should resize to also display the whole viewport.

public bool ResizeToViewport { get; set; }  

Property Value

Boolean

ViewportLocation

public Point ViewportLocation { get; set; }  

Property Value

Point

ViewportSize

public Size ViewportSize { get; set; }  

Property Value

Size

ViewportStyle

Gets or sets the style to use for the viewport rectangle.

public Style ViewportStyle { get; set; }  

Property Value

Style

Methods

BeginPanning()

Starts the panning operation from the specified location. Call Nodify.Minimap.EndPanning to end the panning operation.

public void BeginPanning();  

BeginPanning(Point)

public void BeginPanning(Point location);  

Parameters

location Point

CancelPanning()

Cancels the current panning operation and reverts the viewport to its initial location if Minimap.AllowPanningCancellation is true. Otherwise, it ends the panning operation by calling Nodify.Minimap.EndPanning.

public void CancelPanning();  

EndPanning()

Ends the current panning operation, retaining the current Minimap.ViewportLocation.

public void EndPanning();  

GetContainerForItemOverride()

protected override DependencyObject GetContainerForItemOverride();  

Returns

DependencyObject

GetLocationInsideMinimap(MouseEventArgs)

Translates the event location to graph space coordinates (relative to the Minimap.ItemsHost).

public Point GetLocationInsideMinimap(MouseEventArgs args);  

Parameters

args MouseEventArgs: The mouse event.

Returns

Point: A location inside the minimap

IsItemItsOwnContainerOverride(Object)

protected override bool IsItemItsOwnContainerOverride(object item);  

Parameters

item Object

Returns

Boolean

OnApplyTemplate()

public override void OnApplyTemplate();  

OnKeyDown(KeyEventArgs)

protected override void OnKeyDown(KeyEventArgs e);  

Parameters

e KeyEventArgs

OnKeyUp(KeyEventArgs)

protected override void OnKeyUp(KeyEventArgs e);  

Parameters

e KeyEventArgs

OnLostMouseCapture(MouseEventArgs)

protected override void OnLostMouseCapture(MouseEventArgs e);  

Parameters

e MouseEventArgs

OnMouseDown(MouseButtonEventArgs)

protected override void OnMouseDown(MouseButtonEventArgs e);  

Parameters

e MouseButtonEventArgs

OnMouseMove(MouseEventArgs)

protected override void OnMouseMove(MouseEventArgs e);  

Parameters

e MouseEventArgs

OnMouseUp(MouseButtonEventArgs)

protected override void OnMouseUp(MouseButtonEventArgs e);  

Parameters

e MouseButtonEventArgs

OnMouseWheel(MouseWheelEventArgs)

protected override void OnMouseWheel(MouseWheelEventArgs e);  

Parameters

e MouseWheelEventArgs

SetViewportLocation(Point)

protected void SetViewportLocation(Point location);  

Parameters

location Point

UpdatePanning(Point)

Sets the viewport location to the specified location.

public void UpdatePanning(Point location);  

Parameters

location Point: The location to pan the viewport to.

ZoomAtPosition(Double, Point)

Zoom at the specified location in graph space coordinates.

public void ZoomAtPosition(double zoom, Point location);  

Parameters

zoom Double: The zoom factor.

location Point: The location to focus when zooming.

Events

Zoom

Triggered when zooming in or out using the mouse wheel.

public event ZoomEventHandler Zoom;  

Event Type

ZoomEventHandler

Clone this wiki locally